diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2698286c..04a5df8a6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,76 @@
-## 0.3.14 (unreleased)
+## 0.4.2 (unreleased)
+
+- Add `sdwan_policy_object_application_list` resource and data source
+- Add `sdwan_policy_object_sla_class_list` resource and data source
+- Add `sdwan_policy_object_app_probe_class` resource and data source
+- Add `sdwan_policy_object_as_path_list` resource and data source
+- Add `sdwan_policy_object_vpn_group` resource and data source
+- Add `sdwan_policy_object_security_data_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_security_fqdn_list` resource and data source
+- Add `sdwan_policy_object_security_geolocation_list` resource and data source
+- Add `sdwan_policy_object_security_ips_signature` resource and data source
+- Add `sdwan_policy_object_security_local_domain_list` resource and data source
+- Add `sdwan_policy_object_security_port_list` resource and data source
+- Add `sdwan_policy_object_security_scalable_group_tag_list` resource and data source
+- Add `sdwan_policy_object_security_url_list` resource and data source
+- Add `sdwan_policy_object_preferred_color_group` resource and data source
+- Add `sdwan_policy_object_security_identity_list` resource and data source
+- Add `sdwan_policy_object_security_local_application_list` resource and data source
+- Add `sdwan_policy_object_standard_community_list` resource and data source
+- Add `sdwan_dns_security_feature_profile` resource and data source
+- Add `sdwan_sig_security_feature_profile` resource and data source
+- Add `sdwan_embedded_security_feature_profile` resource and data source
+
+## 0.4.1
+
+- Update documentation categories
+
+## 0.4.0
- Fix issue when reading deleted `sdwan_cli_config_profile_parcel` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/291)
+- Add `sdwan_transport_tracker_group_feature` resource and data source
+- Add `sdwan_transport_tracker_feature` resource and data source
+- Add `sdwan_service_tracker_group_feature` resource and data source
+- Add `sdwan_transport_ipv6_tracker_group_feature` resource and data source
+- Add `sdwan_service_object_tracker_feature` resource and data source
+- Add `sdwan_service_object_tracker_group_feature` resource and data source
+- BREAKING CHANGE: Rename `enable_crl_check` attribute of `sdwan_system_remote_access_profile_parcel` resource to `enable_certificate_list_check`
+- BREAKING CHANGE: Rename `psk_selection` attribute of `sdwan_system_remote_access_profile_parcel` resource to `psk_authentication_type`
+- BREAKING CHANGE: Rename `aaa_derive_name_identity` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_identity`
+- BREAKING CHANGE: Rename `aaa_derive_name_domain` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_domain`
+- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel`
+- Add `sdwan_policy_object_feature_profile` resource and data source
+- Add `sdwan_policy_object_class_map` resource and data source
+- Add `sdwan_policy_object_color_list` resource and data source
+- Add `sdwan_policy_object_data_ipv6_prefix_list` resource and data source
+- Add `sdwan_policy_object_data_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_tloc_list` resource and data source
+- Add `sdwan_policy_object_expanded_community_list` resource and data source
+- Add `sdwan_policy_object_extended_community_list` resource and data source
+- Add `sdwan_policy_object_mirror` resource and data source
+- Add `sdwan_policy_object_policer` resource and data source
+- Add `sdwan_policy_object_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_ipv6_prefix_list` resource and data source
+- Add `sdwan_other_feature_profile` resource and data source
+- Add `sdwan_other_ucse_feature` resource and data source
+- Add `sdwan_other_thousandeyes_feature` resource and data source
+- Add `sdwan_transport_gps_feature` resource and data source
+- Add `sdwan_transport_routing_ospf_feature` resource and data source
+- Add `sdwan_transport_routing_ospfv3_ipv4_feature` resource and data source
+- Add `sdwan_transport_routing_ospfv3_ipv6_feature` resource and data source
+- Add `sdwan_service_routing_ospf_feature` resource and data source
+- Add `sdwan_service_routing_ospfv3_ipv4_feature` resource and data source
+- Add `sdwan_service_routing_ospfv3_ipv6_feature` resource and data source
+- Add `sdwan_service_routing_bgp_feature` resource and data source
+- Add `sdwan_service_switchport_feature` resource and data source
+- Add `sdwan_transport_route_policy_feature` resource and data source
+- Add `sdwan_service_route_policy_feature` resource and data source
+- BREAKING CHANGE: Rename all profile parcel resources and data sources being used in configuration groups to "Features" with a `_feature` suffix
+- BREAKING CHANGE: Rename `sdwan_application_priority_qos_policy_profile_parcel` resource and data source to `sdwan_application_priority_qos_policy`
+- Fix issue when reading deleted `sdwan_configuration_group` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/297)
+- BREAKING CHANGE: Rename `service_lan_vpn_profile_parcel_id` attribute of `sdwan_service_lan_vpn_interface_ethernet_feature`, `sdwan_service_lan_vpn_interface_gre_feature`, `sdwan_service_lan_vpn_interface_ipsec_feature` and `sdwan_service_lan_vpn_interface_svi_feature` resource to `service_lan_vpn_feature_id`
+- BREAKING CHANGE: Rename `transport_management_vpn_profile_parcel_id` attribute of `sdwan_transport_management_vpn_interface_ethernet_feature` resource to `transport_management_vpn_feature_id`
+- BREAKING CHANGE: Rename `transport_wan_vpn_profile_parcel_id` attribute of `sdwan_transport_wan_vpn_interface_cellular_feature`, `sdwan_transport_wan_vpn_interface_ethernet_feature`, `sdwan_transport_wan_vpn_interface_gre_feature`, `sdwan_transport_wan_vpn_interface_ipsec_feature` and `sdwan_transport_wan_vpn_interface_t1_e1_serial_feature` resource to `transport_wan_vpn_feature_id`
## 0.3.13
diff --git a/docs/data-sources/advanced_inspection_profile_policy_definition.md b/docs/data-sources/advanced_inspection_profile_policy_definition.md
index 8a5111188..b545525f1 100644
--- a/docs/data-sources/advanced_inspection_profile_policy_definition.md
+++ b/docs/data-sources/advanced_inspection_profile_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_advanced_inspection_profile_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the Advanced Inspection Profile Policy Definition .
---
diff --git a/docs/data-sources/advanced_malware_protection_policy_definition.md b/docs/data-sources/advanced_malware_protection_policy_definition.md
index e120e4300..197b7ced9 100644
--- a/docs/data-sources/advanced_malware_protection_policy_definition.md
+++ b/docs/data-sources/advanced_malware_protection_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_advanced_malware_protection_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the Advanced Malware Protection Policy Definition .
---
diff --git a/docs/data-sources/allow_url_list_policy_object.md b/docs/data-sources/allow_url_list_policy_object.md
index 7c43e072e..7b45bf87d 100644
--- a/docs/data-sources/allow_url_list_policy_object.md
+++ b/docs/data-sources/allow_url_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_allow_url_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Allow URL List Policy Object .
---
diff --git a/docs/data-sources/app_probe_class_policy_object.md b/docs/data-sources/app_probe_class_policy_object.md
index 5d80b5254..c635eaceb 100644
--- a/docs/data-sources/app_probe_class_policy_object.md
+++ b/docs/data-sources/app_probe_class_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_app_probe_class_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the App Probe Class Policy Object .
---
diff --git a/docs/data-sources/application_aware_routing_policy_definition.md b/docs/data-sources/application_aware_routing_policy_definition.md
index dd829ca18..169bdf2d6 100644
--- a/docs/data-sources/application_aware_routing_policy_definition.md
+++ b/docs/data-sources/application_aware_routing_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_application_aware_routing_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the Application Aware Routing Policy Definition .
---
@@ -86,6 +86,7 @@ Read-Only:
- `dns_application_list_id` (String) DNS Application list ID
- `dns_application_list_version` (Number) DNS Application list version
- `dscp` (Number) DSCP value
+- `icmp_message` (String) ICMP Message
- `plp` (String) PLP
- `protocol` (String) IP Protocol, 0-255 (Single value or multiple values separated by spaces)
- `source_data_prefix_list_id` (String) Source Data Prefix list ID
diff --git a/docs/data-sources/application_list_policy_object.md b/docs/data-sources/application_list_policy_object.md
index 18de91d6c..806a9db30 100644
--- a/docs/data-sources/application_list_policy_object.md
+++ b/docs/data-sources/application_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_application_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Application List Policy Object .
---
diff --git a/docs/data-sources/application_priority_qos_policy.md b/docs/data-sources/application_priority_qos_policy.md
new file mode 100644
index 000000000..8c5c2efaf
--- /dev/null
+++ b/docs/data-sources/application_priority_qos_policy.md
@@ -0,0 +1,48 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_application_priority_qos_policy Data Source - terraform-provider-sdwan"
+subcategory: "Policies"
+description: |-
+ This data source can read the Application Priority QoS Policy.
+---
+
+# sdwan_application_priority_qos_policy (Data Source)
+
+This data source can read the Application Priority QoS Policy.
+
+## Example Usage
+
+```terraform
+data "sdwan_application_priority_qos_policy" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy
+
+### Read-Only
+
+- `description` (String) The description of the Policy
+- `name` (String) The name of the Policy
+- `qos_schedulers` (Attributes List) qosSchedulers (see [below for nested schema](#nestedatt--qos_schedulers))
+- `target_interface` (Set of String) interfaces
+- `target_interface_variable` (String) Variable name
+- `version` (Number) The version of the Policy
+
+
+### Nested Schema for `qos_schedulers`
+
+Read-Only:
+
+- `bandwidth` (String) bandwidthPercent
+- `drops` (String) drops
+- `forwarding_class_id` (String)
+- `queue` (String) queue
+- `scheduling_type` (String) scheduling
diff --git a/docs/data-sources/application_priority_qos_policy_profile_parcel.md b/docs/data-sources/application_priority_qos_policy_profile_parcel.md
deleted file mode 100644
index 6a4b1901c..000000000
--- a/docs/data-sources/application_priority_qos_policy_profile_parcel.md
+++ /dev/null
@@ -1,48 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_application_priority_qos_policy_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Application Priority QoS Policy profile parcel.
----
-
-# sdwan_application_priority_qos_policy_profile_parcel (Data Source)
-
-This data source can read the Application Priority QoS Policy profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_application_priority_qos_policy_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `name` (String) The name of the profile parcel
-- `qos_schedulers` (Attributes List) qosSchedulers (see [below for nested schema](#nestedatt--qos_schedulers))
-- `target_interface` (Set of String) interfaces
-- `target_interface_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `qos_schedulers`
-
-Read-Only:
-
-- `bandwidth` (String) bandwidthPercent
-- `drops` (String) drops
-- `forwarding_class_id` (String)
-- `queue` (String) queue
-- `scheduling_type` (String) scheduling
diff --git a/docs/data-sources/as_path_list_policy_object.md b/docs/data-sources/as_path_list_policy_object.md
index c36d5ab0f..38c9ec738 100644
--- a/docs/data-sources/as_path_list_policy_object.md
+++ b/docs/data-sources/as_path_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_as_path_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the AS Path List Policy Object .
---
diff --git a/docs/data-sources/block_url_list_policy_object.md b/docs/data-sources/block_url_list_policy_object.md
index b4867ec7e..661c6dbd7 100644
--- a/docs/data-sources/block_url_list_policy_object.md
+++ b/docs/data-sources/block_url_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_block_url_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Block URL List Policy Object .
---
diff --git a/docs/data-sources/cedge_aaa_feature_template.md b/docs/data-sources/cedge_aaa_feature_template.md
index c30640501..0f1ce850d 100644
--- a/docs/data-sources/cedge_aaa_feature_template.md
+++ b/docs/data-sources/cedge_aaa_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_aaa_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the cEdge AAA feature template.
---
diff --git a/docs/data-sources/cedge_global_feature_template.md b/docs/data-sources/cedge_global_feature_template.md
index 022ef10b0..21cce1540 100644
--- a/docs/data-sources/cedge_global_feature_template.md
+++ b/docs/data-sources/cedge_global_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_global_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the cEdge Global feature template.
---
diff --git a/docs/data-sources/cedge_igmp_feature_template.md b/docs/data-sources/cedge_igmp_feature_template.md
index 338e5b2f2..35d1dbc5c 100644
--- a/docs/data-sources/cedge_igmp_feature_template.md
+++ b/docs/data-sources/cedge_igmp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_igmp_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the cEdge IGMP feature template.
---
diff --git a/docs/data-sources/cedge_multicast_feature_template.md b/docs/data-sources/cedge_multicast_feature_template.md
index e1fdcf296..25411df35 100644
--- a/docs/data-sources/cedge_multicast_feature_template.md
+++ b/docs/data-sources/cedge_multicast_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_multicast_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the cEdge Multicast feature template.
---
diff --git a/docs/data-sources/cedge_pim_feature_template.md b/docs/data-sources/cedge_pim_feature_template.md
index dc00145ef..742143146 100644
--- a/docs/data-sources/cedge_pim_feature_template.md
+++ b/docs/data-sources/cedge_pim_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_pim_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the cEdge PIM feature template.
---
diff --git a/docs/data-sources/cellular_cedge_profile_feature_template.md b/docs/data-sources/cellular_cedge_profile_feature_template.md
index 08dfcb75e..cd2698bd9 100644
--- a/docs/data-sources/cellular_cedge_profile_feature_template.md
+++ b/docs/data-sources/cellular_cedge_profile_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cellular_cedge_profile_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cellular cEdge Profile feature template.
---
diff --git a/docs/data-sources/cellular_controller_feature_template.md b/docs/data-sources/cellular_controller_feature_template.md
index dfd77e783..099952743 100644
--- a/docs/data-sources/cellular_controller_feature_template.md
+++ b/docs/data-sources/cellular_controller_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cellular_controller_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cellular Controller feature template.
---
diff --git a/docs/data-sources/cellular_profile_feature_template.md b/docs/data-sources/cellular_profile_feature_template.md
index 308542289..9335315ec 100644
--- a/docs/data-sources/cellular_profile_feature_template.md
+++ b/docs/data-sources/cellular_profile_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cellular_profile_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cellular Profile feature template.
---
diff --git a/docs/data-sources/centralized_policy.md b/docs/data-sources/centralized_policy.md
index 6dbea6675..b10c59437 100644
--- a/docs/data-sources/centralized_policy.md
+++ b/docs/data-sources/centralized_policy.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_centralized_policy Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the Centralized Policy .
---
diff --git a/docs/data-sources/cflowd_policy_definition.md b/docs/data-sources/cflowd_policy_definition.md
index c9d742562..8d286552c 100644
--- a/docs/data-sources/cflowd_policy_definition.md
+++ b/docs/data-sources/cflowd_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cflowd_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the Cflowd Policy Definition .
---
diff --git a/docs/data-sources/cisco_banner_feature_template.md b/docs/data-sources/cisco_banner_feature_template.md
index c59faae67..3ece3c9a9 100644
--- a/docs/data-sources/cisco_banner_feature_template.md
+++ b/docs/data-sources/cisco_banner_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_banner_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco Banner feature template.
---
diff --git a/docs/data-sources/cisco_bfd_feature_template.md b/docs/data-sources/cisco_bfd_feature_template.md
index 929c81f94..a2d537879 100644
--- a/docs/data-sources/cisco_bfd_feature_template.md
+++ b/docs/data-sources/cisco_bfd_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_bfd_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco BFD feature template.
---
diff --git a/docs/data-sources/cisco_bgp_feature_template.md b/docs/data-sources/cisco_bgp_feature_template.md
index 0caab688d..81417d057 100644
--- a/docs/data-sources/cisco_bgp_feature_template.md
+++ b/docs/data-sources/cisco_bgp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_bgp_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco BGP feature template.
---
diff --git a/docs/data-sources/cisco_dhcp_server_feature_template.md b/docs/data-sources/cisco_dhcp_server_feature_template.md
index 77304c54c..6213406e5 100644
--- a/docs/data-sources/cisco_dhcp_server_feature_template.md
+++ b/docs/data-sources/cisco_dhcp_server_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_dhcp_server_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco DHCP Server feature template.
---
diff --git a/docs/data-sources/cisco_logging_feature_template.md b/docs/data-sources/cisco_logging_feature_template.md
index f157bfd3c..f508da522 100644
--- a/docs/data-sources/cisco_logging_feature_template.md
+++ b/docs/data-sources/cisco_logging_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_logging_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco Logging feature template.
---
diff --git a/docs/data-sources/cisco_ntp_feature_template.md b/docs/data-sources/cisco_ntp_feature_template.md
index 96a590051..d015ee6a0 100644
--- a/docs/data-sources/cisco_ntp_feature_template.md
+++ b/docs/data-sources/cisco_ntp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_ntp_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco NTP feature template.
---
diff --git a/docs/data-sources/cisco_omp_feature_template.md b/docs/data-sources/cisco_omp_feature_template.md
index ce619992f..8187c5d7c 100644
--- a/docs/data-sources/cisco_omp_feature_template.md
+++ b/docs/data-sources/cisco_omp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_omp_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco OMP feature template.
---
diff --git a/docs/data-sources/cisco_ospf_feature_template.md b/docs/data-sources/cisco_ospf_feature_template.md
index de1901ae3..0a1883a96 100644
--- a/docs/data-sources/cisco_ospf_feature_template.md
+++ b/docs/data-sources/cisco_ospf_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_ospf_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco OSPF feature template.
---
diff --git a/docs/data-sources/cisco_ospfv3_feature_template.md b/docs/data-sources/cisco_ospfv3_feature_template.md
index f1ee93858..289a4019b 100644
--- a/docs/data-sources/cisco_ospfv3_feature_template.md
+++ b/docs/data-sources/cisco_ospfv3_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_ospfv3_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco OSPFv3 feature template.
---
diff --git a/docs/data-sources/cisco_secure_internet_gateway_feature_template.md b/docs/data-sources/cisco_secure_internet_gateway_feature_template.md
index 7d63cb975..ff68372fc 100644
--- a/docs/data-sources/cisco_secure_internet_gateway_feature_template.md
+++ b/docs/data-sources/cisco_secure_internet_gateway_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_secure_internet_gateway_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco Secure Internet Gateway feature template.
---
diff --git a/docs/data-sources/cisco_security_feature_template.md b/docs/data-sources/cisco_security_feature_template.md
index dea10cf95..d487634f9 100644
--- a/docs/data-sources/cisco_security_feature_template.md
+++ b/docs/data-sources/cisco_security_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_security_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco Security feature template.
---
diff --git a/docs/data-sources/cisco_sig_credentials_feature_template.md b/docs/data-sources/cisco_sig_credentials_feature_template.md
index 0688de8b9..24948474d 100644
--- a/docs/data-sources/cisco_sig_credentials_feature_template.md
+++ b/docs/data-sources/cisco_sig_credentials_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_sig_credentials_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco SIG Credentials feature template.
---
diff --git a/docs/data-sources/cisco_snmp_feature_template.md b/docs/data-sources/cisco_snmp_feature_template.md
index 7db253b0a..19771dcb7 100644
--- a/docs/data-sources/cisco_snmp_feature_template.md
+++ b/docs/data-sources/cisco_snmp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_snmp_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco SNMP feature template.
---
diff --git a/docs/data-sources/cisco_system_feature_template.md b/docs/data-sources/cisco_system_feature_template.md
index 67c29ec34..08698d9c6 100644
--- a/docs/data-sources/cisco_system_feature_template.md
+++ b/docs/data-sources/cisco_system_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_system_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco System feature template.
---
diff --git a/docs/data-sources/cisco_thousandeyes_feature_template.md b/docs/data-sources/cisco_thousandeyes_feature_template.md
index 31ea83633..53b63e9e1 100644
--- a/docs/data-sources/cisco_thousandeyes_feature_template.md
+++ b/docs/data-sources/cisco_thousandeyes_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_thousandeyes_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco ThousandEyes feature template.
---
diff --git a/docs/data-sources/cisco_trustsec_feature_template.md b/docs/data-sources/cisco_trustsec_feature_template.md
index 49f049cff..990785316 100644
--- a/docs/data-sources/cisco_trustsec_feature_template.md
+++ b/docs/data-sources/cisco_trustsec_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_trustsec_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco TrustSec feature template.
---
diff --git a/docs/data-sources/cisco_vpn_feature_template.md b/docs/data-sources/cisco_vpn_feature_template.md
index 28f47ac81..b6104aa4d 100644
--- a/docs/data-sources/cisco_vpn_feature_template.md
+++ b/docs/data-sources/cisco_vpn_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco VPN feature template.
---
diff --git a/docs/data-sources/cisco_vpn_interface_feature_template.md b/docs/data-sources/cisco_vpn_interface_feature_template.md
index 7e1390410..3b9c34437 100644
--- a/docs/data-sources/cisco_vpn_interface_feature_template.md
+++ b/docs/data-sources/cisco_vpn_interface_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_interface_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco VPN Interface feature template.
---
diff --git a/docs/data-sources/cisco_vpn_interface_gre_feature_template.md b/docs/data-sources/cisco_vpn_interface_gre_feature_template.md
index f2922b38e..c71c68b9a 100644
--- a/docs/data-sources/cisco_vpn_interface_gre_feature_template.md
+++ b/docs/data-sources/cisco_vpn_interface_gre_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_interface_gre_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco VPN Interface GRE feature template.
---
diff --git a/docs/data-sources/cisco_vpn_interface_ipsec_feature_template.md b/docs/data-sources/cisco_vpn_interface_ipsec_feature_template.md
index a0ec22833..ae39229cc 100644
--- a/docs/data-sources/cisco_vpn_interface_ipsec_feature_template.md
+++ b/docs/data-sources/cisco_vpn_interface_ipsec_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_interface_ipsec_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco VPN Interface IPSec feature template.
---
diff --git a/docs/data-sources/cisco_wireless_lan_feature_template.md b/docs/data-sources/cisco_wireless_lan_feature_template.md
index bdb10e21a..69e165360 100644
--- a/docs/data-sources/cisco_wireless_lan_feature_template.md
+++ b/docs/data-sources/cisco_wireless_lan_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_wireless_lan_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Cisco Wireless LAN feature template.
---
diff --git a/docs/data-sources/class_map_policy_object.md b/docs/data-sources/class_map_policy_object.md
index 5c404afcb..10f87df96 100644
--- a/docs/data-sources/class_map_policy_object.md
+++ b/docs/data-sources/class_map_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_class_map_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Class Map Policy Object .
---
diff --git a/docs/data-sources/cli_config_feature.md b/docs/data-sources/cli_config_feature.md
new file mode 100644
index 000000000..d51fd8ab1
--- /dev/null
+++ b/docs/data-sources/cli_config_feature.md
@@ -0,0 +1,35 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_cli_config_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the CLI Config Feature .
+---
+
+# sdwan_cli_config_feature (Data Source)
+
+This data source can read the CLI Config Feature .
+
+## Example Usage
+
+```terraform
+data "sdwan_cli_config_feature" "example" {
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the object
+
+### Read-Only
+
+- `cli_configuration` (String) CLI configuration
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `version` (Number) The version of the object
diff --git a/docs/data-sources/cli_config_profile_parcel.md b/docs/data-sources/cli_config_profile_parcel.md
deleted file mode 100644
index ae94ceaab..000000000
--- a/docs/data-sources/cli_config_profile_parcel.md
+++ /dev/null
@@ -1,35 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_cli_config_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the CLI Config Profile Parcel .
----
-
-# sdwan_cli_config_profile_parcel (Data Source)
-
-This data source can read the CLI Config Profile Parcel .
-
-## Example Usage
-
-```terraform
-data "sdwan_cli_config_profile_parcel" "example" {
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the object
-
-### Read-Only
-
-- `cli_configuration` (String) CLI configuration
-- `description` (String) The description of the profile parcel
-- `name` (String) The name of the profile parcel
-- `version` (Number) The version of the object
diff --git a/docs/data-sources/cli_device_template.md b/docs/data-sources/cli_device_template.md
index 8989bf841..47bb7a3a7 100644
--- a/docs/data-sources/cli_device_template.md
+++ b/docs/data-sources/cli_device_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cli_device_template Data Source - terraform-provider-sdwan"
-subcategory: "Device Templates"
+subcategory: "(Classic) Device Templates"
description: |-
This data source can read the CLI Device Template .
---
diff --git a/docs/data-sources/cli_template_feature_template.md b/docs/data-sources/cli_template_feature_template.md
index 615625426..1ae7a70a8 100644
--- a/docs/data-sources/cli_template_feature_template.md
+++ b/docs/data-sources/cli_template_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cli_template_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the CLI Template feature template.
---
diff --git a/docs/data-sources/color_list_policy_object.md b/docs/data-sources/color_list_policy_object.md
index 92e8418c8..4486a17ae 100644
--- a/docs/data-sources/color_list_policy_object.md
+++ b/docs/data-sources/color_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_color_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Color List Policy Object .
---
diff --git a/docs/data-sources/custom_control_topology_policy_definition.md b/docs/data-sources/custom_control_topology_policy_definition.md
index 740a6eaa7..8b921e821 100644
--- a/docs/data-sources/custom_control_topology_policy_definition.md
+++ b/docs/data-sources/custom_control_topology_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_custom_control_topology_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the Custom Control Topology Policy Definition .
---
diff --git a/docs/data-sources/data_fqdn_prefix_list_policy_object.md b/docs/data-sources/data_fqdn_prefix_list_policy_object.md
index 7ed857085..01815eafc 100644
--- a/docs/data-sources/data_fqdn_prefix_list_policy_object.md
+++ b/docs/data-sources/data_fqdn_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_data_fqdn_prefix_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Data FQDN Prefix List Policy Object .
---
diff --git a/docs/data-sources/data_ipv4_prefix_list_policy_object.md b/docs/data-sources/data_ipv4_prefix_list_policy_object.md
index ca92ddce9..9b5a3c17c 100644
--- a/docs/data-sources/data_ipv4_prefix_list_policy_object.md
+++ b/docs/data-sources/data_ipv4_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_data_ipv4_prefix_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Data IPv4 Prefix List Policy Object .
---
diff --git a/docs/data-sources/data_ipv6_prefix_list_policy_object.md b/docs/data-sources/data_ipv6_prefix_list_policy_object.md
index 136f2be0f..63353d3d7 100644
--- a/docs/data-sources/data_ipv6_prefix_list_policy_object.md
+++ b/docs/data-sources/data_ipv6_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_data_ipv6_prefix_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Data IPv6 Prefix List Policy Object .
---
diff --git a/docs/data-sources/dns_security_feature_profile.md b/docs/data-sources/dns_security_feature_profile.md
new file mode 100644
index 000000000..bfbb1679d
--- /dev/null
+++ b/docs/data-sources/dns_security_feature_profile.md
@@ -0,0 +1,31 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_dns_security_feature_profile Data Source - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This data source can read the DNS Security Feature Profile .
+---
+
+# sdwan_dns_security_feature_profile (Data Source)
+
+This data source can read the DNS Security Feature Profile .
+
+## Example Usage
+
+```terraform
+data "sdwan_dns_security_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `id` (String) The id of the object
+
+### Read-Only
+
+- `description` (String) Description
+- `name` (String) The name of the dns security feature profile
diff --git a/docs/data-sources/dns_security_policy_definition.md b/docs/data-sources/dns_security_policy_definition.md
index e0555ec98..d8a8e8454 100644
--- a/docs/data-sources/dns_security_policy_definition.md
+++ b/docs/data-sources/dns_security_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_dns_security_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the DNS Security Policy Definition .
---
diff --git a/docs/data-sources/domain_list_policy_object.md b/docs/data-sources/domain_list_policy_object.md
index 6b51ac657..198b5a64f 100644
--- a/docs/data-sources/domain_list_policy_object.md
+++ b/docs/data-sources/domain_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_domain_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Domain List Policy Object .
---
diff --git a/docs/data-sources/eigrp_feature_template.md b/docs/data-sources/eigrp_feature_template.md
index f2d2b1a6e..538b54506 100644
--- a/docs/data-sources/eigrp_feature_template.md
+++ b/docs/data-sources/eigrp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_eigrp_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the eigrp feature template.
---
diff --git a/docs/data-sources/embedded_security_feature_profile.md b/docs/data-sources/embedded_security_feature_profile.md
new file mode 100644
index 000000000..d81e6bec4
--- /dev/null
+++ b/docs/data-sources/embedded_security_feature_profile.md
@@ -0,0 +1,31 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_embedded_security_feature_profile Data Source - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This data source can read the Embedded Security Feature Profile .
+---
+
+# sdwan_embedded_security_feature_profile (Data Source)
+
+This data source can read the Embedded Security Feature Profile .
+
+## Example Usage
+
+```terraform
+data "sdwan_embedded_security_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `id` (String) The id of the object
+
+### Read-Only
+
+- `description` (String) Description
+- `name` (String) The name of the embedded security feature profile
diff --git a/docs/data-sources/expanded_community_list_policy_object.md b/docs/data-sources/expanded_community_list_policy_object.md
index ed285a83f..2defa4ed5 100644
--- a/docs/data-sources/expanded_community_list_policy_object.md
+++ b/docs/data-sources/expanded_community_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_expanded_community_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Expanded Community List Policy Object .
---
diff --git a/docs/data-sources/extended_community_list_policy_object.md b/docs/data-sources/extended_community_list_policy_object.md
index a62783f87..2effa8a3b 100644
--- a/docs/data-sources/extended_community_list_policy_object.md
+++ b/docs/data-sources/extended_community_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_extended_community_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Extended Community List Policy Object .
---
diff --git a/docs/data-sources/feature_device_template.md b/docs/data-sources/feature_device_template.md
index ece109fb8..cc9562c92 100644
--- a/docs/data-sources/feature_device_template.md
+++ b/docs/data-sources/feature_device_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_feature_device_template Data Source - terraform-provider-sdwan"
-subcategory: "Device Templates"
+subcategory: "(Classic) Device Templates"
description: |-
This data source can read the Feature Device Template .
---
diff --git a/docs/data-sources/geo_location_list_policy_object.md b/docs/data-sources/geo_location_list_policy_object.md
index 47b49dff9..961059faa 100644
--- a/docs/data-sources/geo_location_list_policy_object.md
+++ b/docs/data-sources/geo_location_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_geo_location_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Geo Location List Policy Object .
---
diff --git a/docs/data-sources/gps_feature_template.md b/docs/data-sources/gps_feature_template.md
index 586c5f7c3..63938cc2f 100644
--- a/docs/data-sources/gps_feature_template.md
+++ b/docs/data-sources/gps_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_gps_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the gps feature template.
---
diff --git a/docs/data-sources/hub_and_spoke_topology_policy_definition.md b/docs/data-sources/hub_and_spoke_topology_policy_definition.md
index c427a345b..bc2d933b4 100644
--- a/docs/data-sources/hub_and_spoke_topology_policy_definition.md
+++ b/docs/data-sources/hub_and_spoke_topology_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_hub_and_spoke_topology_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the Hub and Spoke Topology Policy Definition .
---
diff --git a/docs/data-sources/intrusion_prevention_policy_definition.md b/docs/data-sources/intrusion_prevention_policy_definition.md
index 64b22eb0b..86d4a7781 100644
--- a/docs/data-sources/intrusion_prevention_policy_definition.md
+++ b/docs/data-sources/intrusion_prevention_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_intrusion_prevention_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the Intrusion Prevention Policy Definition .
---
diff --git a/docs/data-sources/ips_signature_list_policy_object.md b/docs/data-sources/ips_signature_list_policy_object.md
index 2e43f1b89..dbede43ac 100644
--- a/docs/data-sources/ips_signature_list_policy_object.md
+++ b/docs/data-sources/ips_signature_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ips_signature_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the IPS Signature List Policy Object .
---
diff --git a/docs/data-sources/ipv4_acl_policy_definition.md b/docs/data-sources/ipv4_acl_policy_definition.md
index 821b314c0..864907af7 100644
--- a/docs/data-sources/ipv4_acl_policy_definition.md
+++ b/docs/data-sources/ipv4_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv4_acl_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the IPv4 ACL Policy Definition .
---
@@ -84,6 +84,7 @@ Read-Only:
- `destination_ip` (String) Destination IP prefix
- `destination_ports` (String) Destination ports. Single value (0-65535) or ranges separated by spaces.
- `dscp` (Number) DSCP value
+- `icmp_message` (String) ICMP Message
- `packet_length` (Number) Packet length
- `priority` (String) PLP - priority
- `protocol` (String) Single value (0-255) or multiple values separated by spaces
diff --git a/docs/data-sources/ipv4_device_acl_policy_definition.md b/docs/data-sources/ipv4_device_acl_policy_definition.md
index 8002c80a1..b4bab79dc 100644
--- a/docs/data-sources/ipv4_device_acl_policy_definition.md
+++ b/docs/data-sources/ipv4_device_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv4_device_acl_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the IPv4 Device ACL Policy Definition .
---
diff --git a/docs/data-sources/ipv4_prefix_list_policy_object.md b/docs/data-sources/ipv4_prefix_list_policy_object.md
index de811f345..3d3cdf6a1 100644
--- a/docs/data-sources/ipv4_prefix_list_policy_object.md
+++ b/docs/data-sources/ipv4_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv4_prefix_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the IPv4 Prefix List Policy Object .
---
diff --git a/docs/data-sources/ipv6_acl_policy_definition.md b/docs/data-sources/ipv6_acl_policy_definition.md
index e9c86eb71..0ae9285f0 100644
--- a/docs/data-sources/ipv6_acl_policy_definition.md
+++ b/docs/data-sources/ipv6_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv6_acl_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the IPv6 ACL Policy Definition .
---
diff --git a/docs/data-sources/ipv6_device_acl_policy_definition.md b/docs/data-sources/ipv6_device_acl_policy_definition.md
index 23d98b029..d2f4b257a 100644
--- a/docs/data-sources/ipv6_device_acl_policy_definition.md
+++ b/docs/data-sources/ipv6_device_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv6_device_acl_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the IPv6 Device ACL Policy Definition .
---
diff --git a/docs/data-sources/ipv6_prefix_list_policy_object.md b/docs/data-sources/ipv6_prefix_list_policy_object.md
index 26fe87b7f..85522ecb2 100644
--- a/docs/data-sources/ipv6_prefix_list_policy_object.md
+++ b/docs/data-sources/ipv6_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv6_prefix_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the IPv6 Prefix List Policy Object .
---
diff --git a/docs/data-sources/local_application_list_policy_object.md b/docs/data-sources/local_application_list_policy_object.md
index 34c3356ab..834d3955b 100644
--- a/docs/data-sources/local_application_list_policy_object.md
+++ b/docs/data-sources/local_application_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_local_application_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Local Application List Policy Object .
---
diff --git a/docs/data-sources/localized_policy.md b/docs/data-sources/localized_policy.md
index 309c8387f..6313edd4b 100644
--- a/docs/data-sources/localized_policy.md
+++ b/docs/data-sources/localized_policy.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_localized_policy Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the Localized Policy .
---
diff --git a/docs/data-sources/mesh_topology_policy_definition.md b/docs/data-sources/mesh_topology_policy_definition.md
index 51092a8a0..a48214725 100644
--- a/docs/data-sources/mesh_topology_policy_definition.md
+++ b/docs/data-sources/mesh_topology_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_mesh_topology_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the Mesh Topology Policy Definition .
---
diff --git a/docs/data-sources/mirror_policy_object.md b/docs/data-sources/mirror_policy_object.md
index 591307dd0..f5ca30c00 100644
--- a/docs/data-sources/mirror_policy_object.md
+++ b/docs/data-sources/mirror_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_mirror_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Mirror Policy Object .
---
diff --git a/docs/data-sources/object_group_policy_definition.md b/docs/data-sources/object_group_policy_definition.md
index dbd3779ef..1d67ab2d5 100644
--- a/docs/data-sources/object_group_policy_definition.md
+++ b/docs/data-sources/object_group_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_object_group_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the Object Group Policy Definition .
---
diff --git a/docs/data-sources/other_feature_profile.md b/docs/data-sources/other_feature_profile.md
new file mode 100644
index 000000000..b841803f2
--- /dev/null
+++ b/docs/data-sources/other_feature_profile.md
@@ -0,0 +1,31 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_other_feature_profile Data Source - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This data source can read the Other Feature Profile .
+---
+
+# sdwan_other_feature_profile (Data Source)
+
+This data source can read the Other Feature Profile .
+
+## Example Usage
+
+```terraform
+data "sdwan_other_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `id` (String) The id of the object
+
+### Read-Only
+
+- `description` (String) Description
+- `name` (String) The name of the transport feature profile
diff --git a/docs/data-sources/other_thousandeyes_feature.md b/docs/data-sources/other_thousandeyes_feature.md
new file mode 100644
index 000000000..c6040af3e
--- /dev/null
+++ b/docs/data-sources/other_thousandeyes_feature.md
@@ -0,0 +1,62 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_other_thousandeyes_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Other ThousandEyes Feature.
+---
+
+# sdwan_other_thousandeyes_feature (Data Source)
+
+This data source can read the Other ThousandEyes Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_other_thousandeyes_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `version` (Number) The version of the Feature
+- `virtual_application` (Attributes List) Virtual application Instance (see [below for nested schema](#nestedatt--virtual_application))
+
+
+### Nested Schema for `virtual_application`
+
+Read-Only:
+
+- `account_group_token` (String) Set the Account Group Token
+- `account_group_token_variable` (String) Variable name
+- `agent_default_gateway` (String) Set the Agent default gateway
+- `agent_default_gateway_variable` (String) Variable name
+- `hostname` (String) Set the host name
+- `hostname_variable` (String) Variable name
+- `management_ip` (String) Set the Agent IP Address
+- `management_ip_variable` (String) Variable name
+- `management_subnet_mask` (String) Set the Agent SubnetMask
+- `management_subnet_mask_variable` (String) Variable name
+- `name_server_ip` (String) Set the name server
+- `name_server_ip_variable` (String) Variable name
+- `pac_url` (String) Set the proxy PAC url
+- `pac_url_variable` (String) Variable name
+- `proxy_host` (String) Set the Proxy Host
+- `proxy_host_variable` (String) Variable name
+- `proxy_port` (Number) Set the Proxy Port
+- `proxy_port_variable` (String) Variable name
+- `proxy_type` (String) Select Web Proxy Type
+- `vpn` (Number) VPN number
+- `vpn_variable` (String) Variable name
diff --git a/docs/data-sources/other_ucse_feature.md b/docs/data-sources/other_ucse_feature.md
new file mode 100644
index 000000000..891514cf9
--- /dev/null
+++ b/docs/data-sources/other_ucse_feature.md
@@ -0,0 +1,60 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_other_ucse_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Other UCSE Feature.
+---
+
+# sdwan_other_ucse_feature (Data Source)
+
+This data source can read the Other UCSE Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_other_ucse_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `access_port_dedicated` (Boolean) Dedicated
+- `access_port_shared_failover_type` (String)
+- `access_port_shared_type` (String)
+- `assign_priority` (Number) Assign priority
+- `assign_priority_variable` (String) Variable name
+- `bay` (Number) Bay
+- `default_gateway` (String) Assign default gateway
+- `default_gateway_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interfaces` (Attributes List) Interface name: GigabitEthernet0/<>/<> when present (see [below for nested schema](#nestedatt--interfaces))
+- `ipv4_address` (String) Assign IPv4 address
+- `ipv4_address_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `slot` (Number) Slot
+- `version` (Number) The version of the Feature
+- `vlan_id` (Number) Assign Vlan Id
+- `vlan_id_variable` (String) Variable name
+
+
+### Nested Schema for `interfaces`
+
+Read-Only:
+
+- `interface_name` (String) Set Inteface name
+- `interface_name_variable` (String) Variable name
+- `ipv4_address` (String) Assign IPv4 address
+- `ipv4_address_variable` (String) Variable name
+- `ucse_interface_vpn` (Number) UCSE Interface VPN
+- `ucse_interface_vpn_variable` (String) Variable name
diff --git a/docs/data-sources/policer_policy_object.md b/docs/data-sources/policer_policy_object.md
index f9d51a55f..83d259766 100644
--- a/docs/data-sources/policer_policy_object.md
+++ b/docs/data-sources/policer_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_policer_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Policer Policy Object .
---
diff --git a/docs/data-sources/policy_object_app_probe_class.md b/docs/data-sources/policy_object_app_probe_class.md
new file mode 100644
index 000000000..a4aa2ba6c
--- /dev/null
+++ b/docs/data-sources/policy_object_app_probe_class.md
@@ -0,0 +1,51 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_app_probe_class Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object App Probe Class Policy_object.
+---
+
+# sdwan_policy_object_app_probe_class (Data Source)
+
+This data source can read the Policy Object App Probe Class Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_app_probe_class" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) App Probe List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `forwarding_class` (String) Forwarding Class Name
+- `map` (Attributes List) Map (see [below for nested schema](#nestedatt--entries--map))
+
+
+### Nested Schema for `entries.map`
+
+Read-Only:
+
+- `color` (String) Color
+- `dscp` (Number) DSCP number
diff --git a/docs/data-sources/policy_object_application_list.md b/docs/data-sources/policy_object_application_list.md
new file mode 100644
index 000000000..08341c22a
--- /dev/null
+++ b/docs/data-sources/policy_object_application_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_application_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Application List Policy_object.
+---
+
+# sdwan_policy_object_application_list (Data Source)
+
+This data source can read the Policy Object Application List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_application_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Centralized Policy App List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `application` (String)
+- `application_family` (String)
diff --git a/docs/data-sources/policy_object_as_path_list.md b/docs/data-sources/policy_object_as_path_list.md
new file mode 100644
index 000000000..d41d05cce
--- /dev/null
+++ b/docs/data-sources/policy_object_as_path_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_as_path_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object AS Path List Policy_object.
+---
+
+# sdwan_policy_object_as_path_list (Data Source)
+
+This data source can read the Policy Object AS Path List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_as_path_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `as_path_list_id` (Number) As path List Number
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) AS Path List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `as_path_list` (String)
diff --git a/docs/data-sources/policy_object_class_map.md b/docs/data-sources/policy_object_class_map.md
new file mode 100644
index 000000000..80e7a9df8
--- /dev/null
+++ b/docs/data-sources/policy_object_class_map.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_class_map Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Class Map Policy_object.
+---
+
+# sdwan_policy_object_class_map (Data Source)
+
+This data source can read the Policy Object Class Map Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_class_map" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) class map List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `queue` (String) select a queue
diff --git a/docs/data-sources/policy_object_color_list.md b/docs/data-sources/policy_object_color_list.md
new file mode 100644
index 000000000..6bf0bbf8f
--- /dev/null
+++ b/docs/data-sources/policy_object_color_list.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_color_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Color List Policy_object.
+---
+
+# sdwan_policy_object_color_list (Data Source)
+
+This data source can read the Policy Object Color List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_color_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Color List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `color` (String)
diff --git a/docs/data-sources/policy_object_data_ipv4_prefix_list.md b/docs/data-sources/policy_object_data_ipv4_prefix_list.md
new file mode 100644
index 000000000..d366232f6
--- /dev/null
+++ b/docs/data-sources/policy_object_data_ipv4_prefix_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_data_ipv4_prefix_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Data IPv4 Prefix List Policy_object.
+---
+
+# sdwan_policy_object_data_ipv4_prefix_list (Data Source)
+
+This data source can read the Policy Object Data IPv4 Prefix List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_data_ipv4_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) IPv4 Data Prefix List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `ipv4_address` (String) IPv4 address
+- `ipv4_prefix_length` (Number) IPv4 prefix Length
diff --git a/docs/data-sources/policy_object_data_ipv6_prefix_list.md b/docs/data-sources/policy_object_data_ipv6_prefix_list.md
new file mode 100644
index 000000000..5bd401d73
--- /dev/null
+++ b/docs/data-sources/policy_object_data_ipv6_prefix_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_data_ipv6_prefix_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Data IPv6 Prefix List Policy_object.
+---
+
+# sdwan_policy_object_data_ipv6_prefix_list (Data Source)
+
+This data source can read the Policy Object Data IPv6 Prefix List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_data_ipv6_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `ipv6_address` (String) IPv6 address
+- `ipv6_prefix_length` (Number) IPv6 prefix
diff --git a/docs/data-sources/policy_object_expanded_community_list.md b/docs/data-sources/policy_object_expanded_community_list.md
new file mode 100644
index 000000000..a9facdfc5
--- /dev/null
+++ b/docs/data-sources/policy_object_expanded_community_list.md
@@ -0,0 +1,36 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_expanded_community_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Expanded Community List Policy_object.
+---
+
+# sdwan_policy_object_expanded_community_list (Data Source)
+
+This data source can read the Policy Object Expanded Community List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_expanded_community_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `expanded_community_lists` (Set of String) Expanded Community List
+- `expanded_community_lists_variable` (String) Variable name
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
diff --git a/docs/data-sources/policy_object_extended_community_list.md b/docs/data-sources/policy_object_extended_community_list.md
new file mode 100644
index 000000000..68fc48c69
--- /dev/null
+++ b/docs/data-sources/policy_object_extended_community_list.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_extended_community_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Extended Community List Policy_object.
+---
+
+# sdwan_policy_object_extended_community_list (Data Source)
+
+This data source can read the Policy Object Extended Community List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_extended_community_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Extended Community List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `extended_community` (String) can be soo 10.0.0.1:30 or rt 500:50 etc.
diff --git a/docs/data-sources/policy_object_feature_profile.md b/docs/data-sources/policy_object_feature_profile.md
new file mode 100644
index 000000000..12a6b1e57
--- /dev/null
+++ b/docs/data-sources/policy_object_feature_profile.md
@@ -0,0 +1,31 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_feature_profile Data Source - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This data source can read the Policy Object Feature Profile .
+---
+
+# sdwan_policy_object_feature_profile (Data Source)
+
+This data source can read the Policy Object Feature Profile .
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `id` (String) The id of the object
+
+### Read-Only
+
+- `description` (String) Description
+- `name` (String) The name of the policy object feature profile
diff --git a/docs/data-sources/policy_object_ipv4_prefix_list.md b/docs/data-sources/policy_object_ipv4_prefix_list.md
new file mode 100644
index 000000000..0db742be0
--- /dev/null
+++ b/docs/data-sources/policy_object_ipv4_prefix_list.md
@@ -0,0 +1,45 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_ipv4_prefix_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object IPv4 Prefix List Policy_object.
+---
+
+# sdwan_policy_object_ipv4_prefix_list (Data Source)
+
+This data source can read the Policy Object IPv4 Prefix List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_ipv4_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) IPv4 Prefix List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `ge` (Number) IPv4 prefix length with ge range operator
+- `ipv4_address` (String) IPv4 address
+- `ipv4_prefix_length` (Number) IPv4 prefix length
+- `le` (Number) IPv4 prefix length with le range operator
diff --git a/docs/data-sources/policy_object_ipv6_prefix_list.md b/docs/data-sources/policy_object_ipv6_prefix_list.md
new file mode 100644
index 000000000..a958ce2b0
--- /dev/null
+++ b/docs/data-sources/policy_object_ipv6_prefix_list.md
@@ -0,0 +1,45 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_ipv6_prefix_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object IPv6 Prefix List Policy_object.
+---
+
+# sdwan_policy_object_ipv6_prefix_list (Data Source)
+
+This data source can read the Policy Object IPv6 Prefix List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_ipv6_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `ge` (Number) IPv6 prefix length with ge range operator
+- `ipv6_address` (String) IPv6 address
+- `ipv6_prefix_length` (Number) IPv6 prefix length
+- `le` (Number) IPv6 prefix length with le range operator
diff --git a/docs/data-sources/policy_object_mirror.md b/docs/data-sources/policy_object_mirror.md
new file mode 100644
index 000000000..a5e2a8197
--- /dev/null
+++ b/docs/data-sources/policy_object_mirror.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_mirror Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Mirror Policy_object.
+---
+
+# sdwan_policy_object_mirror (Data Source)
+
+This data source can read the Policy Object Mirror Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_mirror" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Mirror List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `remote_destination_ip` (String) remote destination ip address
+- `source_ip` (String) source ip address
diff --git a/docs/data-sources/policy_object_policer.md b/docs/data-sources/policy_object_policer.md
new file mode 100644
index 000000000..32119fed4
--- /dev/null
+++ b/docs/data-sources/policy_object_policer.md
@@ -0,0 +1,44 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_policer Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Policer Policy_object.
+---
+
+# sdwan_policy_object_policer (Data Source)
+
+This data source can read the Policy Object Policer Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_policer" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Policer Entries (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `burst_bytes` (Number) Burst (Bytes)
+- `exceed_action` (String) Exceed options such as Drop or Remark
+- `rate_bps` (Number) Rate (bps)
diff --git a/docs/data-sources/policy_object_preferred_color_group.md b/docs/data-sources/policy_object_preferred_color_group.md
new file mode 100644
index 000000000..f91fe05f9
--- /dev/null
+++ b/docs/data-sources/policy_object_preferred_color_group.md
@@ -0,0 +1,47 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_preferred_color_group Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Preferred Color Group Policy_object.
+---
+
+# sdwan_policy_object_preferred_color_group (Data Source)
+
+This data source can read the Policy Object Preferred Color Group Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_preferred_color_group" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Preferred Color Group List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `primary_color_preference` (Set of String)
+- `primary_path_preference` (String)
+- `secondary_color_preference` (Set of String)
+- `secondary_path_preference` (String)
+- `tertiary_color_preference` (Set of String)
+- `tertiary_path_preference` (String)
diff --git a/docs/data-sources/policy_object_security_data_ipv4_prefix_list.md b/docs/data-sources/policy_object_security_data_ipv4_prefix_list.md
new file mode 100644
index 000000000..5615d1533
--- /dev/null
+++ b/docs/data-sources/policy_object_security_data_ipv4_prefix_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_data_ipv4_prefix_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security Data IPv4 Prefix List Policy_object.
+---
+
+# sdwan_policy_object_security_data_ipv4_prefix_list (Data Source)
+
+This data source can read the Policy Object Security Data IPv4 Prefix List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_data_ipv4_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `ip_prefix` (String)
+- `ip_prefix_variable` (String) Variable name
diff --git a/docs/data-sources/policy_object_security_fqdn_list.md b/docs/data-sources/policy_object_security_fqdn_list.md
new file mode 100644
index 000000000..0c765096d
--- /dev/null
+++ b/docs/data-sources/policy_object_security_fqdn_list.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_fqdn_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security FQDN List Policy_object.
+---
+
+# sdwan_policy_object_security_fqdn_list (Data Source)
+
+This data source can read the Policy Object Security FQDN List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_fqdn_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `pattern` (String)
diff --git a/docs/data-sources/policy_object_security_geolocation_list.md b/docs/data-sources/policy_object_security_geolocation_list.md
new file mode 100644
index 000000000..784d89999
--- /dev/null
+++ b/docs/data-sources/policy_object_security_geolocation_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_geolocation_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security Geolocation List Policy_object.
+---
+
+# sdwan_policy_object_security_geolocation_list (Data Source)
+
+This data source can read the Policy Object Security Geolocation List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_geolocation_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Geolocation List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `continent` (String) continent name
+- `country` (String) country names
diff --git a/docs/data-sources/policy_object_security_identity_list.md b/docs/data-sources/policy_object_security_identity_list.md
new file mode 100644
index 000000000..352b21b15
--- /dev/null
+++ b/docs/data-sources/policy_object_security_identity_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_identity_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security Identity List Policy_object.
+---
+
+# sdwan_policy_object_security_identity_list (Data Source)
+
+This data source can read the Policy Object Security Identity List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_identity_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Array of Users and User Groups (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `user` (String)
+- `user_group` (String)
diff --git a/docs/data-sources/policy_object_security_ips_signature.md b/docs/data-sources/policy_object_security_ips_signature.md
new file mode 100644
index 000000000..2dcb5706d
--- /dev/null
+++ b/docs/data-sources/policy_object_security_ips_signature.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_ips_signature Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security IPS Signature Policy_object.
+---
+
+# sdwan_policy_object_security_ips_signature (Data Source)
+
+This data source can read the Policy Object Security IPS Signature Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_ips_signature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Ips Signature (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `generator_id` (String)
+- `signature_id` (String)
diff --git a/docs/data-sources/policy_object_security_local_application_list.md b/docs/data-sources/policy_object_security_local_application_list.md
new file mode 100644
index 000000000..c1802d21b
--- /dev/null
+++ b/docs/data-sources/policy_object_security_local_application_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_local_application_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security Local Application List Policy_object.
+---
+
+# sdwan_policy_object_security_local_application_list (Data Source)
+
+This data source can read the Policy Object Security Local Application List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_local_application_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Localapp list (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `app` (String)
+- `app_family` (String)
diff --git a/docs/data-sources/policy_object_security_local_domain_list.md b/docs/data-sources/policy_object_security_local_domain_list.md
new file mode 100644
index 000000000..3a5f79b02
--- /dev/null
+++ b/docs/data-sources/policy_object_security_local_domain_list.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_local_domain_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security Local Domain List Policy_object.
+---
+
+# sdwan_policy_object_security_local_domain_list (Data Source)
+
+This data source can read the Policy Object Security Local Domain List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_local_domain_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `local_domain` (String)
diff --git a/docs/data-sources/policy_object_security_port_list.md b/docs/data-sources/policy_object_security_port_list.md
new file mode 100644
index 000000000..ca2f79436
--- /dev/null
+++ b/docs/data-sources/policy_object_security_port_list.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_port_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security Port List Policy_object.
+---
+
+# sdwan_policy_object_security_port_list (Data Source)
+
+This data source can read the Policy Object Security Port List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_port_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Port List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `port` (String) can be single port or port range
diff --git a/docs/data-sources/policy_object_security_scalable_group_tag_list.md b/docs/data-sources/policy_object_security_scalable_group_tag_list.md
new file mode 100644
index 000000000..61e1b035b
--- /dev/null
+++ b/docs/data-sources/policy_object_security_scalable_group_tag_list.md
@@ -0,0 +1,43 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_scalable_group_tag_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security Scalable Group Tag List Policy_object.
+---
+
+# sdwan_policy_object_security_scalable_group_tag_list (Data Source)
+
+This data source can read the Policy Object Security Scalable Group Tag List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_scalable_group_tag_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = ""
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `sgt_name` (String)
+- `tag` (String)
diff --git a/docs/data-sources/policy_object_security_url_list.md b/docs/data-sources/policy_object_security_url_list.md
new file mode 100644
index 000000000..f5365f1ef
--- /dev/null
+++ b/docs/data-sources/policy_object_security_url_list.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_url_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Security URL List Policy_object.
+---
+
+# sdwan_policy_object_security_url_list (Data Source)
+
+This data source can read the Policy Object Security URL List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_security_url_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) URL List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `pattern` (String) valid url pattern
diff --git a/docs/data-sources/policy_object_sla_class_list.md b/docs/data-sources/policy_object_sla_class_list.md
new file mode 100644
index 000000000..d97bc5b3c
--- /dev/null
+++ b/docs/data-sources/policy_object_sla_class_list.md
@@ -0,0 +1,49 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_sla_class_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object SLA Class List Policy_object.
+---
+
+# sdwan_policy_object_sla_class_list (Data Source)
+
+This data source can read the Policy Object SLA Class List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_sla_class_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Sla class List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `app_probe_class_list_id` (String)
+- `fallback_best_tunnel_criteria` (String)
+- `fallback_best_tunnel_jitter_variance` (Number)
+- `fallback_best_tunnel_latency_variance` (Number)
+- `fallback_best_tunnel_loss_variance` (Number)
+- `jitter` (Number)
+- `latency` (Number)
+- `loss` (Number)
diff --git a/docs/data-sources/policy_object_standard_community_list.md b/docs/data-sources/policy_object_standard_community_list.md
new file mode 100644
index 000000000..fac069aac
--- /dev/null
+++ b/docs/data-sources/policy_object_standard_community_list.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_standard_community_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object Standard Community List Policy_object.
+---
+
+# sdwan_policy_object_standard_community_list (Data Source)
+
+This data source can read the Policy Object Standard Community List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_standard_community_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Standard Community List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `standard_community` (String) Standard Community
diff --git a/docs/data-sources/policy_object_tloc_list.md b/docs/data-sources/policy_object_tloc_list.md
new file mode 100644
index 000000000..7a7bec423
--- /dev/null
+++ b/docs/data-sources/policy_object_tloc_list.md
@@ -0,0 +1,45 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_tloc_list Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object TLOC List Policy_object.
+---
+
+# sdwan_policy_object_tloc_list (Data Source)
+
+This data source can read the Policy Object TLOC List Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_tloc_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) TLOC List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `color` (String) color
+- `encapsulation` (String) encapsulation
+- `preference` (String) Preference
+- `tloc_ip` (String) tloc
diff --git a/docs/data-sources/policy_object_vpn_group.md b/docs/data-sources/policy_object_vpn_group.md
new file mode 100644
index 000000000..dfb06adb9
--- /dev/null
+++ b/docs/data-sources/policy_object_vpn_group.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_vpn_group Data Source - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This data source can read the Policy Object VPN Group Policy_object.
+---
+
+# sdwan_policy_object_vpn_group (Data Source)
+
+This data source can read the Policy Object VPN Group Policy_object.
+
+## Example Usage
+
+```terraform
+data "sdwan_policy_object_vpn_group" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Policy_object
+
+### Read-Only
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) VPN List (see [below for nested schema](#nestedatt--entries))
+- `name` (String) The name of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Read-Only:
+
+- `vpn` (Number) can be single vpn id or vpn id range
diff --git a/docs/data-sources/port_list_policy_object.md b/docs/data-sources/port_list_policy_object.md
index 98386c926..de0d45178 100644
--- a/docs/data-sources/port_list_policy_object.md
+++ b/docs/data-sources/port_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_port_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Port List Policy Object .
---
diff --git a/docs/data-sources/preferred_color_group_policy_object.md b/docs/data-sources/preferred_color_group_policy_object.md
index 5f818c0ef..42a807fff 100644
--- a/docs/data-sources/preferred_color_group_policy_object.md
+++ b/docs/data-sources/preferred_color_group_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_preferred_color_group_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Preferred Color Group Policy Object .
---
diff --git a/docs/data-sources/protocol_list_policy_object.md b/docs/data-sources/protocol_list_policy_object.md
index d8a5d4a12..bbd0a1d14 100644
--- a/docs/data-sources/protocol_list_policy_object.md
+++ b/docs/data-sources/protocol_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_protocol_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Protocol List Policy Object .
---
diff --git a/docs/data-sources/qos_map_policy_definition.md b/docs/data-sources/qos_map_policy_definition.md
index 758379db7..16a3a61dd 100644
--- a/docs/data-sources/qos_map_policy_definition.md
+++ b/docs/data-sources/qos_map_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_qos_map_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the QoS Map Policy Definition .
---
diff --git a/docs/data-sources/region_list_policy_object.md b/docs/data-sources/region_list_policy_object.md
index 3882b8621..23d60aee7 100644
--- a/docs/data-sources/region_list_policy_object.md
+++ b/docs/data-sources/region_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_region_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Region List Policy Object .
---
diff --git a/docs/data-sources/rewrite_rule_policy_definition.md b/docs/data-sources/rewrite_rule_policy_definition.md
index 0b610a52d..cbc1a4f3f 100644
--- a/docs/data-sources/rewrite_rule_policy_definition.md
+++ b/docs/data-sources/rewrite_rule_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_rewrite_rule_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the Rewrite Rule Policy Definition .
---
diff --git a/docs/data-sources/route_policy_definition.md b/docs/data-sources/route_policy_definition.md
index e4bfa8b4f..cb3cd083e 100644
--- a/docs/data-sources/route_policy_definition.md
+++ b/docs/data-sources/route_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_route_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This data source can read the Route Policy Definition .
---
diff --git a/docs/data-sources/rule_set_policy_definition.md b/docs/data-sources/rule_set_policy_definition.md
index 71a5738bd..c579f5ea2 100644
--- a/docs/data-sources/rule_set_policy_definition.md
+++ b/docs/data-sources/rule_set_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_rule_set_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the Rule Set Policy Definition .
---
diff --git a/docs/data-sources/security_app_hosting_feature_template.md b/docs/data-sources/security_app_hosting_feature_template.md
index 14dcf1be9..7a5ce83d6 100644
--- a/docs/data-sources/security_app_hosting_feature_template.md
+++ b/docs/data-sources/security_app_hosting_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_security_app_hosting_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Security App Hosting feature template.
---
diff --git a/docs/data-sources/security_policy.md b/docs/data-sources/security_policy.md
index 1f17a194d..be32bca9d 100644
--- a/docs/data-sources/security_policy.md
+++ b/docs/data-sources/security_policy.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_security_policy Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the Security Policy .
---
diff --git a/docs/data-sources/service_lan_vpn_feature.md b/docs/data-sources/service_lan_vpn_feature.md
new file mode 100644
index 000000000..90a45fa34
--- /dev/null
+++ b/docs/data-sources/service_lan_vpn_feature.md
@@ -0,0 +1,417 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service LAN VPN Feature.
+---
+
+# sdwan_service_lan_vpn_feature (Data Source)
+
+This data source can read the Service LAN VPN Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_lan_vpn_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `advertise_omp_ipv4s` (Attributes List) OMP Advertise IPv4 (see [below for nested schema](#nestedatt--advertise_omp_ipv4s))
+- `advertise_omp_ipv6s` (Attributes List) OMP Advertise IPv6 (see [below for nested schema](#nestedatt--advertise_omp_ipv6s))
+- `config_description` (String) Name
+- `config_description_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `enable_sdwan_remote_access` (Boolean) Enable SDWAN Remote Access
+- `gre_routes` (Attributes List) IPv4 Static GRE Route (see [below for nested schema](#nestedatt--gre_routes))
+- `host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--host_mappings))
+- `ipsec_routes` (Attributes List) IPv4 Static IPSEC Route (see [below for nested schema](#nestedatt--ipsec_routes))
+- `ipv4_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_export_route_targets))
+- `ipv4_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_import_route_targets))
+- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
+- `ipv6_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_export_route_targets))
+- `ipv6_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_import_route_targets))
+- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
+- `name` (String) The name of the Feature
+- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
+- `nat_pools` (Attributes List) NAT Pool (see [below for nested schema](#nestedatt--nat_pools))
+- `nat_port_forwards` (Attributes List) NAT Port Forward (see [below for nested schema](#nestedatt--nat_port_forwards))
+- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
+- `omp_admin_distance_ipv4_variable` (String) Variable name
+- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
+- `omp_admin_distance_ipv6_variable` (String) Variable name
+- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
+- `primary_dns_address_ipv4_variable` (String) Variable name
+- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
+- `primary_dns_address_ipv6_variable` (String) Variable name
+- `route_leak_from_global_vpns` (Attributes List) Enable route leaking from Global to Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns))
+- `route_leak_from_other_services` (Attributes List) Enable route leak from another Service VPN to current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services))
+- `route_leak_to_global_vpns` (Attributes List) Enable route leaking from Service to Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns))
+- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
+- `secondary_dns_address_ipv4_variable` (String) Variable name
+- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
+- `secondary_dns_address_ipv6_variable` (String) Variable name
+- `service_routes` (Attributes List) Service (see [below for nested schema](#nestedatt--service_routes))
+- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
+- `static_nats` (Attributes List) Static NAT Rules (see [below for nested schema](#nestedatt--static_nats))
+- `version` (Number) The version of the Feature
+- `vpn` (Number) VPN
+- `vpn_variable` (String) Variable name
+
+
+### Nested Schema for `advertise_omp_ipv4s`
+
+Read-Only:
+
+- `prefixes` (Attributes List) IPv4 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv4s--prefixes))
+- `protocol` (String) Protocol
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+### Nested Schema for `advertise_omp_ipv4s.prefixes`
+
+Read-Only:
+
+- `aggregate_only` (Boolean) Aggregate Only
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `region` (String) Applied to Region
+- `region_variable` (String) Variable name
+- `subnet_mask` (String)
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `advertise_omp_ipv6s`
+
+Read-Only:
+
+- `prefixes` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv6s--prefixes))
+- `protocol` (String) Protocol
+- `protocol_sub_type` (String) Protocol Sub Type
+- `protocol_sub_type_variable` (String) Variable name
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+### Nested Schema for `advertise_omp_ipv6s.prefixes`
+
+Read-Only:
+
+- `aggregate_only` (Boolean) Aggregate Only
+- `prefix` (String) IPv6 Prefix
+- `prefix_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `gre_routes`
+
+Read-Only:
+
+- `interface` (Set of String) Interface
+- `interface_variable` (String) Variable name
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+- `vpn` (Number) Service
+
+
+
+### Nested Schema for `host_mappings`
+
+Read-Only:
+
+- `host_name` (String) Hostname
+- `host_name_variable` (String) Variable name
+- `list_of_ips` (Set of String) List of IP
+- `list_of_ips_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipsec_routes`
+
+Read-Only:
+
+- `interface` (Set of String) Interface
+- `interface_variable` (String) Variable name
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_export_route_targets`
+
+Read-Only:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_import_route_targets`
+
+Read-Only:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_static_routes`
+
+Read-Only:
+
+- `gateway_dhcp` (Boolean) IPv4 Route Gateway DHCP
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `next_hop_with_trackers` (Attributes List) IPv4 Route Gateway Next Hop with Tracker (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hop_with_trackers))
+- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
+- `null0` (Boolean) IPv4 Route Gateway Next Hop
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+- `vpn` (Boolean) IPv4 Route Gateway VPN
+
+
+### Nested Schema for `ipv4_static_routes.next_hop_with_trackers`
+
+Read-Only:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+- `tracker_id` (String)
+
+
+
+### Nested Schema for `ipv4_static_routes.next_hops`
+
+Read-Only:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_export_route_targets`
+
+Read-Only:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_import_route_targets`
+
+Read-Only:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_static_routes`
+
+Read-Only:
+
+- `nat` (String) IPv6 Nat
+- `nat_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
+- `null0` (Boolean) IPv6 Route Gateway Next Hop
+- `prefix` (String) Prefix
+- `prefix_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_static_routes.next_hops`
+
+Read-Only:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `nat_64_v4_pools`
+
+Read-Only:
+
+- `name` (String) NAT64 v4 Pool Name
+- `name_variable` (String) Variable name
+- `overload` (Boolean) NAT64 Overload
+- `overload_variable` (String) Variable name
+- `range_end` (String) NAT64 Pool Range End
+- `range_end_variable` (String) Variable name
+- `range_start` (String) NAT64 Pool Range Start
+- `range_start_variable` (String) Variable name
+
+
+
+### Nested Schema for `nat_pools`
+
+Read-Only:
+
+- `direction` (String) NAT Direction
+- `direction_variable` (String) Variable name
+- `nat_pool_name` (Number) NAT Pool Name
+- `nat_pool_name_variable` (String) Variable name
+- `overload` (Boolean) NAT Overload
+- `overload_variable` (String) Variable name
+- `prefix_length` (Number) NAT Pool Prefix Length
+- `prefix_length_variable` (String) Variable name
+- `range_end` (String) NAT Pool Range End
+- `range_end_variable` (String) Variable name
+- `range_start` (String) NAT Pool Range Start
+- `range_start_variable` (String) Variable name
+- `tracker_object_id` (String)
+
+
+
+### Nested Schema for `nat_port_forwards`
+
+Read-Only:
+
+- `nat_pool_name` (Number) NAT Pool Name
+- `nat_pool_name_variable` (String) Variable name
+- `protocol` (String) Protocol
+- `protocol_variable` (String) Variable name
+- `source_ip` (String) Source IP Address
+- `source_ip_variable` (String) Variable name
+- `source_port` (Number) Source Port
+- `source_port_variable` (String) Variable name
+- `translate_port` (Number) Translate Port
+- `translate_port_variable` (String) Variable name
+- `translated_source_ip` (String) Translated Source IP Address
+- `translated_source_ip_variable` (String) Variable name
+
+
+
+### Nested Schema for `route_leak_from_global_vpns`
+
+Read-Only:
+
+- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns--redistributions))
+- `route_policy_id` (String)
+- `route_protocol` (String) Leak Routes of particular protocol from Global to Service VPN
+- `route_protocol_variable` (String) Variable name
+
+
+### Nested Schema for `route_leak_from_global_vpns.redistributions`
+
+Read-Only:
+
+- `protocol` (String) Protocol to restributed leaked routes
+- `protocol_variable` (String) Variable name
+- `redistribution_policy_id` (String)
+
+
+
+
+### Nested Schema for `route_leak_from_other_services`
+
+Read-Only:
+
+- `redistributions` (Attributes List) Redistribute Route to specific Protocol on Current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services--redistributions))
+- `route_policy_id` (String)
+- `route_protocol` (String) Leak Route of particular protocol from Source Service VPN
+- `route_protocol_variable` (String) Variable name
+- `source_vpn` (Number) Source Service VPN from where route are to be leaked
+- `source_vpn_variable` (String) Variable name
+
+
+### Nested Schema for `route_leak_from_other_services.redistributions`
+
+Read-Only:
+
+- `protocol` (String) Protocol to restributed leaked routes
+- `protocol_variable` (String) Variable name
+- `redistribution_policy_id` (String)
+
+
+
+
+### Nested Schema for `route_leak_to_global_vpns`
+
+Read-Only:
+
+- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns--redistributions))
+- `route_policy_id` (String)
+- `route_protocol` (String) Leak Routes of particular protocol from Service to Global VPN
+- `route_protocol_variable` (String) Variable name
+
+
+### Nested Schema for `route_leak_to_global_vpns.redistributions`
+
+Read-Only:
+
+- `protocol` (String) Protocol to restributed leaked routes
+- `protocol_variable` (String) Variable name
+- `redistribution_policy_id` (String)
+
+
+
+
+### Nested Schema for `service_routes`
+
+Read-Only:
+
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `service` (String) Service
+- `service_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+- `vpn` (Number) Service
+
+
+
+### Nested Schema for `services`
+
+Read-Only:
+
+- `ipv4_addresses` (Set of String) IPv4 Addresses (Maximum: 4)
+- `ipv4_addresses_variable` (String) Variable name
+- `service_type` (String) Service Type
+- `service_type_variable` (String) Variable name
+- `tracking` (Boolean) Tracking
+- `tracking_variable` (String) Variable name
+
+
+
+### Nested Schema for `static_nats`
+
+Read-Only:
+
+- `nat_pool_name` (Number) NAT Pool Name
+- `nat_pool_name_variable` (String) Variable name
+- `source_ip` (String) Source IP Address
+- `source_ip_variable` (String) Variable name
+- `static_nat_direction` (String) Static NAT Direction
+- `static_nat_direction_variable` (String) Variable name
+- `tracker_object_id` (String)
+- `translated_source_ip` (String) Translated Source IP Address
+- `translated_source_ip_variable` (String) Variable name
diff --git a/docs/data-sources/service_lan_vpn_interface_ethernet_feature.md b/docs/data-sources/service_lan_vpn_interface_ethernet_feature.md
new file mode 100644
index 000000000..7767e2611
--- /dev/null
+++ b/docs/data-sources/service_lan_vpn_interface_ethernet_feature.md
@@ -0,0 +1,241 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_ethernet_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service LAN VPN Interface Ethernet Feature.
+---
+
+# sdwan_service_lan_vpn_interface_ethernet_feature (Data Source)
+
+This data source can read the Service LAN VPN Interface Ethernet Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_lan_vpn_interface_ethernet_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+
+### Read-Only
+
+- `acl_ipv4_egress_policy_id` (String)
+- `acl_ipv4_ingress_policy_id` (String)
+- `acl_ipv6_egress_policy_id` (String)
+- `acl_ipv6_ingress_policy_id` (String)
+- `acl_shaping_rate` (Number) Shaping Rate (Kbps)
+- `acl_shaping_rate_variable` (String) Variable name
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+- `arp_timeout_variable` (String) Variable name
+- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
+- `autonegotiate` (Boolean) Link autonegotiation
+- `autonegotiate_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `duplex` (String) Duplex mode
+- `duplex_variable` (String) Variable name
+- `enable_dhcpv6` (Boolean) Enable DHCPv6
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String) IP Address
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_dhcp_distance` (Number) DHCP Distance
+- `ipv4_dhcp_distance_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `ipv4_nat` (Boolean) enable Network Address Translation on this interface
+- `ipv4_nat_loopback` (String) NAT Inside Source Loopback Interface
+- `ipv4_nat_loopback_variable` (String) Variable name
+- `ipv4_nat_overload` (Boolean) NAT Overload
+- `ipv4_nat_overload_variable` (String) Variable name
+- `ipv4_nat_prefix_length` (Number) NAT Pool Prefix Length
+- `ipv4_nat_prefix_length_variable` (String) Variable name
+- `ipv4_nat_range_end` (String) NAT Pool Range End
+- `ipv4_nat_range_end_variable` (String) Variable name
+- `ipv4_nat_range_start` (String) NAT Pool Range Start
+- `ipv4_nat_range_start_variable` (String) Variable name
+- `ipv4_nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
+- `ipv4_nat_tcp_timeout_variable` (String) Variable name
+- `ipv4_nat_type` (String) NAT Type
+- `ipv4_nat_type_variable` (String) Variable name
+- `ipv4_nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
+- `ipv4_nat_udp_timeout_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask` (String) Subnet Mask
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv4_vrrps` (Attributes List) Enable VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
+- `ipv6_address` (String) IPv6 Address Secondary
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
+- `ipv6_dhcp_secondary_addresses` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_addresses))
+- `ipv6_nat` (Boolean) enable Network Address Translation ipv6 on this interface
+- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
+- `ipv6_vrrps` (Attributes List) Enable VRRP Ipv6 (see [below for nested schema](#nestedatt--ipv6_vrrps))
+- `load_interval` (Number) Interval for interface load calculation
+- `load_interval_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+- `media_type` (String) Media type
+- `media_type_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `nat64` (Boolean) NAT64 on this interface
+- `shutdown` (Boolean)
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+- `speed_variable` (String) Variable name
+- `static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--static_nats))
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tracker` (String) Enable tracker for this interface
+- `tracker_variable` (String) Variable name
+- `trustsec_enable_enforced_propogation` (Boolean) Enable/Disable SGT Enforcement on an interface
+- `trustsec_enable_sgt_propogation` (Boolean) Indicates that the interface is trustworthy for CTS
+- `trustsec_enforced_security_group_tag` (Number) SGT value between 2 and 65519
+- `trustsec_enforced_security_group_tag_variable` (String) Variable name
+- `trustsec_propogate` (Boolean) Enables the interface for CTS SGT authorization and forwarding
+- `trustsec_security_group_tag` (Number) SGT value between 2 and 65519
+- `trustsec_security_group_tag_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local LAN interface
+- `xconnect_variable` (String) Variable name
+
+
+### Nested Schema for `arps`
+
+Read-Only:
+
+- `ip_address` (String) IPV4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_vrrps`
+
+Read-Only:
+
+- `address` (String) VRRP Ip Address
+- `address_variable` (String) Variable name
+- `group_id` (Number) Group ID
+- `group_id_variable` (String) Variable name
+- `priority` (Number) Set priority
+- `priority_variable` (String) Variable name
+- `secondary_addresses` (Attributes List) VRRP Secondary Ip Addresses (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+- `timer_variable` (String) Variable name
+- `tloc_pref_change_value` (Number) Timer interval for successive advertisements, in milliseconds
+- `tloc_prefix_change` (Boolean) Timer interval for successive advertisements, in milliseconds
+- `track_omp` (Boolean) Track OMP status
+
+
+### Nested Schema for `ipv4_vrrps.secondary_addresses`
+
+Read-Only:
+
+- `address` (String) Ip Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_dhcp_helpers`
+
+Read-Only:
+
+- `address` (String) DHCPv6 Helper address
+- `address_variable` (String) Variable name
+- `dhcpv6_helper_vpn` (Number) DHCPv6 Helper VPN
+- `dhcpv6_helper_vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_dhcp_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_vrrps`
+
+Read-Only:
+
+- `group_id` (Number) Group ID
+- `group_id_variable` (String) Variable name
+- `ipv6_addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--ipv6_addresses))
+- `priority` (Number) Set priority
+- `priority_variable` (String) Variable name
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+- `timer_variable` (String) Variable name
+- `track_omp` (Boolean) Track OMP status
+
+
+### Nested Schema for `ipv6_vrrps.ipv6_addresses`
+
+Read-Only:
+
+- `global_address` (String) Assign Global IPv6 Prefix
+- `global_address_variable` (String) Variable name
+- `link_local_address` (String) Use link-local IPv6 Address
+- `link_local_address_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `static_nats`
+
+Read-Only:
+
+- `direction` (String) Direction of static NAT translation
+- `source_ip` (String) Source IP address to be translated
+- `source_ip_variable` (String) Variable name
+- `source_vpn` (Number) Source VPN ID
+- `source_vpn_variable` (String) Variable name
+- `translate_ip` (String) Statically translated source IP address
+- `translate_ip_variable` (String) Variable name
diff --git a/docs/data-sources/service_lan_vpn_interface_ethernet_profile_parcel.md b/docs/data-sources/service_lan_vpn_interface_ethernet_profile_parcel.md
deleted file mode 100644
index 9cbf070f4..000000000
--- a/docs/data-sources/service_lan_vpn_interface_ethernet_profile_parcel.md
+++ /dev/null
@@ -1,241 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_ethernet_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Service LAN VPN Interface Ethernet profile parcel.
----
-
-# sdwan_service_lan_vpn_interface_ethernet_profile_parcel (Data Source)
-
-This data source can read the Service LAN VPN Interface Ethernet profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Profile ID
-
-### Read-Only
-
-- `acl_ipv4_egress_policy_id` (String)
-- `acl_ipv4_ingress_policy_id` (String)
-- `acl_ipv6_egress_policy_id` (String)
-- `acl_ipv6_ingress_policy_id` (String)
-- `acl_shaping_rate` (Number) Shaping Rate (Kbps)
-- `acl_shaping_rate_variable` (String) Variable name
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
-- `arp_timeout_variable` (String) Variable name
-- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
-- `autonegotiate` (Boolean) Link autonegotiation
-- `autonegotiate_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `duplex` (String) Duplex mode
-- `duplex_variable` (String) Variable name
-- `enable_dhcpv6` (Boolean) Enable DHCPv6
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String) IP Address
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_dhcp_distance` (Number) DHCP Distance
-- `ipv4_dhcp_distance_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `ipv4_nat` (Boolean) enable Network Address Translation on this interface
-- `ipv4_nat_loopback` (String) NAT Inside Source Loopback Interface
-- `ipv4_nat_loopback_variable` (String) Variable name
-- `ipv4_nat_overload` (Boolean) NAT Overload
-- `ipv4_nat_overload_variable` (String) Variable name
-- `ipv4_nat_prefix_length` (Number) NAT Pool Prefix Length
-- `ipv4_nat_prefix_length_variable` (String) Variable name
-- `ipv4_nat_range_end` (String) NAT Pool Range End
-- `ipv4_nat_range_end_variable` (String) Variable name
-- `ipv4_nat_range_start` (String) NAT Pool Range Start
-- `ipv4_nat_range_start_variable` (String) Variable name
-- `ipv4_nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
-- `ipv4_nat_tcp_timeout_variable` (String) Variable name
-- `ipv4_nat_type` (String) NAT Type
-- `ipv4_nat_type_variable` (String) Variable name
-- `ipv4_nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
-- `ipv4_nat_udp_timeout_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask` (String) Subnet Mask
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv4_vrrps` (Attributes List) Enable VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
-- `ipv6_address` (String) IPv6 Address Secondary
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
-- `ipv6_dhcp_secondary_addresses` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_addresses))
-- `ipv6_nat` (Boolean) enable Network Address Translation ipv6 on this interface
-- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
-- `ipv6_vrrps` (Attributes List) Enable VRRP Ipv6 (see [below for nested schema](#nestedatt--ipv6_vrrps))
-- `load_interval` (Number) Interval for interface load calculation
-- `load_interval_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-- `media_type` (String) Media type
-- `media_type_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `nat64` (Boolean) NAT64 on this interface
-- `shutdown` (Boolean)
-- `shutdown_variable` (String) Variable name
-- `speed` (String) Set interface speed
-- `speed_variable` (String) Variable name
-- `static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--static_nats))
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tracker` (String) Enable tracker for this interface
-- `tracker_variable` (String) Variable name
-- `trustsec_enable_enforced_propogation` (Boolean) Enable/Disable SGT Enforcement on an interface
-- `trustsec_enable_sgt_propogation` (Boolean) Indicates that the interface is trustworthy for CTS
-- `trustsec_enforced_security_group_tag` (Number) SGT value between 2 and 65519
-- `trustsec_enforced_security_group_tag_variable` (String) Variable name
-- `trustsec_propogate` (Boolean) Enables the interface for CTS SGT authorization and forwarding
-- `trustsec_security_group_tag` (Number) SGT value between 2 and 65519
-- `trustsec_security_group_tag_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local LAN interface
-- `xconnect_variable` (String) Variable name
-
-
-### Nested Schema for `arps`
-
-Read-Only:
-
-- `ip_address` (String) IPV4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_vrrps`
-
-Read-Only:
-
-- `address` (String) VRRP Ip Address
-- `address_variable` (String) Variable name
-- `group_id` (Number) Group ID
-- `group_id_variable` (String) Variable name
-- `priority` (Number) Set priority
-- `priority_variable` (String) Variable name
-- `secondary_addresses` (Attributes List) VRRP Secondary Ip Addresses (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
-- `timer_variable` (String) Variable name
-- `tloc_pref_change_value` (Number) Timer interval for successive advertisements, in milliseconds
-- `tloc_prefix_change` (Boolean) Timer interval for successive advertisements, in milliseconds
-- `track_omp` (Boolean) Track OMP status
-
-
-### Nested Schema for `ipv4_vrrps.secondary_addresses`
-
-Read-Only:
-
-- `address` (String) Ip Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_dhcp_helpers`
-
-Read-Only:
-
-- `address` (String) DHCPv6 Helper address
-- `address_variable` (String) Variable name
-- `dhcpv6_helper_vpn` (Number) DHCPv6 Helper VPN
-- `dhcpv6_helper_vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_dhcp_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_vrrps`
-
-Read-Only:
-
-- `group_id` (Number) Group ID
-- `group_id_variable` (String) Variable name
-- `ipv6_addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--ipv6_addresses))
-- `priority` (Number) Set priority
-- `priority_variable` (String) Variable name
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
-- `timer_variable` (String) Variable name
-- `track_omp` (Boolean) Track OMP status
-
-
-### Nested Schema for `ipv6_vrrps.ipv6_addresses`
-
-Read-Only:
-
-- `global_address` (String) Assign Global IPv6 Prefix
-- `global_address_variable` (String) Variable name
-- `link_local_address` (String) Use link-local IPv6 Address
-- `link_local_address_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `static_nats`
-
-Read-Only:
-
-- `direction` (String) Direction of static NAT translation
-- `source_ip` (String) Source IP address to be translated
-- `source_ip_variable` (String) Variable name
-- `source_vpn` (Number) Source VPN ID
-- `source_vpn_variable` (String) Variable name
-- `translate_ip` (String) Statically translated source IP address
-- `translate_ip_variable` (String) Variable name
diff --git a/docs/data-sources/service_lan_vpn_interface_gre_feature.md b/docs/data-sources/service_lan_vpn_interface_gre_feature.md
new file mode 100644
index 000000000..de8a6dcdf
--- /dev/null
+++ b/docs/data-sources/service_lan_vpn_interface_gre_feature.md
@@ -0,0 +1,64 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_gre_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service LAN VPN Interface GRE Feature.
+---
+
+# sdwan_service_lan_vpn_interface_gre_feature (Data Source)
+
+This data source can read the Service LAN VPN Interface GRE Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_lan_vpn_interface_gre_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+
+### Read-Only
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name` (String) Interface name (1..255)
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String)
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `shutdown` (Boolean) Administrative state
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
+- `tunnel_route_via_loopback_variable` (String) Variable name
+- `tunnel_source_interface` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback_variable` (String) Variable name
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/service_lan_vpn_interface_gre_profile_parcel.md b/docs/data-sources/service_lan_vpn_interface_gre_profile_parcel.md
deleted file mode 100644
index b60bdfc64..000000000
--- a/docs/data-sources/service_lan_vpn_interface_gre_profile_parcel.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_gre_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Service LAN VPN Interface GRE profile parcel.
----
-
-# sdwan_service_lan_vpn_interface_gre_profile_parcel (Data Source)
-
-This data source can read the Service LAN VPN Interface GRE profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_service_lan_vpn_interface_gre_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Parcel ID
-
-### Read-Only
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name` (String) Interface name (1..255)
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String)
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String)
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `shutdown` (Boolean) Administrative state
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
-- `tunnel_route_via_loopback_variable` (String) Variable name
-- `tunnel_source_interface` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback_variable` (String) Variable name
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/service_lan_vpn_interface_ipsec_feature.md b/docs/data-sources/service_lan_vpn_interface_ipsec_feature.md
new file mode 100644
index 000000000..be53869bc
--- /dev/null
+++ b/docs/data-sources/service_lan_vpn_interface_ipsec_feature.md
@@ -0,0 +1,95 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_ipsec_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service LAN VPN Interface IPSec Feature.
+---
+
+# sdwan_service_lan_vpn_interface_ipsec_feature (Data Source)
+
+This data source can read the Service LAN VPN Interface IPSec Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_lan_vpn_interface_ipsec_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+
+### Read-Only
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `dpd_interval` (Number) IKE keepalive interval (seconds)
+- `dpd_interval_variable` (String) Variable name
+- `dpd_retries` (Number) IKE keepalive retries
+- `dpd_retries_variable` (String) Variable name
+- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
+- `ike_ciphersuite_variable` (String) Variable name
+- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
+- `ike_diffie_hellman_group_variable` (String) Variable name
+- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_local_end_point_variable` (String) Variable name
+- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_remote_end_point_variable` (String) Variable name
+- `ike_integrity_protocol` (String) IKE integrity protocol
+- `ike_integrity_protocol_variable` (String) Variable name
+- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
+- `ike_preshared_key_variable` (String) Variable name
+- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
+- `ike_rekey_interval_variable` (String) Variable name
+- `ike_version` (Number) IKE Version <1..2>
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name` (String) Interface name: IPsec when present
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
+- `ipsec_ciphersuite_variable` (String) Variable name
+- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
+- `ipsec_rekey_interval_variable` (String) Variable name
+- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
+- `ipsec_replay_window_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String)
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
+- `perfect_forward_secrecy_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tracker_id` (String) Enable tracker for this interface
+- `tracker_id_variable` (String) Variable name
+- `tunnel_destination_ipv4_address` (String)
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_destination_ipv4_subnet_mask` (String)
+- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
+- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_route_via_variable` (String) Variable name
+- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address` (String)
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+- `tunnel_source_ipv4_subnet_mask` (String)
+- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/service_lan_vpn_interface_ipsec_profile_parcel.md b/docs/data-sources/service_lan_vpn_interface_ipsec_profile_parcel.md
deleted file mode 100644
index 4267aa1c0..000000000
--- a/docs/data-sources/service_lan_vpn_interface_ipsec_profile_parcel.md
+++ /dev/null
@@ -1,95 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_ipsec_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Service LAN VPN Interface IPSec profile parcel.
----
-
-# sdwan_service_lan_vpn_interface_ipsec_profile_parcel (Data Source)
-
-This data source can read the Service LAN VPN Interface IPSec profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Parcel ID
-
-### Read-Only
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `dpd_interval` (Number) IKE keepalive interval (seconds)
-- `dpd_interval_variable` (String) Variable name
-- `dpd_retries` (Number) IKE keepalive retries
-- `dpd_retries_variable` (String) Variable name
-- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
-- `ike_ciphersuite_variable` (String) Variable name
-- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
-- `ike_diffie_hellman_group_variable` (String) Variable name
-- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_local_end_point_variable` (String) Variable name
-- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_remote_end_point_variable` (String) Variable name
-- `ike_integrity_protocol` (String) IKE integrity protocol
-- `ike_integrity_protocol_variable` (String) Variable name
-- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
-- `ike_preshared_key_variable` (String) Variable name
-- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
-- `ike_rekey_interval_variable` (String) Variable name
-- `ike_version` (Number) IKE Version <1..2>
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name` (String) Interface name: IPsec when present
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
-- `ipsec_ciphersuite_variable` (String) Variable name
-- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
-- `ipsec_rekey_interval_variable` (String) Variable name
-- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
-- `ipsec_replay_window_variable` (String) Variable name
-- `ipv4_address` (String)
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String)
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
-- `perfect_forward_secrecy_variable` (String) Variable name
-- `shutdown` (Boolean) Administrative state
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tracker_id` (String) Enable tracker for this interface
-- `tracker_id_variable` (String) Variable name
-- `tunnel_destination_ipv4_address` (String)
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_destination_ipv4_subnet_mask` (String)
-- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
-- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_route_via_variable` (String) Variable name
-- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address` (String)
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-- `tunnel_source_ipv4_subnet_mask` (String)
-- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/service_lan_vpn_interface_svi_feature.md b/docs/data-sources/service_lan_vpn_interface_svi_feature.md
new file mode 100644
index 000000000..27ce9e9c3
--- /dev/null
+++ b/docs/data-sources/service_lan_vpn_interface_svi_feature.md
@@ -0,0 +1,181 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_svi_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service LAN VPN Interface SVI Feature.
+---
+
+# sdwan_service_lan_vpn_interface_svi_feature (Data Source)
+
+This data source can read the Service LAN VPN Interface SVI Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_lan_vpn_interface_svi_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+
+### Read-Only
+
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+- `arp_timeout_variable` (String) Variable name
+- `arps` (Attributes List) Configure static ARP entries (see [below for nested schema](#nestedatt--arps))
+- `description` (String) The description of the Feature
+- `enable_dhcpv6` (Boolean) Enable DHCPv6
+- `enable_dhcpv6_variable` (String) Variable name
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU <1500..9216> in bytes
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String) Interface name: VLAN 1 - VLAN 4094 when present
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU <576..Interface MTU>, in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String) IP Address
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_dhcp_helpers` (Set of String) List of DHCP helper addresses
+- `ipv4_dhcp_helpers_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Assign secondary IP addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask` (String) Subnet Mask
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv4_vrrps` (Attributes List) Enable ipv4 VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
+- `ipv6_address` (String) Assign IPv6 address
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
+- `ipv6_secondary_addresses` (Attributes List) Assign secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
+- `ipv6_vrrps` (Attributes List) Enable ipv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps))
+- `name` (String) The name of the Feature
+- `shutdown` (Boolean) Administrative state
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arps`
+
+Read-Only:
+
+- `ip_address` (String) IP Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String) Subnet Mask
+- `ipv4_subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_vrrps`
+
+Read-Only:
+
+- `address` (String) Assign IPV4 Address
+- `address_variable` (String) Variable name
+- `group_id` (Number) Group ID
+- `group_id_variable` (String) Variable name
+- `prefix_list` (String) Track Prefix List
+- `prefix_list_variable` (String) Variable name
+- `priority` (Number) Set priority
+- `priority_variable` (String) Variable name
+- `secondary_addresses` (Attributes List) VRRP Secondary IPV4 address (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+- `timer_variable` (String) Variable name
+- `tloc_prefix_change` (Boolean) change TLOC preference
+- `tloc_prefix_change_value` (Number) Set tloc preference change value
+- `tloc_prefix_change_value_variable` (String) Variable name
+- `track_omp` (Boolean) Track OMP status
+- `track_omp_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_vrrps.secondary_addresses`
+
+Read-Only:
+
+- `address` (String) VRRP Secondary IPV4 address
+- `address_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_dhcp_helpers`
+
+Read-Only:
+
+- `address` (String) DHCPv6 Helper address
+- `address_variable` (String) Variable name
+- `vpn` (Number) DHCPv6 Helper VPN
+- `vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IPv6 Address
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_vrrps`
+
+Read-Only:
+
+- `addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--addresses))
+- `group_id` (Number) Group ID
+- `group_id_variable` (String) Variable name
+- `priority` (Number) Set priority
+- `priority_variable` (String) Variable name
+- `secondary_addresses` (Attributes List) IPv6 Secondary IP address (see [below for nested schema](#nestedatt--ipv6_vrrps--secondary_addresses))
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+- `timer_variable` (String) Variable name
+- `track_omp` (Boolean) Track OMP status
+- `track_omp_variable` (String) Variable name
+- `track_prefix_list` (String) Track Prefix List
+- `track_prefix_list_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_vrrps.addresses`
+
+Read-Only:
+
+- `global_address` (String) Assign Global IPv6 Prefix
+- `global_address_variable` (String) Variable name
+- `link_local_address` (String) Use link-local IPv6 Address
+- `link_local_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_vrrps.secondary_addresses`
+
+Read-Only:
+
+- `prefix` (String) IPv6 Secondary IP address
+- `prefix_variable` (String) Variable name
diff --git a/docs/data-sources/service_lan_vpn_interface_svi_profile_parcel.md b/docs/data-sources/service_lan_vpn_interface_svi_profile_parcel.md
deleted file mode 100644
index 7c7ae2a96..000000000
--- a/docs/data-sources/service_lan_vpn_interface_svi_profile_parcel.md
+++ /dev/null
@@ -1,181 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_svi_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Service LAN VPN Interface SVI profile parcel.
----
-
-# sdwan_service_lan_vpn_interface_svi_profile_parcel (Data Source)
-
-This data source can read the Service LAN VPN Interface SVI profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_service_lan_vpn_interface_svi_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Profile ID
-
-### Read-Only
-
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
-- `arp_timeout_variable` (String) Variable name
-- `arps` (Attributes List) Configure static ARP entries (see [below for nested schema](#nestedatt--arps))
-- `description` (String) The description of the profile parcel
-- `enable_dhcpv6` (Boolean) Enable DHCPv6
-- `enable_dhcpv6_variable` (String) Variable name
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU <1500..9216> in bytes
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String) Interface name: VLAN 1 - VLAN 4094 when present
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU <576..Interface MTU>, in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String) IP Address
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_dhcp_helpers` (Set of String) List of DHCP helper addresses
-- `ipv4_dhcp_helpers_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Assign secondary IP addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask` (String) Subnet Mask
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv4_vrrps` (Attributes List) Enable ipv4 VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
-- `ipv6_address` (String) Assign IPv6 address
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
-- `ipv6_secondary_addresses` (Attributes List) Assign secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
-- `ipv6_vrrps` (Attributes List) Enable ipv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps))
-- `name` (String) The name of the profile parcel
-- `shutdown` (Boolean) Administrative state
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arps`
-
-Read-Only:
-
-- `ip_address` (String) IP Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String) Subnet Mask
-- `ipv4_subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_vrrps`
-
-Read-Only:
-
-- `address` (String) Assign IPV4 Address
-- `address_variable` (String) Variable name
-- `group_id` (Number) Group ID
-- `group_id_variable` (String) Variable name
-- `prefix_list` (String) Track Prefix List
-- `prefix_list_variable` (String) Variable name
-- `priority` (Number) Set priority
-- `priority_variable` (String) Variable name
-- `secondary_addresses` (Attributes List) VRRP Secondary IPV4 address (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
-- `timer_variable` (String) Variable name
-- `tloc_prefix_change` (Boolean) change TLOC preference
-- `tloc_prefix_change_value` (Number) Set tloc preference change value
-- `tloc_prefix_change_value_variable` (String) Variable name
-- `track_omp` (Boolean) Track OMP status
-- `track_omp_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_vrrps.secondary_addresses`
-
-Read-Only:
-
-- `address` (String) VRRP Secondary IPV4 address
-- `address_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_dhcp_helpers`
-
-Read-Only:
-
-- `address` (String) DHCPv6 Helper address
-- `address_variable` (String) Variable name
-- `vpn` (Number) DHCPv6 Helper VPN
-- `vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IPv6 Address
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_vrrps`
-
-Read-Only:
-
-- `addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--addresses))
-- `group_id` (Number) Group ID
-- `group_id_variable` (String) Variable name
-- `priority` (Number) Set priority
-- `priority_variable` (String) Variable name
-- `secondary_addresses` (Attributes List) IPv6 Secondary IP address (see [below for nested schema](#nestedatt--ipv6_vrrps--secondary_addresses))
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
-- `timer_variable` (String) Variable name
-- `track_omp` (Boolean) Track OMP status
-- `track_omp_variable` (String) Variable name
-- `track_prefix_list` (String) Track Prefix List
-- `track_prefix_list_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_vrrps.addresses`
-
-Read-Only:
-
-- `global_address` (String) Assign Global IPv6 Prefix
-- `global_address_variable` (String) Variable name
-- `link_local_address` (String) Use link-local IPv6 Address
-- `link_local_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_vrrps.secondary_addresses`
-
-Read-Only:
-
-- `prefix` (String) IPv6 Secondary IP address
-- `prefix_variable` (String) Variable name
diff --git a/docs/data-sources/service_lan_vpn_profile_parcel.md b/docs/data-sources/service_lan_vpn_profile_parcel.md
deleted file mode 100644
index 7f281b998..000000000
--- a/docs/data-sources/service_lan_vpn_profile_parcel.md
+++ /dev/null
@@ -1,417 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Service LAN VPN profile parcel.
----
-
-# sdwan_service_lan_vpn_profile_parcel (Data Source)
-
-This data source can read the Service LAN VPN profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_service_lan_vpn_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `advertise_omp_ipv4s` (Attributes List) OMP Advertise IPv4 (see [below for nested schema](#nestedatt--advertise_omp_ipv4s))
-- `advertise_omp_ipv6s` (Attributes List) OMP Advertise IPv6 (see [below for nested schema](#nestedatt--advertise_omp_ipv6s))
-- `config_description` (String) Name
-- `config_description_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `enable_sdwan_remote_access` (Boolean) Enable SDWAN Remote Access
-- `gre_routes` (Attributes List) IPv4 Static GRE Route (see [below for nested schema](#nestedatt--gre_routes))
-- `host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--host_mappings))
-- `ipsec_routes` (Attributes List) IPv4 Static IPSEC Route (see [below for nested schema](#nestedatt--ipsec_routes))
-- `ipv4_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_export_route_targets))
-- `ipv4_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_import_route_targets))
-- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
-- `ipv6_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_export_route_targets))
-- `ipv6_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_import_route_targets))
-- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
-- `name` (String) The name of the profile parcel
-- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
-- `nat_pools` (Attributes List) NAT Pool (see [below for nested schema](#nestedatt--nat_pools))
-- `nat_port_forwards` (Attributes List) NAT Port Forward (see [below for nested schema](#nestedatt--nat_port_forwards))
-- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
-- `omp_admin_distance_ipv4_variable` (String) Variable name
-- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
-- `omp_admin_distance_ipv6_variable` (String) Variable name
-- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
-- `primary_dns_address_ipv4_variable` (String) Variable name
-- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
-- `primary_dns_address_ipv6_variable` (String) Variable name
-- `route_leak_from_global_vpns` (Attributes List) Enable route leaking from Global to Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns))
-- `route_leak_from_other_services` (Attributes List) Enable route leak from another Service VPN to current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services))
-- `route_leak_to_global_vpns` (Attributes List) Enable route leaking from Service to Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns))
-- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
-- `secondary_dns_address_ipv4_variable` (String) Variable name
-- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
-- `secondary_dns_address_ipv6_variable` (String) Variable name
-- `service_routes` (Attributes List) Service (see [below for nested schema](#nestedatt--service_routes))
-- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
-- `static_nats` (Attributes List) Static NAT Rules (see [below for nested schema](#nestedatt--static_nats))
-- `version` (Number) The version of the profile parcel
-- `vpn` (Number) VPN
-- `vpn_variable` (String) Variable name
-
-
-### Nested Schema for `advertise_omp_ipv4s`
-
-Read-Only:
-
-- `prefixes` (Attributes List) IPv4 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv4s--prefixes))
-- `protocol` (String) Protocol
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-### Nested Schema for `advertise_omp_ipv4s.prefixes`
-
-Read-Only:
-
-- `aggregate_only` (Boolean) Aggregate Only
-- `network_address` (String)
-- `network_address_variable` (String) Variable name
-- `region` (String) Applied to Region
-- `region_variable` (String) Variable name
-- `subnet_mask` (String)
-- `subnet_mask_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `advertise_omp_ipv6s`
-
-Read-Only:
-
-- `prefixes` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv6s--prefixes))
-- `protocol` (String) Protocol
-- `protocol_sub_type` (String) Protocol Sub Type
-- `protocol_sub_type_variable` (String) Variable name
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-### Nested Schema for `advertise_omp_ipv6s.prefixes`
-
-Read-Only:
-
-- `aggregate_only` (Boolean) Aggregate Only
-- `prefix` (String) IPv6 Prefix
-- `prefix_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `gre_routes`
-
-Read-Only:
-
-- `interface` (Set of String) Interface
-- `interface_variable` (String) Variable name
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-- `vpn` (Number) Service
-
-
-
-### Nested Schema for `host_mappings`
-
-Read-Only:
-
-- `host_name` (String) Hostname
-- `host_name_variable` (String) Variable name
-- `list_of_ips` (Set of String) List of IP
-- `list_of_ips_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipsec_routes`
-
-Read-Only:
-
-- `interface` (Set of String) Interface
-- `interface_variable` (String) Variable name
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_export_route_targets`
-
-Read-Only:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_import_route_targets`
-
-Read-Only:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_static_routes`
-
-Read-Only:
-
-- `gateway_dhcp` (Boolean) IPv4 Route Gateway DHCP
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `next_hop_with_trackers` (Attributes List) IPv4 Route Gateway Next Hop with Tracker (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hop_with_trackers))
-- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
-- `null0` (Boolean) IPv4 Route Gateway Next Hop
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-- `vpn` (Boolean) IPv4 Route Gateway VPN
-
-
-### Nested Schema for `ipv4_static_routes.next_hop_with_trackers`
-
-Read-Only:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-- `tracker_id` (String)
-
-
-
-### Nested Schema for `ipv4_static_routes.next_hops`
-
-Read-Only:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_export_route_targets`
-
-Read-Only:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_import_route_targets`
-
-Read-Only:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_static_routes`
-
-Read-Only:
-
-- `nat` (String) IPv6 Nat
-- `nat_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
-- `null0` (Boolean) IPv6 Route Gateway Next Hop
-- `prefix` (String) Prefix
-- `prefix_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_static_routes.next_hops`
-
-Read-Only:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `nat_64_v4_pools`
-
-Read-Only:
-
-- `name` (String) NAT64 v4 Pool Name
-- `name_variable` (String) Variable name
-- `overload` (Boolean) NAT64 Overload
-- `overload_variable` (String) Variable name
-- `range_end` (String) NAT64 Pool Range End
-- `range_end_variable` (String) Variable name
-- `range_start` (String) NAT64 Pool Range Start
-- `range_start_variable` (String) Variable name
-
-
-
-### Nested Schema for `nat_pools`
-
-Read-Only:
-
-- `direction` (String) NAT Direction
-- `direction_variable` (String) Variable name
-- `nat_pool_name` (Number) NAT Pool Name
-- `nat_pool_name_variable` (String) Variable name
-- `overload` (Boolean) NAT Overload
-- `overload_variable` (String) Variable name
-- `prefix_length` (Number) NAT Pool Prefix Length
-- `prefix_length_variable` (String) Variable name
-- `range_end` (String) NAT Pool Range End
-- `range_end_variable` (String) Variable name
-- `range_start` (String) NAT Pool Range Start
-- `range_start_variable` (String) Variable name
-- `tracker_object_id` (String)
-
-
-
-### Nested Schema for `nat_port_forwards`
-
-Read-Only:
-
-- `nat_pool_name` (Number) NAT Pool Name
-- `nat_pool_name_variable` (String) Variable name
-- `protocol` (String) Protocol
-- `protocol_variable` (String) Variable name
-- `source_ip` (String) Source IP Address
-- `source_ip_variable` (String) Variable name
-- `source_port` (Number) Source Port
-- `source_port_variable` (String) Variable name
-- `translate_port` (Number) Translate Port
-- `translate_port_variable` (String) Variable name
-- `translated_source_ip` (String) Translated Source IP Address
-- `translated_source_ip_variable` (String) Variable name
-
-
-
-### Nested Schema for `route_leak_from_global_vpns`
-
-Read-Only:
-
-- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns--redistributions))
-- `route_policy_id` (String)
-- `route_protocol` (String) Leak Routes of particular protocol from Global to Service VPN
-- `route_protocol_variable` (String) Variable name
-
-
-### Nested Schema for `route_leak_from_global_vpns.redistributions`
-
-Read-Only:
-
-- `protocol` (String) Protocol to restributed leaked routes
-- `protocol_variable` (String) Variable name
-- `redistribution_policy_id` (String)
-
-
-
-
-### Nested Schema for `route_leak_from_other_services`
-
-Read-Only:
-
-- `redistributions` (Attributes List) Redistribute Route to specific Protocol on Current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services--redistributions))
-- `route_policy_id` (String)
-- `route_protocol` (String) Leak Route of particular protocol from Source Service VPN
-- `route_protocol_variable` (String) Variable name
-- `source_vpn` (Number) Source Service VPN from where route are to be leaked
-- `source_vpn_variable` (String) Variable name
-
-
-### Nested Schema for `route_leak_from_other_services.redistributions`
-
-Read-Only:
-
-- `protocol` (String) Protocol to restributed leaked routes
-- `protocol_variable` (String) Variable name
-- `redistribution_policy_id` (String)
-
-
-
-
-### Nested Schema for `route_leak_to_global_vpns`
-
-Read-Only:
-
-- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns--redistributions))
-- `route_policy_id` (String)
-- `route_protocol` (String) Leak Routes of particular protocol from Service to Global VPN
-- `route_protocol_variable` (String) Variable name
-
-
-### Nested Schema for `route_leak_to_global_vpns.redistributions`
-
-Read-Only:
-
-- `protocol` (String) Protocol to restributed leaked routes
-- `protocol_variable` (String) Variable name
-- `redistribution_policy_id` (String)
-
-
-
-
-### Nested Schema for `service_routes`
-
-Read-Only:
-
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `service` (String) Service
-- `service_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-- `vpn` (Number) Service
-
-
-
-### Nested Schema for `services`
-
-Read-Only:
-
-- `ipv4_addresses` (Set of String) IPv4 Addresses (Maximum: 4)
-- `ipv4_addresses_variable` (String) Variable name
-- `service_type` (String) Service Type
-- `service_type_variable` (String) Variable name
-- `tracking` (Boolean) Tracking
-- `tracking_variable` (String) Variable name
-
-
-
-### Nested Schema for `static_nats`
-
-Read-Only:
-
-- `nat_pool_name` (Number) NAT Pool Name
-- `nat_pool_name_variable` (String) Variable name
-- `source_ip` (String) Source IP Address
-- `source_ip_variable` (String) Variable name
-- `static_nat_direction` (String) Static NAT Direction
-- `static_nat_direction_variable` (String) Variable name
-- `tracker_object_id` (String)
-- `translated_source_ip` (String) Translated Source IP Address
-- `translated_source_ip_variable` (String) Variable name
diff --git a/docs/data-sources/service_object_tracker_feature.md b/docs/data-sources/service_object_tracker_feature.md
new file mode 100644
index 000000000..98d4e15f8
--- /dev/null
+++ b/docs/data-sources/service_object_tracker_feature.md
@@ -0,0 +1,45 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_object_tracker_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Object Tracker Feature.
+---
+
+# sdwan_service_object_tracker_feature (Data Source)
+
+This data source can read the Service Object Tracker Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_object_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `interface` (String) interface name
+- `interface_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `object_tracker_id` (Number) Object tracker ID
+- `object_tracker_id_variable` (String) Variable name
+- `object_tracker_type` (String) objectTrackerType:Interface SIG Route
+- `route_ip` (String) IP address
+- `route_ip_variable` (String) Variable name
+- `route_mask` (String) IP mask
+- `route_mask_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+- `vpn` (Number) VPN
+- `vpn_variable` (String) Variable name
diff --git a/docs/data-sources/service_object_tracker_group_feature.md b/docs/data-sources/service_object_tracker_group_feature.md
new file mode 100644
index 000000000..aa537e3de
--- /dev/null
+++ b/docs/data-sources/service_object_tracker_group_feature.md
@@ -0,0 +1,46 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_object_tracker_group_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Object Tracker Group Feature.
+---
+
+# sdwan_service_object_tracker_group_feature (Data Source)
+
+This data source can read the Service Object Tracker Group Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_object_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `object_tracker_id` (Number) Object ID
+- `object_tracker_id_variable` (String) Variable name
+- `reachable` (String) tracker ref list criteria boolean and or
+- `reachable_variable` (String) Variable name
+- `tracker_elements` (Attributes List) Group Tracks ID Refs (see [below for nested schema](#nestedatt--tracker_elements))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Read-Only:
+
+- `object_tracker_id` (String)
diff --git a/docs/data-sources/service_route_policy_feature.md b/docs/data-sources/service_route_policy_feature.md
new file mode 100644
index 000000000..2fa9c35a4
--- /dev/null
+++ b/docs/data-sources/service_route_policy_feature.md
@@ -0,0 +1,94 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_route_policy_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Route Policy Feature.
+---
+
+# sdwan_service_route_policy_feature (Data Source)
+
+This data source can read the Service Route Policy Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_route_policy_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `default_action` (String) Default Action
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `sequences` (Attributes List) Route Policy List (see [below for nested schema](#nestedatt--sequences))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Read-Only:
+
+- `actions` (Attributes List) Define list of actions (see [below for nested schema](#nestedatt--sequences--actions))
+- `base_action` (String) Base Action
+- `id` (Number) Sequence Id
+- `match_entries` (Attributes List) Define match conditions (see [below for nested schema](#nestedatt--sequences--match_entries))
+- `name` (String) Sequence Name
+- `protocol` (String) protocol such as IPV4, IPV6, or BOTH
+
+
+### Nested Schema for `sequences.actions`
+
+Read-Only:
+
+- `as_path_prepend` (Set of Number)
+- `community` (Set of String)
+- `community_additive` (Boolean)
+- `community_variable` (String) Variable name
+- `ipv4_next_hop` (String) Set Ipv4 Next Hop
+- `ipv6_next_hop` (String) Set Ipv6 Next Hop
+- `local_preference` (Number) Set Local Preference
+- `metric` (Number) Set Metric
+- `metric_type` (String) Set Metric Type
+- `omp_tag` (Number) Set OMP Tag
+- `origin` (String) Set Origin
+- `ospf_tag` (Number) Set OSPF Tag
+- `weight` (Number) Set Weight
+
+
+
+### Nested Schema for `sequences.match_entries`
+
+Read-Only:
+
+- `as_path_list_id` (String)
+- `bgp_local_preference` (Number) BGP Local Preference
+- `expanded_community_list_id` (String)
+- `extended_community_list_id` (String)
+- `ipv4_address_prefix_list_id` (String)
+- `ipv4_next_hop_prefix_list_id` (String)
+- `ipv6_address_prefix_list_id` (String)
+- `ipv6_next_hop_prefix_list_id` (String)
+- `metric` (Number) Select Metric
+- `omp_tag` (Number) Select OMP Tag
+- `ospf_tag` (Number) Select OSPF Tag
+- `standard_community_list_criteria` (String) Select a condition such as OR, AND or EXACT
+- `standard_community_lists` (Attributes List) Select a standard community list (see [below for nested schema](#nestedatt--sequences--match_entries--standard_community_lists))
+
+
+### Nested Schema for `sequences.match_entries.standard_community_lists`
+
+Read-Only:
+
+- `id` (String)
diff --git a/docs/data-sources/service_routing_bgp_feature.md b/docs/data-sources/service_routing_bgp_feature.md
new file mode 100644
index 000000000..f806ff5f2
--- /dev/null
+++ b/docs/data-sources/service_routing_bgp_feature.md
@@ -0,0 +1,263 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_bgp_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Routing BGP Feature.
+---
+
+# sdwan_service_routing_bgp_feature (Data Source)
+
+This data source can read the Service Routing BGP Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_routing_bgp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `always_compare_med` (Boolean) Compare MEDs from all ASs when selecting active BGP paths
+- `always_compare_med_variable` (String) Variable name
+- `as_number` (Number) Set autonomous system number <1..4294967295> or
+- `as_number_variable` (String) Variable name
+- `compare_router_id` (Boolean) Compare router IDs when selecting active BGP paths
+- `compare_router_id_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `deterministic_med` (Boolean) Compare MEDs from all routes from same AS when selecting active BGP paths
+- `deterministic_med_variable` (String) Variable name
+- `external_routes_distance` (Number) Set administrative distance for external BGP routes
+- `external_routes_distance_variable` (String) Variable name
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+- `hold_time_variable` (String) Variable name
+- `internal_routes_distance` (Number) Set administrative distance for internal BGP routes
+- `internal_routes_distance_variable` (String) Variable name
+- `ipv4_aggregate_addresses` (Attributes List) Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv4_aggregate_addresses))
+- `ipv4_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+- `ipv4_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv4_neighbors` (Attributes List) Set BGP IPv4 neighbors (see [below for nested schema](#nestedatt--ipv4_neighbors))
+- `ipv4_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv4_networks))
+- `ipv4_originate` (Boolean) BGP Default Information Originate
+- `ipv4_originate_variable` (String) Variable name
+- `ipv4_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv4_redistributes))
+- `ipv4_table_map_filter` (Boolean) Table map filtered or not
+- `ipv4_table_map_filter_variable` (String) Variable name
+- `ipv4_table_map_route_policy_id` (String)
+- `ipv6_aggregate_addresses` (Attributes List) IPv6 Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv6_aggregate_addresses))
+- `ipv6_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+- `ipv6_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv6_neighbors` (Attributes List) Set BGP IPv6 neighbors (see [below for nested schema](#nestedatt--ipv6_neighbors))
+- `ipv6_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv6_networks))
+- `ipv6_originate` (Boolean) BGP Default Information Originate
+- `ipv6_originate_variable` (String) Variable name
+- `ipv6_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv6_redistributes))
+- `ipv6_table_map_filter` (Boolean) Table map filtered or not
+- `ipv6_table_map_filter_variable` (String) Variable name
+- `ipv6_table_map_route_policy_id` (String)
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+- `keepalive_time_variable` (String) Variable name
+- `local_routes_distance` (Number) Set administrative distance for local BGP routes
+- `local_routes_distance_variable` (String) Variable name
+- `missing_med_as_worst` (Boolean) If path has no MED, consider it to be worst path when selecting active BGP paths
+- `missing_med_as_worst_variable` (String) Variable name
+- `multipath_relax` (Boolean) Ignore AS for multipath selection
+- `multipath_relax_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `propagate_as_path` (Boolean) Propagate AS Path
+- `propagate_as_path_variable` (String) Variable name
+- `propagate_community` (Boolean) Propagate Community
+- `propagate_community_variable` (String) Variable name
+- `router_id` (String) Configure BGP router identifier
+- `router_id_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_aggregate_addresses`
+
+Read-Only:
+
+- `as_set_path` (Boolean) Set AS set path information
+- `as_set_path_variable` (String) Variable name
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String)
+- `subnet_mask_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_neighbors`
+
+Read-Only:
+
+- `address` (String) Set neighbor address
+- `address_families` (Attributes List) Set BGP address family (see [below for nested schema](#nestedatt--ipv4_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+- `ebgp_multihop_variable` (String) Variable name
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+- `send_extended_community_variable` (String) Variable name
+- `send_label` (Boolean) Send label
+- `send_label_variable` (String) Variable name
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_neighbors.address_families`
+
+Read-Only:
+
+- `family_type` (String) Set IPv4 unicast address family
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv4_networks`
+
+Read-Only:
+
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String)
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_redistributes`
+
+Read-Only:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `ipv6_aggregate_addresses`
+
+Read-Only:
+
+- `aggregate_prefix` (String) Configure the IPv6 prefixes to aggregate
+- `aggregate_prefix_variable` (String) Variable name
+- `as_set_path` (Boolean) Set AS set path information
+- `as_set_path_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_neighbors`
+
+Read-Only:
+
+- `address` (String) Set IPv6 neighbor address
+- `address_families` (Attributes List) Set IPv6 BGP address family (see [below for nested schema](#nestedatt--ipv6_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+- `ebgp_multihop_variable` (String) Variable name
+- `hold_time` (Number) Set how long to wait since receiving a keepalive message to consider BGP peer unavailable
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Set how often to advertise keepalive messages to BGP peer
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+- `send_extended_community_variable` (String) Variable name
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_neighbors.address_families`
+
+Read-Only:
+
+- `family_type` (String) Set IPv6 unicast address family
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_networks`
+
+Read-Only:
+
+- `network_prefix` (String) Configure the prefixes for BGP to announce
+- `network_prefix_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_redistributes`
+
+Read-Only:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
diff --git a/docs/data-sources/service_routing_ospf_feature.md b/docs/data-sources/service_routing_ospf_feature.md
new file mode 100644
index 000000000..2862abb55
--- /dev/null
+++ b/docs/data-sources/service_routing_ospf_feature.md
@@ -0,0 +1,142 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_ospf_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Routing OSPF Feature.
+---
+
+# sdwan_service_routing_ospf_feature (Data Source)
+
+This data source can read the Service Routing OSPF Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_routing_ospf_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `areas` (Attributes List) Configure OSPF area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+- `default_information_originate_metric_type` (String) Set default route type
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance_external` (Number) Set distance for external routes
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+- `distance_intra_area_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsas` (Attributes List) Advertise own router LSA with infinite distance (see [below for nested schema](#nestedatt--router_lsas))
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+- `spf_maximum_hold_time_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Read-Only:
+
+- `area_number` (Number) Set OSPF area number
+- `area_number_variable` (String) Variable name
+- `area_type` (String) set the area type
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject interarea routes into STUB or NSSA
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Read-Only:
+
+- `authentication_type` (String) Set OSPF interface authentication type
+- `authentication_type_variable` (String) Variable name
+- `cost` (Number) Set cost of OSPF interface
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+- `dead_interval_variable` (String) Variable name
+- `designated_router_priority` (Number) Set router’s priority to be elected as designated router
+- `designated_router_priority_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `message_digest_key` (String) Set MD5 authentication key
+- `message_digest_key_id` (Number) Set MD5 message digest key
+- `message_digest_key_id_variable` (String) Variable name
+- `message_digest_key_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Read-Only:
+
+- `cost` (Number) Set cost for this range
+- `cost_variable` (String) Variable name
+- `ip_address` (String) IP Address
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Read-Only:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `router_lsas`
+
+Read-Only:
+
+- `time` (Number) Set how long to advertise maximum metric after router starts up
+- `time_variable` (String) Variable name
+- `type` (String) Set the router LSA advertisement type
diff --git a/docs/data-sources/service_routing_ospfv3_ipv4_feature.md b/docs/data-sources/service_routing_ospfv3_ipv4_feature.md
new file mode 100644
index 000000000..06ce51088
--- /dev/null
+++ b/docs/data-sources/service_routing_ospfv3_ipv4_feature.md
@@ -0,0 +1,137 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_ospfv3_ipv4_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Routing OSPFv3 IPv4 Feature.
+---
+
+# sdwan_service_routing_ospfv3_ipv4_feature (Data Source)
+
+This data source can read the Service Routing OSPFv3 IPv4 Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_routing_ospfv3_ipv4_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `areas` (Attributes List) Configure OSPFv3 IPv4 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+- `default_information_originate_metric_type` (String) Set default route metric type
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+- `distance_external` (Number) Set distance for external routes
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+- `filter_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+- `spf_maximum_hold_time_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Read-Only:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Read-Only:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+- `cost` (Number) Set cost of OSPF interface
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Read-Only:
+
+- `cost` (Number) Set cost for this range
+- `cost_variable` (String) Variable name
+- `ip_address` (String)
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String)
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Read-Only:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
diff --git a/docs/data-sources/service_routing_ospfv3_ipv6_feature.md b/docs/data-sources/service_routing_ospfv3_ipv6_feature.md
new file mode 100644
index 000000000..7400782d4
--- /dev/null
+++ b/docs/data-sources/service_routing_ospfv3_ipv6_feature.md
@@ -0,0 +1,133 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_ospfv3_ipv6_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Routing OSPFv3 IPv6 Feature.
+---
+
+# sdwan_service_routing_ospfv3_ipv6_feature (Data Source)
+
+This data source can read the Service Routing OSPFv3 IPv6 Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_routing_ospfv3_ipv6_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `areas` (Attributes List) Configure OSPFv3 IPv6 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+- `default_information_originate_metric_type` (String) Set default route metric type
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+- `distance_external` (Number) Set distance for external routes
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+- `filter_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+- `spf_maximum_hold_time_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Read-Only:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Read-Only:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+- `cost` (Number) Set cost of OSPF interface
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Read-Only:
+
+- `cost` (Number) Set cost for this range
+- `cost_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+- `no_advertise_variable` (String) Variable name
+- `prefix` (String) IPv6 prefix,for example 2001::/64
+- `prefix_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Read-Only:
+
+- `protocol` (String) Set the protocol
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
diff --git a/docs/data-sources/service_switchport_feature.md b/docs/data-sources/service_switchport_feature.md
new file mode 100644
index 000000000..3fe388157
--- /dev/null
+++ b/docs/data-sources/service_switchport_feature.md
@@ -0,0 +1,98 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_switchport_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Switchport Feature.
+---
+
+# sdwan_service_switchport_feature (Data Source)
+
+This data source can read the Service Switchport Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_switchport_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `age_out_time` (Number) Set when a MAC table entry ages out (0 to disable, 10-1000000 otherwise)
+- `age_out_time_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interfaces` (Attributes List) Interface name: GigabitEthernet0/<>/<> when present (see [below for nested schema](#nestedatt--interfaces))
+- `name` (String) The name of the Feature
+- `static_mac_addresses` (Attributes List) Add static MAC address entries for interface (see [below for nested schema](#nestedatt--static_mac_addresses))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `interfaces`
+
+Read-Only:
+
+- `control_direction` (String) Set uni or bi directional authorization mode
+- `control_direction_variable` (String) Variable name
+- `critical_vlan` (Number) Set Critical VLAN
+- `critical_vlan_variable` (String) Variable name
+- `duplex` (String) Duplex mode
+- `duplex_variable` (String) Variable name
+- `enable_periodic_reauth` (Boolean) Enable Periodic Reauthentication
+- `enable_periodic_reauth_variable` (String) Variable name
+- `enable_voice` (Boolean) Enable Critical Voice VLAN
+- `enable_voice_variable` (String) Variable name
+- `guest_vlan` (Number) Set vlan to drop non-802.1x enabled clients into if client is not in MAB list
+- `guest_vlan_variable` (String) Variable name
+- `host_mode` (String) Set host mode
+- `host_mode_variable` (String) Variable name
+- `inactivity` (Number) Periodic Reauthentication Inactivity Timeout (in seconds)
+- `inactivity_variable` (String) Variable name
+- `interface_name` (String) Set Interface name
+- `interface_name_variable` (String) Variable name
+- `mac_authentication_bypass` (Boolean) MAC Authentication Bypass
+- `mac_authentication_bypass_variable` (String) Variable name
+- `mode` (String) Set type of switch port: access/trunk
+- `pae_enable` (Boolean) Set 802.1x Interface Pae Type
+- `pae_enable_variable` (String) Variable name
+- `port_control` (String) Set Port-Control Mode
+- `port_control_variable` (String) Variable name
+- `reauthentication` (Number) Periodic Reauthentication Interval (in seconds)
+- `reauthentication_variable` (String) Variable name
+- `restricted_vlan` (Number) Set Restricted VLAN ID
+- `restricted_vlan_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+- `speed_variable` (String) Variable name
+- `switchport_access_vlan` (Number) Set VLAN identifier associated with bridging domain
+- `switchport_access_vlan_variable` (String) Variable name
+- `switchport_trunk_allowed_vlans` (String) Configure VLAN IDs used with the trunk
+- `switchport_trunk_allowed_vlans_variable` (String) Variable name
+- `switchport_trunk_native_vlan` (Number) Configure VLAN ID used for native VLAN
+- `switchport_trunk_native_vlan_variable` (String) Variable name
+- `voice_vlan` (Number) Configure Voice Vlan
+- `voice_vlan_variable` (String) Variable name
+
+
+
+### Nested Schema for `static_mac_addresses`
+
+Read-Only:
+
+- `interface_name` (String) Interface name: GigabitEthernet0/<>/<>
+- `interface_name_variable` (String) Variable name
+- `mac_address` (String) Set MAC address in xxxx.xxxx.xxxx format
+- `mac_address_variable` (String) Variable name
+- `vlan_id` (Number) Configure VLAN ID used with the mac and interface
+- `vlan_id_variable` (String) Variable name
diff --git a/docs/data-sources/service_tracker_feature.md b/docs/data-sources/service_tracker_feature.md
new file mode 100644
index 000000000..f6c014325
--- /dev/null
+++ b/docs/data-sources/service_tracker_feature.md
@@ -0,0 +1,56 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_tracker_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Tracker Feature.
+---
+
+# sdwan_service_tracker_feature (Data Source)
+
+This data source can read the Service Tracker Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `endpoint_api_url` (String) API url of endpoint
+- `endpoint_api_url_variable` (String) Variable name
+- `endpoint_dns_name` (String) Endpoint DNS Name
+- `endpoint_dns_name_variable` (String) Variable name
+- `endpoint_ip` (String) Endpoint IP
+- `endpoint_ip_variable` (String) Variable name
+- `endpoint_tracker_type` (String) Endpoint Tracker Type
+- `endpoint_tracker_type_variable` (String) Variable name
+- `interval` (Number) Interval
+- `interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+- `multiplier_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `port` (Number)
+- `port_variable` (String) Variable name
+- `protocol` (String)
+- `protocol_variable` (String) Variable name
+- `threshold` (Number) Threshold
+- `threshold_variable` (String) Variable name
+- `tracker_name` (String) Tracker Name
+- `tracker_name_variable` (String) Variable name
+- `tracker_type` (String) Tracker Type
+- `tracker_type_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/service_tracker_group_feature.md b/docs/data-sources/service_tracker_group_feature.md
new file mode 100644
index 000000000..0948f738c
--- /dev/null
+++ b/docs/data-sources/service_tracker_group_feature.md
@@ -0,0 +1,44 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_tracker_group_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Service Tracker Group Feature.
+---
+
+# sdwan_service_tracker_group_feature (Data Source)
+
+This data source can read the Service Tracker Group Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_service_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `tracker_boolean` (String) tracker ref list combine boolean and or
+- `tracker_boolean_variable` (String) Variable name
+- `tracker_elements` (Attributes List) tracker parcel ref list (see [below for nested schema](#nestedatt--tracker_elements))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Read-Only:
+
+- `tracker_id` (String)
diff --git a/docs/data-sources/service_tracker_profile_parcel.md b/docs/data-sources/service_tracker_profile_parcel.md
deleted file mode 100644
index eafe4637a..000000000
--- a/docs/data-sources/service_tracker_profile_parcel.md
+++ /dev/null
@@ -1,56 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_tracker_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Service Tracker profile parcel.
----
-
-# sdwan_service_tracker_profile_parcel (Data Source)
-
-This data source can read the Service Tracker profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_service_tracker_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `endpoint_api_url` (String) API url of endpoint
-- `endpoint_api_url_variable` (String) Variable name
-- `endpoint_dns_name` (String) Endpoint DNS Name
-- `endpoint_dns_name_variable` (String) Variable name
-- `endpoint_ip` (String) Endpoint IP
-- `endpoint_ip_variable` (String) Variable name
-- `endpoint_tracker_type` (String) Endpoint Tracker Type
-- `endpoint_tracker_type_variable` (String) Variable name
-- `interval` (Number) Interval
-- `interval_variable` (String) Variable name
-- `multiplier` (Number) Multiplier
-- `multiplier_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `port` (Number)
-- `port_variable` (String) Variable name
-- `protocol` (String)
-- `protocol_variable` (String) Variable name
-- `threshold` (Number) Threshold
-- `threshold_variable` (String) Variable name
-- `tracker_name` (String) Tracker Name
-- `tracker_name_variable` (String) Variable name
-- `tracker_type` (String) Tracker Type
-- `tracker_type_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/sig_security_feature_profile.md b/docs/data-sources/sig_security_feature_profile.md
new file mode 100644
index 000000000..fba60e5fe
--- /dev/null
+++ b/docs/data-sources/sig_security_feature_profile.md
@@ -0,0 +1,31 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_sig_security_feature_profile Data Source - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This data source can read the SIG Security Feature Profile .
+---
+
+# sdwan_sig_security_feature_profile (Data Source)
+
+This data source can read the SIG Security Feature Profile .
+
+## Example Usage
+
+```terraform
+data "sdwan_sig_security_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `id` (String) The id of the object
+
+### Read-Only
+
+- `description` (String) Description
+- `name` (String) The name of the sig security feature profile
diff --git a/docs/data-sources/site_list_policy_object.md b/docs/data-sources/site_list_policy_object.md
index 17860d38e..4424fabe1 100644
--- a/docs/data-sources/site_list_policy_object.md
+++ b/docs/data-sources/site_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_site_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Site List Policy Object .
---
diff --git a/docs/data-sources/sla_class_policy_object.md b/docs/data-sources/sla_class_policy_object.md
index b91764508..22211b559 100644
--- a/docs/data-sources/sla_class_policy_object.md
+++ b/docs/data-sources/sla_class_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_sla_class_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the SLA Class Policy Object .
---
diff --git a/docs/data-sources/standard_community_list_policy_object.md b/docs/data-sources/standard_community_list_policy_object.md
index bc02f4e6d..80fb1e3f7 100644
--- a/docs/data-sources/standard_community_list_policy_object.md
+++ b/docs/data-sources/standard_community_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_standard_community_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Standard Community List Policy Object .
---
diff --git a/docs/data-sources/switchport_feature_template.md b/docs/data-sources/switchport_feature_template.md
index 3e51adc89..776a87241 100644
--- a/docs/data-sources/switchport_feature_template.md
+++ b/docs/data-sources/switchport_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_switchport_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the Switchport feature template.
---
diff --git a/docs/data-sources/system_aaa_feature.md b/docs/data-sources/system_aaa_feature.md
new file mode 100644
index 000000000..042a6a7f9
--- /dev/null
+++ b/docs/data-sources/system_aaa_feature.md
@@ -0,0 +1,157 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_aaa_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System AAA Feature.
+---
+
+# sdwan_system_aaa_feature (Data Source)
+
+This data source can read the System AAA Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_aaa_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `accounting_group` (Boolean) Accounting configurations parameters
+- `accounting_group_variable` (String) Variable name
+- `accounting_rules` (Attributes List) Configure the accounting rules (see [below for nested schema](#nestedatt--accounting_rules))
+- `authentication_group` (Boolean) Authentication configurations parameters
+- `authentication_group_variable` (String) Variable name
+- `authorization_config_commands` (Boolean) For configuration mode commands.
+- `authorization_config_commands_variable` (String) Variable name
+- `authorization_console` (Boolean) For enabling console authorization
+- `authorization_console_variable` (String) Variable name
+- `authorization_rules` (Attributes List) Configure the Authorization Rules (see [below for nested schema](#nestedatt--authorization_rules))
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `radius_groups` (Attributes List) Configure the Radius serverGroup (see [below for nested schema](#nestedatt--radius_groups))
+- `server_auth_order` (Set of String) ServerGroups priority order
+- `tacacs_groups` (Attributes List) Configure the TACACS serverGroup (see [below for nested schema](#nestedatt--tacacs_groups))
+- `users` (Attributes List) Create local login account (see [below for nested schema](#nestedatt--users))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `accounting_rules`
+
+Read-Only:
+
+- `group` (Set of String) Use Server-group
+- `level` (String) Privilege level when method is commands
+- `method` (String) Configure Accounting Method
+- `rule_id` (String) Configure Accounting Rule ID
+- `start_stop` (Boolean) Record start and stop without waiting
+- `start_stop_variable` (String) Variable name
+
+
+
+### Nested Schema for `authorization_rules`
+
+Read-Only:
+
+- `group` (Set of String) Use Server-group
+- `if_authenticated` (Boolean) Succeed if user has authenticated
+- `level` (String) Privilege level when method is commands
+- `method` (String) Method
+- `rule_id` (String) Configure Authorization Rule ID
+
+
+
+### Nested Schema for `radius_groups`
+
+Read-Only:
+
+- `group_name` (String) Set Radius server Group Name
+- `servers` (Attributes List) Configure the Radius server (see [below for nested schema](#nestedatt--radius_groups--servers))
+- `source_interface` (String) Set interface to use to reach Radius server
+- `source_interface_variable` (String) Variable name
+- `vpn` (Number) Set VPN in which Radius server is located
+
+
+### Nested Schema for `radius_groups.servers`
+
+Read-Only:
+
+- `acct_port` (Number) Set Accounting port to use to connect to Radius server
+- `acct_port_variable` (String) Variable name
+- `address` (String) Set IP address of Radius server
+- `auth_port` (Number) Set Authentication port to use to connect to Radius server
+- `auth_port_variable` (String) Variable name
+- `key` (String) Set the Radius server shared key
+- `key_enum` (String) Type of encyption. To be used for type 6
+- `key_type` (String) key type
+- `key_type_variable` (String) Variable name
+- `retransmit` (Number) Configure how many times to contact this Radius server
+- `retransmit_variable` (String) Variable name
+- `secret_key` (String) Set the Radius server shared type 7 encrypted key
+- `secret_key_variable` (String) Variable name
+- `timeout` (Number) Configure how long to wait for replies from the Radius server
+- `timeout_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `tacacs_groups`
+
+Read-Only:
+
+- `group_name` (String) Set TACACS server Group Name
+- `servers` (Attributes List) Configure the TACACS server (see [below for nested schema](#nestedatt--tacacs_groups--servers))
+- `source_interface` (String) Set interface to use to reach TACACS server
+- `source_interface_variable` (String) Variable name
+- `vpn` (Number) Set VPN in which TACACS server is located
+
+
+### Nested Schema for `tacacs_groups.servers`
+
+Read-Only:
+
+- `address` (String) Set IP address of TACACS server
+- `key` (String) Set the TACACS server shared key
+- `key_enum` (String) Type of encyption. To be used for type 6
+- `port` (Number) TACACS Port
+- `port_variable` (String) Variable name
+- `secret_key` (String) Set the TACACS server shared type 7 encrypted key
+- `secret_key_variable` (String) Variable name
+- `timeout` (Number) Configure how long to wait for replies from the TACACS server
+- `timeout_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `users`
+
+Read-Only:
+
+- `name` (String) Set the username
+- `name_variable` (String) Variable name
+- `password` (String) Set the user password
+- `password_variable` (String) Variable name
+- `privilege` (String) Set Privilege Level for this user
+- `privilege_variable` (String) Variable name
+- `public_keys` (Attributes List) List of RSA public-keys per user (see [below for nested schema](#nestedatt--users--public_keys))
+
+
+### Nested Schema for `users.public_keys`
+
+Read-Only:
+
+- `key_string` (String) Set the RSA key string
+- `key_type` (String) Only RSA is supported
+- `key_type_variable` (String) Variable name
diff --git a/docs/data-sources/system_aaa_profile_parcel.md b/docs/data-sources/system_aaa_profile_parcel.md
deleted file mode 100644
index b021e9e3f..000000000
--- a/docs/data-sources/system_aaa_profile_parcel.md
+++ /dev/null
@@ -1,157 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_aaa_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System AAA profile parcel.
----
-
-# sdwan_system_aaa_profile_parcel (Data Source)
-
-This data source can read the System AAA profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_aaa_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `accounting_group` (Boolean) Accounting configurations parameters
-- `accounting_group_variable` (String) Variable name
-- `accounting_rules` (Attributes List) Configure the accounting rules (see [below for nested schema](#nestedatt--accounting_rules))
-- `authentication_group` (Boolean) Authentication configurations parameters
-- `authentication_group_variable` (String) Variable name
-- `authorization_config_commands` (Boolean) For configuration mode commands.
-- `authorization_config_commands_variable` (String) Variable name
-- `authorization_console` (Boolean) For enabling console authorization
-- `authorization_console_variable` (String) Variable name
-- `authorization_rules` (Attributes List) Configure the Authorization Rules (see [below for nested schema](#nestedatt--authorization_rules))
-- `description` (String) The description of the profile parcel
-- `name` (String) The name of the profile parcel
-- `radius_groups` (Attributes List) Configure the Radius serverGroup (see [below for nested schema](#nestedatt--radius_groups))
-- `server_auth_order` (Set of String) ServerGroups priority order
-- `tacacs_groups` (Attributes List) Configure the TACACS serverGroup (see [below for nested schema](#nestedatt--tacacs_groups))
-- `users` (Attributes List) Create local login account (see [below for nested schema](#nestedatt--users))
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `accounting_rules`
-
-Read-Only:
-
-- `group` (Set of String) Use Server-group
-- `level` (String) Privilege level when method is commands
-- `method` (String) Configure Accounting Method
-- `rule_id` (String) Configure Accounting Rule ID
-- `start_stop` (Boolean) Record start and stop without waiting
-- `start_stop_variable` (String) Variable name
-
-
-
-### Nested Schema for `authorization_rules`
-
-Read-Only:
-
-- `group` (Set of String) Use Server-group
-- `if_authenticated` (Boolean) Succeed if user has authenticated
-- `level` (String) Privilege level when method is commands
-- `method` (String) Method
-- `rule_id` (String) Configure Authorization Rule ID
-
-
-
-### Nested Schema for `radius_groups`
-
-Read-Only:
-
-- `group_name` (String) Set Radius server Group Name
-- `servers` (Attributes List) Configure the Radius server (see [below for nested schema](#nestedatt--radius_groups--servers))
-- `source_interface` (String) Set interface to use to reach Radius server
-- `source_interface_variable` (String) Variable name
-- `vpn` (Number) Set VPN in which Radius server is located
-
-
-### Nested Schema for `radius_groups.servers`
-
-Read-Only:
-
-- `acct_port` (Number) Set Accounting port to use to connect to Radius server
-- `acct_port_variable` (String) Variable name
-- `address` (String) Set IP address of Radius server
-- `auth_port` (Number) Set Authentication port to use to connect to Radius server
-- `auth_port_variable` (String) Variable name
-- `key` (String) Set the Radius server shared key
-- `key_enum` (String) Type of encyption. To be used for type 6
-- `key_type` (String) key type
-- `key_type_variable` (String) Variable name
-- `retransmit` (Number) Configure how many times to contact this Radius server
-- `retransmit_variable` (String) Variable name
-- `secret_key` (String) Set the Radius server shared type 7 encrypted key
-- `secret_key_variable` (String) Variable name
-- `timeout` (Number) Configure how long to wait for replies from the Radius server
-- `timeout_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `tacacs_groups`
-
-Read-Only:
-
-- `group_name` (String) Set TACACS server Group Name
-- `servers` (Attributes List) Configure the TACACS server (see [below for nested schema](#nestedatt--tacacs_groups--servers))
-- `source_interface` (String) Set interface to use to reach TACACS server
-- `source_interface_variable` (String) Variable name
-- `vpn` (Number) Set VPN in which TACACS server is located
-
-
-### Nested Schema for `tacacs_groups.servers`
-
-Read-Only:
-
-- `address` (String) Set IP address of TACACS server
-- `key` (String) Set the TACACS server shared key
-- `key_enum` (String) Type of encyption. To be used for type 6
-- `port` (Number) TACACS Port
-- `port_variable` (String) Variable name
-- `secret_key` (String) Set the TACACS server shared type 7 encrypted key
-- `secret_key_variable` (String) Variable name
-- `timeout` (Number) Configure how long to wait for replies from the TACACS server
-- `timeout_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `users`
-
-Read-Only:
-
-- `name` (String) Set the username
-- `name_variable` (String) Variable name
-- `password` (String) Set the user password
-- `password_variable` (String) Variable name
-- `privilege` (String) Set Privilege Level for this user
-- `privilege_variable` (String) Variable name
-- `public_keys` (Attributes List) List of RSA public-keys per user (see [below for nested schema](#nestedatt--users--public_keys))
-
-
-### Nested Schema for `users.public_keys`
-
-Read-Only:
-
-- `key_string` (String) Set the RSA key string
-- `key_type` (String) Only RSA is supported
-- `key_type_variable` (String) Variable name
diff --git a/docs/data-sources/system_banner_feature.md b/docs/data-sources/system_banner_feature.md
new file mode 100644
index 000000000..a0d8cfd4b
--- /dev/null
+++ b/docs/data-sources/system_banner_feature.md
@@ -0,0 +1,38 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_banner_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Banner Feature.
+---
+
+# sdwan_system_banner_feature (Data Source)
+
+This data source can read the System Banner Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_banner_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `login` (String)
+- `login_variable` (String) Variable name
+- `motd` (String)
+- `motd_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/system_banner_profile_parcel.md b/docs/data-sources/system_banner_profile_parcel.md
deleted file mode 100644
index b7ffe243f..000000000
--- a/docs/data-sources/system_banner_profile_parcel.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_banner_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Banner profile parcel.
----
-
-# sdwan_system_banner_profile_parcel (Data Source)
-
-This data source can read the System Banner profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_banner_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `login` (String)
-- `login_variable` (String) Variable name
-- `motd` (String)
-- `motd_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/system_basic_feature.md b/docs/data-sources/system_basic_feature.md
new file mode 100644
index 000000000..61e8d07cd
--- /dev/null
+++ b/docs/data-sources/system_basic_feature.md
@@ -0,0 +1,113 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_basic_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Basic Feature.
+---
+
+# sdwan_system_basic_feature (Data Source)
+
+This data source can read the System Basic Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_basic_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `admin_tech_on_failure` (Boolean) Collect admin-tech before reboot due to daemon failure
+- `admin_tech_on_failure_variable` (String) Variable name
+- `affinity_group_number` (Number) Affinity Group Number
+- `affinity_group_number_variable` (String) Variable name
+- `affinity_group_preferences` (Set of Number) Affinity Group Preference
+- `affinity_group_preferences_variable` (String) Variable name
+- `affinity_per_vrfs` (Attributes List) Affinity Group Number for VRFs (see [below for nested schema](#nestedatt--affinity_per_vrfs))
+- `affinity_preference_auto` (Boolean) Affinity Group Preference Auto
+- `affinity_preference_auto_variable` (String) Variable name
+- `config_description` (String) Set a text description of the device
+- `config_description_variable` (String) Variable name
+- `console_baud_rate` (String) Set the console baud rate
+- `console_baud_rate_variable` (String) Variable name
+- `control_session_pps` (Number) Set the policer rate for control sessions
+- `control_session_pps_variable` (String) Variable name
+- `controller_groups` (Set of Number) Configure a list of comma-separated controller groups
+- `controller_groups_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `device_groups` (Set of String) Device groups
+- `device_groups_variable` (String) Variable name
+- `enhanced_app_aware_routing` (String) Enable SLA Dampening and Enhanced App Routing.
+- `enhanced_app_aware_routing_variable` (String) Variable name
+- `gps_geo_fencing_enable` (Boolean) Enable Geo fencing
+- `gps_geo_fencing_range` (Number) Set the device’s geo fencing range
+- `gps_geo_fencing_range_variable` (String) Variable name
+- `gps_latitude` (Number) Set the device physical latitude
+- `gps_latitude_variable` (String) Variable name
+- `gps_longitude` (Number) Set the device physical longitude
+- `gps_longitude_variable` (String) Variable name
+- `gps_sms_enable` (Boolean) Enable device’s geo fencing SMS
+- `gps_sms_mobile_numbers` (Attributes List) Set device’s geo fencing SMS phone number (see [below for nested schema](#nestedatt--gps_sms_mobile_numbers))
+- `idle_timeout` (Number) Idle CLI timeout in minutes
+- `idle_timeout_variable` (String) Variable name
+- `location` (String) Set the location of the device
+- `location_variable` (String) Variable name
+- `max_omp_sessions` (Number) Set the maximum number of OMP sessions <1..100> the device can have
+- `max_omp_sessions_variable` (String) Variable name
+- `multi_tenant` (Boolean) Device is multi-tenant
+- `multi_tenant_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `on_demand_enable` (Boolean) Enable or disable On-demand Tunnel
+- `on_demand_enable_variable` (String) Variable name
+- `on_demand_idle_timeout` (Number) Set the idle timeout for on-demand tunnels
+- `on_demand_idle_timeout_variable` (String) Variable name
+- `overlay_id` (Number) Set the Overlay ID
+- `overlay_id_variable` (String) Variable name
+- `port_hopping` (Boolean) Enable port hopping
+- `port_hopping_variable` (String) Variable name
+- `port_offset` (Number) Set the TLOC port offset when multiple devices are behind a NAT
+- `port_offset_variable` (String) Variable name
+- `site_types` (Set of String) Site Type
+- `site_types_variable` (String) Variable name
+- `timezone` (String) Set the timezone
+- `timezone_variable` (String) Variable name
+- `track_default_gateway` (Boolean) Enable or disable default gateway tracking
+- `track_default_gateway_variable` (String) Variable name
+- `track_interface_tag` (Number) OMP Tag attached to routes based on interface tracking
+- `track_interface_tag_variable` (String) Variable name
+- `track_transport` (Boolean) Configure tracking of transport
+- `track_transport_variable` (String) Variable name
+- `transport_gateway` (Boolean) Enable transport gateway
+- `transport_gateway_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `affinity_per_vrfs`
+
+Read-Only:
+
+- `affinity_group_number` (Number) Affinity Group Number
+- `affinity_group_number_variable` (String) Variable name
+- `vrf_range` (String) Range of VRFs
+- `vrf_range_variable` (String) Variable name
+
+
+
+### Nested Schema for `gps_sms_mobile_numbers`
+
+Read-Only:
+
+- `number` (String) Mobile number, ex: 1231234414
+- `number_variable` (String) Variable name
diff --git a/docs/data-sources/system_basic_profile_parcel.md b/docs/data-sources/system_basic_profile_parcel.md
deleted file mode 100644
index 13f2754fa..000000000
--- a/docs/data-sources/system_basic_profile_parcel.md
+++ /dev/null
@@ -1,113 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_basic_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Basic profile parcel.
----
-
-# sdwan_system_basic_profile_parcel (Data Source)
-
-This data source can read the System Basic profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_basic_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `admin_tech_on_failure` (Boolean) Collect admin-tech before reboot due to daemon failure
-- `admin_tech_on_failure_variable` (String) Variable name
-- `affinity_group_number` (Number) Affinity Group Number
-- `affinity_group_number_variable` (String) Variable name
-- `affinity_group_preferences` (Set of Number) Affinity Group Preference
-- `affinity_group_preferences_variable` (String) Variable name
-- `affinity_per_vrfs` (Attributes List) Affinity Group Number for VRFs (see [below for nested schema](#nestedatt--affinity_per_vrfs))
-- `affinity_preference_auto` (Boolean) Affinity Group Preference Auto
-- `affinity_preference_auto_variable` (String) Variable name
-- `config_description` (String) Set a text description of the device
-- `config_description_variable` (String) Variable name
-- `console_baud_rate` (String) Set the console baud rate
-- `console_baud_rate_variable` (String) Variable name
-- `control_session_pps` (Number) Set the policer rate for control sessions
-- `control_session_pps_variable` (String) Variable name
-- `controller_groups` (Set of Number) Configure a list of comma-separated controller groups
-- `controller_groups_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `device_groups` (Set of String) Device groups
-- `device_groups_variable` (String) Variable name
-- `enhanced_app_aware_routing` (String) Enable SLA Dampening and Enhanced App Routing.
-- `enhanced_app_aware_routing_variable` (String) Variable name
-- `gps_geo_fencing_enable` (Boolean) Enable Geo fencing
-- `gps_geo_fencing_range` (Number) Set the device’s geo fencing range
-- `gps_geo_fencing_range_variable` (String) Variable name
-- `gps_latitude` (Number) Set the device physical latitude
-- `gps_latitude_variable` (String) Variable name
-- `gps_longitude` (Number) Set the device physical longitude
-- `gps_longitude_variable` (String) Variable name
-- `gps_sms_enable` (Boolean) Enable device’s geo fencing SMS
-- `gps_sms_mobile_numbers` (Attributes List) Set device’s geo fencing SMS phone number (see [below for nested schema](#nestedatt--gps_sms_mobile_numbers))
-- `idle_timeout` (Number) Idle CLI timeout in minutes
-- `idle_timeout_variable` (String) Variable name
-- `location` (String) Set the location of the device
-- `location_variable` (String) Variable name
-- `max_omp_sessions` (Number) Set the maximum number of OMP sessions <1..100> the device can have
-- `max_omp_sessions_variable` (String) Variable name
-- `multi_tenant` (Boolean) Device is multi-tenant
-- `multi_tenant_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `on_demand_enable` (Boolean) Enable or disable On-demand Tunnel
-- `on_demand_enable_variable` (String) Variable name
-- `on_demand_idle_timeout` (Number) Set the idle timeout for on-demand tunnels
-- `on_demand_idle_timeout_variable` (String) Variable name
-- `overlay_id` (Number) Set the Overlay ID
-- `overlay_id_variable` (String) Variable name
-- `port_hopping` (Boolean) Enable port hopping
-- `port_hopping_variable` (String) Variable name
-- `port_offset` (Number) Set the TLOC port offset when multiple devices are behind a NAT
-- `port_offset_variable` (String) Variable name
-- `site_types` (Set of String) Site Type
-- `site_types_variable` (String) Variable name
-- `timezone` (String) Set the timezone
-- `timezone_variable` (String) Variable name
-- `track_default_gateway` (Boolean) Enable or disable default gateway tracking
-- `track_default_gateway_variable` (String) Variable name
-- `track_interface_tag` (Number) OMP Tag attached to routes based on interface tracking
-- `track_interface_tag_variable` (String) Variable name
-- `track_transport` (Boolean) Configure tracking of transport
-- `track_transport_variable` (String) Variable name
-- `transport_gateway` (Boolean) Enable transport gateway
-- `transport_gateway_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `affinity_per_vrfs`
-
-Read-Only:
-
-- `affinity_group_number` (Number) Affinity Group Number
-- `affinity_group_number_variable` (String) Variable name
-- `vrf_range` (String) Range of VRFs
-- `vrf_range_variable` (String) Variable name
-
-
-
-### Nested Schema for `gps_sms_mobile_numbers`
-
-Read-Only:
-
-- `number` (String) Mobile number, ex: 1231234414
-- `number_variable` (String) Variable name
diff --git a/docs/data-sources/system_bfd_feature.md b/docs/data-sources/system_bfd_feature.md
new file mode 100644
index 000000000..055c4057a
--- /dev/null
+++ b/docs/data-sources/system_bfd_feature.md
@@ -0,0 +1,57 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_bfd_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System BFD Feature.
+---
+
+# sdwan_system_bfd_feature (Data Source)
+
+This data source can read the System BFD Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_bfd_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `colors` (Attributes List) Set color that identifies the WAN transport tunnel (see [below for nested schema](#nestedatt--colors))
+- `default_dscp` (Number)
+- `default_dscp_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `multiplier` (Number)
+- `multiplier_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `poll_interval` (Number)
+- `poll_interval_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `colors`
+
+Read-Only:
+
+- `color` (String) Color that identifies the WAN transport tunnel
+- `color_variable` (String) Variable name
+- `dscp` (Number) BFD Default DSCP value for tloc color
+- `dscp_variable` (String) Variable name
+- `hello_interval` (Number) Hello Interval (milliseconds)
+- `hello_interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+- `multiplier_variable` (String) Variable name
+- `pmtu_discovery` (Boolean) Path MTU Discovery
+- `pmtu_discovery_variable` (String) Variable name
diff --git a/docs/data-sources/system_bfd_profile_parcel.md b/docs/data-sources/system_bfd_profile_parcel.md
deleted file mode 100644
index 3280b724a..000000000
--- a/docs/data-sources/system_bfd_profile_parcel.md
+++ /dev/null
@@ -1,57 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_bfd_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System BFD profile parcel.
----
-
-# sdwan_system_bfd_profile_parcel (Data Source)
-
-This data source can read the System BFD profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_bfd_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `colors` (Attributes List) Set color that identifies the WAN transport tunnel (see [below for nested schema](#nestedatt--colors))
-- `default_dscp` (Number)
-- `default_dscp_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `multiplier` (Number)
-- `multiplier_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `poll_interval` (Number)
-- `poll_interval_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `colors`
-
-Read-Only:
-
-- `color` (String) Color that identifies the WAN transport tunnel
-- `color_variable` (String) Variable name
-- `dscp` (Number) BFD Default DSCP value for tloc color
-- `dscp_variable` (String) Variable name
-- `hello_interval` (Number) Hello Interval (milliseconds)
-- `hello_interval_variable` (String) Variable name
-- `multiplier` (Number) Multiplier
-- `multiplier_variable` (String) Variable name
-- `pmtu_discovery` (Boolean) Path MTU Discovery
-- `pmtu_discovery_variable` (String) Variable name
diff --git a/docs/data-sources/system_flexible_port_speed_feature.md b/docs/data-sources/system_flexible_port_speed_feature.md
new file mode 100644
index 000000000..08ba63ffb
--- /dev/null
+++ b/docs/data-sources/system_flexible_port_speed_feature.md
@@ -0,0 +1,36 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_flexible_port_speed_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Flexible Port Speed Feature.
+---
+
+# sdwan_system_flexible_port_speed_feature (Data Source)
+
+This data source can read the System Flexible Port Speed Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_flexible_port_speed_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `port_type` (String) port Type
+- `port_type_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/system_flexible_port_speed_profile_parcel.md b/docs/data-sources/system_flexible_port_speed_profile_parcel.md
deleted file mode 100644
index 636233063..000000000
--- a/docs/data-sources/system_flexible_port_speed_profile_parcel.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_flexible_port_speed_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Flexible Port Speed profile parcel.
----
-
-# sdwan_system_flexible_port_speed_profile_parcel (Data Source)
-
-This data source can read the System Flexible Port Speed profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_flexible_port_speed_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `name` (String) The name of the profile parcel
-- `port_type` (String) port Type
-- `port_type_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/system_global_feature.md b/docs/data-sources/system_global_feature.md
new file mode 100644
index 000000000..f00af105e
--- /dev/null
+++ b/docs/data-sources/system_global_feature.md
@@ -0,0 +1,80 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_global_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Global Feature.
+---
+
+# sdwan_system_global_feature (Data Source)
+
+This data source can read the System Global Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_global_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `arp_proxy` (Boolean) Set ARP Proxy
+- `arp_proxy_variable` (String) Variable name
+- `cdp` (Boolean) Configure CDP
+- `cdp_variable` (String) Variable name
+- `console_logging` (Boolean) Configure Console Logging
+- `console_logging_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `domain_lookup` (Boolean) Configure Domain-Lookup
+- `domain_lookup_variable` (String) Variable name
+- `ftp_passive` (Boolean) Set Passive FTP
+- `ftp_passive_variable` (String) Variable name
+- `http_authentication` (String) Set preference for HTTP Authentication
+- `http_authentication_variable` (String) Variable name
+- `http_server` (Boolean) Set a HTTP Server
+- `http_server_variable` (String) Variable name
+- `https_server` (Boolean) Set a HTTPS Server
+- `https_server_variable` (String) Variable name
+- `ignore_bootp` (Boolean) Configure Ignore BOOTP
+- `ignore_bootp_variable` (String) Variable name
+- `ip_source_routing` (Boolean) Set Source Route
+- `ip_source_routing_variable` (String) Variable name
+- `line_vty` (Boolean) Configure Telnet (Outbound)
+- `line_vty_variable` (String) Variable name
+- `lldp` (Boolean) Configure LLDP
+- `lldp_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `nat64_tcp_timeout` (Number) Set NAT64 TCP session timeout, in seconds
+- `nat64_tcp_timeout_variable` (String) Variable name
+- `nat64_udp_timeout` (Number) Set NAT64 UDP session timeout, in seconds
+- `nat64_udp_timeout_variable` (String) Variable name
+- `rsh_rcp` (Boolean) Set RSH/RCP
+- `rsh_rcp_variable` (String) Variable name
+- `snmp_ifindex_persist` (Boolean) Configure SNMP Ifindex Persist
+- `snmp_ifindex_persist_variable` (String) Variable name
+- `source_interface` (String) Specify interface for source address in all HTTP(S) client connections
+- `source_interface_variable` (String) Variable name
+- `ssh_version` (String) Set SSH version
+- `ssh_version_variable` (String) Variable name
+- `tcp_keepalives_in` (Boolean) Configure tcp-keepalives-in
+- `tcp_keepalives_in_variable` (String) Variable name
+- `tcp_keepalives_out` (Boolean) Configure tcp-keepalives-out
+- `tcp_keepalives_out_variable` (String) Variable name
+- `tcp_small_servers` (Boolean) Configure tcp-small-servers
+- `tcp_small_servers_variable` (String) Variable name
+- `udp_small_servers` (Boolean) Configure udp-small-servers
+- `udp_small_servers_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+- `vty_line_logging` (Boolean) Configure VTY Line Logging
+- `vty_line_logging_variable` (String) Variable name
diff --git a/docs/data-sources/system_global_profile_parcel.md b/docs/data-sources/system_global_profile_parcel.md
deleted file mode 100644
index 8c95f45a1..000000000
--- a/docs/data-sources/system_global_profile_parcel.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_global_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Global profile parcel.
----
-
-# sdwan_system_global_profile_parcel (Data Source)
-
-This data source can read the System Global profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_global_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `arp_proxy` (Boolean) Set ARP Proxy
-- `arp_proxy_variable` (String) Variable name
-- `cdp` (Boolean) Configure CDP
-- `cdp_variable` (String) Variable name
-- `console_logging` (Boolean) Configure Console Logging
-- `console_logging_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `domain_lookup` (Boolean) Configure Domain-Lookup
-- `domain_lookup_variable` (String) Variable name
-- `ftp_passive` (Boolean) Set Passive FTP
-- `ftp_passive_variable` (String) Variable name
-- `http_authentication` (String) Set preference for HTTP Authentication
-- `http_authentication_variable` (String) Variable name
-- `http_server` (Boolean) Set a HTTP Server
-- `http_server_variable` (String) Variable name
-- `https_server` (Boolean) Set a HTTPS Server
-- `https_server_variable` (String) Variable name
-- `ignore_bootp` (Boolean) Configure Ignore BOOTP
-- `ignore_bootp_variable` (String) Variable name
-- `ip_source_routing` (Boolean) Set Source Route
-- `ip_source_routing_variable` (String) Variable name
-- `line_vty` (Boolean) Configure Telnet (Outbound)
-- `line_vty_variable` (String) Variable name
-- `lldp` (Boolean) Configure LLDP
-- `lldp_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `nat64_tcp_timeout` (Number) Set NAT64 TCP session timeout, in seconds
-- `nat64_tcp_timeout_variable` (String) Variable name
-- `nat64_udp_timeout` (Number) Set NAT64 UDP session timeout, in seconds
-- `nat64_udp_timeout_variable` (String) Variable name
-- `rsh_rcp` (Boolean) Set RSH/RCP
-- `rsh_rcp_variable` (String) Variable name
-- `snmp_ifindex_persist` (Boolean) Configure SNMP Ifindex Persist
-- `snmp_ifindex_persist_variable` (String) Variable name
-- `source_interface` (String) Specify interface for source address in all HTTP(S) client connections
-- `source_interface_variable` (String) Variable name
-- `ssh_version` (String) Set SSH version
-- `ssh_version_variable` (String) Variable name
-- `tcp_keepalives_in` (Boolean) Configure tcp-keepalives-in
-- `tcp_keepalives_in_variable` (String) Variable name
-- `tcp_keepalives_out` (Boolean) Configure tcp-keepalives-out
-- `tcp_keepalives_out_variable` (String) Variable name
-- `tcp_small_servers` (Boolean) Configure tcp-small-servers
-- `tcp_small_servers_variable` (String) Variable name
-- `udp_small_servers` (Boolean) Configure udp-small-servers
-- `udp_small_servers_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-- `vty_line_logging` (Boolean) Configure VTY Line Logging
-- `vty_line_logging_variable` (String) Variable name
diff --git a/docs/data-sources/system_ipv4_device_access_feature.md b/docs/data-sources/system_ipv4_device_access_feature.md
new file mode 100644
index 000000000..01a3d2a22
--- /dev/null
+++ b/docs/data-sources/system_ipv4_device_access_feature.md
@@ -0,0 +1,53 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_ipv4_device_access_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System IPv4 Device Access Feature.
+---
+
+# sdwan_system_ipv4_device_access_feature (Data Source)
+
+This data source can read the System IPv4 Device Access Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_ipv4_device_access_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `default_action` (String) Default Action
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Read-Only:
+
+- `base_action` (String) Base Action
+- `destination_data_prefix_list_id` (String)
+- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
+- `destination_ip_prefix_list_variable` (String) Variable name
+- `device_access_port` (Number) device access protocol
+- `id` (Number) Sequence Id
+- `name` (String) Sequence Name
+- `source_data_prefix_list_id` (String)
+- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
+- `source_ip_prefix_list_variable` (String) Variable name
+- `source_ports` (Set of Number) Source Port List
diff --git a/docs/data-sources/system_ipv4_device_access_profile_parcel.md b/docs/data-sources/system_ipv4_device_access_profile_parcel.md
deleted file mode 100644
index ab0a21a7d..000000000
--- a/docs/data-sources/system_ipv4_device_access_profile_parcel.md
+++ /dev/null
@@ -1,53 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_ipv4_device_access_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System IPv4 Device Access profile parcel.
----
-
-# sdwan_system_ipv4_device_access_profile_parcel (Data Source)
-
-This data source can read the System IPv4 Device Access profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_ipv4_device_access_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `default_action` (String) Default Action
-- `description` (String) The description of the profile parcel
-- `name` (String) The name of the profile parcel
-- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `sequences`
-
-Read-Only:
-
-- `base_action` (String) Base Action
-- `destination_data_prefix_list_id` (String)
-- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
-- `destination_ip_prefix_list_variable` (String) Variable name
-- `device_access_port` (Number) device access protocol
-- `id` (Number) Sequence Id
-- `name` (String) Sequence Name
-- `source_data_prefix_list_id` (String)
-- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
-- `source_ip_prefix_list_variable` (String) Variable name
-- `source_ports` (Set of Number) Source Port List
diff --git a/docs/data-sources/system_ipv6_device_access_feature.md b/docs/data-sources/system_ipv6_device_access_feature.md
new file mode 100644
index 000000000..d2c01dd28
--- /dev/null
+++ b/docs/data-sources/system_ipv6_device_access_feature.md
@@ -0,0 +1,53 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_ipv6_device_access_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System IPv6 Device Access Feature.
+---
+
+# sdwan_system_ipv6_device_access_feature (Data Source)
+
+This data source can read the System IPv6 Device Access Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_ipv6_device_access_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `default_action` (String) Default Action
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Read-Only:
+
+- `base_action` (String) Base Action
+- `destination_data_prefix_list_id` (String)
+- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
+- `destination_ip_prefix_list_variable` (String) Variable name
+- `device_access_port` (Number) device access protocol
+- `id` (Number) Sequence Id
+- `name` (String) Sequence Name
+- `source_data_prefix_list_id` (String)
+- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
+- `source_ip_prefix_list_variable` (String) Variable name
+- `source_ports` (Set of Number) Source Port List
diff --git a/docs/data-sources/system_ipv6_device_access_profile_parcel.md b/docs/data-sources/system_ipv6_device_access_profile_parcel.md
deleted file mode 100644
index ee02102b0..000000000
--- a/docs/data-sources/system_ipv6_device_access_profile_parcel.md
+++ /dev/null
@@ -1,53 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_ipv6_device_access_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System IPv6 Device Access profile parcel.
----
-
-# sdwan_system_ipv6_device_access_profile_parcel (Data Source)
-
-This data source can read the System IPv6 Device Access profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_ipv6_device_access_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `default_action` (String) Default Action
-- `description` (String) The description of the profile parcel
-- `name` (String) The name of the profile parcel
-- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `sequences`
-
-Read-Only:
-
-- `base_action` (String) Base Action
-- `destination_data_prefix_list_id` (String)
-- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
-- `destination_ip_prefix_list_variable` (String) Variable name
-- `device_access_port` (Number) device access protocol
-- `id` (Number) Sequence Id
-- `name` (String) Sequence Name
-- `source_data_prefix_list_id` (String)
-- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
-- `source_ip_prefix_list_variable` (String) Variable name
-- `source_ports` (Set of Number) Source Port List
diff --git a/docs/data-sources/system_logging_feature.md b/docs/data-sources/system_logging_feature.md
new file mode 100644
index 000000000..167b446cb
--- /dev/null
+++ b/docs/data-sources/system_logging_feature.md
@@ -0,0 +1,97 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_logging_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Logging Feature.
+---
+
+# sdwan_system_logging_feature (Data Source)
+
+This data source can read the System Logging Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_logging_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `disk_enable` (Boolean) Enable logging to local disk
+- `disk_enable_variable` (String) Variable name
+- `disk_file_rotate` (Number) Set number of syslog files to create before discarding oldest files
+- `disk_file_rotate_variable` (String) Variable name
+- `disk_file_size` (Number) Set maximum size of file before it is rotated
+- `disk_file_size_variable` (String) Variable name
+- `ipv4_servers` (Attributes List) Enable logging to remote server (see [below for nested schema](#nestedatt--ipv4_servers))
+- `ipv6_servers` (Attributes List) Enable logging to remote ipv6 server (see [below for nested schema](#nestedatt--ipv6_servers))
+- `name` (String) The name of the Feature
+- `tls_profiles` (Attributes List) Configure a TLS profile (see [below for nested schema](#nestedatt--tls_profiles))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_servers`
+
+Read-Only:
+
+- `hostname_ip` (String) Set hostname or IPv4 address of server
+- `hostname_ip_variable` (String) Variable name
+- `priority` (String) Set logging level for messages logged to server
+- `priority_variable` (String) Variable name
+- `source_interface` (String) Set interface to use to reach syslog server
+- `source_interface_variable` (String) Variable name
+- `tls_enable` (Boolean) Enable TLS Profile
+- `tls_enable_variable` (String) Variable name
+- `tls_properties_custom_profile` (Boolean) Define custom profile
+- `tls_properties_custom_profile_variable` (String) Variable name
+- `tls_properties_profile` (String) Configure a TLS profile
+- `tls_properties_profile_variable` (String) Variable name
+- `vpn` (Number) Set hostname or IPv4 address of server
+- `vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_servers`
+
+Read-Only:
+
+- `hostname_ip` (String) Set IPv6 hostname or IPv6 address of server
+- `hostname_ip_variable` (String) Variable name
+- `priority` (String) Set logging level for messages logged to server
+- `priority_variable` (String) Variable name
+- `source_interface` (String) Set interface to use to reach syslog server
+- `source_interface_variable` (String) Variable name
+- `tls_enable` (Boolean) Enable TLS Profile
+- `tls_enable_variable` (String) Variable name
+- `tls_properties_custom_profile` (Boolean) Define custom profile
+- `tls_properties_custom_profile_variable` (String) Variable name
+- `tls_properties_profile` (String) Configure a TLS profile
+- `tls_properties_profile_variable` (String) Variable name
+- `vpn` (Number) Set hostname or IPv4 address of server
+- `vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `tls_profiles`
+
+Read-Only:
+
+- `cipher_suites` (Set of String) Syslog secure server ciphersuites
+- `cipher_suites_variable` (String) Variable name
+- `profile` (String) Specify the name of the TLS profile
+- `profile_variable` (String) Variable name
+- `tls_version` (String) TLS Version
+- `tls_version_variable` (String) Variable name
diff --git a/docs/data-sources/system_logging_profile_parcel.md b/docs/data-sources/system_logging_profile_parcel.md
deleted file mode 100644
index fa9dc8ad6..000000000
--- a/docs/data-sources/system_logging_profile_parcel.md
+++ /dev/null
@@ -1,97 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_logging_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Logging profile parcel.
----
-
-# sdwan_system_logging_profile_parcel (Data Source)
-
-This data source can read the System Logging profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_logging_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `disk_enable` (Boolean) Enable logging to local disk
-- `disk_enable_variable` (String) Variable name
-- `disk_file_rotate` (Number) Set number of syslog files to create before discarding oldest files
-- `disk_file_rotate_variable` (String) Variable name
-- `disk_file_size` (Number) Set maximum size of file before it is rotated
-- `disk_file_size_variable` (String) Variable name
-- `ipv4_servers` (Attributes List) Enable logging to remote server (see [below for nested schema](#nestedatt--ipv4_servers))
-- `ipv6_servers` (Attributes List) Enable logging to remote ipv6 server (see [below for nested schema](#nestedatt--ipv6_servers))
-- `name` (String) The name of the profile parcel
-- `tls_profiles` (Attributes List) Configure a TLS profile (see [below for nested schema](#nestedatt--tls_profiles))
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `ipv4_servers`
-
-Read-Only:
-
-- `hostname_ip` (String) Set hostname or IPv4 address of server
-- `hostname_ip_variable` (String) Variable name
-- `priority` (String) Set logging level for messages logged to server
-- `priority_variable` (String) Variable name
-- `source_interface` (String) Set interface to use to reach syslog server
-- `source_interface_variable` (String) Variable name
-- `tls_enable` (Boolean) Enable TLS Profile
-- `tls_enable_variable` (String) Variable name
-- `tls_properties_custom_profile` (Boolean) Define custom profile
-- `tls_properties_custom_profile_variable` (String) Variable name
-- `tls_properties_profile` (String) Configure a TLS profile
-- `tls_properties_profile_variable` (String) Variable name
-- `vpn` (Number) Set hostname or IPv4 address of server
-- `vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_servers`
-
-Read-Only:
-
-- `hostname_ip` (String) Set IPv6 hostname or IPv6 address of server
-- `hostname_ip_variable` (String) Variable name
-- `priority` (String) Set logging level for messages logged to server
-- `priority_variable` (String) Variable name
-- `source_interface` (String) Set interface to use to reach syslog server
-- `source_interface_variable` (String) Variable name
-- `tls_enable` (Boolean) Enable TLS Profile
-- `tls_enable_variable` (String) Variable name
-- `tls_properties_custom_profile` (Boolean) Define custom profile
-- `tls_properties_custom_profile_variable` (String) Variable name
-- `tls_properties_profile` (String) Configure a TLS profile
-- `tls_properties_profile_variable` (String) Variable name
-- `vpn` (Number) Set hostname or IPv4 address of server
-- `vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `tls_profiles`
-
-Read-Only:
-
-- `cipher_suites` (Set of String) Syslog secure server ciphersuites
-- `cipher_suites_variable` (String) Variable name
-- `profile` (String) Specify the name of the TLS profile
-- `profile_variable` (String) Variable name
-- `tls_version` (String) TLS Version
-- `tls_version_variable` (String) Variable name
diff --git a/docs/data-sources/system_mrf_feature.md b/docs/data-sources/system_mrf_feature.md
new file mode 100644
index 000000000..97a110483
--- /dev/null
+++ b/docs/data-sources/system_mrf_feature.md
@@ -0,0 +1,41 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_mrf_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System MRF Feature.
+---
+
+# sdwan_system_mrf_feature (Data Source)
+
+This data source can read the System MRF Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_mrf_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `enable_migration_to_mrf` (String) Enable migration mode to Multi-Region Fabric
+- `migration_bgp_community` (Number) Set BGP community during migration from BGP-core based network
+- `name` (String) The name of the Feature
+- `region_id` (Number) Set region ID
+- `role` (String) Set the role for router
+- `role_variable` (String) Variable name
+- `secondary_region_id` (Number) Set secondary region ID
+- `secondary_region_id_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/system_mrf_profile_parcel.md b/docs/data-sources/system_mrf_profile_parcel.md
deleted file mode 100644
index 86305853c..000000000
--- a/docs/data-sources/system_mrf_profile_parcel.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_mrf_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System MRF profile parcel.
----
-
-# sdwan_system_mrf_profile_parcel (Data Source)
-
-This data source can read the System MRF profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_mrf_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `enable_migration_to_mrf` (String) Enable migration mode to Multi-Region Fabric
-- `migration_bgp_community` (Number) Set BGP community during migration from BGP-core based network
-- `name` (String) The name of the profile parcel
-- `region_id` (Number) Set region ID
-- `role` (String) Set the role for router
-- `role_variable` (String) Variable name
-- `secondary_region_id` (Number) Set secondary region ID
-- `secondary_region_id_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/system_ntp_feature.md b/docs/data-sources/system_ntp_feature.md
new file mode 100644
index 000000000..b0fe16fba
--- /dev/null
+++ b/docs/data-sources/system_ntp_feature.md
@@ -0,0 +1,73 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_ntp_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System NTP Feature.
+---
+
+# sdwan_system_ntp_feature (Data Source)
+
+This data source can read the System NTP Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_ntp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `authentication_keys` (Attributes List) Set MD5 authentication key (see [below for nested schema](#nestedatt--authentication_keys))
+- `authoritative_ntp_server` (Boolean) Enable device as NTP Leader
+- `authoritative_ntp_server_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `servers` (Attributes List) Configure NTP servers (see [below for nested schema](#nestedatt--servers))
+- `source_interface` (String) Enable device as NTP Leader
+- `source_interface_variable` (String) Variable name
+- `stratum` (Number) Enable device as NTP Leader
+- `stratum_variable` (String) Variable name
+- `trusted_keys` (Set of Number) Designate authentication key as trustworthy
+- `trusted_keys_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `authentication_keys`
+
+Read-Only:
+
+- `key_id` (Number) MD5 authentication key ID
+- `key_id_variable` (String) Variable name
+- `md5_value` (String) Enter cleartext or AES-encrypted MD5 authentication key
+- `md5_value_variable` (String) Variable name
+
+
+
+### Nested Schema for `servers`
+
+Read-Only:
+
+- `authentication_key` (Number) Set authentication key for the server
+- `authentication_key_variable` (String) Variable name
+- `hostname_ip_address` (String) Set hostname or IP address of server
+- `hostname_ip_address_variable` (String) Variable name
+- `ntp_version` (Number) Set NTP version
+- `ntp_version_variable` (String) Variable name
+- `prefer_this_ntp_server` (Boolean) Prefer this NTP server
+- `prefer_this_ntp_server_variable` (String) Variable name
+- `source_interface` (String) Set interface to use to reach NTP server
+- `source_interface_variable` (String) Variable name
+- `vpn` (Number) Set VPN in which NTP server is located
+- `vpn_variable` (String) Variable name
diff --git a/docs/data-sources/system_ntp_profile_parcel.md b/docs/data-sources/system_ntp_profile_parcel.md
deleted file mode 100644
index 0f4404c36..000000000
--- a/docs/data-sources/system_ntp_profile_parcel.md
+++ /dev/null
@@ -1,73 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_ntp_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System NTP profile parcel.
----
-
-# sdwan_system_ntp_profile_parcel (Data Source)
-
-This data source can read the System NTP profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_ntp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `authentication_keys` (Attributes List) Set MD5 authentication key (see [below for nested schema](#nestedatt--authentication_keys))
-- `authoritative_ntp_server` (Boolean) Enable device as NTP Leader
-- `authoritative_ntp_server_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `name` (String) The name of the profile parcel
-- `servers` (Attributes List) Configure NTP servers (see [below for nested schema](#nestedatt--servers))
-- `source_interface` (String) Enable device as NTP Leader
-- `source_interface_variable` (String) Variable name
-- `stratum` (Number) Enable device as NTP Leader
-- `stratum_variable` (String) Variable name
-- `trusted_keys` (Set of Number) Designate authentication key as trustworthy
-- `trusted_keys_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `authentication_keys`
-
-Read-Only:
-
-- `key_id` (Number) MD5 authentication key ID
-- `key_id_variable` (String) Variable name
-- `md5_value` (String) Enter cleartext or AES-encrypted MD5 authentication key
-- `md5_value_variable` (String) Variable name
-
-
-
-### Nested Schema for `servers`
-
-Read-Only:
-
-- `authentication_key` (Number) Set authentication key for the server
-- `authentication_key_variable` (String) Variable name
-- `hostname_ip_address` (String) Set hostname or IP address of server
-- `hostname_ip_address_variable` (String) Variable name
-- `ntp_version` (Number) Set NTP version
-- `ntp_version_variable` (String) Variable name
-- `prefer_this_ntp_server` (Boolean) Prefer this NTP server
-- `prefer_this_ntp_server_variable` (String) Variable name
-- `source_interface` (String) Set interface to use to reach NTP server
-- `source_interface_variable` (String) Variable name
-- `vpn` (Number) Set VPN in which NTP server is located
-- `vpn_variable` (String) Variable name
diff --git a/docs/data-sources/system_omp_feature.md b/docs/data-sources/system_omp_feature.md
new file mode 100644
index 000000000..f5927fc13
--- /dev/null
+++ b/docs/data-sources/system_omp_feature.md
@@ -0,0 +1,92 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_omp_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System OMP Feature.
+---
+
+# sdwan_system_omp_feature (Data Source)
+
+This data source can read the System OMP Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_omp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `advertise_ipv4_bgp` (Boolean) BGP
+- `advertise_ipv4_bgp_variable` (String) Variable name
+- `advertise_ipv4_connected` (Boolean) Connected
+- `advertise_ipv4_connected_variable` (String) Variable name
+- `advertise_ipv4_eigrp` (Boolean) EIGRP
+- `advertise_ipv4_eigrp_variable` (String) Variable name
+- `advertise_ipv4_isis` (Boolean) ISIS
+- `advertise_ipv4_isis_variable` (String) Variable name
+- `advertise_ipv4_lisp` (Boolean) LISP
+- `advertise_ipv4_lisp_variable` (String) Variable name
+- `advertise_ipv4_ospf` (Boolean) OSPF
+- `advertise_ipv4_ospf_v3` (Boolean) OSPFV3
+- `advertise_ipv4_ospf_v3_variable` (String) Variable name
+- `advertise_ipv4_ospf_variable` (String) Variable name
+- `advertise_ipv4_static` (Boolean) Static
+- `advertise_ipv4_static_variable` (String) Variable name
+- `advertise_ipv6_bgp` (Boolean) BGP
+- `advertise_ipv6_bgp_variable` (String) Variable name
+- `advertise_ipv6_connected` (Boolean) Connected
+- `advertise_ipv6_connected_variable` (String) Variable name
+- `advertise_ipv6_eigrp` (Boolean) EIGRP
+- `advertise_ipv6_eigrp_variable` (String) Variable name
+- `advertise_ipv6_isis` (Boolean) ISIS
+- `advertise_ipv6_isis_variable` (String) Variable name
+- `advertise_ipv6_lisp` (Boolean) LISP
+- `advertise_ipv6_lisp_variable` (String) Variable name
+- `advertise_ipv6_ospf` (Boolean) OSPF
+- `advertise_ipv6_ospf_variable` (String) Variable name
+- `advertise_ipv6_static` (Boolean) Static
+- `advertise_ipv6_static_variable` (String) Variable name
+- `advertisement_interval` (Number) Advertisement Interval (seconds)
+- `advertisement_interval_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `ecmp_limit` (Number) Set maximum number of OMP paths to install in cEdge route table
+- `ecmp_limit_variable` (String) Variable name
+- `eor_timer` (Number) EOR Timer
+- `eor_timer_variable` (String) Variable name
+- `graceful_restart` (Boolean) Graceful Restart for OMP
+- `graceful_restart_timer` (Number) Graceful Restart Timer (seconds)
+- `graceful_restart_timer_variable` (String) Variable name
+- `graceful_restart_variable` (String) Variable name
+- `holdtime` (Number) Hold Time (seconds)
+- `holdtime_variable` (String) Variable name
+- `ignore_region_path_length` (Boolean) Treat hierarchical and direct (secondary region) paths equally
+- `ignore_region_path_length_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
+- `omp_admin_distance_ipv4_variable` (String) Variable name
+- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
+- `omp_admin_distance_ipv6_variable` (String) Variable name
+- `overlay_as` (Number) Overlay AS Number
+- `overlay_as_variable` (String) Variable name
+- `paths_advertised_per_prefix` (Number) Number of Paths Advertised per Prefix
+- `paths_advertised_per_prefix_variable` (String) Variable name
+- `shutdown` (Boolean) Shutdown
+- `shutdown_variable` (String) Variable name
+- `site_types` (Set of String) Site Types
+- `site_types_variable` (String) Variable name
+- `transport_gateway` (String) Transport Gateway Path Behavior
+- `transport_gateway_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/system_omp_profile_parcel.md b/docs/data-sources/system_omp_profile_parcel.md
deleted file mode 100644
index 3adbe5cd2..000000000
--- a/docs/data-sources/system_omp_profile_parcel.md
+++ /dev/null
@@ -1,92 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_omp_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System OMP profile parcel.
----
-
-# sdwan_system_omp_profile_parcel (Data Source)
-
-This data source can read the System OMP profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_omp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `advertise_ipv4_bgp` (Boolean) BGP
-- `advertise_ipv4_bgp_variable` (String) Variable name
-- `advertise_ipv4_connected` (Boolean) Connected
-- `advertise_ipv4_connected_variable` (String) Variable name
-- `advertise_ipv4_eigrp` (Boolean) EIGRP
-- `advertise_ipv4_eigrp_variable` (String) Variable name
-- `advertise_ipv4_isis` (Boolean) ISIS
-- `advertise_ipv4_isis_variable` (String) Variable name
-- `advertise_ipv4_lisp` (Boolean) LISP
-- `advertise_ipv4_lisp_variable` (String) Variable name
-- `advertise_ipv4_ospf` (Boolean) OSPF
-- `advertise_ipv4_ospf_v3` (Boolean) OSPFV3
-- `advertise_ipv4_ospf_v3_variable` (String) Variable name
-- `advertise_ipv4_ospf_variable` (String) Variable name
-- `advertise_ipv4_static` (Boolean) Static
-- `advertise_ipv4_static_variable` (String) Variable name
-- `advertise_ipv6_bgp` (Boolean) BGP
-- `advertise_ipv6_bgp_variable` (String) Variable name
-- `advertise_ipv6_connected` (Boolean) Connected
-- `advertise_ipv6_connected_variable` (String) Variable name
-- `advertise_ipv6_eigrp` (Boolean) EIGRP
-- `advertise_ipv6_eigrp_variable` (String) Variable name
-- `advertise_ipv6_isis` (Boolean) ISIS
-- `advertise_ipv6_isis_variable` (String) Variable name
-- `advertise_ipv6_lisp` (Boolean) LISP
-- `advertise_ipv6_lisp_variable` (String) Variable name
-- `advertise_ipv6_ospf` (Boolean) OSPF
-- `advertise_ipv6_ospf_variable` (String) Variable name
-- `advertise_ipv6_static` (Boolean) Static
-- `advertise_ipv6_static_variable` (String) Variable name
-- `advertisement_interval` (Number) Advertisement Interval (seconds)
-- `advertisement_interval_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `ecmp_limit` (Number) Set maximum number of OMP paths to install in cEdge route table
-- `ecmp_limit_variable` (String) Variable name
-- `eor_timer` (Number) EOR Timer
-- `eor_timer_variable` (String) Variable name
-- `graceful_restart` (Boolean) Graceful Restart for OMP
-- `graceful_restart_timer` (Number) Graceful Restart Timer (seconds)
-- `graceful_restart_timer_variable` (String) Variable name
-- `graceful_restart_variable` (String) Variable name
-- `holdtime` (Number) Hold Time (seconds)
-- `holdtime_variable` (String) Variable name
-- `ignore_region_path_length` (Boolean) Treat hierarchical and direct (secondary region) paths equally
-- `ignore_region_path_length_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
-- `omp_admin_distance_ipv4_variable` (String) Variable name
-- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
-- `omp_admin_distance_ipv6_variable` (String) Variable name
-- `overlay_as` (Number) Overlay AS Number
-- `overlay_as_variable` (String) Variable name
-- `paths_advertised_per_prefix` (Number) Number of Paths Advertised per Prefix
-- `paths_advertised_per_prefix_variable` (String) Variable name
-- `shutdown` (Boolean) Shutdown
-- `shutdown_variable` (String) Variable name
-- `site_types` (Set of String) Site Types
-- `site_types_variable` (String) Variable name
-- `transport_gateway` (String) Transport Gateway Path Behavior
-- `transport_gateway_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/system_performance_monitoring_feature.md b/docs/data-sources/system_performance_monitoring_feature.md
new file mode 100644
index 000000000..3602629fd
--- /dev/null
+++ b/docs/data-sources/system_performance_monitoring_feature.md
@@ -0,0 +1,40 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_performance_monitoring_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Performance Monitoring Feature.
+---
+
+# sdwan_system_performance_monitoring_feature (Data Source)
+
+This data source can read the System Performance Monitoring Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_performance_monitoring_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `app_perf_monitor_app_group` (Set of String) Application groups to be monitored
+- `app_perf_monitor_enabled` (Boolean) Application performance monitoring enable or disable
+- `description` (String) The description of the Feature
+- `event_driven_config_enabled` (Boolean) UMTS event driven monitoring enable or disable
+- `event_driven_events` (Set of String) UMTS events
+- `monitoring_config_enabled` (Boolean) UMTS monitoring enable or disable
+- `monitoring_config_interval` (String) UMTS monitoring interval(Minutes)
+- `name` (String) The name of the Feature
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/system_performance_monitoring_profile_parcel.md b/docs/data-sources/system_performance_monitoring_profile_parcel.md
deleted file mode 100644
index 9a492c168..000000000
--- a/docs/data-sources/system_performance_monitoring_profile_parcel.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_performance_monitoring_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Performance Monitoring profile parcel.
----
-
-# sdwan_system_performance_monitoring_profile_parcel (Data Source)
-
-This data source can read the System Performance Monitoring profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_performance_monitoring_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `app_perf_monitor_app_group` (Set of String) Application groups to be monitored
-- `app_perf_monitor_enabled` (Boolean) Application performance monitoring enable or disable
-- `description` (String) The description of the profile parcel
-- `event_driven_config_enabled` (Boolean) UMTS event driven monitoring enable or disable
-- `event_driven_events` (Set of String) UMTS events
-- `monitoring_config_enabled` (Boolean) UMTS monitoring enable or disable
-- `monitoring_config_interval` (String) UMTS monitoring interval(Minutes)
-- `name` (String) The name of the profile parcel
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/system_remote_access_feature.md b/docs/data-sources/system_remote_access_feature.md
new file mode 100644
index 000000000..019f5090b
--- /dev/null
+++ b/docs/data-sources/system_remote_access_feature.md
@@ -0,0 +1,74 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_remote_access_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Remote Access Feature.
+---
+
+# sdwan_system_remote_access_feature (Data Source)
+
+This data source can read the System Remote Access Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_remote_access_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `aaa_derive_name_from_peer_domain` (String)
+- `aaa_derive_name_from_peer_domain_variable` (String) Variable name
+- `aaa_derive_name_from_peer_identity` (String)
+- `aaa_derive_name_from_peer_identity_variable` (String) Variable name
+- `aaa_enable_accounting` (Boolean) Enable Accounting
+- `aaa_enable_accounting_variable` (String) Variable name
+- `aaa_specify_name_policy_name` (String)
+- `aaa_specify_name_policy_name_variable` (String) Variable name
+- `aaa_specify_name_policy_password` (String)
+- `aaa_specify_name_policy_password_variable` (String) Variable name
+- `any_connect_eap_authentication_type` (String)
+- `connection_type_ssl` (Boolean) Enabled SSL VPN
+- `description` (String) The description of the Feature
+- `enable_certificate_list_check` (Boolean)
+- `enable_certificate_list_check_variable` (String) Variable name
+- `ikev2_anti_dos_threshold` (Number) Anti-DOS Threshold
+- `ikev2_anti_dos_threshold_variable` (String) Variable name
+- `ikev2_local_ike_identity_type` (String)
+- `ikev2_local_ike_identity_type_variable` (String) Variable name
+- `ikev2_local_ike_identity_value` (String)
+- `ikev2_local_ike_identity_value_variable` (String) Variable name
+- `ikev2_security_association_lifetime` (Number) Security Association Lifetime in Seconds
+- `ikev2_security_association_lifetime_variable` (String) Variable name
+- `ipsec_anti_replay_window_size` (Number) security Association Lifetime
+- `ipsec_anti_replay_window_size_variable` (String) Variable name
+- `ipsec_enable_anti_replay` (Boolean) Enable Anti-Replay
+- `ipsec_enable_anti_replay_variable` (String) Variable name
+- `ipsec_enable_perfect_foward_secrecy` (Boolean) security Association Lifetime
+- `ipsec_enable_perfect_foward_secrecy_variable` (String) Variable name
+- `ipsec_security_association_lifetime` (Number) Security Association Lifetime in Seconds
+- `ipsec_security_association_lifetime_variable` (String) Variable name
+- `ipv4_pool_size` (Number) IPv4 Pool Size
+- `ipv4_pool_size_variable` (String) Variable name
+- `ipv6_pool_size` (Number) IPv6 Pool Size
+- `ipv6_pool_size_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `psk_authentication_pre_shared_key` (String) PSK Pre Shared Key
+- `psk_authentication_pre_shared_key_variable` (String) Variable name
+- `psk_authentication_type` (String) PSK Selection
+- `psk_authentication_type_variable` (String) Variable name
+- `radius_group_name` (String)
+- `radius_group_name_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/system_remote_access_profile_parcel.md b/docs/data-sources/system_remote_access_profile_parcel.md
deleted file mode 100644
index a4990d644..000000000
--- a/docs/data-sources/system_remote_access_profile_parcel.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_remote_access_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Remote Access profile parcel.
----
-
-# sdwan_system_remote_access_profile_parcel (Data Source)
-
-This data source can read the System Remote Access profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_remote_access_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `aaa_derive_name_from_peer_domain` (String)
-- `aaa_derive_name_from_peer_domain_variable` (String) Variable name
-- `aaa_derive_name_from_peer_identity` (String)
-- `aaa_derive_name_from_peer_identity_variable` (String) Variable name
-- `aaa_enable_accounting` (Boolean) Enable Accounting
-- `aaa_enable_accounting_variable` (String) Variable name
-- `aaa_specify_name_policy_name` (String)
-- `aaa_specify_name_policy_name_variable` (String) Variable name
-- `aaa_specify_name_policy_password` (String)
-- `aaa_specify_name_policy_password_variable` (String) Variable name
-- `any_connect_eap_authentication_type` (String)
-- `connection_type_ssl` (Boolean) Enabled SSL VPN
-- `description` (String) The description of the profile parcel
-- `enable_certificate_list_check` (Boolean)
-- `enable_certificate_list_check_variable` (String) Variable name
-- `ikev2_anti_dos_threshold` (Number) Anti-DOS Threshold
-- `ikev2_anti_dos_threshold_variable` (String) Variable name
-- `ikev2_local_ike_identity_type` (String)
-- `ikev2_local_ike_identity_type_variable` (String) Variable name
-- `ikev2_local_ike_identity_value` (String)
-- `ikev2_local_ike_identity_value_variable` (String) Variable name
-- `ikev2_security_association_lifetime` (Number) Security Association Lifetime in Seconds
-- `ikev2_security_association_lifetime_variable` (String) Variable name
-- `ipsec_anti_replay_window_size` (Number) security Association Lifetime
-- `ipsec_anti_replay_window_size_variable` (String) Variable name
-- `ipsec_enable_anti_replay` (Boolean) Enable Anti-Replay
-- `ipsec_enable_anti_replay_variable` (String) Variable name
-- `ipsec_enable_perfect_foward_secrecy` (Boolean) security Association Lifetime
-- `ipsec_enable_perfect_foward_secrecy_variable` (String) Variable name
-- `ipsec_security_association_lifetime` (Number) Security Association Lifetime in Seconds
-- `ipsec_security_association_lifetime_variable` (String) Variable name
-- `ipv4_pool_size` (Number) IPv4 Pool Size
-- `ipv4_pool_size_variable` (String) Variable name
-- `ipv6_pool_size` (Number) IPv6 Pool Size
-- `ipv6_pool_size_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `psk_authentication_pre_shared_key` (String) PSK Pre Shared Key
-- `psk_authentication_pre_shared_key_variable` (String) Variable name
-- `psk_authentication_type` (String) PSK Selection
-- `psk_authentication_type_variable` (String) Variable name
-- `radius_group_name` (String)
-- `radius_group_name_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/system_security_feature.md b/docs/data-sources/system_security_feature.md
new file mode 100644
index 000000000..8fcccd33f
--- /dev/null
+++ b/docs/data-sources/system_security_feature.md
@@ -0,0 +1,90 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_security_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System Security Feature.
+---
+
+# sdwan_system_security_feature (Data Source)
+
+This data source can read the System Security Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_security_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `anti_replay_window` (String) Set the sliding replay window size
+- `anti_replay_window_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `extended_anti_replay_window` (Number) Extended Anti-Replay Window
+- `extended_anti_replay_window_variable` (String) Variable name
+- `integrity_type` (Set of String) Set the authentication type for DTLS connections
+- `integrity_type_variable` (String) Variable name
+- `ipsec_pairwise_keying` (Boolean) Enable or disable IPsec pairwise-keying
+- `ipsec_pairwise_keying_variable` (String) Variable name
+- `keychains` (Attributes List) Configure a Keychain (see [below for nested schema](#nestedatt--keychains))
+- `keys` (Attributes List) Configure a Key (see [below for nested schema](#nestedatt--keys))
+- `name` (String) The name of the Feature
+- `rekey` (Number) Set how often to change the AES key for DTLS connections
+- `rekey_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `keychains`
+
+Read-Only:
+
+- `key_chain_name` (String) Specify the name of the Keychain
+- `key_id` (Number) Specify the Key ID
+
+
+
+### Nested Schema for `keys`
+
+Read-Only:
+
+- `accept_ao_mismatch` (Boolean) Configure Accept AO Mismatch
+- `accept_ao_mismatch_variable` (String) Variable name
+- `accept_life_time_duration` (Number) Send lifetime Duration (seconds)
+- `accept_life_time_duration_variable` (String) Variable name
+- `accept_life_time_exact` (Number) Configure Key lifetime end time
+- `accept_life_time_infinite` (Boolean) Infinite lifetime
+- `accept_life_time_infinite_variable` (String) Variable name
+- `accept_life_time_local` (Boolean) Configure Send lifetime Local
+- `accept_life_time_local_variable` (String) Variable name
+- `accept_life_time_start_epoch` (Number) Configure Key lifetime start time
+- `crypto_algorithm` (String) Crypto Algorithm
+- `id` (Number) Select the Key ID
+- `include_tcp_options` (Boolean) Configure Include TCP Options
+- `include_tcp_options_variable` (String) Variable name
+- `key_string` (String) Specify the Key String
+- `key_string_variable` (String) Variable name
+- `name` (String) Select the chain name
+- `receiver_id` (Number) Specify the Receiver ID
+- `receiver_id_variable` (String) Variable name
+- `send_id` (Number) Specify the Send ID
+- `send_id_variable` (String) Variable name
+- `send_life_time_duration` (Number) Send lifetime Duration (seconds)
+- `send_life_time_duration_variable` (String) Variable name
+- `send_life_time_exact` (Number) Configure Key lifetime end time
+- `send_life_time_infinite` (Boolean) Infinite lifetime
+- `send_life_time_infinite_variable` (String) Variable name
+- `send_life_time_local` (Boolean) Configure Send lifetime Local
+- `send_life_time_local_variable` (String) Variable name
+- `send_life_time_start_epoch` (Number) Configure Key lifetime start time
diff --git a/docs/data-sources/system_security_profile_parcel.md b/docs/data-sources/system_security_profile_parcel.md
deleted file mode 100644
index 80b4ea4f8..000000000
--- a/docs/data-sources/system_security_profile_parcel.md
+++ /dev/null
@@ -1,90 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_security_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System Security profile parcel.
----
-
-# sdwan_system_security_profile_parcel (Data Source)
-
-This data source can read the System Security profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_security_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `anti_replay_window` (String) Set the sliding replay window size
-- `anti_replay_window_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `extended_anti_replay_window` (Number) Extended Anti-Replay Window
-- `extended_anti_replay_window_variable` (String) Variable name
-- `integrity_type` (Set of String) Set the authentication type for DTLS connections
-- `integrity_type_variable` (String) Variable name
-- `ipsec_pairwise_keying` (Boolean) Enable or disable IPsec pairwise-keying
-- `ipsec_pairwise_keying_variable` (String) Variable name
-- `keychains` (Attributes List) Configure a Keychain (see [below for nested schema](#nestedatt--keychains))
-- `keys` (Attributes List) Configure a Key (see [below for nested schema](#nestedatt--keys))
-- `name` (String) The name of the profile parcel
-- `rekey` (Number) Set how often to change the AES key for DTLS connections
-- `rekey_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `keychains`
-
-Read-Only:
-
-- `key_chain_name` (String) Specify the name of the Keychain
-- `key_id` (Number) Specify the Key ID
-
-
-
-### Nested Schema for `keys`
-
-Read-Only:
-
-- `accept_ao_mismatch` (Boolean) Configure Accept AO Mismatch
-- `accept_ao_mismatch_variable` (String) Variable name
-- `accept_life_time_duration` (Number) Send lifetime Duration (seconds)
-- `accept_life_time_duration_variable` (String) Variable name
-- `accept_life_time_exact` (Number) Configure Key lifetime end time
-- `accept_life_time_infinite` (Boolean) Infinite lifetime
-- `accept_life_time_infinite_variable` (String) Variable name
-- `accept_life_time_local` (Boolean) Configure Send lifetime Local
-- `accept_life_time_local_variable` (String) Variable name
-- `accept_life_time_start_epoch` (Number) Configure Key lifetime start time
-- `crypto_algorithm` (String) Crypto Algorithm
-- `id` (Number) Select the Key ID
-- `include_tcp_options` (Boolean) Configure Include TCP Options
-- `include_tcp_options_variable` (String) Variable name
-- `key_string` (String) Specify the Key String
-- `key_string_variable` (String) Variable name
-- `name` (String) Select the chain name
-- `receiver_id` (Number) Specify the Receiver ID
-- `receiver_id_variable` (String) Variable name
-- `send_id` (Number) Specify the Send ID
-- `send_id_variable` (String) Variable name
-- `send_life_time_duration` (Number) Send lifetime Duration (seconds)
-- `send_life_time_duration_variable` (String) Variable name
-- `send_life_time_exact` (Number) Configure Key lifetime end time
-- `send_life_time_infinite` (Boolean) Infinite lifetime
-- `send_life_time_infinite_variable` (String) Variable name
-- `send_life_time_local` (Boolean) Configure Send lifetime Local
-- `send_life_time_local_variable` (String) Variable name
-- `send_life_time_start_epoch` (Number) Configure Key lifetime start time
diff --git a/docs/data-sources/system_snmp_feature.md b/docs/data-sources/system_snmp_feature.md
new file mode 100644
index 000000000..fcaba3a9b
--- /dev/null
+++ b/docs/data-sources/system_snmp_feature.md
@@ -0,0 +1,123 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_snmp_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the System SNMP Feature.
+---
+
+# sdwan_system_snmp_feature (Data Source)
+
+This data source can read the System SNMP Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_system_snmp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `communities` (Attributes List) Configure SNMP community (see [below for nested schema](#nestedatt--communities))
+- `contact_person` (String) Set the contact for this managed node
+- `contact_person_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `groups` (Attributes List) Configure an SNMP group (see [below for nested schema](#nestedatt--groups))
+- `location_of_device` (String) Set the physical location of this managed node
+- `location_of_device_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `shutdown` (Boolean) Enable or disable SNMP
+- `shutdown_variable` (String) Variable name
+- `trap_target_servers` (Attributes List) Configure SNMP server to receive SNMP traps (see [below for nested schema](#nestedatt--trap_target_servers))
+- `users` (Attributes List) Configure an SNMP user (see [below for nested schema](#nestedatt--users))
+- `version` (Number) The version of the Feature
+- `views` (Attributes List) Configure a view record (see [below for nested schema](#nestedatt--views))
+
+
+### Nested Schema for `communities`
+
+Read-Only:
+
+- `authorization` (String) Configure access permissions
+- `authorization_variable` (String) Variable name
+- `name` (String) Set name of the SNMP community
+- `user_label` (String) Set user label of the SNMP community
+- `view` (String) Set name of the SNMP view
+- `view_variable` (String) Variable name
+
+
+
+### Nested Schema for `groups`
+
+Read-Only:
+
+- `name` (String) Name of the SNMP group
+- `security_level` (String) Configure security level
+- `view` (String) Name of the SNMP view
+- `view_variable` (String) Variable name
+
+
+
+### Nested Schema for `trap_target_servers`
+
+Read-Only:
+
+- `ip` (String) Set IPv4/IPv6 address of SNMP server
+- `ip_variable` (String) Variable name
+- `port` (Number) Set UDP port number to connect to SNMP server
+- `port_variable` (String) Variable name
+- `source_interface` (String) Source interface for outgoing SNMP traps
+- `source_interface_variable` (String) Variable name
+- `user` (String) Set name of the SNMP user
+- `user_label` (String) Set user label of the SNMP community
+- `user_variable` (String) Variable name
+- `vpn_id` (Number) Set VPN in which SNMP server is located
+- `vpn_id_variable` (String) Variable name
+
+
+
+### Nested Schema for `users`
+
+Read-Only:
+
+- `authentication_password` (String) Specify authentication protocol password
+- `authentication_password_variable` (String) Variable name
+- `authentication_protocol` (String) Configure authentication protocol
+- `authentication_protocol_variable` (String) Variable name
+- `group` (String) Name of the SNMP group
+- `group_variable` (String) Variable name
+- `name` (String) Name of the SNMP user
+- `privacy_password` (String) Specify privacy protocol password
+- `privacy_password_variable` (String) Variable name
+- `privacy_protocol` (String) Configure privacy protocol
+- `privacy_protocol_variable` (String) Variable name
+
+
+
+### Nested Schema for `views`
+
+Read-Only:
+
+- `name` (String) Set the name of the SNMP view
+- `oids` (Attributes List) Configure SNMP object identifier (see [below for nested schema](#nestedatt--views--oids))
+
+
+### Nested Schema for `views.oids`
+
+Read-Only:
+
+- `exclude` (Boolean) Exclude the OID
+- `exclude_variable` (String) Variable name
+- `id` (String) Configure identifier of subtree of MIB objects
+- `id_variable` (String) Variable name
diff --git a/docs/data-sources/system_snmp_profile_parcel.md b/docs/data-sources/system_snmp_profile_parcel.md
deleted file mode 100644
index f7d5daf50..000000000
--- a/docs/data-sources/system_snmp_profile_parcel.md
+++ /dev/null
@@ -1,123 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_snmp_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the System SNMP profile parcel.
----
-
-# sdwan_system_snmp_profile_parcel (Data Source)
-
-This data source can read the System SNMP profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_system_snmp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `communities` (Attributes List) Configure SNMP community (see [below for nested schema](#nestedatt--communities))
-- `contact_person` (String) Set the contact for this managed node
-- `contact_person_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `groups` (Attributes List) Configure an SNMP group (see [below for nested schema](#nestedatt--groups))
-- `location_of_device` (String) Set the physical location of this managed node
-- `location_of_device_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `shutdown` (Boolean) Enable or disable SNMP
-- `shutdown_variable` (String) Variable name
-- `trap_target_servers` (Attributes List) Configure SNMP server to receive SNMP traps (see [below for nested schema](#nestedatt--trap_target_servers))
-- `users` (Attributes List) Configure an SNMP user (see [below for nested schema](#nestedatt--users))
-- `version` (Number) The version of the profile parcel
-- `views` (Attributes List) Configure a view record (see [below for nested schema](#nestedatt--views))
-
-
-### Nested Schema for `communities`
-
-Read-Only:
-
-- `authorization` (String) Configure access permissions
-- `authorization_variable` (String) Variable name
-- `name` (String) Set name of the SNMP community
-- `user_label` (String) Set user label of the SNMP community
-- `view` (String) Set name of the SNMP view
-- `view_variable` (String) Variable name
-
-
-
-### Nested Schema for `groups`
-
-Read-Only:
-
-- `name` (String) Name of the SNMP group
-- `security_level` (String) Configure security level
-- `view` (String) Name of the SNMP view
-- `view_variable` (String) Variable name
-
-
-
-### Nested Schema for `trap_target_servers`
-
-Read-Only:
-
-- `ip` (String) Set IPv4/IPv6 address of SNMP server
-- `ip_variable` (String) Variable name
-- `port` (Number) Set UDP port number to connect to SNMP server
-- `port_variable` (String) Variable name
-- `source_interface` (String) Source interface for outgoing SNMP traps
-- `source_interface_variable` (String) Variable name
-- `user` (String) Set name of the SNMP user
-- `user_label` (String) Set user label of the SNMP community
-- `user_variable` (String) Variable name
-- `vpn_id` (Number) Set VPN in which SNMP server is located
-- `vpn_id_variable` (String) Variable name
-
-
-
-### Nested Schema for `users`
-
-Read-Only:
-
-- `authentication_password` (String) Specify authentication protocol password
-- `authentication_password_variable` (String) Variable name
-- `authentication_protocol` (String) Configure authentication protocol
-- `authentication_protocol_variable` (String) Variable name
-- `group` (String) Name of the SNMP group
-- `group_variable` (String) Variable name
-- `name` (String) Name of the SNMP user
-- `privacy_password` (String) Specify privacy protocol password
-- `privacy_password_variable` (String) Variable name
-- `privacy_protocol` (String) Configure privacy protocol
-- `privacy_protocol_variable` (String) Variable name
-
-
-
-### Nested Schema for `views`
-
-Read-Only:
-
-- `name` (String) Set the name of the SNMP view
-- `oids` (Attributes List) Configure SNMP object identifier (see [below for nested schema](#nestedatt--views--oids))
-
-
-### Nested Schema for `views.oids`
-
-Read-Only:
-
-- `exclude` (Boolean) Exclude the OID
-- `exclude_variable` (String) Variable name
-- `id` (String) Configure identifier of subtree of MIB objects
-- `id_variable` (String) Variable name
diff --git a/docs/data-sources/tloc_list_policy_object.md b/docs/data-sources/tloc_list_policy_object.md
index afbd4120b..61d7edf32 100644
--- a/docs/data-sources/tloc_list_policy_object.md
+++ b/docs/data-sources/tloc_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_tloc_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the TLOC List Policy Object .
---
diff --git a/docs/data-sources/tls_ssl_decryption_policy_definition.md b/docs/data-sources/tls_ssl_decryption_policy_definition.md
index 4296598c0..0130acde0 100644
--- a/docs/data-sources/tls_ssl_decryption_policy_definition.md
+++ b/docs/data-sources/tls_ssl_decryption_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_tls_ssl_decryption_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the TLS SSL Decryption Policy Definition .
---
diff --git a/docs/data-sources/tls_ssl_profile_policy_definition.md b/docs/data-sources/tls_ssl_profile_policy_definition.md
index e0c6b1dfd..a2c5014ee 100644
--- a/docs/data-sources/tls_ssl_profile_policy_definition.md
+++ b/docs/data-sources/tls_ssl_profile_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_tls_ssl_profile_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the TLS SSL Profile Policy Definition .
---
diff --git a/docs/data-sources/traffic_data_policy_definition.md b/docs/data-sources/traffic_data_policy_definition.md
index 9b4b58380..62e96ce23 100644
--- a/docs/data-sources/traffic_data_policy_definition.md
+++ b/docs/data-sources/traffic_data_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_traffic_data_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the Traffic Data Policy Definition .
---
@@ -59,7 +59,7 @@ Read-Only:
- `log` (Boolean) Enable logging
- `loss_correction` (String) Loss correction
- `loss_correction_fec` (String) Loss correction FEC
-- `loss_correction_fec_threshold` (Number) Loss correction FEC threshold
+- `loss_correction_fec_threshold` (String) Loss correction FEC threshold
- `loss_correction_packet_duplication` (String) Loss correction packet duplication
- `nat_parameters` (Attributes List) List of NAT parameters (see [below for nested schema](#nestedatt--sequences--action_entries--nat_parameters))
- `nat_pool` (String) NAT pool
@@ -134,6 +134,7 @@ Read-Only:
- `dns_application_list_id` (String) DNS Application list ID
- `dns_application_list_version` (Number) DNS Application list version
- `dscp` (Number) DSCP value
+- `icmp_message` (String) ICMP Message
- `packet_length` (Number) Packet length
- `plp` (String) PLP
- `protocol` (String) IP Protocol, 0-255 (Single value or multiple values separated by spaces)
diff --git a/docs/data-sources/transport_gps_feature.md b/docs/data-sources/transport_gps_feature.md
new file mode 100644
index 000000000..472d5d290
--- /dev/null
+++ b/docs/data-sources/transport_gps_feature.md
@@ -0,0 +1,46 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_gps_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport GPS Feature.
+---
+
+# sdwan_transport_gps_feature (Data Source)
+
+This data source can read the Transport GPS Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_gps_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `gps_enable` (Boolean) Enable/disable GPS
+- `gps_enable_variable` (String) Variable name
+- `gps_mode` (String) Select GPS mode
+- `gps_mode_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `nmea_destination_address` (String) Destination address
+- `nmea_destination_address_variable` (String) Variable name
+- `nmea_destination_port` (Number) Destination port
+- `nmea_destination_port_variable` (String) Variable name
+- `nmea_enable` (Boolean) Enable/disable NMEA data
+- `nmea_enable_variable` (String) Variable name
+- `nmea_source_address` (String) Source address
+- `nmea_source_address_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/transport_ipv6_tracker_feature.md b/docs/data-sources/transport_ipv6_tracker_feature.md
new file mode 100644
index 000000000..7b1977845
--- /dev/null
+++ b/docs/data-sources/transport_ipv6_tracker_feature.md
@@ -0,0 +1,52 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_ipv6_tracker_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport IPv6 Tracker Feature.
+---
+
+# sdwan_transport_ipv6_tracker_feature (Data Source)
+
+This data source can read the Transport IPv6 Tracker Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_ipv6_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `endpoint_api_url` (String) API url of endpoint
+- `endpoint_api_url_variable` (String) Variable name
+- `endpoint_dns_name` (String) Endpoint DNS Name
+- `endpoint_dns_name_variable` (String) Variable name
+- `endpoint_ip` (String) Endpoint IP
+- `endpoint_ip_variable` (String) Variable name
+- `endpoint_tracker_type` (String) Endpoint Tracker Type
+- `endpoint_tracker_type_variable` (String) Variable name
+- `interval` (Number) Interval
+- `interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+- `multiplier_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `threshold` (Number) Threshold
+- `threshold_variable` (String) Variable name
+- `tracker_name` (String) Tracker Name
+- `tracker_name_variable` (String) Variable name
+- `tracker_type` (String) Tracker Type
+- `tracker_type_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/transport_ipv6_tracker_group_feature.md b/docs/data-sources/transport_ipv6_tracker_group_feature.md
new file mode 100644
index 000000000..d64b78320
--- /dev/null
+++ b/docs/data-sources/transport_ipv6_tracker_group_feature.md
@@ -0,0 +1,46 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_ipv6_tracker_group_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport IPv6 Tracker Group Feature.
+---
+
+# sdwan_transport_ipv6_tracker_group_feature (Data Source)
+
+This data source can read the Transport IPv6 Tracker Group Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_ipv6_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `tracker_boolean` (String) tracker ref list combine boolean and or
+- `tracker_boolean_variable` (String) Variable name
+- `tracker_elements` (Attributes List) trackers ref list (see [below for nested schema](#nestedatt--tracker_elements))
+- `tracker_name` (String) Tracker Name
+- `tracker_name_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Read-Only:
+
+- `tracker_id` (String)
diff --git a/docs/data-sources/transport_ipv6_tracker_profile_parcel.md b/docs/data-sources/transport_ipv6_tracker_profile_parcel.md
deleted file mode 100644
index 1b09ad1d9..000000000
--- a/docs/data-sources/transport_ipv6_tracker_profile_parcel.md
+++ /dev/null
@@ -1,52 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_ipv6_tracker_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport IPv6 Tracker profile parcel.
----
-
-# sdwan_transport_ipv6_tracker_profile_parcel (Data Source)
-
-This data source can read the Transport IPv6 Tracker profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_ipv6_tracker_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `endpoint_api_url` (String) API url of endpoint
-- `endpoint_api_url_variable` (String) Variable name
-- `endpoint_dns_name` (String) Endpoint DNS Name
-- `endpoint_dns_name_variable` (String) Variable name
-- `endpoint_ip` (String) Endpoint IP
-- `endpoint_ip_variable` (String) Variable name
-- `endpoint_tracker_type` (String) Endpoint Tracker Type
-- `endpoint_tracker_type_variable` (String) Variable name
-- `interval` (Number) Interval
-- `interval_variable` (String) Variable name
-- `multiplier` (Number) Multiplier
-- `multiplier_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `threshold` (Number) Threshold
-- `threshold_variable` (String) Variable name
-- `tracker_name` (String) Tracker Name
-- `tracker_name_variable` (String) Variable name
-- `tracker_type` (String) Tracker Type
-- `tracker_type_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/transport_management_vpn_feature.md b/docs/data-sources/transport_management_vpn_feature.md
new file mode 100644
index 000000000..51e606698
--- /dev/null
+++ b/docs/data-sources/transport_management_vpn_feature.md
@@ -0,0 +1,108 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_management_vpn_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Management VPN Feature.
+---
+
+# sdwan_transport_management_vpn_feature (Data Source)
+
+This data source can read the Transport Management VPN Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_management_vpn_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
+- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
+- `name` (String) The name of the Feature
+- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
+- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
+- `primary_dns_address_ipv4_variable` (String) Variable name
+- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
+- `primary_dns_address_ipv6_variable` (String) Variable name
+- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
+- `secondary_dns_address_ipv4_variable` (String) Variable name
+- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
+- `secondary_dns_address_ipv6_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+- `vpn_description` (String) Name
+- `vpn_description_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_static_routes`
+
+Read-Only:
+
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+- `gateway` (String) Gateway
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_static_routes.next_hops`
+
+Read-Only:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_static_routes`
+
+Read-Only:
+
+- `gateway` (String) Gateway
+- `nat` (String) IPv6 Nat
+- `nat_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
+- `null0` (Boolean) IPv6 Route Gateway Next Hop
+- `prefix` (String) Prefix
+- `prefix_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_static_routes.next_hops`
+
+Read-Only:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `new_host_mappings`
+
+Read-Only:
+
+- `host_name` (String) Hostname
+- `host_name_variable` (String) Variable name
+- `list_of_ip_addresses` (Set of String) List of IP
+- `list_of_ip_addresses_variable` (String) Variable name
diff --git a/docs/data-sources/transport_management_vpn_interface_ethernet_feature.md b/docs/data-sources/transport_management_vpn_interface_ethernet_feature.md
new file mode 100644
index 000000000..d3add6303
--- /dev/null
+++ b/docs/data-sources/transport_management_vpn_interface_ethernet_feature.md
@@ -0,0 +1,106 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_management_vpn_interface_ethernet_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Management VPN Interface Ethernet Feature.
+---
+
+# sdwan_transport_management_vpn_interface_ethernet_feature (Data Source)
+
+This data source can read the Transport Management VPN Interface Ethernet Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_management_vpn_interface_ethernet_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_management_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `transport_management_vpn_feature_id` (String) Transport Management VPN Feature ID
+
+### Read-Only
+
+- `arp_entries` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arp_entries))
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+- `arp_timeout_variable` (String) Variable name
+- `autonegotiate` (Boolean) Link autonegotiation
+- `autonegotiate_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `duplex` (String) Duplex mode
+- `duplex_variable` (String) Variable name
+- `enable_dhcpv6` (Boolean) Enable DHCPv6
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String) IP Address
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
+- `ipv4_auto_detect_bandwidth_variable` (String) Variable name
+- `ipv4_configuration_type` (String) IPv4 Configuration Type
+- `ipv4_dhcp_distance` (Number) DHCP Distance
+- `ipv4_dhcp_distance_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `ipv4_iperf_server` (String) Iperf server for auto bandwidth detect
+- `ipv4_iperf_server_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask` (String) Subnet Mask
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv6_address` (String) IPv6 Address Secondary
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_configuration_type` (String) IPv6 Configuration Type
+- `load_interval` (Number) Interval for interface load calculation
+- `load_interval_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+- `media_type` (String) Media type
+- `media_type_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `shutdown` (Boolean)
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+- `speed_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arp_entries`
+
+Read-Only:
+
+- `ip_address` (String) IPV4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
diff --git a/docs/data-sources/transport_management_vpn_interface_ethernet_profile_parcel.md b/docs/data-sources/transport_management_vpn_interface_ethernet_profile_parcel.md
deleted file mode 100644
index e12fd15a2..000000000
--- a/docs/data-sources/transport_management_vpn_interface_ethernet_profile_parcel.md
+++ /dev/null
@@ -1,106 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_management_vpn_interface_ethernet_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport Management VPN Interface Ethernet profile parcel.
----
-
-# sdwan_transport_management_vpn_interface_ethernet_profile_parcel (Data Source)
-
-This data source can read the Transport Management VPN Interface Ethernet profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_management_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `transport_management_vpn_profile_parcel_id` (String) Transport Management VPN Profile Parcel ID
-
-### Read-Only
-
-- `arp_entries` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arp_entries))
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
-- `arp_timeout_variable` (String) Variable name
-- `autonegotiate` (Boolean) Link autonegotiation
-- `autonegotiate_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `duplex` (String) Duplex mode
-- `duplex_variable` (String) Variable name
-- `enable_dhcpv6` (Boolean) Enable DHCPv6
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String) IP Address
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
-- `ipv4_auto_detect_bandwidth_variable` (String) Variable name
-- `ipv4_configuration_type` (String) IPv4 Configuration Type
-- `ipv4_dhcp_distance` (Number) DHCP Distance
-- `ipv4_dhcp_distance_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `ipv4_iperf_server` (String) Iperf server for auto bandwidth detect
-- `ipv4_iperf_server_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask` (String) Subnet Mask
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv6_address` (String) IPv6 Address Secondary
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_configuration_type` (String) IPv6 Configuration Type
-- `load_interval` (Number) Interval for interface load calculation
-- `load_interval_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-- `media_type` (String) Media type
-- `media_type_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `shutdown` (Boolean)
-- `shutdown_variable` (String) Variable name
-- `speed` (String) Set interface speed
-- `speed_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arp_entries`
-
-Read-Only:
-
-- `ip_address` (String) IPV4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
diff --git a/docs/data-sources/transport_management_vpn_profile_parcel.md b/docs/data-sources/transport_management_vpn_profile_parcel.md
deleted file mode 100644
index d5e5244e5..000000000
--- a/docs/data-sources/transport_management_vpn_profile_parcel.md
+++ /dev/null
@@ -1,108 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_management_vpn_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport Management VPN profile parcel.
----
-
-# sdwan_transport_management_vpn_profile_parcel (Data Source)
-
-This data source can read the Transport Management VPN profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_management_vpn_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
-- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
-- `name` (String) The name of the profile parcel
-- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
-- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
-- `primary_dns_address_ipv4_variable` (String) Variable name
-- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
-- `primary_dns_address_ipv6_variable` (String) Variable name
-- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
-- `secondary_dns_address_ipv4_variable` (String) Variable name
-- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
-- `secondary_dns_address_ipv6_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-- `vpn_description` (String) Name
-- `vpn_description_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_static_routes`
-
-Read-Only:
-
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-- `gateway` (String) Gateway
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_static_routes.next_hops`
-
-Read-Only:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_static_routes`
-
-Read-Only:
-
-- `gateway` (String) Gateway
-- `nat` (String) IPv6 Nat
-- `nat_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
-- `null0` (Boolean) IPv6 Route Gateway Next Hop
-- `prefix` (String) Prefix
-- `prefix_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_static_routes.next_hops`
-
-Read-Only:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `new_host_mappings`
-
-Read-Only:
-
-- `host_name` (String) Hostname
-- `host_name_variable` (String) Variable name
-- `list_of_ip_addresses` (Set of String) List of IP
-- `list_of_ip_addresses_variable` (String) Variable name
diff --git a/docs/data-sources/transport_route_policy_feature.md b/docs/data-sources/transport_route_policy_feature.md
new file mode 100644
index 000000000..e9bda1653
--- /dev/null
+++ b/docs/data-sources/transport_route_policy_feature.md
@@ -0,0 +1,94 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_route_policy_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Route Policy Feature.
+---
+
+# sdwan_transport_route_policy_feature (Data Source)
+
+This data source can read the Transport Route Policy Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_route_policy_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `default_action` (String) Default Action
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `sequences` (Attributes List) Route Policy List (see [below for nested schema](#nestedatt--sequences))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Read-Only:
+
+- `actions` (Attributes List) Define list of actions (see [below for nested schema](#nestedatt--sequences--actions))
+- `base_action` (String) Base Action
+- `id` (Number) Sequence Id
+- `match_entries` (Attributes List) Define match conditions (see [below for nested schema](#nestedatt--sequences--match_entries))
+- `name` (String) Sequence Name
+- `protocol` (String) protocol such as IPV4, IPV6, or BOTH
+
+
+### Nested Schema for `sequences.actions`
+
+Read-Only:
+
+- `as_path_prepend` (Set of Number)
+- `community` (Set of String)
+- `community_additive` (Boolean)
+- `community_variable` (String) Variable name
+- `ipv4_next_hop` (String) Set Ipv4 Next Hop
+- `ipv6_next_hop` (String) Set Ipv6 Next Hop
+- `local_preference` (Number) Set Local Preference
+- `metric` (Number) Set Metric
+- `metric_type` (String) Set Metric Type
+- `omp_tag` (Number) Set OMP Tag
+- `origin` (String) Set Origin
+- `ospf_tag` (Number) Set OSPF Tag
+- `weight` (Number) Set Weight
+
+
+
+### Nested Schema for `sequences.match_entries`
+
+Read-Only:
+
+- `as_path_list_id` (String)
+- `bgp_local_preference` (Number) BGP Local Preference
+- `expanded_community_list_id` (String)
+- `extended_community_list_id` (String)
+- `ipv4_address_prefix_list_id` (String)
+- `ipv4_next_hop_prefix_list_id` (String)
+- `ipv6_address_prefix_list_id` (String)
+- `ipv6_next_hop_prefix_list_id` (String)
+- `metric` (Number) Select Metric
+- `omp_tag` (Number) Select OMP Tag
+- `ospf_tag` (Number) Select OSPF Tag
+- `standard_community_list_criteria` (String) Select a condition such as OR, AND or EXACT
+- `standard_community_lists` (Attributes List) Select a standard community list (see [below for nested schema](#nestedatt--sequences--match_entries--standard_community_lists))
+
+
+### Nested Schema for `sequences.match_entries.standard_community_lists`
+
+Read-Only:
+
+- `id` (String)
diff --git a/docs/data-sources/transport_routing_bgp_feature.md b/docs/data-sources/transport_routing_bgp_feature.md
new file mode 100644
index 000000000..c7c7821a5
--- /dev/null
+++ b/docs/data-sources/transport_routing_bgp_feature.md
@@ -0,0 +1,274 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_bgp_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Routing BGP Feature.
+---
+
+# sdwan_transport_routing_bgp_feature (Data Source)
+
+This data source can read the Transport Routing BGP Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_routing_bgp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `always_compare_med` (Boolean) Compare MEDs from all ASs when selecting active BGP paths
+- `always_compare_med_variable` (String) Variable name
+- `as_number` (Number) Set autonomous system number <1..4294967295> or
+- `as_number_variable` (String) Variable name
+- `compare_router_id` (Boolean) Compare router IDs when selecting active BGP paths
+- `compare_router_id_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `deterministic_med` (Boolean) Compare MEDs from all routes from same AS when selecting active BGP paths
+- `deterministic_med_variable` (String) Variable name
+- `external_routes_distance` (Number) Set administrative distance for external BGP routes
+- `external_routes_distance_variable` (String) Variable name
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+- `hold_time_variable` (String) Variable name
+- `internal_routes_distance` (Number) Set administrative distance for internal BGP routes
+- `internal_routes_distance_variable` (String) Variable name
+- `ipv4_aggregate_addresses` (Attributes List) Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv4_aggregate_addresses))
+- `ipv4_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+- `ipv4_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv4_neighbors` (Attributes List) Set BGP IPv4 neighbors (see [below for nested schema](#nestedatt--ipv4_neighbors))
+- `ipv4_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv4_networks))
+- `ipv4_originate` (Boolean) BGP Default Information Originate
+- `ipv4_originate_variable` (String) Variable name
+- `ipv4_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv4_redistributes))
+- `ipv4_table_map_filter` (Boolean) Table map filtered or not
+- `ipv4_table_map_filter_variable` (String) Variable name
+- `ipv4_table_map_route_policy_id` (String)
+- `ipv6_aggregate_addresses` (Attributes List) IPv6 Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv6_aggregate_addresses))
+- `ipv6_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+- `ipv6_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv6_neighbors` (Attributes List) Set BGP IPv6 neighbors (see [below for nested schema](#nestedatt--ipv6_neighbors))
+- `ipv6_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv6_networks))
+- `ipv6_originate` (Boolean) BGP Default Information Originate
+- `ipv6_originate_variable` (String) Variable name
+- `ipv6_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv6_redistributes))
+- `ipv6_table_map_filter` (Boolean) Table map filtered or not
+- `ipv6_table_map_filter_variable` (String) Variable name
+- `ipv6_table_map_route_policy_id` (String)
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+- `keepalive_time_variable` (String) Variable name
+- `local_routes_distance` (Number) Set administrative distance for local BGP routes
+- `local_routes_distance_variable` (String) Variable name
+- `missing_med_as_worst` (Boolean) If path has no MED, consider it to be worst path when selecting active BGP paths
+- `missing_med_as_worst_variable` (String) Variable name
+- `mpls_interfaces` (Attributes List) MPLS BGP Interface (see [below for nested schema](#nestedatt--mpls_interfaces))
+- `multipath_relax` (Boolean) Ignore AS for multipath selection
+- `multipath_relax_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `propagate_as_path` (Boolean) Propagate AS Path
+- `propagate_as_path_variable` (String) Variable name
+- `propagate_community` (Boolean) Propagate Community
+- `propagate_community_variable` (String) Variable name
+- `router_id` (String) Configure BGP router identifier
+- `router_id_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_aggregate_addresses`
+
+Read-Only:
+
+- `as_set_path` (Boolean) Set AS set path information
+- `as_set_path_variable` (String) Variable name
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String)
+- `subnet_mask_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_neighbors`
+
+Read-Only:
+
+- `address` (String) Set neighbor address
+- `address_families` (Attributes List) Set BGP address family (see [below for nested schema](#nestedatt--ipv4_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+- `ebgp_multihop_variable` (String) Variable name
+- `explicit_null` (Boolean) Send explicit null label
+- `explicit_null_variable` (String) Variable name
+- `hold_time` (Number) Set how long to wait since receiving a keepalive message to consider BGP peer unavailable
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Set how often to advertise keepalive messages to BGP peer
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+- `send_extended_community_variable` (String) Variable name
+- `send_label` (Boolean) Send label
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_neighbors.address_families`
+
+Read-Only:
+
+- `family_type` (String) Set IPv4 unicast address family
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv4_networks`
+
+Read-Only:
+
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String)
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_redistributes`
+
+Read-Only:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `ipv6_aggregate_addresses`
+
+Read-Only:
+
+- `aggregate_prefix` (String) Configure the IPv6 prefixes to aggregate
+- `aggregate_prefix_variable` (String) Variable name
+- `as_set_path` (Boolean) Set AS set path information
+- `as_set_path_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_neighbors`
+
+Read-Only:
+
+- `address` (String) Set IPv6 neighbor address
+- `address_families` (Attributes List) Set IPv6 BGP address family (see [below for nested schema](#nestedatt--ipv6_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+- `ebgp_multihop_variable` (String) Variable name
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+- `send_extended_community_variable` (String) Variable name
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_neighbors.address_families`
+
+Read-Only:
+
+- `family_type` (String) Set IPv6 unicast address family
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_networks`
+
+Read-Only:
+
+- `network_prefix` (String) Configure the prefixes for BGP to announce
+- `network_prefix_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_redistributes`
+
+Read-Only:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `mpls_interfaces`
+
+Read-Only:
+
+- `interface_name` (String) Interface Name
+- `interface_name_variable` (String) Variable name
diff --git a/docs/data-sources/transport_routing_bgp_profile_parcel.md b/docs/data-sources/transport_routing_bgp_profile_parcel.md
deleted file mode 100644
index 6c06b7488..000000000
--- a/docs/data-sources/transport_routing_bgp_profile_parcel.md
+++ /dev/null
@@ -1,274 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_routing_bgp_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport Routing BGP profile parcel.
----
-
-# sdwan_transport_routing_bgp_profile_parcel (Data Source)
-
-This data source can read the Transport Routing BGP profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_routing_bgp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `always_compare_med` (Boolean) Compare MEDs from all ASs when selecting active BGP paths
-- `always_compare_med_variable` (String) Variable name
-- `as_number` (Number) Set autonomous system number <1..4294967295> or
-- `as_number_variable` (String) Variable name
-- `compare_router_id` (Boolean) Compare router IDs when selecting active BGP paths
-- `compare_router_id_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `deterministic_med` (Boolean) Compare MEDs from all routes from same AS when selecting active BGP paths
-- `deterministic_med_variable` (String) Variable name
-- `external_routes_distance` (Number) Set administrative distance for external BGP routes
-- `external_routes_distance_variable` (String) Variable name
-- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
-- `hold_time_variable` (String) Variable name
-- `internal_routes_distance` (Number) Set administrative distance for internal BGP routes
-- `internal_routes_distance_variable` (String) Variable name
-- `ipv4_aggregate_addresses` (Attributes List) Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv4_aggregate_addresses))
-- `ipv4_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
-- `ipv4_eibgp_maximum_paths_variable` (String) Variable name
-- `ipv4_neighbors` (Attributes List) Set BGP IPv4 neighbors (see [below for nested schema](#nestedatt--ipv4_neighbors))
-- `ipv4_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv4_networks))
-- `ipv4_originate` (Boolean) BGP Default Information Originate
-- `ipv4_originate_variable` (String) Variable name
-- `ipv4_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv4_redistributes))
-- `ipv4_table_map_filter` (Boolean) Table map filtered or not
-- `ipv4_table_map_filter_variable` (String) Variable name
-- `ipv4_table_map_route_policy_id` (String)
-- `ipv6_aggregate_addresses` (Attributes List) IPv6 Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv6_aggregate_addresses))
-- `ipv6_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
-- `ipv6_eibgp_maximum_paths_variable` (String) Variable name
-- `ipv6_neighbors` (Attributes List) Set BGP IPv6 neighbors (see [below for nested schema](#nestedatt--ipv6_neighbors))
-- `ipv6_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv6_networks))
-- `ipv6_originate` (Boolean) BGP Default Information Originate
-- `ipv6_originate_variable` (String) Variable name
-- `ipv6_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv6_redistributes))
-- `ipv6_table_map_filter` (Boolean) Table map filtered or not
-- `ipv6_table_map_filter_variable` (String) Variable name
-- `ipv6_table_map_route_policy_id` (String)
-- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
-- `keepalive_time_variable` (String) Variable name
-- `local_routes_distance` (Number) Set administrative distance for local BGP routes
-- `local_routes_distance_variable` (String) Variable name
-- `missing_med_as_worst` (Boolean) If path has no MED, consider it to be worst path when selecting active BGP paths
-- `missing_med_as_worst_variable` (String) Variable name
-- `mpls_interfaces` (Attributes List) MPLS BGP Interface (see [below for nested schema](#nestedatt--mpls_interfaces))
-- `multipath_relax` (Boolean) Ignore AS for multipath selection
-- `multipath_relax_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `propagate_as_path` (Boolean) Propagate AS Path
-- `propagate_as_path_variable` (String) Variable name
-- `propagate_community` (Boolean) Propagate Community
-- `propagate_community_variable` (String) Variable name
-- `router_id` (String) Configure BGP router identifier
-- `router_id_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `ipv4_aggregate_addresses`
-
-Read-Only:
-
-- `as_set_path` (Boolean) Set AS set path information
-- `as_set_path_variable` (String) Variable name
-- `network_address` (String)
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String)
-- `subnet_mask_variable` (String) Variable name
-- `summary_only` (Boolean) Filter out more specific routes from updates
-- `summary_only_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_neighbors`
-
-Read-Only:
-
-- `address` (String) Set neighbor address
-- `address_families` (Attributes List) Set BGP address family (see [below for nested schema](#nestedatt--ipv4_neighbors--address_families))
-- `address_variable` (String) Variable name
-- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
-- `allowas_in_number_variable` (String) Variable name
-- `as_override` (Boolean) Override matching AS-number while sending update
-- `as_override_variable` (String) Variable name
-- `description` (String) Set description
-- `description_variable` (String) Variable name
-- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
-- `ebgp_multihop_variable` (String) Variable name
-- `explicit_null` (Boolean) Send explicit null label
-- `explicit_null_variable` (String) Variable name
-- `hold_time` (Number) Set how long to wait since receiving a keepalive message to consider BGP peer unavailable
-- `hold_time_variable` (String) Variable name
-- `keepalive_time` (Number) Set how often to advertise keepalive messages to BGP peer
-- `keepalive_time_variable` (String) Variable name
-- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
-- `local_as_variable` (String) Variable name
-- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
-- `next_hop_self_variable` (String) Variable name
-- `password` (String) Set MD5 password on TCP connection with BGP peer
-- `password_variable` (String) Variable name
-- `remote_as` (Number) Set remote autonomous system number
-- `remote_as_variable` (String) Variable name
-- `send_community` (Boolean) Send community attribute
-- `send_community_variable` (String) Variable name
-- `send_extended_community` (Boolean) Send extended community attribute
-- `send_extended_community_variable` (String) Variable name
-- `send_label` (Boolean) Send label
-- `shutdown` (Boolean) Enable or disable a BGP neighbor
-- `shutdown_variable` (String) Variable name
-- `update_source_interface` (String) Source interface name for BGP neighbor
-- `update_source_interface_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_neighbors.address_families`
-
-Read-Only:
-
-- `family_type` (String) Set IPv4 unicast address family
-- `in_route_policy_id` (String)
-- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
-- `max_number_of_prefixes_variable` (String) Variable name
-- `out_route_policy_id` (String)
-- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
-- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
-- `restart_interval_variable` (String) Variable name
-- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
-- `threshold_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv4_networks`
-
-Read-Only:
-
-- `network_address` (String)
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String)
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_redistributes`
-
-Read-Only:
-
-- `protocol` (String) Set the protocol to redistribute routes from
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-
-### Nested Schema for `ipv6_aggregate_addresses`
-
-Read-Only:
-
-- `aggregate_prefix` (String) Configure the IPv6 prefixes to aggregate
-- `aggregate_prefix_variable` (String) Variable name
-- `as_set_path` (Boolean) Set AS set path information
-- `as_set_path_variable` (String) Variable name
-- `summary_only` (Boolean) Filter out more specific routes from updates
-- `summary_only_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_neighbors`
-
-Read-Only:
-
-- `address` (String) Set IPv6 neighbor address
-- `address_families` (Attributes List) Set IPv6 BGP address family (see [below for nested schema](#nestedatt--ipv6_neighbors--address_families))
-- `address_variable` (String) Variable name
-- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
-- `allowas_in_number_variable` (String) Variable name
-- `as_override` (Boolean) Override matching AS-number while sending update
-- `as_override_variable` (String) Variable name
-- `description` (String) Set description
-- `description_variable` (String) Variable name
-- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
-- `ebgp_multihop_variable` (String) Variable name
-- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
-- `hold_time_variable` (String) Variable name
-- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
-- `keepalive_time_variable` (String) Variable name
-- `local_as` (Number) Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
-- `local_as_variable` (String) Variable name
-- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
-- `next_hop_self_variable` (String) Variable name
-- `password` (String) Set MD5 password on TCP connection with BGP peer
-- `password_variable` (String) Variable name
-- `remote_as` (Number) Set remote autonomous system number
-- `remote_as_variable` (String) Variable name
-- `send_community` (Boolean) Send community attribute
-- `send_community_variable` (String) Variable name
-- `send_extended_community` (Boolean) Send extended community attribute
-- `send_extended_community_variable` (String) Variable name
-- `shutdown` (Boolean) Enable or disable a BGP neighbor
-- `shutdown_variable` (String) Variable name
-- `update_source_interface` (String) Source interface name for BGP neighbor
-- `update_source_interface_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_neighbors.address_families`
-
-Read-Only:
-
-- `family_type` (String) Set IPv6 unicast address family
-- `in_route_policy_id` (String)
-- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
-- `max_number_of_prefixes_variable` (String) Variable name
-- `out_route_policy_id` (String)
-- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
-- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
-- `restart_interval_variable` (String) Variable name
-- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
-- `threshold_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_networks`
-
-Read-Only:
-
-- `network_prefix` (String) Configure the prefixes for BGP to announce
-- `network_prefix_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_redistributes`
-
-Read-Only:
-
-- `protocol` (String) Set the protocol to redistribute routes from
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-
-### Nested Schema for `mpls_interfaces`
-
-Read-Only:
-
-- `interface_name` (String) Interface Name
-- `interface_name_variable` (String) Variable name
diff --git a/docs/data-sources/transport_routing_ospf_feature.md b/docs/data-sources/transport_routing_ospf_feature.md
new file mode 100644
index 000000000..9e904e240
--- /dev/null
+++ b/docs/data-sources/transport_routing_ospf_feature.md
@@ -0,0 +1,142 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_ospf_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Routing OSPF Feature.
+---
+
+# sdwan_transport_routing_ospf_feature (Data Source)
+
+This data source can read the Transport Routing OSPF Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_routing_ospf_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `areas` (Attributes List) Configure OSPF area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+- `default_information_originate_metric_type` (String) Set default route type
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance_external` (Number) Set distance for external routes
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+- `distance_intra_area_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsas` (Attributes List) Advertise own router LSA with infinite distance (see [below for nested schema](#nestedatt--router_lsas))
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+- `spf_maximum_hold_time_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Read-Only:
+
+- `area_number` (Number) Set OSPF area number
+- `area_number_variable` (String) Variable name
+- `area_type` (String) set the area type
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject interarea routes into STUB or NSSA
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Read-Only:
+
+- `authentication_type` (String) Set OSPF interface authentication type
+- `authentication_type_variable` (String) Variable name
+- `cost` (Number) Set cost of OSPF interface
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+- `dead_interval_variable` (String) Variable name
+- `designated_router_priority` (Number) Set router’s priority to be elected as designated router
+- `designated_router_priority_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `message_digest_key` (String) Set MD5 authentication key
+- `message_digest_key_id` (Number) Set MD5 message digest key
+- `message_digest_key_id_variable` (String) Variable name
+- `message_digest_key_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Read-Only:
+
+- `cost` (Number) Set cost for this range
+- `cost_variable` (String) Variable name
+- `ip_address` (String) IP Address
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Read-Only:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `router_lsas`
+
+Read-Only:
+
+- `time` (Number) Set how long to advertise maximum metric after router starts up
+- `time_variable` (String) Variable name
+- `type` (String) Set the router LSA advertisement type
diff --git a/docs/data-sources/transport_routing_ospfv3_ipv4_feature.md b/docs/data-sources/transport_routing_ospfv3_ipv4_feature.md
new file mode 100644
index 000000000..d426180ce
--- /dev/null
+++ b/docs/data-sources/transport_routing_ospfv3_ipv4_feature.md
@@ -0,0 +1,137 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_ospfv3_ipv4_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Routing OSPFv3 IPv4 Feature.
+---
+
+# sdwan_transport_routing_ospfv3_ipv4_feature (Data Source)
+
+This data source can read the Transport Routing OSPFv3 IPv4 Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_routing_ospfv3_ipv4_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `areas` (Attributes List) Configure OSPFv3 IPv4 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+- `default_information_originate_metric_type` (String) Set default route metric type
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+- `distance_external` (Number) Set distance for external routes
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+- `filter_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+- `spf_maximum_hold_time_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Read-Only:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Read-Only:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+- `cost` (Number) Set cost of OSPF interface
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Read-Only:
+
+- `cost` (Number) Set cost for this range
+- `cost_variable` (String) Variable name
+- `ip_address` (String)
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String)
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Read-Only:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
diff --git a/docs/data-sources/transport_routing_ospfv3_ipv6_feature.md b/docs/data-sources/transport_routing_ospfv3_ipv6_feature.md
new file mode 100644
index 000000000..8b1debd45
--- /dev/null
+++ b/docs/data-sources/transport_routing_ospfv3_ipv6_feature.md
@@ -0,0 +1,133 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_ospfv3_ipv6_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Routing OSPFv3 IPv6 Feature.
+---
+
+# sdwan_transport_routing_ospfv3_ipv6_feature (Data Source)
+
+This data source can read the Transport Routing OSPFv3 IPv6 Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_routing_ospfv3_ipv6_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `areas` (Attributes List) Configure OSPFv3 IPv6 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+- `default_information_originate_metric_type` (String) Set default route metric type
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+- `distance_external` (Number) Set distance for external routes
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+- `filter_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+- `spf_maximum_hold_time_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Read-Only:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Read-Only:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+- `cost` (Number) Set cost of OSPF interface
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Read-Only:
+
+- `cost` (Number) Set cost for this range
+- `cost_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+- `no_advertise_variable` (String) Variable name
+- `prefix` (String) IPv6 prefix,for example 2001::/64
+- `prefix_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Read-Only:
+
+- `protocol` (String) Set the protocol
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
diff --git a/docs/data-sources/transport_tracker_feature.md b/docs/data-sources/transport_tracker_feature.md
new file mode 100644
index 000000000..a4896d691
--- /dev/null
+++ b/docs/data-sources/transport_tracker_feature.md
@@ -0,0 +1,52 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_tracker_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Tracker Feature.
+---
+
+# sdwan_transport_tracker_feature (Data Source)
+
+This data source can read the Transport Tracker Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `endpoint_api_url` (String) API url of endpoint
+- `endpoint_api_url_variable` (String) Variable name
+- `endpoint_dns_name` (String) Endpoint DNS Name
+- `endpoint_dns_name_variable` (String) Variable name
+- `endpoint_ip` (String) Endpoint IP
+- `endpoint_ip_variable` (String) Variable name
+- `endpoint_tracker_type` (String) Endpoint Tracker Type
+- `endpoint_tracker_type_variable` (String) Variable name
+- `interval` (Number) Interval
+- `interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+- `multiplier_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `threshold` (Number) Threshold
+- `threshold_variable` (String) Variable name
+- `tracker_name` (String) Tracker Name
+- `tracker_name_variable` (String) Variable name
+- `tracker_type` (String) Tracker Type
+- `tracker_type_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/transport_tracker_group_feature.md b/docs/data-sources/transport_tracker_group_feature.md
new file mode 100644
index 000000000..043fda90c
--- /dev/null
+++ b/docs/data-sources/transport_tracker_group_feature.md
@@ -0,0 +1,44 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_tracker_group_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport Tracker Group Feature.
+---
+
+# sdwan_transport_tracker_group_feature (Data Source)
+
+This data source can read the Transport Tracker Group Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `name` (String) The name of the Feature
+- `tracker_boolean` (String) tracker ref list combine boolean and or
+- `tracker_boolean_variable` (String) Variable name
+- `tracker_elements` (Attributes List) tracker parcel ref list (see [below for nested schema](#nestedatt--tracker_elements))
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Read-Only:
+
+- `tracker_id` (String)
diff --git a/docs/data-sources/transport_wan_vpn_feature.md b/docs/data-sources/transport_wan_vpn_feature.md
new file mode 100644
index 000000000..5c17b40c2
--- /dev/null
+++ b/docs/data-sources/transport_wan_vpn_feature.md
@@ -0,0 +1,133 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport WAN VPN Feature.
+---
+
+# sdwan_transport_wan_vpn_feature (Data Source)
+
+This data source can read the Transport WAN VPN Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_wan_vpn_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+
+### Read-Only
+
+- `description` (String) The description of the Feature
+- `enhance_ecmp_keying` (Boolean) Enhance ECMP Keying
+- `enhance_ecmp_keying_variable` (String) Variable name
+- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
+- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
+- `name` (String) The name of the Feature
+- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
+- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
+- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
+- `primary_dns_address_ipv4_variable` (String) Variable name
+- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
+- `primary_dns_address_ipv6_variable` (String) Variable name
+- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
+- `secondary_dns_address_ipv4_variable` (String) Variable name
+- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
+- `secondary_dns_address_ipv6_variable` (String) Variable name
+- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
+- `version` (Number) The version of the Feature
+- `vpn` (Number) VPN
+
+
+### Nested Schema for `ipv4_static_routes`
+
+Read-Only:
+
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+- `gateway` (String) Gateway
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_static_routes.next_hops`
+
+Read-Only:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_static_routes`
+
+Read-Only:
+
+- `nat` (String) IPv6 Nat
+- `nat_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
+- `null0` (Boolean) IPv6 Route Gateway Next Hop
+- `prefix` (String) Prefix
+- `prefix_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_static_routes.next_hops`
+
+Read-Only:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `nat_64_v4_pools`
+
+Read-Only:
+
+- `nat64_v4_pool_name` (String) NAT64 v4 Pool Name
+- `nat64_v4_pool_name_variable` (String) Variable name
+- `nat64_v4_pool_overload` (Boolean) NAT64 Overload
+- `nat64_v4_pool_overload_variable` (String) Variable name
+- `nat64_v4_pool_range_end` (String) NAT64 Pool Range End
+- `nat64_v4_pool_range_end_variable` (String) Variable name
+- `nat64_v4_pool_range_start` (String) NAT64 Pool Range Start
+- `nat64_v4_pool_range_start_variable` (String) Variable name
+
+
+
+### Nested Schema for `new_host_mappings`
+
+Read-Only:
+
+- `host_name` (String) Hostname
+- `host_name_variable` (String) Variable name
+- `list_of_ip_addresses` (Set of String) List of IP
+- `list_of_ip_addresses_variable` (String) Variable name
+
+
+
+### Nested Schema for `services`
+
+Read-Only:
+
+- `service_type` (String) Service Type
diff --git a/docs/data-sources/transport_wan_vpn_interface_cellular_feature.md b/docs/data-sources/transport_wan_vpn_interface_cellular_feature.md
new file mode 100644
index 000000000..104bd9b7a
--- /dev/null
+++ b/docs/data-sources/transport_wan_vpn_interface_cellular_feature.md
@@ -0,0 +1,182 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_cellular_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport WAN VPN Interface Cellular Feature.
+---
+
+# sdwan_transport_wan_vpn_interface_cellular_feature (Data Source)
+
+This data source can read the Transport WAN VPN Interface Cellular Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_wan_vpn_interface_cellular_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+
+### Read-Only
+
+- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
+- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
+- `bandwidth_downstream_variable` (String) Variable name
+- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
+- `bandwidth_upstream_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `nat_ipv4` (Boolean) Network Address Translation on this interface
+- `nat_ipv4_variable` (String) Variable name
+- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
+- `nat_tcp_timeout_variable` (String) Variable name
+- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
+- `nat_udp_timeout_variable` (String) Variable name
+- `per_tunnel_qos` (Boolean) Per-tunnel Qos
+- `per_tunnel_qos_variable` (String) Variable name
+- `qos_adaptive` (Boolean) Adaptive QoS
+- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
+- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
+- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
+- `qos_adaptive_default_downstream_variable` (String) Variable name
+- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
+- `qos_adaptive_default_upstream_variable` (String) Variable name
+- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
+- `qos_adaptive_max_downstream_variable` (String) Variable name
+- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
+- `qos_adaptive_max_upstream_variable` (String) Variable name
+- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
+- `qos_adaptive_min_downstream_variable` (String) Variable name
+- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
+- `qos_adaptive_min_upstream_variable` (String) Variable name
+- `qos_adaptive_period` (Number) Adapt Period(Minutes)
+- `qos_adaptive_period_variable` (String) Variable name
+- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
+- `qos_shaping_rate_variable` (String) Variable name
+- `service_provider` (String) Service Provider Name
+- `service_provider_variable` (String) Variable name
+- `shutdown` (Boolean)
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
+- `tloc_extension_variable` (String) Variable name
+- `tracker` (String) Enable tracker for this interface
+- `tracker_variable` (String) Variable name
+- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
+- `tunnel_bandwidth_percent_variable` (String) Variable name
+- `tunnel_interface` (Boolean) Tunnel Interface on/off
+- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
+- `tunnel_interface_allow_all_variable` (String) Variable name
+- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
+- `tunnel_interface_allow_bfd_variable` (String) Variable name
+- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
+- `tunnel_interface_allow_bgp_variable` (String) Variable name
+- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
+- `tunnel_interface_allow_dhcp_variable` (String) Variable name
+- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
+- `tunnel_interface_allow_dns_variable` (String) Variable name
+- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
+- `tunnel_interface_allow_https_variable` (String) Variable name
+- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
+- `tunnel_interface_allow_icmp_variable` (String) Variable name
+- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
+- `tunnel_interface_allow_netconf_variable` (String) Variable name
+- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
+- `tunnel_interface_allow_ntp_variable` (String) Variable name
+- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
+- `tunnel_interface_allow_ospf_variable` (String) Variable name
+- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
+- `tunnel_interface_allow_snmp_variable` (String) Variable name
+- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
+- `tunnel_interface_allow_ssh_variable` (String) Variable name
+- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
+- `tunnel_interface_allow_stun_variable` (String) Variable name
+- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
+- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
+- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
+- `tunnel_interface_border_variable` (String) Variable name
+- `tunnel_interface_carrier` (String) Set carrier for TLOC
+- `tunnel_interface_carrier_variable` (String) Variable name
+- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
+- `tunnel_interface_color` (String) Set color for TLOC
+- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
+- `tunnel_interface_color_restrict_variable` (String) Variable name
+- `tunnel_interface_color_variable` (String) Variable name
+- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
+- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
+- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
+- `tunnel_interface_groups` (Number) List of groups
+- `tunnel_interface_groups_variable` (String) Variable name
+- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
+- `tunnel_interface_hello_interval_variable` (String) Variable name
+- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
+- `tunnel_interface_hello_tolerance_variable` (String) Variable name
+- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
+- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
+- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
+- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
+- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
+- `tunnel_interface_max_control_connections_variable` (String) Variable name
+- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
+- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
+- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
+- `tunnel_interface_network_broadcast_variable` (String) Variable name
+- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
+- `tunnel_interface_port_hop_variable` (String) Variable name
+- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
+- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
+- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
+- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
+- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
+- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
+- `tunnel_qos_mode` (String) Set tunnel QoS mode
+- `tunnel_qos_mode_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arps`
+
+Read-Only:
+
+- `ip_address` (String) IP V4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `tunnel_interface_encapsulations`
+
+Read-Only:
+
+- `encapsulation` (String) Encapsulation
+- `preference` (Number) Set preference for TLOC
+- `preference_variable` (String) Variable name
+- `weight` (Number) Set weight for TLOC
+- `weight_variable` (String) Variable name
diff --git a/docs/data-sources/transport_wan_vpn_interface_cellular_profile_parcel.md b/docs/data-sources/transport_wan_vpn_interface_cellular_profile_parcel.md
deleted file mode 100644
index bc0170952..000000000
--- a/docs/data-sources/transport_wan_vpn_interface_cellular_profile_parcel.md
+++ /dev/null
@@ -1,182 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_cellular_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport WAN VPN Interface Cellular profile parcel.
----
-
-# sdwan_transport_wan_vpn_interface_cellular_profile_parcel (Data Source)
-
-This data source can read the Transport WAN VPN Interface Cellular profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-
-### Read-Only
-
-- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
-- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
-- `bandwidth_downstream_variable` (String) Variable name
-- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
-- `bandwidth_upstream_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `nat_ipv4` (Boolean) Network Address Translation on this interface
-- `nat_ipv4_variable` (String) Variable name
-- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
-- `nat_tcp_timeout_variable` (String) Variable name
-- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
-- `nat_udp_timeout_variable` (String) Variable name
-- `per_tunnel_qos` (Boolean) Per-tunnel Qos
-- `per_tunnel_qos_variable` (String) Variable name
-- `qos_adaptive` (Boolean) Adaptive QoS
-- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
-- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
-- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
-- `qos_adaptive_default_downstream_variable` (String) Variable name
-- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
-- `qos_adaptive_default_upstream_variable` (String) Variable name
-- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
-- `qos_adaptive_max_downstream_variable` (String) Variable name
-- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
-- `qos_adaptive_max_upstream_variable` (String) Variable name
-- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
-- `qos_adaptive_min_downstream_variable` (String) Variable name
-- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
-- `qos_adaptive_min_upstream_variable` (String) Variable name
-- `qos_adaptive_period` (Number) Adapt Period(Minutes)
-- `qos_adaptive_period_variable` (String) Variable name
-- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
-- `qos_shaping_rate_variable` (String) Variable name
-- `service_provider` (String) Service Provider Name
-- `service_provider_variable` (String) Variable name
-- `shutdown` (Boolean)
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
-- `tloc_extension_variable` (String) Variable name
-- `tracker` (String) Enable tracker for this interface
-- `tracker_variable` (String) Variable name
-- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
-- `tunnel_bandwidth_percent_variable` (String) Variable name
-- `tunnel_interface` (Boolean) Tunnel Interface on/off
-- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
-- `tunnel_interface_allow_all_variable` (String) Variable name
-- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
-- `tunnel_interface_allow_bfd_variable` (String) Variable name
-- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
-- `tunnel_interface_allow_bgp_variable` (String) Variable name
-- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
-- `tunnel_interface_allow_dhcp_variable` (String) Variable name
-- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
-- `tunnel_interface_allow_dns_variable` (String) Variable name
-- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
-- `tunnel_interface_allow_https_variable` (String) Variable name
-- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
-- `tunnel_interface_allow_icmp_variable` (String) Variable name
-- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
-- `tunnel_interface_allow_netconf_variable` (String) Variable name
-- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
-- `tunnel_interface_allow_ntp_variable` (String) Variable name
-- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
-- `tunnel_interface_allow_ospf_variable` (String) Variable name
-- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
-- `tunnel_interface_allow_snmp_variable` (String) Variable name
-- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
-- `tunnel_interface_allow_ssh_variable` (String) Variable name
-- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
-- `tunnel_interface_allow_stun_variable` (String) Variable name
-- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
-- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
-- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
-- `tunnel_interface_border_variable` (String) Variable name
-- `tunnel_interface_carrier` (String) Set carrier for TLOC
-- `tunnel_interface_carrier_variable` (String) Variable name
-- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
-- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
-- `tunnel_interface_color` (String) Set color for TLOC
-- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
-- `tunnel_interface_color_restrict_variable` (String) Variable name
-- `tunnel_interface_color_variable` (String) Variable name
-- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
-- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
-- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
-- `tunnel_interface_groups` (Number) List of groups
-- `tunnel_interface_groups_variable` (String) Variable name
-- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
-- `tunnel_interface_hello_interval_variable` (String) Variable name
-- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
-- `tunnel_interface_hello_tolerance_variable` (String) Variable name
-- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
-- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
-- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
-- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
-- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
-- `tunnel_interface_max_control_connections_variable` (String) Variable name
-- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
-- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
-- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
-- `tunnel_interface_network_broadcast_variable` (String) Variable name
-- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
-- `tunnel_interface_port_hop_variable` (String) Variable name
-- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
-- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
-- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
-- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
-- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
-- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
-- `tunnel_qos_mode` (String) Set tunnel QoS mode
-- `tunnel_qos_mode_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arps`
-
-Read-Only:
-
-- `ip_address` (String) IP V4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `tunnel_interface_encapsulations`
-
-Read-Only:
-
-- `encapsulation` (String) Encapsulation
-- `preference` (Number) Set preference for TLOC
-- `preference_variable` (String) Variable name
-- `weight` (Number) Set weight for TLOC
-- `weight_variable` (String) Variable name
diff --git a/docs/data-sources/transport_wan_vpn_interface_ethernet_feature.md b/docs/data-sources/transport_wan_vpn_interface_ethernet_feature.md
new file mode 100644
index 000000000..d45d31ebe
--- /dev/null
+++ b/docs/data-sources/transport_wan_vpn_interface_ethernet_feature.md
@@ -0,0 +1,300 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_ethernet_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport WAN VPN Interface Ethernet Feature.
+---
+
+# sdwan_transport_wan_vpn_interface_ethernet_feature (Data Source)
+
+This data source can read the Transport WAN VPN Interface Ethernet Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+
+### Read-Only
+
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+- `arp_timeout_variable` (String) Variable name
+- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
+- `auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
+- `auto_detect_bandwidth_variable` (String) Variable name
+- `autonegotiate` (Boolean) Link autonegotiation
+- `autonegotiate_variable` (String) Variable name
+- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
+- `bandwidth_downstream_variable` (String) Variable name
+- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
+- `bandwidth_upstream_variable` (String) Variable name
+- `block_non_source_ip` (Boolean) Block packets originating from IP address that is not from this source
+- `block_non_source_ip_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `duplex` (String) Duplex mode
+- `duplex_variable` (String) Variable name
+- `enable_dhcpv6` (Boolean) Enable DHCPv6
+- `gre_tunnel_source_ip` (String) GRE tunnel source IP
+- `gre_tunnel_source_ip_variable` (String) Variable name
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+- `ip_mtu_variable` (String) Variable name
+- `iperf_server` (String) Iperf server for auto bandwidth detect
+- `iperf_server_variable` (String) Variable name
+- `ipv4_address` (String) IP Address
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_configuration_type` (String) IPv4 Configuration Type
+- `ipv4_dhcp_distance` (Number) DHCP Distance
+- `ipv4_dhcp_distance_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask` (String) Subnet Mask
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv6_address` (String) IPv6 Address Secondary
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_configuration_type` (String) IPv6 Configuration Type
+- `ipv6_dhcp_secondary_address` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_address))
+- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
+- `load_interval` (Number) Interval for interface load calculation
+- `load_interval_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+- `media_type` (String) Media type
+- `media_type_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `nat64` (Boolean) NAT64 on this interface
+- `nat66` (Boolean) NAT66 on this interface
+- `nat_ipv4` (Boolean) enable Network Address Translation on this interface
+- `nat_ipv4_variable` (String) Variable name
+- `nat_ipv6` (Boolean) enable Network Address Translation ipv6 on this interface
+- `nat_ipv6_variable` (String) Variable name
+- `nat_loopback` (String) NAT Inside Source Loopback Interface
+- `nat_loopback_variable` (String) Variable name
+- `nat_overload` (Boolean) NAT Overload
+- `nat_overload_variable` (String) Variable name
+- `nat_prefix_length` (Number) NAT Pool Prefix Length
+- `nat_prefix_length_variable` (String) Variable name
+- `nat_range_end` (String) NAT Pool Range End
+- `nat_range_end_variable` (String) Variable name
+- `nat_range_start` (String) NAT Pool Range Start
+- `nat_range_start_variable` (String) Variable name
+- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
+- `nat_tcp_timeout_variable` (String) Variable name
+- `nat_type` (String) NAT Type
+- `nat_type_variable` (String) Variable name
+- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
+- `nat_udp_timeout_variable` (String) Variable name
+- `new_static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--new_static_nats))
+- `per_tunnel_qos` (Boolean) Per-tunnel Qos
+- `per_tunnel_qos_variable` (String) Variable name
+- `qos_adaptive` (Boolean) Adaptive QoS
+- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
+- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
+- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
+- `qos_adaptive_default_downstream_variable` (String) Variable name
+- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
+- `qos_adaptive_default_upstream_variable` (String) Variable name
+- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
+- `qos_adaptive_max_downstream_variable` (String) Variable name
+- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
+- `qos_adaptive_max_upstream_variable` (String) Variable name
+- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
+- `qos_adaptive_min_downstream_variable` (String) Variable name
+- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
+- `qos_adaptive_min_upstream_variable` (String) Variable name
+- `qos_adaptive_period` (Number) Adapt Period(Minutes)
+- `qos_adaptive_period_variable` (String) Variable name
+- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
+- `qos_shaping_rate_variable` (String) Variable name
+- `service_provider` (String) Service Provider Name
+- `service_provider_variable` (String) Variable name
+- `shutdown` (Boolean)
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+- `speed_variable` (String) Variable name
+- `static_nat66` (Attributes List) static NAT66 (see [below for nested schema](#nestedatt--static_nat66))
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
+- `tloc_extension_variable` (String) Variable name
+- `tracker` (String) Enable tracker for this interface
+- `tracker_variable` (String) Variable name
+- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
+- `tunnel_bandwidth_percent_variable` (String) Variable name
+- `tunnel_interface` (Boolean) Tunnel Interface on/off
+- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
+- `tunnel_interface_allow_all_variable` (String) Variable name
+- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
+- `tunnel_interface_allow_bfd_variable` (String) Variable name
+- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
+- `tunnel_interface_allow_bgp_variable` (String) Variable name
+- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
+- `tunnel_interface_allow_dhcp_variable` (String) Variable name
+- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
+- `tunnel_interface_allow_dns_variable` (String) Variable name
+- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
+- `tunnel_interface_allow_https_variable` (String) Variable name
+- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
+- `tunnel_interface_allow_icmp_variable` (String) Variable name
+- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
+- `tunnel_interface_allow_netconf_variable` (String) Variable name
+- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
+- `tunnel_interface_allow_ntp_variable` (String) Variable name
+- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
+- `tunnel_interface_allow_ospf_variable` (String) Variable name
+- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
+- `tunnel_interface_allow_snmp_variable` (String) Variable name
+- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
+- `tunnel_interface_allow_ssh_variable` (String) Variable name
+- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
+- `tunnel_interface_allow_stun_variable` (String) Variable name
+- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
+- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
+- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
+- `tunnel_interface_border_variable` (String) Variable name
+- `tunnel_interface_carrier` (String) Set carrier for TLOC
+- `tunnel_interface_carrier_variable` (String) Variable name
+- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
+- `tunnel_interface_color` (String) Set color for TLOC
+- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
+- `tunnel_interface_color_restrict_variable` (String) Variable name
+- `tunnel_interface_color_variable` (String) Variable name
+- `tunnel_interface_cts_sgt_propagation` (Boolean) CTS SGT Propagation configuration
+- `tunnel_interface_cts_sgt_propagation_variable` (String) Variable name
+- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
+- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
+- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
+- `tunnel_interface_gre_tunnel_destination_ip` (String) GRE tunnel destination IP
+- `tunnel_interface_gre_tunnel_destination_ip_variable` (String) Variable name
+- `tunnel_interface_groups` (Number) List of groups
+- `tunnel_interface_groups_variable` (String) Variable name
+- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
+- `tunnel_interface_hello_interval_variable` (String) Variable name
+- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
+- `tunnel_interface_hello_tolerance_variable` (String) Variable name
+- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
+- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
+- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
+- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
+- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
+- `tunnel_interface_max_control_connections_variable` (String) Variable name
+- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
+- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
+- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
+- `tunnel_interface_network_broadcast_variable` (String) Variable name
+- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
+- `tunnel_interface_port_hop_variable` (String) Variable name
+- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
+- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
+- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
+- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
+- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
+- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
+- `tunnel_qos_mode` (String) Set tunnel QoS mode
+- `tunnel_qos_mode_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local WAN interface
+- `xconnect_variable` (String) Variable name
+
+
+### Nested Schema for `arps`
+
+Read-Only:
+
+- `ip_address` (String) IP V4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_dhcp_secondary_address`
+
+Read-Only:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_secondary_addresses`
+
+Read-Only:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `new_static_nats`
+
+Read-Only:
+
+- `direction` (String) Direction of static NAT translation
+- `source_ip` (String) Source IP address to be translated
+- `source_ip_variable` (String) Variable name
+- `source_vpn` (Number) Source VPN ID
+- `source_vpn_variable` (String) Variable name
+- `translated_ip` (String) Statically translated source IP address
+- `translated_ip_variable` (String) Variable name
+
+
+
+### Nested Schema for `static_nat66`
+
+Read-Only:
+
+- `source_prefix` (String) Source Prefix
+- `source_prefix_variable` (String) Variable name
+- `source_vpn_id` (Number) Source VPN ID
+- `source_vpn_id_variable` (String) Variable name
+- `translated_source_prefix` (String) Translated Source Prefix
+- `translated_source_prefix_variable` (String) Variable name
+
+
+
+### Nested Schema for `tunnel_interface_encapsulations`
+
+Read-Only:
+
+- `encapsulation` (String) Encapsulation
+- `preference` (Number) Set preference for TLOC
+- `preference_variable` (String) Variable name
+- `weight` (Number) Set weight for TLOC
+- `weight_variable` (String) Variable name
diff --git a/docs/data-sources/transport_wan_vpn_interface_ethernet_profile_parcel.md b/docs/data-sources/transport_wan_vpn_interface_ethernet_profile_parcel.md
deleted file mode 100644
index 886f99095..000000000
--- a/docs/data-sources/transport_wan_vpn_interface_ethernet_profile_parcel.md
+++ /dev/null
@@ -1,300 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport WAN VPN Interface Ethernet profile parcel.
----
-
-# sdwan_transport_wan_vpn_interface_ethernet_profile_parcel (Data Source)
-
-This data source can read the Transport WAN VPN Interface Ethernet profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-
-### Read-Only
-
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
-- `arp_timeout_variable` (String) Variable name
-- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
-- `auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
-- `auto_detect_bandwidth_variable` (String) Variable name
-- `autonegotiate` (Boolean) Link autonegotiation
-- `autonegotiate_variable` (String) Variable name
-- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
-- `bandwidth_downstream_variable` (String) Variable name
-- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
-- `bandwidth_upstream_variable` (String) Variable name
-- `block_non_source_ip` (Boolean) Block packets originating from IP address that is not from this source
-- `block_non_source_ip_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `duplex` (String) Duplex mode
-- `duplex_variable` (String) Variable name
-- `enable_dhcpv6` (Boolean) Enable DHCPv6
-- `gre_tunnel_source_ip` (String) GRE tunnel source IP
-- `gre_tunnel_source_ip_variable` (String) Variable name
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
-- `ip_mtu_variable` (String) Variable name
-- `iperf_server` (String) Iperf server for auto bandwidth detect
-- `iperf_server_variable` (String) Variable name
-- `ipv4_address` (String) IP Address
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_configuration_type` (String) IPv4 Configuration Type
-- `ipv4_dhcp_distance` (Number) DHCP Distance
-- `ipv4_dhcp_distance_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask` (String) Subnet Mask
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv6_address` (String) IPv6 Address Secondary
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_configuration_type` (String) IPv6 Configuration Type
-- `ipv6_dhcp_secondary_address` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_address))
-- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
-- `load_interval` (Number) Interval for interface load calculation
-- `load_interval_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-- `media_type` (String) Media type
-- `media_type_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `nat64` (Boolean) NAT64 on this interface
-- `nat66` (Boolean) NAT66 on this interface
-- `nat_ipv4` (Boolean) enable Network Address Translation on this interface
-- `nat_ipv4_variable` (String) Variable name
-- `nat_ipv6` (Boolean) enable Network Address Translation ipv6 on this interface
-- `nat_ipv6_variable` (String) Variable name
-- `nat_loopback` (String) NAT Inside Source Loopback Interface
-- `nat_loopback_variable` (String) Variable name
-- `nat_overload` (Boolean) NAT Overload
-- `nat_overload_variable` (String) Variable name
-- `nat_prefix_length` (Number) NAT Pool Prefix Length
-- `nat_prefix_length_variable` (String) Variable name
-- `nat_range_end` (String) NAT Pool Range End
-- `nat_range_end_variable` (String) Variable name
-- `nat_range_start` (String) NAT Pool Range Start
-- `nat_range_start_variable` (String) Variable name
-- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
-- `nat_tcp_timeout_variable` (String) Variable name
-- `nat_type` (String) NAT Type
-- `nat_type_variable` (String) Variable name
-- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
-- `nat_udp_timeout_variable` (String) Variable name
-- `new_static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--new_static_nats))
-- `per_tunnel_qos` (Boolean) Per-tunnel Qos
-- `per_tunnel_qos_variable` (String) Variable name
-- `qos_adaptive` (Boolean) Adaptive QoS
-- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
-- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
-- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
-- `qos_adaptive_default_downstream_variable` (String) Variable name
-- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
-- `qos_adaptive_default_upstream_variable` (String) Variable name
-- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
-- `qos_adaptive_max_downstream_variable` (String) Variable name
-- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
-- `qos_adaptive_max_upstream_variable` (String) Variable name
-- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
-- `qos_adaptive_min_downstream_variable` (String) Variable name
-- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
-- `qos_adaptive_min_upstream_variable` (String) Variable name
-- `qos_adaptive_period` (Number) Adapt Period(Minutes)
-- `qos_adaptive_period_variable` (String) Variable name
-- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
-- `qos_shaping_rate_variable` (String) Variable name
-- `service_provider` (String) Service Provider Name
-- `service_provider_variable` (String) Variable name
-- `shutdown` (Boolean)
-- `shutdown_variable` (String) Variable name
-- `speed` (String) Set interface speed
-- `speed_variable` (String) Variable name
-- `static_nat66` (Attributes List) static NAT66 (see [below for nested schema](#nestedatt--static_nat66))
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
-- `tloc_extension_variable` (String) Variable name
-- `tracker` (String) Enable tracker for this interface
-- `tracker_variable` (String) Variable name
-- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
-- `tunnel_bandwidth_percent_variable` (String) Variable name
-- `tunnel_interface` (Boolean) Tunnel Interface on/off
-- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
-- `tunnel_interface_allow_all_variable` (String) Variable name
-- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
-- `tunnel_interface_allow_bfd_variable` (String) Variable name
-- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
-- `tunnel_interface_allow_bgp_variable` (String) Variable name
-- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
-- `tunnel_interface_allow_dhcp_variable` (String) Variable name
-- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
-- `tunnel_interface_allow_dns_variable` (String) Variable name
-- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
-- `tunnel_interface_allow_https_variable` (String) Variable name
-- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
-- `tunnel_interface_allow_icmp_variable` (String) Variable name
-- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
-- `tunnel_interface_allow_netconf_variable` (String) Variable name
-- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
-- `tunnel_interface_allow_ntp_variable` (String) Variable name
-- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
-- `tunnel_interface_allow_ospf_variable` (String) Variable name
-- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
-- `tunnel_interface_allow_snmp_variable` (String) Variable name
-- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
-- `tunnel_interface_allow_ssh_variable` (String) Variable name
-- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
-- `tunnel_interface_allow_stun_variable` (String) Variable name
-- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
-- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
-- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
-- `tunnel_interface_border_variable` (String) Variable name
-- `tunnel_interface_carrier` (String) Set carrier for TLOC
-- `tunnel_interface_carrier_variable` (String) Variable name
-- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
-- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
-- `tunnel_interface_color` (String) Set color for TLOC
-- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
-- `tunnel_interface_color_restrict_variable` (String) Variable name
-- `tunnel_interface_color_variable` (String) Variable name
-- `tunnel_interface_cts_sgt_propagation` (Boolean) CTS SGT Propagation configuration
-- `tunnel_interface_cts_sgt_propagation_variable` (String) Variable name
-- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
-- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
-- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
-- `tunnel_interface_gre_tunnel_destination_ip` (String) GRE tunnel destination IP
-- `tunnel_interface_gre_tunnel_destination_ip_variable` (String) Variable name
-- `tunnel_interface_groups` (Number) List of groups
-- `tunnel_interface_groups_variable` (String) Variable name
-- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
-- `tunnel_interface_hello_interval_variable` (String) Variable name
-- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
-- `tunnel_interface_hello_tolerance_variable` (String) Variable name
-- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
-- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
-- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
-- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
-- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
-- `tunnel_interface_max_control_connections_variable` (String) Variable name
-- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
-- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
-- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
-- `tunnel_interface_network_broadcast_variable` (String) Variable name
-- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
-- `tunnel_interface_port_hop_variable` (String) Variable name
-- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
-- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
-- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
-- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
-- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
-- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
-- `tunnel_qos_mode` (String) Set tunnel QoS mode
-- `tunnel_qos_mode_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local WAN interface
-- `xconnect_variable` (String) Variable name
-
-
-### Nested Schema for `arps`
-
-Read-Only:
-
-- `ip_address` (String) IP V4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_dhcp_secondary_address`
-
-Read-Only:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_secondary_addresses`
-
-Read-Only:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `new_static_nats`
-
-Read-Only:
-
-- `direction` (String) Direction of static NAT translation
-- `source_ip` (String) Source IP address to be translated
-- `source_ip_variable` (String) Variable name
-- `source_vpn` (Number) Source VPN ID
-- `source_vpn_variable` (String) Variable name
-- `translated_ip` (String) Statically translated source IP address
-- `translated_ip_variable` (String) Variable name
-
-
-
-### Nested Schema for `static_nat66`
-
-Read-Only:
-
-- `source_prefix` (String) Source Prefix
-- `source_prefix_variable` (String) Variable name
-- `source_vpn_id` (Number) Source VPN ID
-- `source_vpn_id_variable` (String) Variable name
-- `translated_source_prefix` (String) Translated Source Prefix
-- `translated_source_prefix_variable` (String) Variable name
-
-
-
-### Nested Schema for `tunnel_interface_encapsulations`
-
-Read-Only:
-
-- `encapsulation` (String) Encapsulation
-- `preference` (Number) Set preference for TLOC
-- `preference_variable` (String) Variable name
-- `weight` (Number) Set weight for TLOC
-- `weight_variable` (String) Variable name
diff --git a/docs/data-sources/transport_wan_vpn_interface_gre_feature.md b/docs/data-sources/transport_wan_vpn_interface_gre_feature.md
new file mode 100644
index 000000000..f050f11bb
--- /dev/null
+++ b/docs/data-sources/transport_wan_vpn_interface_gre_feature.md
@@ -0,0 +1,64 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_gre_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport WAN VPN Interface GRE Feature.
+---
+
+# sdwan_transport_wan_vpn_interface_gre_feature (Data Source)
+
+This data source can read the Transport WAN VPN Interface GRE Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_wan_vpn_interface_gre_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+
+### Read-Only
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name` (String) Interface name (1..255)
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String)
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `shutdown` (Boolean) Administrative state
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
+- `tunnel_route_via_loopback_variable` (String) Variable name
+- `tunnel_source_interface` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback_variable` (String) Variable name
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/transport_wan_vpn_interface_gre_profile_parcel.md b/docs/data-sources/transport_wan_vpn_interface_gre_profile_parcel.md
deleted file mode 100644
index 89cc65967..000000000
--- a/docs/data-sources/transport_wan_vpn_interface_gre_profile_parcel.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_gre_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport WAN VPN Interface GRE profile parcel.
----
-
-# sdwan_transport_wan_vpn_interface_gre_profile_parcel (Data Source)
-
-This data source can read the Transport WAN VPN Interface GRE profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-
-### Read-Only
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name` (String) Interface name (1..255)
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String)
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String)
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `shutdown` (Boolean) Administrative state
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
-- `tunnel_route_via_loopback_variable` (String) Variable name
-- `tunnel_source_interface` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback_variable` (String) Variable name
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/transport_wan_vpn_interface_ipsec_feature.md b/docs/data-sources/transport_wan_vpn_interface_ipsec_feature.md
new file mode 100644
index 000000000..6b72e2b12
--- /dev/null
+++ b/docs/data-sources/transport_wan_vpn_interface_ipsec_feature.md
@@ -0,0 +1,95 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_ipsec_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport WAN VPN Interface IPSEC Feature.
+---
+
+# sdwan_transport_wan_vpn_interface_ipsec_feature (Data Source)
+
+This data source can read the Transport WAN VPN Interface IPSEC Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_wan_vpn_interface_ipsec_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+
+### Read-Only
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `dpd_interval` (Number) IKE keepalive interval (seconds)
+- `dpd_interval_variable` (String) Variable name
+- `dpd_retries` (Number) IKE keepalive retries
+- `dpd_retries_variable` (String) Variable name
+- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
+- `ike_ciphersuite_variable` (String) Variable name
+- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
+- `ike_diffie_hellman_group_variable` (String) Variable name
+- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_local_end_point_variable` (String) Variable name
+- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_remote_end_point_variable` (String) Variable name
+- `ike_integrity_protocol` (String) IKE integrity protocol
+- `ike_integrity_protocol_variable` (String) Variable name
+- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
+- `ike_preshared_key_variable` (String) Variable name
+- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
+- `ike_rekey_interval_variable` (String) Variable name
+- `ike_version` (Number) IKE Version <1..2>
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name` (String) Interface name: IPsec when present
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
+- `ip_mtu_variable` (String) Variable name
+- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
+- `ipsec_ciphersuite_variable` (String) Variable name
+- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
+- `ipsec_rekey_interval_variable` (String) Variable name
+- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
+- `ipsec_replay_window_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String)
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
+- `perfect_forward_secrecy_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tracker_id` (String) Enable tracker for this interface
+- `tracker_id_variable` (String) Variable name
+- `tunnel_destination_ipv4_address` (String)
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_destination_ipv4_subnet_mask` (String)
+- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
+- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_route_via_variable` (String) Variable name
+- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address` (String)
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+- `tunnel_source_ipv4_subnet_mask` (String)
+- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
+- `version` (Number) The version of the Feature
diff --git a/docs/data-sources/transport_wan_vpn_interface_ipsec_profile_parcel.md b/docs/data-sources/transport_wan_vpn_interface_ipsec_profile_parcel.md
deleted file mode 100644
index 6505fc8c2..000000000
--- a/docs/data-sources/transport_wan_vpn_interface_ipsec_profile_parcel.md
+++ /dev/null
@@ -1,95 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport WAN VPN Interface IPSEC profile parcel.
----
-
-# sdwan_transport_wan_vpn_interface_ipsec_profile_parcel (Data Source)
-
-This data source can read the Transport WAN VPN Interface IPSEC profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-
-### Read-Only
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `dpd_interval` (Number) IKE keepalive interval (seconds)
-- `dpd_interval_variable` (String) Variable name
-- `dpd_retries` (Number) IKE keepalive retries
-- `dpd_retries_variable` (String) Variable name
-- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
-- `ike_ciphersuite_variable` (String) Variable name
-- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
-- `ike_diffie_hellman_group_variable` (String) Variable name
-- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_local_end_point_variable` (String) Variable name
-- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_remote_end_point_variable` (String) Variable name
-- `ike_integrity_protocol` (String) IKE integrity protocol
-- `ike_integrity_protocol_variable` (String) Variable name
-- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
-- `ike_preshared_key_variable` (String) Variable name
-- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
-- `ike_rekey_interval_variable` (String) Variable name
-- `ike_version` (Number) IKE Version <1..2>
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name` (String) Interface name: IPsec when present
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
-- `ip_mtu_variable` (String) Variable name
-- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
-- `ipsec_ciphersuite_variable` (String) Variable name
-- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
-- `ipsec_rekey_interval_variable` (String) Variable name
-- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
-- `ipsec_replay_window_variable` (String) Variable name
-- `ipv4_address` (String)
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String)
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
-- `perfect_forward_secrecy_variable` (String) Variable name
-- `shutdown` (Boolean) Administrative state
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tracker_id` (String) Enable tracker for this interface
-- `tracker_id_variable` (String) Variable name
-- `tunnel_destination_ipv4_address` (String)
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_destination_ipv4_subnet_mask` (String)
-- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
-- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_route_via_variable` (String) Variable name
-- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address` (String)
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-- `tunnel_source_ipv4_subnet_mask` (String)
-- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
diff --git a/docs/data-sources/transport_wan_vpn_interface_t1_e1_serial_feature.md b/docs/data-sources/transport_wan_vpn_interface_t1_e1_serial_feature.md
new file mode 100644
index 000000000..6e714f448
--- /dev/null
+++ b/docs/data-sources/transport_wan_vpn_interface_t1_e1_serial_feature.md
@@ -0,0 +1,147 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature Data Source - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This data source can read the Transport WAN VPN Interface T1 E1 Serial Feature.
+---
+
+# sdwan_transport_wan_vpn_interface_t1_e1_serial_feature (Data Source)
+
+This data source can read the Transport WAN VPN Interface T1 E1 Serial Feature.
+
+## Example Usage
+
+```terraform
+data "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `id` (String) The id of the Feature
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+
+### Read-Only
+
+- `bandwidth` (Number) Interface bandwidth capacity, in kbps
+- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
+- `bandwidth_downstream_variable` (String) Variable name
+- `bandwidth_variable` (String) Variable name
+- `clock_rate` (String) Set preference for interface Clock speed
+- `clock_rate_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `encapsulation` (String) Configure Encapsulation for interface
+- `encapsulation_variable` (String) Variable name
+- `interface_name` (String) Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Set ip mtu
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String)
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv6_address` (String) Assign IPv6 address
+- `ipv6_address_variable` (String) Variable name
+- `mtu` (Number) Interface MTU <68...2000>, in bytes
+- `mtu_variable` (String) Variable name
+- `name` (String) The name of the Feature
+- `per_tunnel_qos` (Boolean) Per-tunnel Qos
+- `per_tunnel_qos_aggregator` (Boolean) Per-tunnel QoS Aggregator
+- `per_tunnel_qos_aggregator_variable` (String) Variable name
+- `per_tunnel_qos_variable` (String) Variable name
+- `qos_shaping_rate` (Number) 1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps
+- `qos_shaping_rate_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+- `tcp_mss_variable` (String) Variable name
+- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
+- `tloc_extension_variable` (String) Variable name
+- `tunnel_interface` (Boolean) Tunnel Interface
+- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
+- `tunnel_interface_allow_all_variable` (String) Variable name
+- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
+- `tunnel_interface_allow_bfd_variable` (String) Variable name
+- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
+- `tunnel_interface_allow_bgp_variable` (String) Variable name
+- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
+- `tunnel_interface_allow_dhcp_variable` (String) Variable name
+- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
+- `tunnel_interface_allow_dns_variable` (String) Variable name
+- `tunnel_interface_allow_https` (Boolean) Allow/Deny Https
+- `tunnel_interface_allow_https_variable` (String) Variable name
+- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
+- `tunnel_interface_allow_icmp_variable` (String) Variable name
+- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
+- `tunnel_interface_allow_netconf_variable` (String) Variable name
+- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
+- `tunnel_interface_allow_ntp_variable` (String) Variable name
+- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
+- `tunnel_interface_allow_ospf_variable` (String) Variable name
+- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
+- `tunnel_interface_allow_snmp_variable` (String) Variable name
+- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
+- `tunnel_interface_allow_ssh_variable` (String) Variable name
+- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
+- `tunnel_interface_allow_stun_variable` (String) Variable name
+- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
+- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
+- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
+- `tunnel_interface_border_variable` (String) Variable name
+- `tunnel_interface_carrier` (String) Set carrier for TLOC
+- `tunnel_interface_carrier_variable` (String) Variable name
+- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
+- `tunnel_interface_clear_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts)
+- `tunnel_interface_clear_network_broadcast_variable` (String) Variable name
+- `tunnel_interface_color` (String) Set color for TLOC
+- `tunnel_interface_color_variable` (String) Variable name
+- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
+- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list
+- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
+- `tunnel_interface_groups` (Number) List of groups
+- `tunnel_interface_groups_variable` (String) Variable name
+- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
+- `tunnel_interface_hello_interval_variable` (String) Variable name
+- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
+- `tunnel_interface_hello_tolerance_variable` (String) Variable name
+- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
+- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
+- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
+- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
+- `tunnel_interface_max_control_connections` (Number) Set the maximum number of control connections for this TLOC
+- `tunnel_interface_max_control_connections_variable` (String) Variable name
+- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
+- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
+- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
+- `tunnel_interface_port_hop_variable` (String) Variable name
+- `tunnel_interface_restrict` (Boolean) Restrict this TLOC behavior
+- `tunnel_interface_restrict_variable` (String) Variable name
+- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
+- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
+- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
+- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
+- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
+- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
+- `tunnel_qos_mode` (String) Set tunnel QoS mode
+- `tunnel_qos_mode_variable` (String) Variable name
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tunnel_interface_encapsulations`
+
+Read-Only:
+
+- `encapsulation` (String) Encapsulation
+- `preference` (Number) Set preference for TLOC
+- `preference_variable` (String) Variable name
+- `weight` (Number) Set weight for TLOC
+- `weight_variable` (String) Variable name
diff --git a/docs/data-sources/transport_wan_vpn_interface_t1_e1_serial_profile_parcel.md b/docs/data-sources/transport_wan_vpn_interface_t1_e1_serial_profile_parcel.md
deleted file mode 100644
index 2f71f556c..000000000
--- a/docs/data-sources/transport_wan_vpn_interface_t1_e1_serial_profile_parcel.md
+++ /dev/null
@@ -1,147 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport WAN VPN Interface T1 E1 Serial profile parcel.
----
-
-# sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel (Data Source)
-
-This data source can read the Transport WAN VPN Interface T1 E1 Serial profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-
-### Read-Only
-
-- `bandwidth` (Number) Interface bandwidth capacity, in kbps
-- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
-- `bandwidth_downstream_variable` (String) Variable name
-- `bandwidth_variable` (String) Variable name
-- `clock_rate` (String) Set preference for interface Clock speed
-- `clock_rate_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `encapsulation` (String) Configure Encapsulation for interface
-- `encapsulation_variable` (String) Variable name
-- `interface_name` (String) Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Set ip mtu
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String)
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String)
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv6_address` (String) Assign IPv6 address
-- `ipv6_address_variable` (String) Variable name
-- `mtu` (Number) Interface MTU <68...2000>, in bytes
-- `mtu_variable` (String) Variable name
-- `name` (String) The name of the profile parcel
-- `per_tunnel_qos` (Boolean) Per-tunnel Qos
-- `per_tunnel_qos_aggregator` (Boolean) Per-tunnel QoS Aggregator
-- `per_tunnel_qos_aggregator_variable` (String) Variable name
-- `per_tunnel_qos_variable` (String) Variable name
-- `qos_shaping_rate` (Number) 1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps
-- `qos_shaping_rate_variable` (String) Variable name
-- `shutdown` (Boolean) Administrative state
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
-- `tcp_mss_variable` (String) Variable name
-- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
-- `tloc_extension_variable` (String) Variable name
-- `tunnel_interface` (Boolean) Tunnel Interface
-- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
-- `tunnel_interface_allow_all_variable` (String) Variable name
-- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
-- `tunnel_interface_allow_bfd_variable` (String) Variable name
-- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
-- `tunnel_interface_allow_bgp_variable` (String) Variable name
-- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
-- `tunnel_interface_allow_dhcp_variable` (String) Variable name
-- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
-- `tunnel_interface_allow_dns_variable` (String) Variable name
-- `tunnel_interface_allow_https` (Boolean) Allow/Deny Https
-- `tunnel_interface_allow_https_variable` (String) Variable name
-- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
-- `tunnel_interface_allow_icmp_variable` (String) Variable name
-- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
-- `tunnel_interface_allow_netconf_variable` (String) Variable name
-- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
-- `tunnel_interface_allow_ntp_variable` (String) Variable name
-- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
-- `tunnel_interface_allow_ospf_variable` (String) Variable name
-- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
-- `tunnel_interface_allow_snmp_variable` (String) Variable name
-- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
-- `tunnel_interface_allow_ssh_variable` (String) Variable name
-- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
-- `tunnel_interface_allow_stun_variable` (String) Variable name
-- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
-- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
-- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
-- `tunnel_interface_border_variable` (String) Variable name
-- `tunnel_interface_carrier` (String) Set carrier for TLOC
-- `tunnel_interface_carrier_variable` (String) Variable name
-- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
-- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
-- `tunnel_interface_clear_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts)
-- `tunnel_interface_clear_network_broadcast_variable` (String) Variable name
-- `tunnel_interface_color` (String) Set color for TLOC
-- `tunnel_interface_color_variable` (String) Variable name
-- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
-- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list
-- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
-- `tunnel_interface_groups` (Number) List of groups
-- `tunnel_interface_groups_variable` (String) Variable name
-- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
-- `tunnel_interface_hello_interval_variable` (String) Variable name
-- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
-- `tunnel_interface_hello_tolerance_variable` (String) Variable name
-- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
-- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
-- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
-- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
-- `tunnel_interface_max_control_connections` (Number) Set the maximum number of control connections for this TLOC
-- `tunnel_interface_max_control_connections_variable` (String) Variable name
-- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
-- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
-- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
-- `tunnel_interface_port_hop_variable` (String) Variable name
-- `tunnel_interface_restrict` (Boolean) Restrict this TLOC behavior
-- `tunnel_interface_restrict_variable` (String) Variable name
-- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
-- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
-- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
-- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
-- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
-- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
-- `tunnel_qos_mode` (String) Set tunnel QoS mode
-- `tunnel_qos_mode_variable` (String) Variable name
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `tunnel_interface_encapsulations`
-
-Read-Only:
-
-- `encapsulation` (String) Encapsulation
-- `preference` (Number) Set preference for TLOC
-- `preference_variable` (String) Variable name
-- `weight` (Number) Set weight for TLOC
-- `weight_variable` (String) Variable name
diff --git a/docs/data-sources/transport_wan_vpn_profile_parcel.md b/docs/data-sources/transport_wan_vpn_profile_parcel.md
deleted file mode 100644
index 5328b464b..000000000
--- a/docs/data-sources/transport_wan_vpn_profile_parcel.md
+++ /dev/null
@@ -1,133 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_profile_parcel Data Source - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This data source can read the Transport WAN VPN profile parcel.
----
-
-# sdwan_transport_wan_vpn_profile_parcel (Data Source)
-
-This data source can read the Transport WAN VPN profile parcel.
-
-## Example Usage
-
-```terraform
-data "sdwan_transport_wan_vpn_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `id` (String) The id of the profile parcel
-
-### Read-Only
-
-- `description` (String) The description of the profile parcel
-- `enhance_ecmp_keying` (Boolean) Enhance ECMP Keying
-- `enhance_ecmp_keying_variable` (String) Variable name
-- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
-- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
-- `name` (String) The name of the profile parcel
-- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
-- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
-- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
-- `primary_dns_address_ipv4_variable` (String) Variable name
-- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
-- `primary_dns_address_ipv6_variable` (String) Variable name
-- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
-- `secondary_dns_address_ipv4_variable` (String) Variable name
-- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
-- `secondary_dns_address_ipv6_variable` (String) Variable name
-- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
-- `version` (Number) The version of the profile parcel
-- `vpn` (Number) VPN
-
-
-### Nested Schema for `ipv4_static_routes`
-
-Read-Only:
-
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-- `gateway` (String) Gateway
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
-- `subnet_mask` (String) Subnet Mask
-- `subnet_mask_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_static_routes.next_hops`
-
-Read-Only:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_static_routes`
-
-Read-Only:
-
-- `nat` (String) IPv6 Nat
-- `nat_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
-- `null0` (Boolean) IPv6 Route Gateway Next Hop
-- `prefix` (String) Prefix
-- `prefix_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_static_routes.next_hops`
-
-Read-Only:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `nat_64_v4_pools`
-
-Read-Only:
-
-- `nat64_v4_pool_name` (String) NAT64 v4 Pool Name
-- `nat64_v4_pool_name_variable` (String) Variable name
-- `nat64_v4_pool_overload` (Boolean) NAT64 Overload
-- `nat64_v4_pool_overload_variable` (String) Variable name
-- `nat64_v4_pool_range_end` (String) NAT64 Pool Range End
-- `nat64_v4_pool_range_end_variable` (String) Variable name
-- `nat64_v4_pool_range_start` (String) NAT64 Pool Range Start
-- `nat64_v4_pool_range_start_variable` (String) Variable name
-
-
-
-### Nested Schema for `new_host_mappings`
-
-Read-Only:
-
-- `host_name` (String) Hostname
-- `host_name_variable` (String) Variable name
-- `list_of_ip_addresses` (Set of String) List of IP
-- `list_of_ip_addresses_variable` (String) Variable name
-
-
-
-### Nested Schema for `services`
-
-Read-Only:
-
-- `service_type` (String) Service Type
diff --git a/docs/data-sources/url_filtering_policy_definition.md b/docs/data-sources/url_filtering_policy_definition.md
index 217ce6af8..fdb322131 100644
--- a/docs/data-sources/url_filtering_policy_definition.md
+++ b/docs/data-sources/url_filtering_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_url_filtering_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the URL Filtering Policy Definition .
---
diff --git a/docs/data-sources/vpn_interface_cellular_feature_template.md b/docs/data-sources/vpn_interface_cellular_feature_template.md
index 65996302a..806994760 100644
--- a/docs/data-sources/vpn_interface_cellular_feature_template.md
+++ b/docs/data-sources/vpn_interface_cellular_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_cellular_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface Cellular feature template.
---
diff --git a/docs/data-sources/vpn_interface_dsl_ipoe_feature_template.md b/docs/data-sources/vpn_interface_dsl_ipoe_feature_template.md
index c5d3f7489..7ddb8b835 100644
--- a/docs/data-sources/vpn_interface_dsl_ipoe_feature_template.md
+++ b/docs/data-sources/vpn_interface_dsl_ipoe_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_dsl_ipoe_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface DSL IPoE feature template.
---
diff --git a/docs/data-sources/vpn_interface_dsl_pppoa_feature_template.md b/docs/data-sources/vpn_interface_dsl_pppoa_feature_template.md
index f449dc626..64259918a 100644
--- a/docs/data-sources/vpn_interface_dsl_pppoa_feature_template.md
+++ b/docs/data-sources/vpn_interface_dsl_pppoa_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_dsl_pppoa_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface DSL PPPoA feature template.
---
diff --git a/docs/data-sources/vpn_interface_dsl_pppoe_feature_template.md b/docs/data-sources/vpn_interface_dsl_pppoe_feature_template.md
index 34bd502fc..3f4468ca1 100644
--- a/docs/data-sources/vpn_interface_dsl_pppoe_feature_template.md
+++ b/docs/data-sources/vpn_interface_dsl_pppoe_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_dsl_pppoe_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface DSL PPPoE feature template.
---
diff --git a/docs/data-sources/vpn_interface_ethernet_pppoe_feature_template.md b/docs/data-sources/vpn_interface_ethernet_pppoe_feature_template.md
index 18bec1882..bef2edb44 100644
--- a/docs/data-sources/vpn_interface_ethernet_pppoe_feature_template.md
+++ b/docs/data-sources/vpn_interface_ethernet_pppoe_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_ethernet_pppoe_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface Ethernet PPPoE feature template.
---
diff --git a/docs/data-sources/vpn_interface_multilink_feature_template.md b/docs/data-sources/vpn_interface_multilink_feature_template.md
index ffcb1c07a..1b52052da 100644
--- a/docs/data-sources/vpn_interface_multilink_feature_template.md
+++ b/docs/data-sources/vpn_interface_multilink_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_multilink_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface Multilink feature template.
---
diff --git a/docs/data-sources/vpn_interface_svi_feature_template.md b/docs/data-sources/vpn_interface_svi_feature_template.md
index 8910e28cc..874d3b80e 100644
--- a/docs/data-sources/vpn_interface_svi_feature_template.md
+++ b/docs/data-sources/vpn_interface_svi_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_svi_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface SVI feature template.
---
diff --git a/docs/data-sources/vpn_interface_t1_e1_serial_feature_template.md b/docs/data-sources/vpn_interface_t1_e1_serial_feature_template.md
index 9bd446354..95c29144f 100644
--- a/docs/data-sources/vpn_interface_t1_e1_serial_feature_template.md
+++ b/docs/data-sources/vpn_interface_t1_e1_serial_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_t1_e1_serial_feature_template Data Source - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This data source can read the VPN Interface T1 E1 Serial feature template.
---
diff --git a/docs/data-sources/vpn_list_policy_object.md b/docs/data-sources/vpn_list_policy_object.md
index ee33678f3..e72db0191 100644
--- a/docs/data-sources/vpn_list_policy_object.md
+++ b/docs/data-sources/vpn_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the VPN List Policy Object .
---
diff --git a/docs/data-sources/vpn_membership_policy_definition.md b/docs/data-sources/vpn_membership_policy_definition.md
index 645728008..a952b9632 100644
--- a/docs/data-sources/vpn_membership_policy_definition.md
+++ b/docs/data-sources/vpn_membership_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_membership_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This data source can read the VPN Membership Policy Definition .
---
diff --git a/docs/data-sources/zone_based_firewall_policy_definition.md b/docs/data-sources/zone_based_firewall_policy_definition.md
index 7d8b826df..33a042844 100644
--- a/docs/data-sources/zone_based_firewall_policy_definition.md
+++ b/docs/data-sources/zone_based_firewall_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_zone_based_firewall_policy_definition Data Source - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This data source can read the Zone Based Firewall Policy Definition .
---
diff --git a/docs/data-sources/zone_list_policy_object.md b/docs/data-sources/zone_list_policy_object.md
index f246187d3..d85e73fc6 100644
--- a/docs/data-sources/zone_list_policy_object.md
+++ b/docs/data-sources/zone_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_zone_list_policy_object Data Source - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This data source can read the Zone List Policy Object .
---
diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md
index c87e96edf..a839c9577 100644
--- a/docs/guides/changelog.md
+++ b/docs/guides/changelog.md
@@ -7,9 +7,79 @@ description: |-
# Changelog
-## 0.3.14 (unreleased)
+## 0.4.2 (unreleased)
+
+- Add `sdwan_policy_object_application_list` resource and data source
+- Add `sdwan_policy_object_sla_class_list` resource and data source
+- Add `sdwan_policy_object_app_probe_class` resource and data source
+- Add `sdwan_policy_object_as_path_list` resource and data source
+- Add `sdwan_policy_object_vpn_group` resource and data source
+- Add `sdwan_policy_object_security_data_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_security_fqdn_list` resource and data source
+- Add `sdwan_policy_object_security_geolocation_list` resource and data source
+- Add `sdwan_policy_object_security_ips_signature` resource and data source
+- Add `sdwan_policy_object_security_local_domain_list` resource and data source
+- Add `sdwan_policy_object_security_port_list` resource and data source
+- Add `sdwan_policy_object_security_scalable_group_tag_list` resource and data source
+- Add `sdwan_policy_object_security_url_list` resource and data source
+- Add `sdwan_policy_object_preferred_color_group` resource and data source
+- Add `sdwan_policy_object_security_identity_list` resource and data source
+- Add `sdwan_policy_object_security_local_application_list` resource and data source
+- Add `sdwan_policy_object_standard_community_list` resource and data source
+- Add `sdwan_dns_security_feature_profile` resource and data source
+- Add `sdwan_sig_security_feature_profile` resource and data source
+- Add `sdwan_embedded_security_feature_profile` resource and data source
+
+## 0.4.1
+
+- Update documentation categories
+
+## 0.4.0
- Fix issue when reading deleted `sdwan_cli_config_profile_parcel` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/291)
+- Add `sdwan_transport_tracker_group_feature` resource and data source
+- Add `sdwan_transport_tracker_feature` resource and data source
+- Add `sdwan_service_tracker_group_feature` resource and data source
+- Add `sdwan_transport_ipv6_tracker_group_feature` resource and data source
+- Add `sdwan_service_object_tracker_feature` resource and data source
+- Add `sdwan_service_object_tracker_group_feature` resource and data source
+- BREAKING CHANGE: Rename `enable_crl_check` attribute of `sdwan_system_remote_access_profile_parcel` resource to `enable_certificate_list_check`
+- BREAKING CHANGE: Rename `psk_selection` attribute of `sdwan_system_remote_access_profile_parcel` resource to `psk_authentication_type`
+- BREAKING CHANGE: Rename `aaa_derive_name_identity` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_identity`
+- BREAKING CHANGE: Rename `aaa_derive_name_domain` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_domain`
+- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel`
+- Add `sdwan_policy_object_feature_profile` resource and data source
+- Add `sdwan_policy_object_class_map` resource and data source
+- Add `sdwan_policy_object_color_list` resource and data source
+- Add `sdwan_policy_object_data_ipv6_prefix_list` resource and data source
+- Add `sdwan_policy_object_data_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_tloc_list` resource and data source
+- Add `sdwan_policy_object_expanded_community_list` resource and data source
+- Add `sdwan_policy_object_extended_community_list` resource and data source
+- Add `sdwan_policy_object_mirror` resource and data source
+- Add `sdwan_policy_object_policer` resource and data source
+- Add `sdwan_policy_object_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_ipv6_prefix_list` resource and data source
+- Add `sdwan_other_feature_profile` resource and data source
+- Add `sdwan_other_ucse_feature` resource and data source
+- Add `sdwan_other_thousandeyes_feature` resource and data source
+- Add `sdwan_transport_gps_feature` resource and data source
+- Add `sdwan_transport_routing_ospf_feature` resource and data source
+- Add `sdwan_transport_routing_ospfv3_ipv4_feature` resource and data source
+- Add `sdwan_transport_routing_ospfv3_ipv6_feature` resource and data source
+- Add `sdwan_service_routing_ospf_feature` resource and data source
+- Add `sdwan_service_routing_ospfv3_ipv4_feature` resource and data source
+- Add `sdwan_service_routing_ospfv3_ipv6_feature` resource and data source
+- Add `sdwan_service_routing_bgp_feature` resource and data source
+- Add `sdwan_service_switchport_feature` resource and data source
+- Add `sdwan_transport_route_policy_feature` resource and data source
+- Add `sdwan_service_route_policy_feature` resource and data source
+- BREAKING CHANGE: Rename all profile parcel resources and data sources being used in configuration groups to "Features" with a `_feature` suffix
+- BREAKING CHANGE: Rename `sdwan_application_priority_qos_policy_profile_parcel` resource and data source to `sdwan_application_priority_qos_policy`
+- Fix issue when reading deleted `sdwan_configuration_group` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/297)
+- BREAKING CHANGE: Rename `service_lan_vpn_profile_parcel_id` attribute of `sdwan_service_lan_vpn_interface_ethernet_feature`, `sdwan_service_lan_vpn_interface_gre_feature`, `sdwan_service_lan_vpn_interface_ipsec_feature` and `sdwan_service_lan_vpn_interface_svi_feature` resource to `service_lan_vpn_feature_id`
+- BREAKING CHANGE: Rename `transport_management_vpn_profile_parcel_id` attribute of `sdwan_transport_management_vpn_interface_ethernet_feature` resource to `transport_management_vpn_feature_id`
+- BREAKING CHANGE: Rename `transport_wan_vpn_profile_parcel_id` attribute of `sdwan_transport_wan_vpn_interface_cellular_feature`, `sdwan_transport_wan_vpn_interface_ethernet_feature`, `sdwan_transport_wan_vpn_interface_gre_feature`, `sdwan_transport_wan_vpn_interface_ipsec_feature` and `sdwan_transport_wan_vpn_interface_t1_e1_serial_feature` resource to `transport_wan_vpn_feature_id`
## 0.3.13
diff --git a/docs/resources/activate_centralized_policy.md b/docs/resources/activate_centralized_policy.md
index 1b7ee03e7..b7abf2e4f 100644
--- a/docs/resources/activate_centralized_policy.md
+++ b/docs/resources/activate_centralized_policy.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_activate_centralized_policy Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can activate a centralized policy.
---
diff --git a/docs/resources/advanced_inspection_profile_policy_definition.md b/docs/resources/advanced_inspection_profile_policy_definition.md
index 46cb435dc..8f342507c 100644
--- a/docs/resources/advanced_inspection_profile_policy_definition.md
+++ b/docs/resources/advanced_inspection_profile_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_advanced_inspection_profile_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a Advanced Inspection Profile Policy Definition .
---
diff --git a/docs/resources/advanced_malware_protection_policy_definition.md b/docs/resources/advanced_malware_protection_policy_definition.md
index 54ec569e3..40d173337 100644
--- a/docs/resources/advanced_malware_protection_policy_definition.md
+++ b/docs/resources/advanced_malware_protection_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_advanced_malware_protection_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a Advanced Malware Protection Policy Definition .
---
diff --git a/docs/resources/allow_url_list_policy_object.md b/docs/resources/allow_url_list_policy_object.md
index 44eb4b007..42ef96182 100644
--- a/docs/resources/allow_url_list_policy_object.md
+++ b/docs/resources/allow_url_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_allow_url_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Allow URL List Policy Object .
---
diff --git a/docs/resources/app_probe_class_policy_object.md b/docs/resources/app_probe_class_policy_object.md
index 56e67a1cd..09391a645 100644
--- a/docs/resources/app_probe_class_policy_object.md
+++ b/docs/resources/app_probe_class_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_app_probe_class_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a App Probe Class Policy Object .
---
diff --git a/docs/resources/application_aware_routing_policy_definition.md b/docs/resources/application_aware_routing_policy_definition.md
index 2ab1c41d1..c245c69b2 100644
--- a/docs/resources/application_aware_routing_policy_definition.md
+++ b/docs/resources/application_aware_routing_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_application_aware_routing_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a Application Aware Routing Policy Definition .
---
@@ -108,7 +108,7 @@ Optional:
Required:
- `type` (String) Type of match entry
- - Choices: `appList`, `dnsAppList`, `dns`, `dscp`, `plp`, `protocol`, `sourceDataPrefixList`, `sourceIp`, `sourcePort`, `destinationDataPrefixList`, `destinationIp`, `destinationRegion`, `destinationPort`, `trafficTo`
+ - Choices: `appList`, `dnsAppList`, `dns`, `dscp`, `plp`, `protocol`, `sourceDataPrefixList`, `sourceIp`, `sourcePort`, `destinationDataPrefixList`, `destinationIp`, `destinationRegion`, `destinationPort`, `trafficTo`, `icmpMessage`
Optional:
@@ -126,6 +126,7 @@ Optional:
- `dns_application_list_version` (Number) DNS Application list version
- `dscp` (Number) DSCP value
- Range: `0`-`63`
+- `icmp_message` (String) ICMP Message
- `plp` (String) PLP
- Choices: `low`, `high`
- `protocol` (String) IP Protocol, 0-255 (Single value or multiple values separated by spaces)
diff --git a/docs/resources/application_list_policy_object.md b/docs/resources/application_list_policy_object.md
index c999d375b..bd4225e50 100644
--- a/docs/resources/application_list_policy_object.md
+++ b/docs/resources/application_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_application_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Application List Policy Object .
---
diff --git a/docs/resources/application_priority_feature_profile.md b/docs/resources/application_priority_feature_profile.md
index a576cc1b2..25fc2b54f 100644
--- a/docs/resources/application_priority_feature_profile.md
+++ b/docs/resources/application_priority_feature_profile.md
@@ -4,11 +4,13 @@ page_title: "sdwan_application_priority_feature_profile Resource - terraform-pro
subcategory: "Feature Profiles"
description: |-
This resource can manage a Application Priority Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
---
# sdwan_application_priority_feature_profile (Resource)
This resource can manage a Application Priority Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
## Example Usage
diff --git a/docs/resources/application_priority_qos_policy.md b/docs/resources/application_priority_qos_policy.md
new file mode 100644
index 000000000..817886c40
--- /dev/null
+++ b/docs/resources/application_priority_qos_policy.md
@@ -0,0 +1,71 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_application_priority_qos_policy Resource - terraform-provider-sdwan"
+subcategory: "Policies"
+description: |-
+ This resource can manage a Application Priority QoS Policy.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_application_priority_qos_policy (Resource)
+
+This resource can manage a Application Priority QoS Policy.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_application_priority_qos_policy" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ target_interface = ["{{interface_var_1}}"]
+ qos_schedulers = [
+ {
+ drops = "tail-drop"
+ queue = "0"
+ bandwidth = "10"
+ scheduling_type = "llq"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy
+
+### Optional
+
+- `description` (String) The description of the Policy
+- `qos_schedulers` (Attributes List) qosSchedulers (see [below for nested schema](#nestedatt--qos_schedulers))
+- `target_interface` (Set of String) interfaces
+- `target_interface_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Policy
+- `version` (Number) The version of the Policy
+
+
+### Nested Schema for `qos_schedulers`
+
+Optional:
+
+- `bandwidth` (String) bandwidthPercent
+- `drops` (String) drops
+- `forwarding_class_id` (String)
+- `queue` (String) queue
+- `scheduling_type` (String) scheduling
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_application_priority_qos_policy.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/application_priority_qos_policy_profile_parcel.md b/docs/resources/application_priority_qos_policy_profile_parcel.md
deleted file mode 100644
index a1d2d9d2d..000000000
--- a/docs/resources/application_priority_qos_policy_profile_parcel.md
+++ /dev/null
@@ -1,71 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_application_priority_qos_policy_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Application Priority QoS Policy profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_application_priority_qos_policy_profile_parcel (Resource)
-
-This resource can manage a Application Priority QoS Policy profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_application_priority_qos_policy_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- target_interface = ["{{interface_var_1}}"]
- qos_schedulers = [
- {
- drops = "tail-drop"
- queue = "0"
- bandwidth = "10"
- scheduling_type = "llq"
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `qos_schedulers` (Attributes List) qosSchedulers (see [below for nested schema](#nestedatt--qos_schedulers))
-- `target_interface` (Set of String) interfaces
-- `target_interface_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `qos_schedulers`
-
-Optional:
-
-- `bandwidth` (String) bandwidthPercent
-- `drops` (String) drops
-- `forwarding_class_id` (String)
-- `queue` (String) queue
-- `scheduling_type` (String) scheduling
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_application_priority_qos_policy_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/as_path_list_policy_object.md b/docs/resources/as_path_list_policy_object.md
index b98b9d656..5fc03c521 100644
--- a/docs/resources/as_path_list_policy_object.md
+++ b/docs/resources/as_path_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_as_path_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a AS Path List Policy Object .
---
diff --git a/docs/resources/attach_feature_device_template.md b/docs/resources/attach_feature_device_template.md
index d9830fd06..e1139dddc 100644
--- a/docs/resources/attach_feature_device_template.md
+++ b/docs/resources/attach_feature_device_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_attach_feature_device_template Resource - terraform-provider-sdwan"
-subcategory: "Device Templates"
+subcategory: "(Classic) Device Templates"
description: |-
This resource can attach a feature device template. Due to limitations of the API, once a device template is attached to a device, only one change can be applied per terraform apply operation. More information is available here https://registry.terraform.io/providers/CiscoDevNet/sdwan/latest/docs/guides/updating_templates.
---
diff --git a/docs/resources/block_url_list_policy_object.md b/docs/resources/block_url_list_policy_object.md
index fffef910e..44ec75782 100644
--- a/docs/resources/block_url_list_policy_object.md
+++ b/docs/resources/block_url_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_block_url_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Block URL List Policy Object .
---
diff --git a/docs/resources/cedge_aaa_feature_template.md b/docs/resources/cedge_aaa_feature_template.md
index 3771faf33..24a1445c3 100644
--- a/docs/resources/cedge_aaa_feature_template.md
+++ b/docs/resources/cedge_aaa_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_aaa_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a cEdge AAA feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cedge_global_feature_template.md b/docs/resources/cedge_global_feature_template.md
index 233a8c64c..2f1c87082 100644
--- a/docs/resources/cedge_global_feature_template.md
+++ b/docs/resources/cedge_global_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_global_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a cEdge Global feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cedge_igmp_feature_template.md b/docs/resources/cedge_igmp_feature_template.md
index 67059681b..f1d2fd894 100644
--- a/docs/resources/cedge_igmp_feature_template.md
+++ b/docs/resources/cedge_igmp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_igmp_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a cEdge IGMP feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cedge_multicast_feature_template.md b/docs/resources/cedge_multicast_feature_template.md
index 0326536d4..580b545f7 100644
--- a/docs/resources/cedge_multicast_feature_template.md
+++ b/docs/resources/cedge_multicast_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_multicast_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a cEdge Multicast feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cedge_pim_feature_template.md b/docs/resources/cedge_pim_feature_template.md
index 2819f5c67..aac6086ab 100644
--- a/docs/resources/cedge_pim_feature_template.md
+++ b/docs/resources/cedge_pim_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cedge_pim_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a cEdge PIM feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cellular_cedge_profile_feature_template.md b/docs/resources/cellular_cedge_profile_feature_template.md
index 1954f53fd..149005a10 100644
--- a/docs/resources/cellular_cedge_profile_feature_template.md
+++ b/docs/resources/cellular_cedge_profile_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cellular_cedge_profile_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cellular cEdge Profile feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cellular_controller_feature_template.md b/docs/resources/cellular_controller_feature_template.md
index 9fa01550e..73b32a171 100644
--- a/docs/resources/cellular_controller_feature_template.md
+++ b/docs/resources/cellular_controller_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cellular_controller_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cellular Controller feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cellular_profile_feature_template.md b/docs/resources/cellular_profile_feature_template.md
index c040905eb..d6a9b7c16 100644
--- a/docs/resources/cellular_profile_feature_template.md
+++ b/docs/resources/cellular_profile_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cellular_profile_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cellular Profile feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/centralized_policy.md b/docs/resources/centralized_policy.md
index a26628a9a..0de1641fe 100644
--- a/docs/resources/centralized_policy.md
+++ b/docs/resources/centralized_policy.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_centralized_policy Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a Centralized Policy .
---
diff --git a/docs/resources/cflowd_policy_definition.md b/docs/resources/cflowd_policy_definition.md
index 23f5f93ff..67afc7e7b 100644
--- a/docs/resources/cflowd_policy_definition.md
+++ b/docs/resources/cflowd_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cflowd_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a Cflowd Policy Definition .
---
diff --git a/docs/resources/cisco_banner_feature_template.md b/docs/resources/cisco_banner_feature_template.md
index ed87f3064..806caf46b 100644
--- a/docs/resources/cisco_banner_feature_template.md
+++ b/docs/resources/cisco_banner_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_banner_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco Banner feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_bfd_feature_template.md b/docs/resources/cisco_bfd_feature_template.md
index f3b726131..b61f401a0 100644
--- a/docs/resources/cisco_bfd_feature_template.md
+++ b/docs/resources/cisco_bfd_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_bfd_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco BFD feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_bgp_feature_template.md b/docs/resources/cisco_bgp_feature_template.md
index fda34bfe8..155516d38 100644
--- a/docs/resources/cisco_bgp_feature_template.md
+++ b/docs/resources/cisco_bgp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_bgp_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco BGP feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_dhcp_server_feature_template.md b/docs/resources/cisco_dhcp_server_feature_template.md
index ceb47808b..e1ad93825 100644
--- a/docs/resources/cisco_dhcp_server_feature_template.md
+++ b/docs/resources/cisco_dhcp_server_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_dhcp_server_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco DHCP Server feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_logging_feature_template.md b/docs/resources/cisco_logging_feature_template.md
index f11b052c1..a5e4ae9cf 100644
--- a/docs/resources/cisco_logging_feature_template.md
+++ b/docs/resources/cisco_logging_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_logging_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco Logging feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_ntp_feature_template.md b/docs/resources/cisco_ntp_feature_template.md
index d3f8e3c9c..29235857d 100644
--- a/docs/resources/cisco_ntp_feature_template.md
+++ b/docs/resources/cisco_ntp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_ntp_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco NTP feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_omp_feature_template.md b/docs/resources/cisco_omp_feature_template.md
index 938765245..84349a892 100644
--- a/docs/resources/cisco_omp_feature_template.md
+++ b/docs/resources/cisco_omp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_omp_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco OMP feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_ospf_feature_template.md b/docs/resources/cisco_ospf_feature_template.md
index 01d9e3bd2..6e2d1192e 100644
--- a/docs/resources/cisco_ospf_feature_template.md
+++ b/docs/resources/cisco_ospf_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_ospf_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco OSPF feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_ospfv3_feature_template.md b/docs/resources/cisco_ospfv3_feature_template.md
index 77b64521e..a21292353 100644
--- a/docs/resources/cisco_ospfv3_feature_template.md
+++ b/docs/resources/cisco_ospfv3_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_ospfv3_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco OSPFv3 feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_secure_internet_gateway_feature_template.md b/docs/resources/cisco_secure_internet_gateway_feature_template.md
index 39b96d3d1..f474a89d8 100644
--- a/docs/resources/cisco_secure_internet_gateway_feature_template.md
+++ b/docs/resources/cisco_secure_internet_gateway_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_secure_internet_gateway_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco Secure Internet Gateway feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_security_feature_template.md b/docs/resources/cisco_security_feature_template.md
index b4f94124b..833206eee 100644
--- a/docs/resources/cisco_security_feature_template.md
+++ b/docs/resources/cisco_security_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_security_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco Security feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_sig_credentials_feature_template.md b/docs/resources/cisco_sig_credentials_feature_template.md
index 7699a91ed..e8449fc50 100644
--- a/docs/resources/cisco_sig_credentials_feature_template.md
+++ b/docs/resources/cisco_sig_credentials_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_sig_credentials_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco SIG Credentials feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_snmp_feature_template.md b/docs/resources/cisco_snmp_feature_template.md
index 7bf040c17..d9388691f 100644
--- a/docs/resources/cisco_snmp_feature_template.md
+++ b/docs/resources/cisco_snmp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_snmp_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco SNMP feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_system_feature_template.md b/docs/resources/cisco_system_feature_template.md
index c1b3f517e..55c1ccba3 100644
--- a/docs/resources/cisco_system_feature_template.md
+++ b/docs/resources/cisco_system_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_system_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco System feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_thousandeyes_feature_template.md b/docs/resources/cisco_thousandeyes_feature_template.md
index 24a9e8475..7d0ca8e19 100644
--- a/docs/resources/cisco_thousandeyes_feature_template.md
+++ b/docs/resources/cisco_thousandeyes_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_thousandeyes_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco ThousandEyes feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_trustsec_feature_template.md b/docs/resources/cisco_trustsec_feature_template.md
index b9c6e6ce2..8c797d477 100644
--- a/docs/resources/cisco_trustsec_feature_template.md
+++ b/docs/resources/cisco_trustsec_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_trustsec_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco TrustSec feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_vpn_feature_template.md b/docs/resources/cisco_vpn_feature_template.md
index 7927e32e9..7dd9956f8 100644
--- a/docs/resources/cisco_vpn_feature_template.md
+++ b/docs/resources/cisco_vpn_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco VPN feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_vpn_interface_feature_template.md b/docs/resources/cisco_vpn_interface_feature_template.md
index 48195474e..9c124a30d 100644
--- a/docs/resources/cisco_vpn_interface_feature_template.md
+++ b/docs/resources/cisco_vpn_interface_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_interface_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco VPN Interface feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_vpn_interface_gre_feature_template.md b/docs/resources/cisco_vpn_interface_gre_feature_template.md
index 9c3b00b5d..56b24a848 100644
--- a/docs/resources/cisco_vpn_interface_gre_feature_template.md
+++ b/docs/resources/cisco_vpn_interface_gre_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_interface_gre_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco VPN Interface GRE feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_vpn_interface_ipsec_feature_template.md b/docs/resources/cisco_vpn_interface_ipsec_feature_template.md
index d1bb994a5..8460e2a1e 100644
--- a/docs/resources/cisco_vpn_interface_ipsec_feature_template.md
+++ b/docs/resources/cisco_vpn_interface_ipsec_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_vpn_interface_ipsec_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco VPN Interface IPSec feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/cisco_wireless_lan_feature_template.md b/docs/resources/cisco_wireless_lan_feature_template.md
index 441cc7345..1daa1ee24 100644
--- a/docs/resources/cisco_wireless_lan_feature_template.md
+++ b/docs/resources/cisco_wireless_lan_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cisco_wireless_lan_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Cisco Wireless LAN feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/class_map_policy_object.md b/docs/resources/class_map_policy_object.md
index 9f1c054fd..f3743caa8 100644
--- a/docs/resources/class_map_policy_object.md
+++ b/docs/resources/class_map_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_class_map_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Class Map Policy Object .
---
diff --git a/docs/resources/cli_config_feature.md b/docs/resources/cli_config_feature.md
new file mode 100644
index 000000000..eccc03595
--- /dev/null
+++ b/docs/resources/cli_config_feature.md
@@ -0,0 +1,47 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_cli_config_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a CLI Config Feature .
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_cli_config_feature (Resource)
+
+This resource can manage a CLI Config Feature .
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_cli_config_feature" "example" {
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ name = "Example"
+ description = "My Example"
+ cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `cli_configuration` (String) CLI configuration
+- `description` (String) The description of the Feature
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Read-Only
+
+- `id` (String) The id of the object
+- `version` (Number) The version of the object
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_cli_config_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/cli_config_profile_parcel.md b/docs/resources/cli_config_profile_parcel.md
deleted file mode 100644
index 0ce9d422c..000000000
--- a/docs/resources/cli_config_profile_parcel.md
+++ /dev/null
@@ -1,47 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_cli_config_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a CLI Config Profile Parcel .
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_cli_config_profile_parcel (Resource)
-
-This resource can manage a CLI Config Profile Parcel .
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_cli_config_profile_parcel" "example" {
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- name = "Example"
- description = "My Example"
- cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `cli_configuration` (String) CLI configuration
-- `description` (String) The description of the profile parcel
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Read-Only
-
-- `id` (String) The id of the object
-- `version` (Number) The version of the object
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_cli_config_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/cli_device_template.md b/docs/resources/cli_device_template.md
index 064709a95..4ddd05d63 100644
--- a/docs/resources/cli_device_template.md
+++ b/docs/resources/cli_device_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cli_device_template Resource - terraform-provider-sdwan"
-subcategory: "Device Templates"
+subcategory: "(Classic) Device Templates"
description: |-
This resource can manage a CLI Device Template .
---
diff --git a/docs/resources/cli_feature_profile.md b/docs/resources/cli_feature_profile.md
index 371a4d641..51e65c390 100644
--- a/docs/resources/cli_feature_profile.md
+++ b/docs/resources/cli_feature_profile.md
@@ -4,11 +4,13 @@ page_title: "sdwan_cli_feature_profile Resource - terraform-provider-sdwan"
subcategory: "Feature Profiles"
description: |-
This resource can manage a CLI Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
---
# sdwan_cli_feature_profile (Resource)
This resource can manage a CLI Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
## Example Usage
diff --git a/docs/resources/cli_template_feature_template.md b/docs/resources/cli_template_feature_template.md
index a5d30559d..fb66a5590 100644
--- a/docs/resources/cli_template_feature_template.md
+++ b/docs/resources/cli_template_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_cli_template_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a CLI Template feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/color_list_policy_object.md b/docs/resources/color_list_policy_object.md
index f75f18018..c50b02429 100644
--- a/docs/resources/color_list_policy_object.md
+++ b/docs/resources/color_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_color_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Color List Policy Object .
---
diff --git a/docs/resources/custom_control_topology_policy_definition.md b/docs/resources/custom_control_topology_policy_definition.md
index 321182fba..3618db627 100644
--- a/docs/resources/custom_control_topology_policy_definition.md
+++ b/docs/resources/custom_control_topology_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_custom_control_topology_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a Custom Control Topology Policy Definition .
---
@@ -53,12 +53,12 @@ resource "sdwan_custom_control_topology_policy_definition" "example" {
- `description` (String) The description of the policy definition
- `name` (String) The name of the policy definition
-- `sequences` (Attributes List) List of sequences (see [below for nested schema](#nestedatt--sequences))
### Optional
- `default_action` (String) Default action, either `accept` or `reject`
- Choices: `accept`, `reject`
+- `sequences` (Attributes List) List of sequences (see [below for nested schema](#nestedatt--sequences))
### Read-Only
diff --git a/docs/resources/data_fqdn_prefix_list_policy_object.md b/docs/resources/data_fqdn_prefix_list_policy_object.md
index 62c7a6abf..b9f3435a4 100644
--- a/docs/resources/data_fqdn_prefix_list_policy_object.md
+++ b/docs/resources/data_fqdn_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_data_fqdn_prefix_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Data FQDN Prefix List Policy Object .
---
diff --git a/docs/resources/data_ipv4_prefix_list_policy_object.md b/docs/resources/data_ipv4_prefix_list_policy_object.md
index 5e861af5f..9c1049d72 100644
--- a/docs/resources/data_ipv4_prefix_list_policy_object.md
+++ b/docs/resources/data_ipv4_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_data_ipv4_prefix_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Data IPv4 Prefix List Policy Object .
---
diff --git a/docs/resources/data_ipv6_prefix_list_policy_object.md b/docs/resources/data_ipv6_prefix_list_policy_object.md
index 6397db17a..93a065dab 100644
--- a/docs/resources/data_ipv6_prefix_list_policy_object.md
+++ b/docs/resources/data_ipv6_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_data_ipv6_prefix_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Data IPv6 Prefix List Policy Object .
---
diff --git a/docs/resources/dns_security_feature_profile.md b/docs/resources/dns_security_feature_profile.md
new file mode 100644
index 000000000..806f7d7ca
--- /dev/null
+++ b/docs/resources/dns_security_feature_profile.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_dns_security_feature_profile Resource - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This resource can manage a DNS Security Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_dns_security_feature_profile (Resource)
+
+This resource can manage a DNS Security Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_dns_security_feature_profile" "example" {
+ name = "DNS_SECURITY_FP_1"
+ description = "My dns security feature profile 1"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `description` (String) Description
+- `name` (String) The name of the dns security feature profile
+
+### Read-Only
+
+- `id` (String) The id of the object
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_dns_security_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/dns_security_policy_definition.md b/docs/resources/dns_security_policy_definition.md
index aa21cbd41..0761151e0 100644
--- a/docs/resources/dns_security_policy_definition.md
+++ b/docs/resources/dns_security_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_dns_security_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a DNS Security Policy Definition .
---
diff --git a/docs/resources/domain_list_policy_object.md b/docs/resources/domain_list_policy_object.md
index 5f8d7755c..95d6bc1d6 100644
--- a/docs/resources/domain_list_policy_object.md
+++ b/docs/resources/domain_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_domain_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Domain List Policy Object .
---
diff --git a/docs/resources/eigrp_feature_template.md b/docs/resources/eigrp_feature_template.md
index 1d2cef689..9652fc053 100644
--- a/docs/resources/eigrp_feature_template.md
+++ b/docs/resources/eigrp_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_eigrp_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a eigrp feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/embedded_security_feature_profile.md b/docs/resources/embedded_security_feature_profile.md
new file mode 100644
index 000000000..adcbf28cd
--- /dev/null
+++ b/docs/resources/embedded_security_feature_profile.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_embedded_security_feature_profile Resource - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This resource can manage a Embedded Security Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_embedded_security_feature_profile (Resource)
+
+This resource can manage a Embedded Security Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_embedded_security_feature_profile" "example" {
+ name = "EMBEDDED_SECURITY_FP_1"
+ description = "My embedded security feature profile 1"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `description` (String) Description
+- `name` (String) The name of the embedded security feature profile
+
+### Read-Only
+
+- `id` (String) The id of the object
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_embedded_security_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/expanded_community_list_policy_object.md b/docs/resources/expanded_community_list_policy_object.md
index e1cd96273..52f9fce5f 100644
--- a/docs/resources/expanded_community_list_policy_object.md
+++ b/docs/resources/expanded_community_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_expanded_community_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Expanded Community List Policy Object .
---
diff --git a/docs/resources/extended_community_list_policy_object.md b/docs/resources/extended_community_list_policy_object.md
index 2998a35d5..42523f1ad 100644
--- a/docs/resources/extended_community_list_policy_object.md
+++ b/docs/resources/extended_community_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_extended_community_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Extended Community List Policy Object .
---
diff --git a/docs/resources/feature_device_template.md b/docs/resources/feature_device_template.md
index 4da2768a6..2d29a9927 100644
--- a/docs/resources/feature_device_template.md
+++ b/docs/resources/feature_device_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_feature_device_template Resource - terraform-provider-sdwan"
-subcategory: "Device Templates"
+subcategory: "(Classic) Device Templates"
description: |-
This resource can manage a Feature Device Template .
---
@@ -57,7 +57,7 @@ Required:
- `id` (String) Feature template ID
- `type` (String) Feature template type
- - Choices: `cisco_system`, `cisco_logging`, `cedge_aaa`, `cisco_bfd`, `cisco_omp`, `cisco_security`, `cisco_banner`, `cisco_snmp`, `cedge_global`, `cli-template`, `cisco_sig_credentials`, `switchport`, `cisco_thousandeyes`, `cisco_vpn`
+ - Choices: `cisco_system`, `cisco_logging`, `cedge_aaa`, `cisco_bfd`, `cisco_omp`, `cisco_security`, `cisco_banner`, `cisco_snmp`, `cedge_global`, `cli-template`, `cisco_sig_credentials`, `switchport`, `cisco_thousandeyes`, `cisco_vpn`, `virtual-application-utd`
Optional:
diff --git a/docs/resources/geo_location_list_policy_object.md b/docs/resources/geo_location_list_policy_object.md
index e027ccb11..2d4d44619 100644
--- a/docs/resources/geo_location_list_policy_object.md
+++ b/docs/resources/geo_location_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_geo_location_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Geo Location List Policy Object .
---
diff --git a/docs/resources/gps_feature_template.md b/docs/resources/gps_feature_template.md
index ad72cecd1..82e909f27 100644
--- a/docs/resources/gps_feature_template.md
+++ b/docs/resources/gps_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_gps_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a gps feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/hub_and_spoke_topology_policy_definition.md b/docs/resources/hub_and_spoke_topology_policy_definition.md
index 4d813dee8..c0eb2d71a 100644
--- a/docs/resources/hub_and_spoke_topology_policy_definition.md
+++ b/docs/resources/hub_and_spoke_topology_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_hub_and_spoke_topology_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a Hub and Spoke Topology Policy Definition .
---
diff --git a/docs/resources/intrusion_prevention_policy_definition.md b/docs/resources/intrusion_prevention_policy_definition.md
index 9f3ee1f91..2d6694309 100644
--- a/docs/resources/intrusion_prevention_policy_definition.md
+++ b/docs/resources/intrusion_prevention_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_intrusion_prevention_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a Intrusion Prevention Policy Definition .
---
diff --git a/docs/resources/ips_signature_list_policy_object.md b/docs/resources/ips_signature_list_policy_object.md
index 933020261..74bf205bd 100644
--- a/docs/resources/ips_signature_list_policy_object.md
+++ b/docs/resources/ips_signature_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ips_signature_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a IPS Signature List Policy Object .
---
diff --git a/docs/resources/ipv4_acl_policy_definition.md b/docs/resources/ipv4_acl_policy_definition.md
index dd218f33d..ce706dbe1 100644
--- a/docs/resources/ipv4_acl_policy_definition.md
+++ b/docs/resources/ipv4_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv4_acl_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a IPv4 ACL Policy Definition .
---
@@ -122,7 +122,7 @@ Optional:
Required:
- `type` (String) Type of match entry
- - Choices: `dscp`, `sourceIp`, `destinationIp`, `class`, `packetLength`, `plp`, `sourcePort`, `destinationPort`, `sourceDataPrefixList`, `destinationDataPrefixList`, `protocol`, `tcp`
+ - Choices: `dscp`, `sourceIp`, `destinationIp`, `class`, `packetLength`, `plp`, `sourcePort`, `destinationPort`, `sourceDataPrefixList`, `destinationDataPrefixList`, `protocol`, `tcp`, `icmpMessage`
Optional:
@@ -134,6 +134,7 @@ Optional:
- `destination_ports` (String) Destination ports. Single value (0-65535) or ranges separated by spaces.
- `dscp` (Number) DSCP value
- Range: `0`-`63`
+- `icmp_message` (String) ICMP Message
- `packet_length` (Number) Packet length
- Range: `0`-`65535`
- `priority` (String) PLP - priority
diff --git a/docs/resources/ipv4_device_acl_policy_definition.md b/docs/resources/ipv4_device_acl_policy_definition.md
index 7944e70a9..8e695ffa1 100644
--- a/docs/resources/ipv4_device_acl_policy_definition.md
+++ b/docs/resources/ipv4_device_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv4_device_acl_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a IPv4 Device ACL Policy Definition .
---
diff --git a/docs/resources/ipv4_prefix_list_policy_object.md b/docs/resources/ipv4_prefix_list_policy_object.md
index a31dd82b4..795bef2f5 100644
--- a/docs/resources/ipv4_prefix_list_policy_object.md
+++ b/docs/resources/ipv4_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv4_prefix_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a IPv4 Prefix List Policy Object .
---
diff --git a/docs/resources/ipv6_acl_policy_definition.md b/docs/resources/ipv6_acl_policy_definition.md
index 8efb21818..870dcb1e5 100644
--- a/docs/resources/ipv6_acl_policy_definition.md
+++ b/docs/resources/ipv6_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv6_acl_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a IPv6 ACL Policy Definition .
---
diff --git a/docs/resources/ipv6_device_acl_policy_definition.md b/docs/resources/ipv6_device_acl_policy_definition.md
index be6d92cdd..2afa94d62 100644
--- a/docs/resources/ipv6_device_acl_policy_definition.md
+++ b/docs/resources/ipv6_device_acl_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv6_device_acl_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a IPv6 Device ACL Policy Definition .
---
diff --git a/docs/resources/ipv6_prefix_list_policy_object.md b/docs/resources/ipv6_prefix_list_policy_object.md
index c319c59e4..56dc12f08 100644
--- a/docs/resources/ipv6_prefix_list_policy_object.md
+++ b/docs/resources/ipv6_prefix_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_ipv6_prefix_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a IPv6 Prefix List Policy Object .
---
diff --git a/docs/resources/local_application_list_policy_object.md b/docs/resources/local_application_list_policy_object.md
index 9a2169a45..12b395f10 100644
--- a/docs/resources/local_application_list_policy_object.md
+++ b/docs/resources/local_application_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_local_application_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Local Application List Policy Object .
---
diff --git a/docs/resources/localized_policy.md b/docs/resources/localized_policy.md
index aa7d30560..ce1488c82 100644
--- a/docs/resources/localized_policy.md
+++ b/docs/resources/localized_policy.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_localized_policy Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a Localized Policy .
---
diff --git a/docs/resources/mesh_topology_policy_definition.md b/docs/resources/mesh_topology_policy_definition.md
index 6599650c1..3882704e9 100644
--- a/docs/resources/mesh_topology_policy_definition.md
+++ b/docs/resources/mesh_topology_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_mesh_topology_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a Mesh Topology Policy Definition .
---
diff --git a/docs/resources/mirror_policy_object.md b/docs/resources/mirror_policy_object.md
index 670b21a52..1752456ba 100644
--- a/docs/resources/mirror_policy_object.md
+++ b/docs/resources/mirror_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_mirror_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Mirror Policy Object .
---
diff --git a/docs/resources/object_group_policy_definition.md b/docs/resources/object_group_policy_definition.md
index b8c7334b3..925ba0d66 100644
--- a/docs/resources/object_group_policy_definition.md
+++ b/docs/resources/object_group_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_object_group_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a Object Group Policy Definition .
---
diff --git a/docs/resources/other_feature_profile.md b/docs/resources/other_feature_profile.md
new file mode 100644
index 000000000..2b9ec7356
--- /dev/null
+++ b/docs/resources/other_feature_profile.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_other_feature_profile Resource - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This resource can manage a Other Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_other_feature_profile (Resource)
+
+This resource can manage a Other Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_other_feature_profile" "example" {
+ name = "OTHER_FP_1"
+ description = "My Other feature profile 1"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `description` (String) Description
+- `name` (String) The name of the transport feature profile
+
+### Read-Only
+
+- `id` (String) The id of the object
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_other_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/other_thousandeyes_feature.md b/docs/resources/other_thousandeyes_feature.md
new file mode 100644
index 000000000..5e5967a0e
--- /dev/null
+++ b/docs/resources/other_thousandeyes_feature.md
@@ -0,0 +1,93 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_other_thousandeyes_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Other ThousandEyes Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_other_thousandeyes_feature (Resource)
+
+This resource can manage a Other ThousandEyes Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_other_thousandeyes_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ virtual_application = [
+ {
+ account_group_token = "qwer"
+ vpn = 1
+ management_ip = "10.0.0.2"
+ management_subnet_mask = "255.255.255.0"
+ agent_default_gateway = "10.0.0.1"
+ name_server_ip = "77.77.77.71"
+ hostname = "thousandeyesHost"
+ proxy_type = "static"
+ proxy_host = "proxy.thousandeyes.com"
+ proxy_port = 3128
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `virtual_application` (Attributes List) Virtual application Instance (see [below for nested schema](#nestedatt--virtual_application))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `virtual_application`
+
+Optional:
+
+- `account_group_token` (String) Set the Account Group Token
+- `account_group_token_variable` (String) Variable name
+- `agent_default_gateway` (String) Set the Agent default gateway
+- `agent_default_gateway_variable` (String) Variable name
+- `hostname` (String) Set the host name
+- `hostname_variable` (String) Variable name
+- `management_ip` (String) Set the Agent IP Address
+- `management_ip_variable` (String) Variable name
+- `management_subnet_mask` (String) Set the Agent SubnetMask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `management_subnet_mask_variable` (String) Variable name
+- `name_server_ip` (String) Set the name server
+- `name_server_ip_variable` (String) Variable name
+- `pac_url` (String) Set the proxy PAC url
+- `pac_url_variable` (String) Variable name
+- `proxy_host` (String) Set the Proxy Host
+- `proxy_host_variable` (String) Variable name
+- `proxy_port` (Number) Set the Proxy Port
+ - Range: `1`-`65535`
+- `proxy_port_variable` (String) Variable name
+- `proxy_type` (String) Select Web Proxy Type
+- `vpn` (Number) VPN number
+ - Range: `0`-`65530`
+- `vpn_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_other_thousandeyes_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/other_ucse_feature.md b/docs/resources/other_ucse_feature.md
new file mode 100644
index 000000000..898d10d88
--- /dev/null
+++ b/docs/resources/other_ucse_feature.md
@@ -0,0 +1,96 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_other_ucse_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Other UCSE Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_other_ucse_feature (Resource)
+
+This resource can manage a Other UCSE Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_other_ucse_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ bay = 2
+ slot = 0
+ access_port_dedicated = false
+ access_port_shared_type = "ge1"
+ access_port_shared_failover_type = "ge2"
+ ipv4_address = "2.2.2.2/24"
+ default_gateway = "2.2.2.2"
+ vlan_id = 3
+ assign_priority = 3
+ interfaces = [
+ {
+ interface_name = "ucse2/0"
+ ucse_interface_vpn = 2
+ ipv4_address = "10.1.15.15/24"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `access_port_shared_failover_type` (String) - Choices: `ge2`, `te2`
+- `access_port_shared_type` (String) - Choices: `ge1`, `ge2`, `ge3`, `te2`, `te3`, `console`, `failover`
+- `bay` (Number) Bay
+ - Range: `0`-`2`
+- `default_gateway` (String) Assign default gateway
+- `feature_profile_id` (String) Feature Profile ID
+- `ipv4_address` (String) Assign IPv4 address
+- `name` (String) The name of the Feature
+- `slot` (Number) Slot
+ - Range: `0`-`3`
+
+### Optional
+
+- `access_port_dedicated` (Boolean) Dedicated
+ - Default value: `true`
+- `assign_priority` (Number) Assign priority
+ - Range: `0`-`7`
+- `assign_priority_variable` (String) Variable name
+- `default_gateway_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interfaces` (Attributes List) Interface name: GigabitEthernet0/<>/<> when present (see [below for nested schema](#nestedatt--interfaces))
+- `ipv4_address_variable` (String) Variable name
+- `vlan_id` (Number) Assign Vlan Id
+ - Range: `2`-`4095`
+- `vlan_id_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `interfaces`
+
+Optional:
+
+- `interface_name` (String) Set Inteface name
+- `interface_name_variable` (String) Variable name
+- `ipv4_address` (String) Assign IPv4 address
+- `ipv4_address_variable` (String) Variable name
+- `ucse_interface_vpn` (Number) UCSE Interface VPN
+ - Range: `1`-`65527`
+- `ucse_interface_vpn_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_other_ucse_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policer_policy_object.md b/docs/resources/policer_policy_object.md
index f86dd85e2..238735146 100644
--- a/docs/resources/policer_policy_object.md
+++ b/docs/resources/policer_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_policer_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Policer Policy Object .
---
diff --git a/docs/resources/policy_object_app_probe_class.md b/docs/resources/policy_object_app_probe_class.md
new file mode 100644
index 000000000..96c29af52
--- /dev/null
+++ b/docs/resources/policy_object_app_probe_class.md
@@ -0,0 +1,78 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_app_probe_class Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object App Probe Class Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_app_probe_class (Resource)
+
+This resource can manage a Policy Object App Probe Class Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_app_probe_class" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ map = [
+ {
+ color = "3g"
+ dscp = 45
+ }
+ ]
+ forwarding_class = "classlist1"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) App Probe List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `forwarding_class` (String) Forwarding Class Name
+- `map` (Attributes List) Map (see [below for nested schema](#nestedatt--entries--map))
+
+
+### Nested Schema for `entries.map`
+
+Optional:
+
+- `color` (String) Color
+ - Choices: `3g`, `biz-internet`, `blue`, `bronze`, `custom1`, `custom2`, `custom3`, `default`, `gold`, `green`, `lte`, `metro-ethernet`, `mpls`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`, `public-internet`, `red`, `silver`
+- `dscp` (Number) DSCP number
+ - Range: `0`-`63`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_app_probe_class.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_application_list.md b/docs/resources/policy_object_application_list.md
new file mode 100644
index 000000000..c7acb69a1
--- /dev/null
+++ b/docs/resources/policy_object_application_list.md
@@ -0,0 +1,62 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_application_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Application List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_application_list (Resource)
+
+This resource can manage a Policy Object Application List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_application_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ application = "3com-amp3"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Centralized Policy App List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `application` (String)
+- `application_family` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_application_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_as_path_list.md b/docs/resources/policy_object_as_path_list.md
new file mode 100644
index 000000000..e9d690532
--- /dev/null
+++ b/docs/resources/policy_object_as_path_list.md
@@ -0,0 +1,64 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_as_path_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object AS Path List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_as_path_list (Resource)
+
+This resource can manage a Policy Object AS Path List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_as_path_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ as_path_list_id = 1
+ entries = [
+ {
+ as_path_list = "110"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `as_path_list_id` (Number) As path List Number
+ - Range: `1`-`500`
+- `entries` (Attributes List) AS Path List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `as_path_list` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_as_path_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_class_map.md b/docs/resources/policy_object_class_map.md
new file mode 100644
index 000000000..d7677b0f2
--- /dev/null
+++ b/docs/resources/policy_object_class_map.md
@@ -0,0 +1,62 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_class_map Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Class Map Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_class_map (Resource)
+
+This resource can manage a Policy Object Class Map Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_class_map" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ queue = "0"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) class map List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `queue` (String) select a queue
+ - Choices: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_class_map.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_color_list.md b/docs/resources/policy_object_color_list.md
new file mode 100644
index 000000000..3d16f74dc
--- /dev/null
+++ b/docs/resources/policy_object_color_list.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_color_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Color List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_color_list (Resource)
+
+This resource can manage a Policy Object Color List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_color_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ color = "blue"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Color List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `color` (String) - Choices: `3g`, `biz-internet`, `blue`, `bronze`, `custom1`, `custom2`, `custom3`, `default`, `gold`, `green`, `lte`, `metro-ethernet`, `mpls`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`, `public-internet`, `red`, `silver`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_color_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_data_ipv4_prefix_list.md b/docs/resources/policy_object_data_ipv4_prefix_list.md
new file mode 100644
index 000000000..41714865f
--- /dev/null
+++ b/docs/resources/policy_object_data_ipv4_prefix_list.md
@@ -0,0 +1,64 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_data_ipv4_prefix_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Data IPv4 Prefix List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_data_ipv4_prefix_list (Resource)
+
+This resource can manage a Policy Object Data IPv4 Prefix List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_data_ipv4_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv4_address = "10.0.0.0"
+ ipv4_prefix_length = 8
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) IPv4 Data Prefix List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `ipv4_address` (String) IPv4 address
+- `ipv4_prefix_length` (Number) IPv4 prefix Length
+ - Range: `0`-`32`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_data_ipv4_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_data_ipv6_prefix_list.md b/docs/resources/policy_object_data_ipv6_prefix_list.md
new file mode 100644
index 000000000..9da20b4ba
--- /dev/null
+++ b/docs/resources/policy_object_data_ipv6_prefix_list.md
@@ -0,0 +1,64 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_data_ipv6_prefix_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Data IPv6 Prefix List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_data_ipv6_prefix_list (Resource)
+
+This resource can manage a Policy Object Data IPv6 Prefix List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_data_ipv6_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv6_address = "2001:db8:85a3::8a2e:370:7334"
+ ipv6_prefix_length = 64
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `ipv6_address` (String) IPv6 address
+- `ipv6_prefix_length` (Number) IPv6 prefix
+ - Range: `0`-`128`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_data_ipv6_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_expanded_community_list.md b/docs/resources/policy_object_expanded_community_list.md
new file mode 100644
index 000000000..729712aa1
--- /dev/null
+++ b/docs/resources/policy_object_expanded_community_list.md
@@ -0,0 +1,51 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_expanded_community_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Expanded Community List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_expanded_community_list (Resource)
+
+This resource can manage a Policy Object Expanded Community List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_expanded_community_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ expanded_community_lists = ["abcd"]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `expanded_community_lists` (Set of String) Expanded Community List
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+- `expanded_community_lists_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_expanded_community_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_extended_community_list.md b/docs/resources/policy_object_extended_community_list.md
new file mode 100644
index 000000000..3ee71a906
--- /dev/null
+++ b/docs/resources/policy_object_extended_community_list.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_extended_community_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Extended Community List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_extended_community_list (Resource)
+
+This resource can manage a Policy Object Extended Community List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_extended_community_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ extended_community = "soo 10.0.0.1:30"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Extended Community List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `extended_community` (String) can be soo 10.0.0.1:30 or rt 500:50 etc.
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_extended_community_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_feature_profile.md b/docs/resources/policy_object_feature_profile.md
new file mode 100644
index 000000000..b068e34b1
--- /dev/null
+++ b/docs/resources/policy_object_feature_profile.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_feature_profile Resource - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ SD-WAN manager supports only a single policy object feature profile to be configured. This resource will therefore either create a new one if none exists or update the existing one.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_feature_profile (Resource)
+
+SD-WAN manager supports only a single policy object feature profile to be configured. This resource will therefore either create a new one if none exists or update the existing one.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_feature_profile" "example" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `description` (String) Description
+- `name` (String) The name of the policy object feature profile
+
+### Read-Only
+
+- `id` (String) The id of the object
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_ipv4_prefix_list.md b/docs/resources/policy_object_ipv4_prefix_list.md
new file mode 100644
index 000000000..a0f97f3be
--- /dev/null
+++ b/docs/resources/policy_object_ipv4_prefix_list.md
@@ -0,0 +1,70 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_ipv4_prefix_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object IPv4 Prefix List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_ipv4_prefix_list (Resource)
+
+This resource can manage a Policy Object IPv4 Prefix List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_ipv4_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv4_address = "10.0.0.0"
+ ipv4_prefix_length = 8
+ le = 24
+ ge = 16
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) IPv4 Prefix List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `ge` (Number) IPv4 prefix length with ge range operator
+ - Range: `1`-`32`
+- `ipv4_address` (String) IPv4 address
+- `ipv4_prefix_length` (Number) IPv4 prefix length
+ - Range: `0`-`32`
+- `le` (Number) IPv4 prefix length with le range operator
+ - Range: `1`-`32`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_ipv4_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_ipv6_prefix_list.md b/docs/resources/policy_object_ipv6_prefix_list.md
new file mode 100644
index 000000000..5746b2ca5
--- /dev/null
+++ b/docs/resources/policy_object_ipv6_prefix_list.md
@@ -0,0 +1,70 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_ipv6_prefix_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object IPv6 Prefix List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_ipv6_prefix_list (Resource)
+
+This resource can manage a Policy Object IPv6 Prefix List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_ipv6_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv6_address = "2001:db8:85a3::8a2e:370:7334"
+ ipv6_prefix_length = 64
+ le = 100
+ ge = 70
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `ge` (Number) IPv6 prefix length with ge range operator
+ - Range: `1`-`128`
+- `ipv6_address` (String) IPv6 address
+- `ipv6_prefix_length` (Number) IPv6 prefix length
+ - Range: `0`-`128`
+- `le` (Number) IPv6 prefix length with le range operator
+ - Range: `1`-`128`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_ipv6_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_mirror.md b/docs/resources/policy_object_mirror.md
new file mode 100644
index 000000000..ce001e9ab
--- /dev/null
+++ b/docs/resources/policy_object_mirror.md
@@ -0,0 +1,63 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_mirror Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Mirror Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_mirror (Resource)
+
+This resource can manage a Policy Object Mirror Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_mirror" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ remote_destination_ip = "10.0.0.1"
+ source_ip = "10.0.0.2"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Mirror List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `remote_destination_ip` (String) remote destination ip address
+- `source_ip` (String) source ip address
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_mirror.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_policer.md b/docs/resources/policy_object_policer.md
new file mode 100644
index 000000000..d8bc8fcfe
--- /dev/null
+++ b/docs/resources/policy_object_policer.md
@@ -0,0 +1,68 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_policer Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Policer Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_policer (Resource)
+
+This resource can manage a Policy Object Policer Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_policer" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ burst_bytes = 56500
+ exceed_action = "remark"
+ rate_bps = 60000
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Policer Entries (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `burst_bytes` (Number) Burst (Bytes)
+ - Range: `15000`-`10000000`
+- `exceed_action` (String) Exceed options such as Drop or Remark
+ - Choices: `drop`, `remark`
+- `rate_bps` (Number) Rate (bps)
+ - Range: `8`-`100000000000`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_policer.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_preferred_color_group.md b/docs/resources/policy_object_preferred_color_group.md
new file mode 100644
index 000000000..df1f86625
--- /dev/null
+++ b/docs/resources/policy_object_preferred_color_group.md
@@ -0,0 +1,71 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_preferred_color_group Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Preferred Color Group Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_preferred_color_group (Resource)
+
+This resource can manage a Policy Object Preferred Color Group Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_preferred_color_group" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ primary_color_preference = ["default"]
+ primary_path_preference = "direct-path"
+ secondary_color_preference = ["bronze"]
+ secondary_path_preference = "all-paths"
+ tertiary_color_preference = ["blue"]
+ tertiary_path_preference = "all-paths"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Preferred Color Group List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `primary_color_preference` (Set of String)
+- `primary_path_preference` (String) - Choices: `all-paths`, `direct-path`, `multi-hop-path`
+- `secondary_color_preference` (Set of String)
+- `secondary_path_preference` (String) - Choices: `all-paths`, `direct-path`, `multi-hop-path`
+- `tertiary_color_preference` (Set of String)
+- `tertiary_path_preference` (String) - Choices: `all-paths`, `direct-path`, `multi-hop-path`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_preferred_color_group.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_data_ipv4_prefix_list.md b/docs/resources/policy_object_security_data_ipv4_prefix_list.md
new file mode 100644
index 000000000..f0dc96199
--- /dev/null
+++ b/docs/resources/policy_object_security_data_ipv4_prefix_list.md
@@ -0,0 +1,62 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_data_ipv4_prefix_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security Data IPv4 Prefix List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_data_ipv4_prefix_list (Resource)
+
+This resource can manage a Policy Object Security Data IPv4 Prefix List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_data_ipv4_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ip_prefix = "10.0.0.0/12"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `ip_prefix` (String)
+- `ip_prefix_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_data_ipv4_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_fqdn_list.md b/docs/resources/policy_object_security_fqdn_list.md
new file mode 100644
index 000000000..c19f6b342
--- /dev/null
+++ b/docs/resources/policy_object_security_fqdn_list.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_fqdn_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security FQDN List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_fqdn_list (Resource)
+
+This resource can manage a Policy Object Security FQDN List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_fqdn_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ pattern = "cisco.com"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `pattern` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_fqdn_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_geolocation_list.md b/docs/resources/policy_object_security_geolocation_list.md
new file mode 100644
index 000000000..5afe89ad3
--- /dev/null
+++ b/docs/resources/policy_object_security_geolocation_list.md
@@ -0,0 +1,64 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_geolocation_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security Geolocation List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_geolocation_list (Resource)
+
+This resource can manage a Policy Object Security Geolocation List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_geolocation_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ country = "DZA"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Geolocation List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `continent` (String) continent name
+ - Choices: `AF`, `AN`, `AS`, `EU`, `NA`, `OC`, `SA`
+- `country` (String) country names
+ - Choices: `AFG`, `ALB`, `ATA`, `DZA`, `ASM`, `AND`, `AGO`, `ATG`, `AZE`, `ARG`, `AUS`, `AUT`, `BHS`, `BHR`, `BGD`, `ARM`, `BRB`, `BEL`, `BMU`, `BTN`, `BOL`, `BIH`, `BWA`, `BVT`, `BRA`, `BLZ`, `IOT`, `SLB`, `VGB`, `BRN`, `BGR`, `MMR`, `BDI`, `BLR`, `KHM`, `CMR`, `CAN`, `CPV`, `CYM`, `CAF`, `LKA`, `TCD`, `CHL`, `CHN`, `TWN`, `CXR`, `CCK`, `COL`, `COM`, `MYT`, `COG`, `COD`, `COK`, `CRI`, `HRV`, `CUB`, `CYP`, `CZE`, `BEN`, `DNK`, `DMA`, `DOM`, `ECU`, `SLV`, `GNQ`, `ETH`, `ERI`, `EST`, `FRO`, `FLK`, `SGS`, `FJI`, `FIN`, `ALA`, `FRA`, `GUF`, `PYF`, `ATF`, `DJI`, `GAB`, `GEO`, `GMB`, `PSE`, `DEU`, `GHA`, `GIB`, `KIR`, `GRC`, `GRL`, `GRD`, `GLP`, `GUM`, `GTM`, `GIN`, `GUY`, `HTI`, `HMD`, `VAT`, `HND`, `HKG`, `HUN`, `ISL`, `IND`, `IDN`, `IRN`, `IRQ`, `IRL`, `ISR`, `ITA`, `CIV`, `JAM`, `JPN`, `KAZ`, `JOR`, `KEN`, `PRK`, `KOR`, `KWT`, `KGZ`, `LAO`, `LBN`, `LSO`, `LVA`, `LBR`, `LBY`, `LIE`, `LTU`, `LUX`, `MAC`, `MDG`, `MWI`, `MYS`, `MDV`, `MLI`, `MLT`, `MTQ`, `MRT`, `MUS`, `MEX`, `MCO`, `MNG`, `MDA`, `MNE`, `MSR`, `MAR`, `MOZ`, `OMN`, `NAM`, `NRU`, `NPL`, `NLD`, `ANT`, `CUW`, `ABW`, `SXM`, `BES`, `NCL`, `VUT`, `NZL`, `NIC`, `NER`, `NGA`, `NIU`, `NFK`, `NOR`, `MNP`, `UMI`, `FSM`, `MHL`, `PLW`, `PAK`, `PAN`, `PNG`, `PRY`, `PER`, `PHL`, `PCN`, `POL`, `PRT`, `GNB`, `TLS`, `PRI`, `QAT`, `REU`, `ROU`, `RUS`, `RWA`, `BLM`, `SHN`, `KNA`, `AIA`, `LCA`, `MAF`, `SPM`, `VCT`, `SMR`, `STP`, `SAU`, `SEN`, `SRB`, `SYC`, `SLE`, `SGP`, `SVK`, `VNM`, `SVN`, `SOM`, `ZAF`, `ZWE`, `ESP`, `SSD`, `ESH`, `SDN`, `SUR`, `SJM`, `SWZ`, `SWE`, `CHE`, `SYR`, `TJK`, `THA`, `TGO`, `TKL`, `TON`, `TTO`, `ARE`, `TUN`, `TUR`, `TKM`, `TCA`, `TUV`, `UGA`, `UKR`, `MKD`, `EGY`, `GBR`, `GGY`, `JEY`, `IMN`, `TZA`, `USA`, `VIR`, `BFA`, `URY`, `UZB`, `VEN`, `WLF`, `WSM`, `YEM`, `ZMB`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_geolocation_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_identity_list.md b/docs/resources/policy_object_security_identity_list.md
new file mode 100644
index 000000000..f4885b9ce
--- /dev/null
+++ b/docs/resources/policy_object_security_identity_list.md
@@ -0,0 +1,62 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_identity_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security Identity List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_identity_list (Resource)
+
+This resource can manage a Policy Object Security Identity List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_identity_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ user = "administrator"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Array of Users and User Groups (see [below for nested schema](#nestedatt--entries))
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `user` (String)
+- `user_group` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_identity_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_ips_signature.md b/docs/resources/policy_object_security_ips_signature.md
new file mode 100644
index 000000000..fce9a641e
--- /dev/null
+++ b/docs/resources/policy_object_security_ips_signature.md
@@ -0,0 +1,63 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_ips_signature Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security IPS Signature Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_ips_signature (Resource)
+
+This resource can manage a Policy Object Security IPS Signature Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_ips_signature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ generator_id = "1234"
+ signature_id = "5678"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Ips Signature (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `generator_id` (String)
+- `signature_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_ips_signature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_local_application_list.md b/docs/resources/policy_object_security_local_application_list.md
new file mode 100644
index 000000000..606a9a922
--- /dev/null
+++ b/docs/resources/policy_object_security_local_application_list.md
@@ -0,0 +1,62 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_local_application_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security Local Application List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_local_application_list (Resource)
+
+This resource can manage a Policy Object Security Local Application List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_local_application_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ app = "audible-com"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+- `entries` (Attributes List) Localapp list (see [below for nested schema](#nestedatt--entries))
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `app` (String)
+- `app_family` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_local_application_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_local_domain_list.md b/docs/resources/policy_object_security_local_domain_list.md
new file mode 100644
index 000000000..4ed91f923
--- /dev/null
+++ b/docs/resources/policy_object_security_local_domain_list.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_local_domain_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security Local Domain List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_local_domain_list (Resource)
+
+This resource can manage a Policy Object Security Local Domain List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_local_domain_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ local_domain = "hello.com"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `local_domain` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_local_domain_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_port_list.md b/docs/resources/policy_object_security_port_list.md
new file mode 100644
index 000000000..65b0bcc23
--- /dev/null
+++ b/docs/resources/policy_object_security_port_list.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_port_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security Port List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_port_list (Resource)
+
+This resource can manage a Policy Object Security Port List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_port_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ port = "100"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Port List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `port` (String) can be single port or port range
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_port_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_scalable_group_tag_list.md b/docs/resources/policy_object_security_scalable_group_tag_list.md
new file mode 100644
index 000000000..c97ede113
--- /dev/null
+++ b/docs/resources/policy_object_security_scalable_group_tag_list.md
@@ -0,0 +1,63 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_scalable_group_tag_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security Scalable Group Tag List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_scalable_group_tag_list (Resource)
+
+This resource can manage a Policy Object Security Scalable Group Tag List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_scalable_group_tag_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = ""
+ entries = [
+ {
+ sgt_name = "ANY"
+ tag = "65535"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `sgt_name` (String)
+- `tag` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_scalable_group_tag_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_security_url_list.md b/docs/resources/policy_object_security_url_list.md
new file mode 100644
index 000000000..53162beca
--- /dev/null
+++ b/docs/resources/policy_object_security_url_list.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_security_url_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Security URL List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_security_url_list (Resource)
+
+This resource can manage a Policy Object Security URL List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_security_url_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ pattern = "www.cisco.com"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) URL List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `pattern` (String) valid url pattern
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_security_url_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_sla_class_list.md b/docs/resources/policy_object_sla_class_list.md
new file mode 100644
index 000000000..7337437b2
--- /dev/null
+++ b/docs/resources/policy_object_sla_class_list.md
@@ -0,0 +1,72 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_sla_class_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object SLA Class List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_sla_class_list (Resource)
+
+This resource can manage a Policy Object SLA Class List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_sla_class_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ latency = 2
+ loss = 1
+ jitter = 1
+ fallback_best_tunnel_criteria = "loss"
+ fallback_best_tunnel_loss_variance = 5
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Sla class List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `app_probe_class_list_id` (String)
+- `fallback_best_tunnel_criteria` (String) - Choices: `jitter`, `latency`, `loss`, `loss-latency`, `loss-jitter`, `latency-loss`, `latency-jitter`, `jitter-latency`, `jitter-loss`, `loss-latency-jitter`, `loss-jitter-latency`, `latency-loss-jitter`, `latency-jitter-loss`, `jitter-latency-loss`, `jitter-loss-latency`
+- `fallback_best_tunnel_jitter_variance` (Number) - Range: `1`-`1000`
+- `fallback_best_tunnel_latency_variance` (Number) - Range: `1`-`1000`
+- `fallback_best_tunnel_loss_variance` (Number) - Range: `0`-`100`
+- `jitter` (Number) - Range: `1`-`1000`
+- `latency` (Number) - Range: `1`-`1000`
+- `loss` (Number) - Range: `0`-`100`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_sla_class_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_standard_community_list.md b/docs/resources/policy_object_standard_community_list.md
new file mode 100644
index 000000000..fcf9ec091
--- /dev/null
+++ b/docs/resources/policy_object_standard_community_list.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_standard_community_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object Standard Community List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_standard_community_list (Resource)
+
+This resource can manage a Policy Object Standard Community List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_standard_community_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ standard_community = "1000:10000"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) Standard Community List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `standard_community` (String) Standard Community
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_standard_community_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_tloc_list.md b/docs/resources/policy_object_tloc_list.md
new file mode 100644
index 000000000..fbec3cb5b
--- /dev/null
+++ b/docs/resources/policy_object_tloc_list.md
@@ -0,0 +1,69 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_tloc_list Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object TLOC List Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_tloc_list (Resource)
+
+This resource can manage a Policy Object TLOC List Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_tloc_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ tloc_ip = "10.0.0.0"
+ color = "3g"
+ encapsulation = "gre"
+ preference = "33"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) TLOC List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `color` (String) color
+ - Choices: `3g`, `biz-internet`, `blue`, `bronze`, `custom1`, `custom2`, `custom3`, `default`, `gold`, `green`, `lte`, `metro-ethernet`, `mpls`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`, `public-internet`, `red`, `silver`
+- `encapsulation` (String) encapsulation
+ - Choices: `ipsec`, `gre`
+- `preference` (String) Preference
+- `tloc_ip` (String) tloc
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_tloc_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/policy_object_vpn_group.md b/docs/resources/policy_object_vpn_group.md
new file mode 100644
index 000000000..175f433db
--- /dev/null
+++ b/docs/resources/policy_object_vpn_group.md
@@ -0,0 +1,61 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_policy_object_vpn_group Resource - terraform-provider-sdwan"
+subcategory: "Policy Objects"
+description: |-
+ This resource can manage a Policy Object VPN Group Policy_object.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_policy_object_vpn_group (Resource)
+
+This resource can manage a Policy Object VPN Group Policy_object.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_policy_object_vpn_group" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ vpn = 100
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `entries` (Attributes List) VPN List (see [below for nested schema](#nestedatt--entries))
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Policy_object
+
+### Optional
+
+- `description` (String) The description of the Policy_object
+
+### Read-Only
+
+- `id` (String) The id of the Policy_object
+- `version` (Number) The version of the Policy_object
+
+
+### Nested Schema for `entries`
+
+Optional:
+
+- `vpn` (Number) can be single vpn id or vpn id range
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_policy_object_vpn_group.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/port_list_policy_object.md b/docs/resources/port_list_policy_object.md
index 24f17e853..e63e8a61a 100644
--- a/docs/resources/port_list_policy_object.md
+++ b/docs/resources/port_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_port_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Port List Policy Object .
---
diff --git a/docs/resources/preferred_color_group_policy_object.md b/docs/resources/preferred_color_group_policy_object.md
index 74cb59e98..0bee67cfc 100644
--- a/docs/resources/preferred_color_group_policy_object.md
+++ b/docs/resources/preferred_color_group_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_preferred_color_group_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Preferred Color Group Policy Object .
---
diff --git a/docs/resources/protocol_list_policy_object.md b/docs/resources/protocol_list_policy_object.md
index 587e1ac4b..4ad115196 100644
--- a/docs/resources/protocol_list_policy_object.md
+++ b/docs/resources/protocol_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_protocol_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Protocol List Policy Object .
---
diff --git a/docs/resources/qos_map_policy_definition.md b/docs/resources/qos_map_policy_definition.md
index 4e7d2d987..a821ba149 100644
--- a/docs/resources/qos_map_policy_definition.md
+++ b/docs/resources/qos_map_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_qos_map_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a QoS Map Policy Definition .
---
diff --git a/docs/resources/region_list_policy_object.md b/docs/resources/region_list_policy_object.md
index 58d830c29..93d7130d8 100644
--- a/docs/resources/region_list_policy_object.md
+++ b/docs/resources/region_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_region_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Region List Policy Object .
---
diff --git a/docs/resources/rewrite_rule_policy_definition.md b/docs/resources/rewrite_rule_policy_definition.md
index 0de81f4ec..446089e2d 100644
--- a/docs/resources/rewrite_rule_policy_definition.md
+++ b/docs/resources/rewrite_rule_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_rewrite_rule_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a Rewrite Rule Policy Definition .
---
diff --git a/docs/resources/route_policy_definition.md b/docs/resources/route_policy_definition.md
index a9717016c..7506fbde1 100644
--- a/docs/resources/route_policy_definition.md
+++ b/docs/resources/route_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_route_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Localized Policies"
+subcategory: "(Classic) Localized Policies"
description: |-
This resource can manage a Route Policy Definition .
---
diff --git a/docs/resources/rule_set_policy_definition.md b/docs/resources/rule_set_policy_definition.md
index 57ed7939e..e7b68053d 100644
--- a/docs/resources/rule_set_policy_definition.md
+++ b/docs/resources/rule_set_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_rule_set_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a Rule Set Policy Definition .
---
diff --git a/docs/resources/security_app_hosting_feature_template.md b/docs/resources/security_app_hosting_feature_template.md
index f88ff839f..b6d410e3c 100644
--- a/docs/resources/security_app_hosting_feature_template.md
+++ b/docs/resources/security_app_hosting_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_security_app_hosting_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Security App Hosting feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/security_policy.md b/docs/resources/security_policy.md
index a6d80f4c2..55f051feb 100644
--- a/docs/resources/security_policy.md
+++ b/docs/resources/security_policy.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_security_policy Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a Security Policy .
---
diff --git a/docs/resources/service_feature_profile.md b/docs/resources/service_feature_profile.md
index b77b01204..01c3862f5 100644
--- a/docs/resources/service_feature_profile.md
+++ b/docs/resources/service_feature_profile.md
@@ -4,11 +4,13 @@ page_title: "sdwan_service_feature_profile Resource - terraform-provider-sdwan"
subcategory: "Feature Profiles"
description: |-
This resource can manage a Service Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
---
# sdwan_service_feature_profile (Resource)
This resource can manage a Service Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
## Example Usage
diff --git a/docs/resources/service_lan_vpn_feature.md b/docs/resources/service_lan_vpn_feature.md
new file mode 100644
index 000000000..b96384917
--- /dev/null
+++ b/docs/resources/service_lan_vpn_feature.md
@@ -0,0 +1,595 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service LAN VPN Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_lan_vpn_feature (Resource)
+
+This resource can manage a Service LAN VPN Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_lan_vpn_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ vpn = 1
+ config_description = "VPN1"
+ omp_admin_distance_ipv4 = 1
+ omp_admin_distance_ipv6 = 1
+ enable_sdwan_remote_access = false
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ host_mappings = [
+ {
+ host_name = "HOSTMAPPING1"
+ list_of_ips = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2001:0:0:1::0/12"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "FW"
+ ipv4_addresses = ["1.2.3.4"]
+ tracking = true
+ }
+ ]
+ service_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ service = "SIG"
+ vpn = 0
+ }
+ ]
+ gre_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ interface = ["gre01"]
+ vpn = 0
+ }
+ ]
+ ipsec_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ interface = ["ipsec01"]
+ }
+ ]
+ nat_pools = [
+ {
+ nat_pool_name = 1
+ prefix_length = 3
+ range_start = "1.2.3.4"
+ range_end = "2.3.4.5"
+ overload = true
+ direction = "inside"
+ }
+ ]
+ nat_port_forwards = [
+ {
+ nat_pool_name = 2
+ source_port = 122
+ translate_port = 330
+ source_ip = "1.2.3.4"
+ translated_source_ip = "2.3.4.5"
+ protocol = "TCP"
+ }
+ ]
+ static_nats = [
+ {
+ nat_pool_name = 3
+ source_ip = "1.2.3.4"
+ translated_source_ip = "2.3.4.5"
+ static_nat_direction = "inside"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ name = "NATPOOL1"
+ range_start = "1.2.3.4"
+ range_end = "2.3.4.5"
+ overload = false
+ }
+ ]
+ ipv4_import_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+ ipv4_export_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+ ipv6_import_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+ ipv6_export_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `advertise_omp_ipv4s` (Attributes List) OMP Advertise IPv4 (see [below for nested schema](#nestedatt--advertise_omp_ipv4s))
+- `advertise_omp_ipv6s` (Attributes List) OMP Advertise IPv6 (see [below for nested schema](#nestedatt--advertise_omp_ipv6s))
+- `config_description` (String) Name
+- `config_description_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `enable_sdwan_remote_access` (Boolean) Enable SDWAN Remote Access
+ - Default value: `false`
+- `gre_routes` (Attributes List) IPv4 Static GRE Route (see [below for nested schema](#nestedatt--gre_routes))
+- `host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--host_mappings))
+- `ipsec_routes` (Attributes List) IPv4 Static IPSEC Route (see [below for nested schema](#nestedatt--ipsec_routes))
+- `ipv4_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_export_route_targets))
+- `ipv4_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_import_route_targets))
+- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
+- `ipv6_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_export_route_targets))
+- `ipv6_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_import_route_targets))
+- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
+- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
+- `nat_pools` (Attributes List) NAT Pool (see [below for nested schema](#nestedatt--nat_pools))
+- `nat_port_forwards` (Attributes List) NAT Port Forward (see [below for nested schema](#nestedatt--nat_port_forwards))
+- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
+ - Range: `1`-`255`
+- `omp_admin_distance_ipv4_variable` (String) Variable name
+- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
+ - Range: `1`-`255`
+- `omp_admin_distance_ipv6_variable` (String) Variable name
+- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
+- `primary_dns_address_ipv4_variable` (String) Variable name
+- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
+- `primary_dns_address_ipv6_variable` (String) Variable name
+- `route_leak_from_global_vpns` (Attributes List) Enable route leaking from Global to Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns))
+- `route_leak_from_other_services` (Attributes List) Enable route leak from another Service VPN to current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services))
+- `route_leak_to_global_vpns` (Attributes List) Enable route leaking from Service to Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns))
+- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
+- `secondary_dns_address_ipv4_variable` (String) Variable name
+- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
+- `secondary_dns_address_ipv6_variable` (String) Variable name
+- `service_routes` (Attributes List) Service (see [below for nested schema](#nestedatt--service_routes))
+- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
+- `static_nats` (Attributes List) Static NAT Rules (see [below for nested schema](#nestedatt--static_nats))
+- `vpn` (Number) VPN
+ - Range: `1`-`65527`
+ - Default value: `0`
+- `vpn_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `advertise_omp_ipv4s`
+
+Optional:
+
+- `prefixes` (Attributes List) IPv4 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv4s--prefixes))
+- `protocol` (String) Protocol
+ - Choices: `bgp`, `ospf`, `ospfv3`, `connected`, `static`, `network`, `aggregate`, `eigrp`, `lisp`, `isis`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+### Nested Schema for `advertise_omp_ipv4s.prefixes`
+
+Optional:
+
+- `aggregate_only` (Boolean) Aggregate Only
+ - Default value: `false`
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `region` (String) Applied to Region
+ - Choices: `core-and-access`, `core`, `access`
+ - Default value: `core-and-access`
+- `region_variable` (String) Variable name
+- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `advertise_omp_ipv6s`
+
+Optional:
+
+- `prefixes` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv6s--prefixes))
+- `protocol` (String) Protocol
+ - Choices: `BGP`, `OSPF`, `Connected`, `Static`, `Network`, `Aggregate`
+- `protocol_sub_type` (String) Protocol Sub Type
+ - Choices: `External`
+- `protocol_sub_type_variable` (String) Variable name
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+### Nested Schema for `advertise_omp_ipv6s.prefixes`
+
+Optional:
+
+- `aggregate_only` (Boolean) Aggregate Only
+ - Default value: `false`
+- `prefix` (String) IPv6 Prefix
+- `prefix_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `gre_routes`
+
+Optional:
+
+- `interface` (Set of String) Interface
+- `interface_variable` (String) Variable name
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+- `vpn` (Number) Service
+
+
+
+### Nested Schema for `host_mappings`
+
+Optional:
+
+- `host_name` (String) Hostname
+- `host_name_variable` (String) Variable name
+- `list_of_ips` (Set of String) List of IP
+- `list_of_ips_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipsec_routes`
+
+Optional:
+
+- `interface` (Set of String) Interface
+- `interface_variable` (String) Variable name
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_export_route_targets`
+
+Optional:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_import_route_targets`
+
+Optional:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_static_routes`
+
+Optional:
+
+- `gateway_dhcp` (Boolean) IPv4 Route Gateway DHCP
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `next_hop_with_trackers` (Attributes List) IPv4 Route Gateway Next Hop with Tracker (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hop_with_trackers))
+- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
+- `null0` (Boolean) IPv4 Route Gateway Next Hop
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+- `vpn` (Boolean) IPv4 Route Gateway VPN
+
+
+### Nested Schema for `ipv4_static_routes.next_hop_with_trackers`
+
+Optional:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+ - Range: `1`-`255`
+- `administrative_distance_variable` (String) Variable name
+- `tracker_id` (String)
+
+
+
+### Nested Schema for `ipv4_static_routes.next_hops`
+
+Optional:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+ - Range: `1`-`255`
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_export_route_targets`
+
+Optional:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_import_route_targets`
+
+Optional:
+
+- `route_target` (String) Route target
+- `route_target_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_static_routes`
+
+Optional:
+
+- `nat` (String) IPv6 Nat
+ - Choices: `NAT64`, `NAT66`
+- `nat_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
+- `null0` (Boolean) IPv6 Route Gateway Next Hop
+- `prefix` (String) Prefix
+- `prefix_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_static_routes.next_hops`
+
+Optional:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+ - Range: `1`-`254`
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `nat_64_v4_pools`
+
+Optional:
+
+- `name` (String) NAT64 v4 Pool Name
+- `name_variable` (String) Variable name
+- `overload` (Boolean) NAT64 Overload
+ - Default value: `false`
+- `overload_variable` (String) Variable name
+- `range_end` (String) NAT64 Pool Range End
+- `range_end_variable` (String) Variable name
+- `range_start` (String) NAT64 Pool Range Start
+- `range_start_variable` (String) Variable name
+
+
+
+### Nested Schema for `nat_pools`
+
+Optional:
+
+- `direction` (String) NAT Direction
+ - Choices: `inside`, `outside`
+- `direction_variable` (String) Variable name
+- `nat_pool_name` (Number) NAT Pool Name
+ - Range: `1`-`32`
+- `nat_pool_name_variable` (String) Variable name
+- `overload` (Boolean) NAT Overload
+ - Default value: `true`
+- `overload_variable` (String) Variable name
+- `prefix_length` (Number) NAT Pool Prefix Length
+ - Range: `1`-`32`
+- `prefix_length_variable` (String) Variable name
+- `range_end` (String) NAT Pool Range End
+- `range_end_variable` (String) Variable name
+- `range_start` (String) NAT Pool Range Start
+- `range_start_variable` (String) Variable name
+- `tracker_object_id` (String)
+
+
+
+### Nested Schema for `nat_port_forwards`
+
+Optional:
+
+- `nat_pool_name` (Number) NAT Pool Name
+ - Range: `1`-`32`
+- `nat_pool_name_variable` (String) Variable name
+- `protocol` (String) Protocol
+ - Choices: `TCP`, `UDP`
+- `protocol_variable` (String) Variable name
+- `source_ip` (String) Source IP Address
+- `source_ip_variable` (String) Variable name
+- `source_port` (Number) Source Port
+- `source_port_variable` (String) Variable name
+- `translate_port` (Number) Translate Port
+- `translate_port_variable` (String) Variable name
+- `translated_source_ip` (String) Translated Source IP Address
+- `translated_source_ip_variable` (String) Variable name
+
+
+
+### Nested Schema for `route_leak_from_global_vpns`
+
+Optional:
+
+- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns--redistributions))
+- `route_policy_id` (String)
+- `route_protocol` (String) Leak Routes of particular protocol from Global to Service VPN
+ - Choices: `static`, `connected`, `bgp`, `ospf`
+- `route_protocol_variable` (String) Variable name
+
+
+### Nested Schema for `route_leak_from_global_vpns.redistributions`
+
+Optional:
+
+- `protocol` (String) Protocol to restributed leaked routes
+ - Choices: `bgp`, `ospf`
+- `protocol_variable` (String) Variable name
+- `redistribution_policy_id` (String)
+
+
+
+
+### Nested Schema for `route_leak_from_other_services`
+
+Optional:
+
+- `redistributions` (Attributes List) Redistribute Route to specific Protocol on Current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services--redistributions))
+- `route_policy_id` (String)
+- `route_protocol` (String) Leak Route of particular protocol from Source Service VPN
+ - Choices: `static`, `connected`, `bgp`, `ospf`
+- `route_protocol_variable` (String) Variable name
+- `source_vpn` (Number) Source Service VPN from where route are to be leaked
+ - Range: `1`-`65530`
+- `source_vpn_variable` (String) Variable name
+
+
+### Nested Schema for `route_leak_from_other_services.redistributions`
+
+Optional:
+
+- `protocol` (String) Protocol to restributed leaked routes
+ - Choices: `bgp`, `ospf`
+- `protocol_variable` (String) Variable name
+- `redistribution_policy_id` (String)
+
+
+
+
+### Nested Schema for `route_leak_to_global_vpns`
+
+Optional:
+
+- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns--redistributions))
+- `route_policy_id` (String)
+- `route_protocol` (String) Leak Routes of particular protocol from Service to Global VPN
+ - Choices: `static`, `connected`, `bgp`, `ospf`
+- `route_protocol_variable` (String) Variable name
+
+
+### Nested Schema for `route_leak_to_global_vpns.redistributions`
+
+Optional:
+
+- `protocol` (String) Protocol to restributed leaked routes
+ - Choices: `bgp`, `ospf`
+- `protocol_variable` (String) Variable name
+- `redistribution_policy_id` (String)
+
+
+
+
+### Nested Schema for `service_routes`
+
+Optional:
+
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `service` (String) Service
+ - Choices: `SIG`
+ - Default value: `SIG`
+- `service_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+- `vpn` (Number) Service
+
+
+
+### Nested Schema for `services`
+
+Optional:
+
+- `ipv4_addresses` (Set of String) IPv4 Addresses (Maximum: 4)
+- `ipv4_addresses_variable` (String) Variable name
+- `service_type` (String) Service Type
+ - Choices: `FW`, `IDS`, `IDP`, `netsvc1`, `netsvc2`, `netsvc3`, `netsvc4`, `TE`, `appqoe`
+- `service_type_variable` (String) Variable name
+- `tracking` (Boolean) Tracking
+ - Default value: `true`
+- `tracking_variable` (String) Variable name
+
+
+
+### Nested Schema for `static_nats`
+
+Optional:
+
+- `nat_pool_name` (Number) NAT Pool Name
+ - Range: `1`-`32`
+- `nat_pool_name_variable` (String) Variable name
+- `source_ip` (String) Source IP Address
+- `source_ip_variable` (String) Variable name
+- `static_nat_direction` (String) Static NAT Direction
+ - Choices: `inside`, `outside`
+- `static_nat_direction_variable` (String) Variable name
+- `tracker_object_id` (String)
+- `translated_source_ip` (String) Translated Source IP Address
+- `translated_source_ip_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_lan_vpn_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_lan_vpn_interface_ethernet_feature.md b/docs/resources/service_lan_vpn_interface_ethernet_feature.md
new file mode 100644
index 000000000..1a62faedf
--- /dev/null
+++ b/docs/resources/service_lan_vpn_interface_ethernet_feature.md
@@ -0,0 +1,401 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_ethernet_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service LAN VPN Interface Ethernet Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_lan_vpn_interface_ethernet_feature (Resource)
+
+This resource can manage a Service LAN VPN Interface Ethernet Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_lan_vpn_interface_ethernet_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = false
+ interface_name = "GigabitEthernet3"
+ interface_description = "LAN"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "1.2.3.5"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ ipv6_dhcp_helpers = [
+ {
+ address = "2001:0:0:1::0"
+ dhcpv6_helper_vpn = 1
+ }
+ ]
+ ipv4_nat = false
+ ipv4_nat_type = "pool"
+ ipv4_nat_range_start = "1.2.3.4"
+ ipv4_nat_range_end = "4.5.6.7"
+ ipv4_nat_prefix_length = 1
+ ipv4_nat_overload = true
+ ipv4_nat_loopback = "123"
+ ipv4_nat_udp_timeout = 123
+ ipv4_nat_tcp_timeout = 123
+ static_nats = [
+ {
+ source_ip = "1.2.3.4"
+ translate_ip = "2.3.4.5"
+ direction = "inside"
+ source_vpn = 0
+ }
+ ]
+ ipv6_nat = true
+ nat64 = false
+ acl_shaping_rate = 12
+ ipv6_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ ipv6_addresses = [
+ {
+ link_local_address = "1::1"
+ global_address = "1::1/24"
+ }
+ ]
+ }
+ ]
+ ipv4_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ address = "1.2.3.4"
+ secondary_addresses = [
+ {
+ address = "2.3.4.5"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ tloc_prefix_change = true
+ tloc_pref_change_value = 100
+ }
+ ]
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ trustsec_enable_sgt_propogation = false
+ trustsec_propogate = true
+ trustsec_security_group_tag = 123
+ trustsec_enable_enforced_propogation = false
+ trustsec_enforced_security_group_tag = 1234
+ duplex = "full"
+ mac_address = "00-B0-D0-63-C2-26"
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 500
+ speed = "1000"
+ arp_timeout = 1200
+ autonegotiate = false
+ media_type = "auto-select"
+ load_interval = 30
+ tracker = "TRACKER1"
+ icmp_redirect_disable = true
+ xconnect = "1"
+ ip_directed_broadcast = false
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `acl_ipv4_egress_policy_id` (String)
+- `acl_ipv4_ingress_policy_id` (String)
+- `acl_ipv6_egress_policy_id` (String)
+- `acl_ipv6_ingress_policy_id` (String)
+- `acl_shaping_rate` (Number) Shaping Rate (Kbps)
+ - Range: `8`-`100000000`
+- `acl_shaping_rate_variable` (String) Variable name
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+ - Range: `0`-`2147483`
+ - Default value: `1200`
+- `arp_timeout_variable` (String) Variable name
+- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
+- `autonegotiate` (Boolean) Link autonegotiation
+- `autonegotiate_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `duplex` (String) Duplex mode
+ - Choices: `full`, `half`, `auto`
+- `duplex_variable` (String) Variable name
+- `enable_dhcpv6` (Boolean) Enable DHCPv6
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+ - Default value: `true`
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU
+ - Range: `1500`-`9216`
+ - Default value: `1500`
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+ - Default value: `false`
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+ - Range: `576`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String) IP Address
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_dhcp_distance` (Number) DHCP Distance
+ - Range: `1`-`65536`
+- `ipv4_dhcp_distance_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `ipv4_nat` (Boolean) enable Network Address Translation on this interface
+ - Default value: `false`
+- `ipv4_nat_loopback` (String) NAT Inside Source Loopback Interface
+- `ipv4_nat_loopback_variable` (String) Variable name
+- `ipv4_nat_overload` (Boolean) NAT Overload
+ - Default value: `true`
+- `ipv4_nat_overload_variable` (String) Variable name
+- `ipv4_nat_prefix_length` (Number) NAT Pool Prefix Length
+ - Range: `1`-`32`
+- `ipv4_nat_prefix_length_variable` (String) Variable name
+- `ipv4_nat_range_end` (String) NAT Pool Range End
+- `ipv4_nat_range_end_variable` (String) Variable name
+- `ipv4_nat_range_start` (String) NAT Pool Range Start
+- `ipv4_nat_range_start_variable` (String) Variable name
+- `ipv4_nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
+ - Range: `1`-`8947`
+ - Default value: `60`
+- `ipv4_nat_tcp_timeout_variable` (String) Variable name
+- `ipv4_nat_type` (String) NAT Type
+ - Choices: `pool`, `loopback`
+- `ipv4_nat_type_variable` (String) Variable name
+- `ipv4_nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
+ - Range: `1`-`8947`
+ - Default value: `1`
+- `ipv4_nat_udp_timeout_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv4_vrrps` (Attributes List) Enable VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
+- `ipv6_address` (String) IPv6 Address Secondary
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
+- `ipv6_dhcp_secondary_addresses` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_addresses))
+- `ipv6_nat` (Boolean) enable Network Address Translation ipv6 on this interface
+ - Default value: `false`
+- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
+- `ipv6_vrrps` (Attributes List) Enable VRRP Ipv6 (see [below for nested schema](#nestedatt--ipv6_vrrps))
+- `load_interval` (Number) Interval for interface load calculation
+ - Range: `30`-`600`
+ - Default value: `30`
+- `load_interval_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+- `media_type` (String) Media type
+ - Choices: `auto-select`, `rj45`, `sfp`
+- `media_type_variable` (String) Variable name
+- `nat64` (Boolean) NAT64 on this interface
+ - Default value: `false`
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+- `shutdown` (Boolean) - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+ - Choices: `10`, `100`, `1000`, `2500`, `10000`
+- `speed_variable` (String) Variable name
+- `static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--static_nats))
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `tracker` (String) Enable tracker for this interface
+- `tracker_variable` (String) Variable name
+- `trustsec_enable_enforced_propogation` (Boolean) Enable/Disable SGT Enforcement on an interface
+- `trustsec_enable_sgt_propogation` (Boolean) Indicates that the interface is trustworthy for CTS
+ - Default value: `false`
+- `trustsec_enforced_security_group_tag` (Number) SGT value between 2 and 65519
+ - Range: `2`-`65519`
+- `trustsec_enforced_security_group_tag_variable` (String) Variable name
+- `trustsec_propogate` (Boolean) Enables the interface for CTS SGT authorization and forwarding
+ - Default value: `true`
+- `trustsec_security_group_tag` (Number) SGT value between 2 and 65519
+ - Range: `2`-`65519`
+- `trustsec_security_group_tag_variable` (String) Variable name
+- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local LAN interface
+- `xconnect_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arps`
+
+Optional:
+
+- `ip_address` (String) IPV4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Optional:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_vrrps`
+
+Optional:
+
+- `address` (String) VRRP Ip Address
+- `address_variable` (String) Variable name
+- `group_id` (Number) Group ID
+ - Range: `1`-`255`
+- `group_id_variable` (String) Variable name
+- `priority` (Number) Set priority
+ - Range: `1`-`254`
+ - Default value: `100`
+- `priority_variable` (String) Variable name
+- `secondary_addresses` (Attributes List) VRRP Secondary Ip Addresses (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+ - Range: `100`-`40950`
+ - Default value: `1000`
+- `timer_variable` (String) Variable name
+- `tloc_pref_change_value` (Number) Timer interval for successive advertisements, in milliseconds
+ - Range: `100`-`4294967295`
+- `tloc_prefix_change` (Boolean) Timer interval for successive advertisements, in milliseconds
+ - Default value: `false`
+- `track_omp` (Boolean) Track OMP status
+ - Default value: `false`
+
+
+### Nested Schema for `ipv4_vrrps.secondary_addresses`
+
+Optional:
+
+- `address` (String) Ip Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_dhcp_helpers`
+
+Optional:
+
+- `address` (String) DHCPv6 Helper address
+- `address_variable` (String) Variable name
+- `dhcpv6_helper_vpn` (Number) DHCPv6 Helper VPN
+ - Range: `1`-`65536`
+- `dhcpv6_helper_vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_dhcp_secondary_addresses`
+
+Optional:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_secondary_addresses`
+
+Optional:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_vrrps`
+
+Optional:
+
+- `group_id` (Number) Group ID
+ - Range: `1`-`255`
+- `group_id_variable` (String) Variable name
+- `ipv6_addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--ipv6_addresses))
+- `priority` (Number) Set priority
+ - Range: `1`-`254`
+ - Default value: `100`
+- `priority_variable` (String) Variable name
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+ - Range: `100`-`40950`
+ - Default value: `1000`
+- `timer_variable` (String) Variable name
+- `track_omp` (Boolean) Track OMP status
+ - Default value: `false`
+
+
+### Nested Schema for `ipv6_vrrps.ipv6_addresses`
+
+Optional:
+
+- `global_address` (String) Assign Global IPv6 Prefix
+- `global_address_variable` (String) Variable name
+- `link_local_address` (String) Use link-local IPv6 Address
+- `link_local_address_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `static_nats`
+
+Optional:
+
+- `direction` (String) Direction of static NAT translation
+ - Choices: `inside`, `outside`
+ - Default value: `inside`
+- `source_ip` (String) Source IP address to be translated
+- `source_ip_variable` (String) Variable name
+- `source_vpn` (Number) Source VPN ID
+ - Range: `0`-`65530`
+ - Default value: `0`
+- `source_vpn_variable` (String) Variable name
+- `translate_ip` (String) Statically translated source IP address
+- `translate_ip_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_lan_vpn_interface_ethernet_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_lan_vpn_interface_ethernet_profile_parcel.md b/docs/resources/service_lan_vpn_interface_ethernet_profile_parcel.md
deleted file mode 100644
index bf557bbda..000000000
--- a/docs/resources/service_lan_vpn_interface_ethernet_profile_parcel.md
+++ /dev/null
@@ -1,401 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_ethernet_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Service LAN VPN Interface Ethernet profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_service_lan_vpn_interface_ethernet_profile_parcel (Resource)
-
-This resource can manage a Service LAN VPN Interface Ethernet profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = false
- interface_name = "GigabitEthernet3"
- interface_description = "LAN"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "1.2.3.5"
- subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helper = ["1.2.3.4"]
- ipv6_dhcp_helpers = [
- {
- address = "2001:0:0:1::0"
- dhcpv6_helper_vpn = 1
- }
- ]
- ipv4_nat = false
- ipv4_nat_type = "pool"
- ipv4_nat_range_start = "1.2.3.4"
- ipv4_nat_range_end = "4.5.6.7"
- ipv4_nat_prefix_length = 1
- ipv4_nat_overload = true
- ipv4_nat_loopback = "123"
- ipv4_nat_udp_timeout = 123
- ipv4_nat_tcp_timeout = 123
- static_nats = [
- {
- source_ip = "1.2.3.4"
- translate_ip = "2.3.4.5"
- direction = "inside"
- source_vpn = 0
- }
- ]
- ipv6_nat = true
- nat64 = false
- acl_shaping_rate = 12
- ipv6_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- ipv6_addresses = [
- {
- link_local_address = "1::1"
- global_address = "1::1/24"
- }
- ]
- }
- ]
- ipv4_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- address = "1.2.3.4"
- secondary_addresses = [
- {
- address = "2.3.4.5"
- subnet_mask = "0.0.0.0"
- }
- ]
- tloc_prefix_change = true
- tloc_pref_change_value = 100
- }
- ]
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- trustsec_enable_sgt_propogation = false
- trustsec_propogate = true
- trustsec_security_group_tag = 123
- trustsec_enable_enforced_propogation = false
- trustsec_enforced_security_group_tag = 1234
- duplex = "full"
- mac_address = "00-B0-D0-63-C2-26"
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 500
- speed = "1000"
- arp_timeout = 1200
- autonegotiate = false
- media_type = "auto-select"
- load_interval = 30
- tracker = "TRACKER1"
- icmp_redirect_disable = true
- xconnect = "1"
- ip_directed_broadcast = false
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `acl_ipv4_egress_policy_id` (String)
-- `acl_ipv4_ingress_policy_id` (String)
-- `acl_ipv6_egress_policy_id` (String)
-- `acl_ipv6_ingress_policy_id` (String)
-- `acl_shaping_rate` (Number) Shaping Rate (Kbps)
- - Range: `8`-`100000000`
-- `acl_shaping_rate_variable` (String) Variable name
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
- - Range: `0`-`2147483`
- - Default value: `1200`
-- `arp_timeout_variable` (String) Variable name
-- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
-- `autonegotiate` (Boolean) Link autonegotiation
-- `autonegotiate_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `duplex` (String) Duplex mode
- - Choices: `full`, `half`, `auto`
-- `duplex_variable` (String) Variable name
-- `enable_dhcpv6` (Boolean) Enable DHCPv6
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
- - Default value: `true`
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU
- - Range: `1500`-`9216`
- - Default value: `1500`
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
- - Default value: `false`
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
- - Range: `576`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String) IP Address
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_dhcp_distance` (Number) DHCP Distance
- - Range: `1`-`65536`
-- `ipv4_dhcp_distance_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `ipv4_nat` (Boolean) enable Network Address Translation on this interface
- - Default value: `false`
-- `ipv4_nat_loopback` (String) NAT Inside Source Loopback Interface
-- `ipv4_nat_loopback_variable` (String) Variable name
-- `ipv4_nat_overload` (Boolean) NAT Overload
- - Default value: `true`
-- `ipv4_nat_overload_variable` (String) Variable name
-- `ipv4_nat_prefix_length` (Number) NAT Pool Prefix Length
- - Range: `1`-`32`
-- `ipv4_nat_prefix_length_variable` (String) Variable name
-- `ipv4_nat_range_end` (String) NAT Pool Range End
-- `ipv4_nat_range_end_variable` (String) Variable name
-- `ipv4_nat_range_start` (String) NAT Pool Range Start
-- `ipv4_nat_range_start_variable` (String) Variable name
-- `ipv4_nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
- - Range: `1`-`8947`
- - Default value: `60`
-- `ipv4_nat_tcp_timeout_variable` (String) Variable name
-- `ipv4_nat_type` (String) NAT Type
- - Choices: `pool`, `loopback`
-- `ipv4_nat_type_variable` (String) Variable name
-- `ipv4_nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
- - Range: `1`-`8947`
- - Default value: `1`
-- `ipv4_nat_udp_timeout_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv4_vrrps` (Attributes List) Enable VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
-- `ipv6_address` (String) IPv6 Address Secondary
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
-- `ipv6_dhcp_secondary_addresses` (Attributes List) secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_addresses))
-- `ipv6_nat` (Boolean) enable Network Address Translation ipv6 on this interface
- - Default value: `false`
-- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
-- `ipv6_vrrps` (Attributes List) Enable VRRP Ipv6 (see [below for nested schema](#nestedatt--ipv6_vrrps))
-- `load_interval` (Number) Interval for interface load calculation
- - Range: `30`-`600`
- - Default value: `30`
-- `load_interval_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-- `media_type` (String) Media type
- - Choices: `auto-select`, `rj45`, `sfp`
-- `media_type_variable` (String) Variable name
-- `nat64` (Boolean) NAT64 on this interface
- - Default value: `false`
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Profile ID
-- `shutdown` (Boolean) - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `speed` (String) Set interface speed
- - Choices: `10`, `100`, `1000`, `2500`, `10000`
-- `speed_variable` (String) Variable name
-- `static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--static_nats))
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `tracker` (String) Enable tracker for this interface
-- `tracker_variable` (String) Variable name
-- `trustsec_enable_enforced_propogation` (Boolean) Enable/Disable SGT Enforcement on an interface
-- `trustsec_enable_sgt_propogation` (Boolean) Indicates that the interface is trustworthy for CTS
- - Default value: `false`
-- `trustsec_enforced_security_group_tag` (Number) SGT value between 2 and 65519
- - Range: `2`-`65519`
-- `trustsec_enforced_security_group_tag_variable` (String) Variable name
-- `trustsec_propogate` (Boolean) Enables the interface for CTS SGT authorization and forwarding
- - Default value: `true`
-- `trustsec_security_group_tag` (Number) SGT value between 2 and 65519
- - Range: `2`-`65519`
-- `trustsec_security_group_tag_variable` (String) Variable name
-- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local LAN interface
-- `xconnect_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arps`
-
-Optional:
-
-- `ip_address` (String) IPV4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Optional:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_vrrps`
-
-Optional:
-
-- `address` (String) VRRP Ip Address
-- `address_variable` (String) Variable name
-- `group_id` (Number) Group ID
- - Range: `1`-`255`
-- `group_id_variable` (String) Variable name
-- `priority` (Number) Set priority
- - Range: `1`-`254`
- - Default value: `100`
-- `priority_variable` (String) Variable name
-- `secondary_addresses` (Attributes List) VRRP Secondary Ip Addresses (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
- - Range: `100`-`40950`
- - Default value: `1000`
-- `timer_variable` (String) Variable name
-- `tloc_pref_change_value` (Number) Timer interval for successive advertisements, in milliseconds
- - Range: `100`-`4294967295`
-- `tloc_prefix_change` (Boolean) Timer interval for successive advertisements, in milliseconds
- - Default value: `false`
-- `track_omp` (Boolean) Track OMP status
- - Default value: `false`
-
-
-### Nested Schema for `ipv4_vrrps.secondary_addresses`
-
-Optional:
-
-- `address` (String) Ip Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_dhcp_helpers`
-
-Optional:
-
-- `address` (String) DHCPv6 Helper address
-- `address_variable` (String) Variable name
-- `dhcpv6_helper_vpn` (Number) DHCPv6 Helper VPN
- - Range: `1`-`65536`
-- `dhcpv6_helper_vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_dhcp_secondary_addresses`
-
-Optional:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_secondary_addresses`
-
-Optional:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_vrrps`
-
-Optional:
-
-- `group_id` (Number) Group ID
- - Range: `1`-`255`
-- `group_id_variable` (String) Variable name
-- `ipv6_addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--ipv6_addresses))
-- `priority` (Number) Set priority
- - Range: `1`-`254`
- - Default value: `100`
-- `priority_variable` (String) Variable name
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
- - Range: `100`-`40950`
- - Default value: `1000`
-- `timer_variable` (String) Variable name
-- `track_omp` (Boolean) Track OMP status
- - Default value: `false`
-
-
-### Nested Schema for `ipv6_vrrps.ipv6_addresses`
-
-Optional:
-
-- `global_address` (String) Assign Global IPv6 Prefix
-- `global_address_variable` (String) Variable name
-- `link_local_address` (String) Use link-local IPv6 Address
-- `link_local_address_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `static_nats`
-
-Optional:
-
-- `direction` (String) Direction of static NAT translation
- - Choices: `inside`, `outside`
- - Default value: `inside`
-- `source_ip` (String) Source IP address to be translated
-- `source_ip_variable` (String) Variable name
-- `source_vpn` (Number) Source VPN ID
- - Range: `0`-`65530`
- - Default value: `0`
-- `source_vpn_variable` (String) Variable name
-- `translate_ip` (String) Statically translated source IP address
-- `translate_ip_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_service_lan_vpn_interface_ethernet_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/service_lan_vpn_interface_gre_feature.md b/docs/resources/service_lan_vpn_interface_gre_feature.md
new file mode 100644
index 000000000..92d2c7bfd
--- /dev/null
+++ b/docs/resources/service_lan_vpn_interface_gre_feature.md
@@ -0,0 +1,95 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_gre_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service LAN VPN Interface GRE Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_lan_vpn_interface_gre_feature (Resource)
+
+This resource can manage a Service LAN VPN Interface GRE Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_lan_vpn_interface_gre_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "gre1"
+ interface_description = "gre1"
+ ipv4_address = "70.1.1.1"
+ ipv4_subnet_mask = "255.255.255.0"
+ shutdown = true
+ tunnel_source_ipv4_address = "78.1.1.1"
+ tunnel_destination_ipv4_address = "79.1.1.1"
+ ip_mtu = 1500
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ application_tunnel_type = "none"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `interface_name` (String) Interface name (1..255)
+- `ipv4_address` (String)
+- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `name` (String) The name of the Feature
+- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
+
+### Optional
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+ - Choices: `none`, `sig`
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+ - Default value: `false`
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
+ - Range: `576`-`9976`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+- `shutdown` (Boolean) Administrative state
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
+- `tunnel_route_via_loopback_variable` (String) Variable name
+- `tunnel_source_interface` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback_variable` (String) Variable name
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_lan_vpn_interface_gre_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_lan_vpn_interface_gre_profile_parcel.md b/docs/resources/service_lan_vpn_interface_gre_profile_parcel.md
deleted file mode 100644
index e72426c15..000000000
--- a/docs/resources/service_lan_vpn_interface_gre_profile_parcel.md
+++ /dev/null
@@ -1,95 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_gre_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Service LAN VPN Interface GRE profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_service_lan_vpn_interface_gre_profile_parcel (Resource)
-
-This resource can manage a Service LAN VPN Interface GRE profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_service_lan_vpn_interface_gre_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "gre1"
- interface_description = "gre1"
- ipv4_address = "70.1.1.1"
- ipv4_subnet_mask = "255.255.255.0"
- shutdown = true
- tunnel_source_ipv4_address = "78.1.1.1"
- tunnel_destination_ipv4_address = "79.1.1.1"
- ip_mtu = 1500
- tcp_mss = 1460
- clear_dont_fragment = false
- application_tunnel_type = "none"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `interface_name` (String) Interface name (1..255)
-- `ipv4_address` (String)
-- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `name` (String) The name of the profile parcel
-- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
-
-### Optional
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
- - Choices: `none`, `sig`
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
- - Default value: `false`
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
- - Range: `576`-`9976`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Parcel ID
-- `shutdown` (Boolean) Administrative state
- - Default value: `false`
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
-- `tunnel_route_via_loopback_variable` (String) Variable name
-- `tunnel_source_interface` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback_variable` (String) Variable name
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_service_lan_vpn_interface_gre_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/service_lan_vpn_interface_ipsec_feature.md b/docs/resources/service_lan_vpn_interface_ipsec_feature.md
new file mode 100644
index 000000000..161f1bc93
--- /dev/null
+++ b/docs/resources/service_lan_vpn_interface_ipsec_feature.md
@@ -0,0 +1,166 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_ipsec_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service LAN VPN Interface IPSec Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_lan_vpn_interface_ipsec_feature (Resource)
+
+This resource can manage a Service LAN VPN Interface IPSec Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_lan_vpn_interface_ipsec_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "ipsec987"
+ shutdown = true
+ interface_description = "ipsec987"
+ ipv4_address = "9.7.5.4"
+ ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_ipv4_address = "1.3.5.88"
+ tunnel_source_ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_interface = "GigabitEthernet8"
+ tunnel_destination_ipv4_address = "2.55.67.99"
+ tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
+ application_tunnel_type = "none"
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ ip_mtu = 1500
+ dpd_interval = 10
+ dpd_retries = 3
+ ike_preshared_key = "123"
+ ike_version = 1
+ ike_integrity_protocol = "main"
+ ike_rekey_interval = 14400
+ ike_ciphersuite = "aes256-cbc-sha1"
+ ike_diffie_hellman_group = "16"
+ ike_id_local_end_point = "xxx"
+ ike_id_remote_end_point = "xxx"
+ ipsec_rekey_interval = 3600
+ ipsec_replay_window = 512
+ ipsec_ciphersuite = "aes256-gcm"
+ perfect_forward_secrecy = "group-16"
+ tunnel_route_via = "2222"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+ - Choices: `none`, `sig`
+- `feature_profile_id` (String) Feature Profile ID
+- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
+- `interface_name` (String) Interface name: IPsec when present
+- `ipv4_address` (String)
+- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `name` (String) The name of the Feature
+- `tunnel_destination_ipv4_address` (String)
+- `tunnel_destination_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_source_ipv4_address` (String)
+- `tunnel_source_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+
+### Optional
+
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+ - Default value: `false`
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `dpd_interval` (Number) IKE keepalive interval (seconds)
+ - Range: `10`-`3600`
+ - Default value: `10`
+- `dpd_interval_variable` (String) Variable name
+- `dpd_retries` (Number) IKE keepalive retries
+ - Range: `2`-`60`
+ - Default value: `3`
+- `dpd_retries_variable` (String) Variable name
+- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
+ - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha2`, `aes128-cbc-sha1`, `aes128-cbc-sha2`
+ - Default value: `aes256-cbc-sha1`
+- `ike_ciphersuite_variable` (String) Variable name
+- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
+ - Choices: `2`, `14`, `15`, `16`, `19`, `20`, `21`, `24`
+ - Default value: `16`
+- `ike_diffie_hellman_group_variable` (String) Variable name
+- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_local_end_point_variable` (String) Variable name
+- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_remote_end_point_variable` (String) Variable name
+- `ike_integrity_protocol` (String) IKE integrity protocol
+ - Choices: `main`, `aggressive`
+ - Default value: `main`
+- `ike_integrity_protocol_variable` (String) Variable name
+- `ike_preshared_key_variable` (String) Variable name
+- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
+ - Range: `60`-`86400`
+ - Default value: `14400`
+- `ike_rekey_interval_variable` (String) Variable name
+- `ike_version` (Number) IKE Version <1..2>
+ - Range: `1`-`2`
+ - Default value: `1`
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
+ - Range: `68`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
+ - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha384`, `aes256-cbc-sha256`, `aes256-cbc-sha512`, `aes256-gcm`, `null-sha1`, `null-sha384`, `null-sha256`, `null-sha512`
+ - Default value: `aes256-gcm`
+- `ipsec_ciphersuite_variable` (String) Variable name
+- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
+ - Range: `120`-`2592000`
+ - Default value: `3600`
+- `ipsec_rekey_interval_variable` (String) Variable name
+- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
+ - Range: `64`-`4096`
+ - Default value: `512`
+- `ipsec_replay_window_variable` (String) Variable name
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
+ - Choices: `group-1`, `group-2`, `group-5`, `group-14`, `group-15`, `group-16`, `group-19`, `group-20`, `group-21`, `group-24`, `none`
+ - Default value: `group-16`
+- `perfect_forward_secrecy_variable` (String) Variable name
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+- `shutdown` (Boolean) Administrative state
+ - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `tracker_id` (String) Enable tracker for this interface
+- `tracker_id_variable` (String) Variable name
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
+- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_route_via_variable` (String) Variable name
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_lan_vpn_interface_ipsec_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_lan_vpn_interface_ipsec_profile_parcel.md b/docs/resources/service_lan_vpn_interface_ipsec_profile_parcel.md
deleted file mode 100644
index 84ecec7f2..000000000
--- a/docs/resources/service_lan_vpn_interface_ipsec_profile_parcel.md
+++ /dev/null
@@ -1,166 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_ipsec_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Service LAN VPN Interface IPSec profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_service_lan_vpn_interface_ipsec_profile_parcel (Resource)
-
-This resource can manage a Service LAN VPN Interface IPSec profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "ipsec987"
- shutdown = true
- interface_description = "ipsec987"
- ipv4_address = "9.7.5.4"
- ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_ipv4_address = "1.3.5.88"
- tunnel_source_ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_interface = "GigabitEthernet8"
- tunnel_destination_ipv4_address = "2.55.67.99"
- tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
- application_tunnel_type = "none"
- tcp_mss = 1460
- clear_dont_fragment = false
- ip_mtu = 1500
- dpd_interval = 10
- dpd_retries = 3
- ike_preshared_key = "123"
- ike_version = 1
- ike_integrity_protocol = "main"
- ike_rekey_interval = 14400
- ike_ciphersuite = "aes256-cbc-sha1"
- ike_diffie_hellman_group = "16"
- ike_id_local_end_point = "xxx"
- ike_id_remote_end_point = "xxx"
- ipsec_rekey_interval = 3600
- ipsec_replay_window = 512
- ipsec_ciphersuite = "aes256-gcm"
- perfect_forward_secrecy = "group-16"
- tunnel_route_via = "2222"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
- - Choices: `none`, `sig`
-- `feature_profile_id` (String) Feature Profile ID
-- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
-- `interface_name` (String) Interface name: IPsec when present
-- `ipv4_address` (String)
-- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `name` (String) The name of the profile parcel
-- `tunnel_destination_ipv4_address` (String)
-- `tunnel_destination_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_source_ipv4_address` (String)
-- `tunnel_source_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-
-### Optional
-
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
- - Default value: `false`
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `dpd_interval` (Number) IKE keepalive interval (seconds)
- - Range: `10`-`3600`
- - Default value: `10`
-- `dpd_interval_variable` (String) Variable name
-- `dpd_retries` (Number) IKE keepalive retries
- - Range: `2`-`60`
- - Default value: `3`
-- `dpd_retries_variable` (String) Variable name
-- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
- - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha2`, `aes128-cbc-sha1`, `aes128-cbc-sha2`
- - Default value: `aes256-cbc-sha1`
-- `ike_ciphersuite_variable` (String) Variable name
-- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
- - Choices: `2`, `14`, `15`, `16`, `19`, `20`, `21`, `24`
- - Default value: `16`
-- `ike_diffie_hellman_group_variable` (String) Variable name
-- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_local_end_point_variable` (String) Variable name
-- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_remote_end_point_variable` (String) Variable name
-- `ike_integrity_protocol` (String) IKE integrity protocol
- - Choices: `main`, `aggressive`
- - Default value: `main`
-- `ike_integrity_protocol_variable` (String) Variable name
-- `ike_preshared_key_variable` (String) Variable name
-- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
- - Range: `60`-`86400`
- - Default value: `14400`
-- `ike_rekey_interval_variable` (String) Variable name
-- `ike_version` (Number) IKE Version <1..2>
- - Range: `1`-`2`
- - Default value: `1`
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
- - Range: `68`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
- - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha384`, `aes256-cbc-sha256`, `aes256-cbc-sha512`, `aes256-gcm`, `null-sha1`, `null-sha384`, `null-sha256`, `null-sha512`
- - Default value: `aes256-gcm`
-- `ipsec_ciphersuite_variable` (String) Variable name
-- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
- - Range: `120`-`2592000`
- - Default value: `3600`
-- `ipsec_rekey_interval_variable` (String) Variable name
-- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
- - Range: `64`-`4096`
- - Default value: `512`
-- `ipsec_replay_window_variable` (String) Variable name
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
- - Choices: `group-1`, `group-2`, `group-5`, `group-14`, `group-15`, `group-16`, `group-19`, `group-20`, `group-21`, `group-24`, `none`
- - Default value: `group-16`
-- `perfect_forward_secrecy_variable` (String) Variable name
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Parcel ID
-- `shutdown` (Boolean) Administrative state
- - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `tracker_id` (String) Enable tracker for this interface
-- `tracker_id_variable` (String) Variable name
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
-- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_route_via_variable` (String) Variable name
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_service_lan_vpn_interface_ipsec_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/service_lan_vpn_interface_svi_feature.md b/docs/resources/service_lan_vpn_interface_svi_feature.md
new file mode 100644
index 000000000..b0df93f9e
--- /dev/null
+++ b/docs/resources/service_lan_vpn_interface_svi_feature.md
@@ -0,0 +1,297 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_lan_vpn_interface_svi_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service LAN VPN Interface SVI Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_lan_vpn_interface_svi_feature (Resource)
+
+This resource can manage a Service LAN VPN Interface SVI Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_lan_vpn_interface_svi_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = false
+ interface_name = "Vlan1"
+ interface_description = "SVI"
+ interface_mtu = 1500
+ ip_mtu = 1500
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "2.3.4.5"
+ ipv4_subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helpers = ["4.5.6.7"]
+ ipv6_address = "2001:0:0:1::0/32"
+ ipv6_secondary_addresses = [
+ {
+ address = "::2/32"
+ }
+ ]
+ ipv6_dhcp_helpers = [
+ {
+ address = "2001:0:0:1::0"
+ vpn = 1
+ }
+ ]
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ ipv4_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ prefix_list = "prefix"
+ address = "1.2.3.4"
+ secondary_addresses = [
+ {
+ address = "2.3.4.5"
+ }
+ ]
+ tloc_prefix_change = true
+ tloc_prefix_change_value = 100
+ }
+ ]
+ ipv6_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ track_prefix_list = "1"
+ addresses = [
+ {
+ link_local_address = "1::1"
+ global_address = "1::1/24"
+ }
+ ]
+ secondary_addresses = [
+ {
+ prefix = "::20/32"
+ }
+ ]
+ }
+ ]
+ enable_dhcpv6 = false
+ tcp_mss = 1024
+ arp_timeout = 1200
+ ip_directed_broadcast = false
+ icmp_redirect_disable = true
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `interface_name` (String) Interface name: VLAN 1 - VLAN 4094 when present
+- `ipv4_address` (String) IP Address
+- `ipv4_subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+ - Range: `0`-`2678400`
+ - Default value: `1200`
+- `arp_timeout_variable` (String) Variable name
+- `arps` (Attributes List) Configure static ARP entries (see [below for nested schema](#nestedatt--arps))
+- `description` (String) The description of the Feature
+- `enable_dhcpv6` (Boolean) Enable DHCPv6
+ - Default value: `false`
+- `enable_dhcpv6_variable` (String) Variable name
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+ - Default value: `true`
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU <1500..9216> in bytes
+ - Range: `1500`-`9216`
+ - Default value: `1500`
+- `interface_mtu_variable` (String) Variable name
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+ - Default value: `false`
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU <576..Interface MTU>, in bytes
+ - Range: `576`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_dhcp_helpers` (Set of String) List of DHCP helper addresses
+- `ipv4_dhcp_helpers_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Assign secondary IP addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv4_vrrps` (Attributes List) Enable ipv4 VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
+- `ipv6_address` (String) Assign IPv6 address
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
+- `ipv6_secondary_addresses` (Attributes List) Assign secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
+- `ipv6_vrrps` (Attributes List) Enable ipv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps))
+- `service_lan_vpn_feature_id` (String) Service LAN VPN Feature ID
+- `shutdown` (Boolean) Administrative state
+ - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `552`-`1960`
+- `tcp_mss_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arps`
+
+Optional:
+
+- `ip_address` (String) IP Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Optional:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `ipv4_subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_vrrps`
+
+Optional:
+
+- `address` (String) Assign IPV4 Address
+- `address_variable` (String) Variable name
+- `group_id` (Number) Group ID
+ - Range: `1`-`255`
+- `group_id_variable` (String) Variable name
+- `prefix_list` (String) Track Prefix List
+- `prefix_list_variable` (String) Variable name
+- `priority` (Number) Set priority
+ - Range: `1`-`254`
+ - Default value: `100`
+- `priority_variable` (String) Variable name
+- `secondary_addresses` (Attributes List) VRRP Secondary IPV4 address (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+ - Range: `100`-`40950`
+ - Default value: `1000`
+- `timer_variable` (String) Variable name
+- `tloc_prefix_change` (Boolean) change TLOC preference
+ - Default value: `false`
+- `tloc_prefix_change_value` (Number) Set tloc preference change value
+ - Range: `1`-`4294967295`
+- `tloc_prefix_change_value_variable` (String) Variable name
+- `track_omp` (Boolean) Track OMP status
+ - Default value: `false`
+- `track_omp_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_vrrps.secondary_addresses`
+
+Optional:
+
+- `address` (String) VRRP Secondary IPV4 address
+- `address_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_dhcp_helpers`
+
+Optional:
+
+- `address` (String) DHCPv6 Helper address
+- `address_variable` (String) Variable name
+- `vpn` (Number) DHCPv6 Helper VPN
+ - Range: `1`-`65536`
+- `vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_secondary_addresses`
+
+Optional:
+
+- `address` (String) IPv6 Address
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_vrrps`
+
+Optional:
+
+- `addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--addresses))
+- `group_id` (Number) Group ID
+ - Range: `1`-`255`
+- `group_id_variable` (String) Variable name
+- `priority` (Number) Set priority
+ - Range: `1`-`254`
+ - Default value: `100`
+- `priority_variable` (String) Variable name
+- `secondary_addresses` (Attributes List) IPv6 Secondary IP address (see [below for nested schema](#nestedatt--ipv6_vrrps--secondary_addresses))
+- `timer` (Number) Timer interval for successive advertisements, in milliseconds
+ - Range: `100`-`40950`
+ - Default value: `1000`
+- `timer_variable` (String) Variable name
+- `track_omp` (Boolean) Track OMP status
+ - Default value: `false`
+- `track_omp_variable` (String) Variable name
+- `track_prefix_list` (String) Track Prefix List
+- `track_prefix_list_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_vrrps.addresses`
+
+Optional:
+
+- `global_address` (String) Assign Global IPv6 Prefix
+- `global_address_variable` (String) Variable name
+- `link_local_address` (String) Use link-local IPv6 Address
+- `link_local_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_vrrps.secondary_addresses`
+
+Optional:
+
+- `prefix` (String) IPv6 Secondary IP address
+- `prefix_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_lan_vpn_interface_svi_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_lan_vpn_interface_svi_profile_parcel.md b/docs/resources/service_lan_vpn_interface_svi_profile_parcel.md
deleted file mode 100644
index 748ed8002..000000000
--- a/docs/resources/service_lan_vpn_interface_svi_profile_parcel.md
+++ /dev/null
@@ -1,297 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_interface_svi_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Service LAN VPN Interface SVI profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_service_lan_vpn_interface_svi_profile_parcel (Resource)
-
-This resource can manage a Service LAN VPN Interface SVI profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_service_lan_vpn_interface_svi_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = false
- interface_name = "Vlan1"
- interface_description = "SVI"
- interface_mtu = 1500
- ip_mtu = 1500
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "2.3.4.5"
- ipv4_subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helpers = ["4.5.6.7"]
- ipv6_address = "2001:0:0:1::0/32"
- ipv6_secondary_addresses = [
- {
- address = "::2/32"
- }
- ]
- ipv6_dhcp_helpers = [
- {
- address = "2001:0:0:1::0"
- vpn = 1
- }
- ]
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- ipv4_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- prefix_list = "prefix"
- address = "1.2.3.4"
- secondary_addresses = [
- {
- address = "2.3.4.5"
- }
- ]
- tloc_prefix_change = true
- tloc_prefix_change_value = 100
- }
- ]
- ipv6_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- track_prefix_list = "1"
- addresses = [
- {
- link_local_address = "1::1"
- global_address = "1::1/24"
- }
- ]
- secondary_addresses = [
- {
- prefix = "::20/32"
- }
- ]
- }
- ]
- enable_dhcpv6 = false
- tcp_mss = 1024
- arp_timeout = 1200
- ip_directed_broadcast = false
- icmp_redirect_disable = true
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `interface_name` (String) Interface name: VLAN 1 - VLAN 4094 when present
-- `ipv4_address` (String) IP Address
-- `ipv4_subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
- - Range: `0`-`2678400`
- - Default value: `1200`
-- `arp_timeout_variable` (String) Variable name
-- `arps` (Attributes List) Configure static ARP entries (see [below for nested schema](#nestedatt--arps))
-- `description` (String) The description of the profile parcel
-- `enable_dhcpv6` (Boolean) Enable DHCPv6
- - Default value: `false`
-- `enable_dhcpv6_variable` (String) Variable name
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
- - Default value: `true`
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU <1500..9216> in bytes
- - Range: `1500`-`9216`
- - Default value: `1500`
-- `interface_mtu_variable` (String) Variable name
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
- - Default value: `false`
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU <576..Interface MTU>, in bytes
- - Range: `576`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_dhcp_helpers` (Set of String) List of DHCP helper addresses
-- `ipv4_dhcp_helpers_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Assign secondary IP addresses (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv4_vrrps` (Attributes List) Enable ipv4 VRRP (see [below for nested schema](#nestedatt--ipv4_vrrps))
-- `ipv6_address` (String) Assign IPv6 address
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_dhcp_helpers` (Attributes List) DHCPv6 Helper (see [below for nested schema](#nestedatt--ipv6_dhcp_helpers))
-- `ipv6_secondary_addresses` (Attributes List) Assign secondary IPv6 addresses (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
-- `ipv6_vrrps` (Attributes List) Enable ipv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps))
-- `service_lan_vpn_profile_parcel_id` (String) Service LAN VPN Profile Profile ID
-- `shutdown` (Boolean) Administrative state
- - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `552`-`1960`
-- `tcp_mss_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arps`
-
-Optional:
-
-- `ip_address` (String) IP Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Optional:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `ipv4_subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_vrrps`
-
-Optional:
-
-- `address` (String) Assign IPV4 Address
-- `address_variable` (String) Variable name
-- `group_id` (Number) Group ID
- - Range: `1`-`255`
-- `group_id_variable` (String) Variable name
-- `prefix_list` (String) Track Prefix List
-- `prefix_list_variable` (String) Variable name
-- `priority` (Number) Set priority
- - Range: `1`-`254`
- - Default value: `100`
-- `priority_variable` (String) Variable name
-- `secondary_addresses` (Attributes List) VRRP Secondary IPV4 address (see [below for nested schema](#nestedatt--ipv4_vrrps--secondary_addresses))
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
- - Range: `100`-`40950`
- - Default value: `1000`
-- `timer_variable` (String) Variable name
-- `tloc_prefix_change` (Boolean) change TLOC preference
- - Default value: `false`
-- `tloc_prefix_change_value` (Number) Set tloc preference change value
- - Range: `1`-`4294967295`
-- `tloc_prefix_change_value_variable` (String) Variable name
-- `track_omp` (Boolean) Track OMP status
- - Default value: `false`
-- `track_omp_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_vrrps.secondary_addresses`
-
-Optional:
-
-- `address` (String) VRRP Secondary IPV4 address
-- `address_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_dhcp_helpers`
-
-Optional:
-
-- `address` (String) DHCPv6 Helper address
-- `address_variable` (String) Variable name
-- `vpn` (Number) DHCPv6 Helper VPN
- - Range: `1`-`65536`
-- `vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_secondary_addresses`
-
-Optional:
-
-- `address` (String) IPv6 Address
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_vrrps`
-
-Optional:
-
-- `addresses` (Attributes List) IPv6 VRRP (see [below for nested schema](#nestedatt--ipv6_vrrps--addresses))
-- `group_id` (Number) Group ID
- - Range: `1`-`255`
-- `group_id_variable` (String) Variable name
-- `priority` (Number) Set priority
- - Range: `1`-`254`
- - Default value: `100`
-- `priority_variable` (String) Variable name
-- `secondary_addresses` (Attributes List) IPv6 Secondary IP address (see [below for nested schema](#nestedatt--ipv6_vrrps--secondary_addresses))
-- `timer` (Number) Timer interval for successive advertisements, in milliseconds
- - Range: `100`-`40950`
- - Default value: `1000`
-- `timer_variable` (String) Variable name
-- `track_omp` (Boolean) Track OMP status
- - Default value: `false`
-- `track_omp_variable` (String) Variable name
-- `track_prefix_list` (String) Track Prefix List
-- `track_prefix_list_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_vrrps.addresses`
-
-Optional:
-
-- `global_address` (String) Assign Global IPv6 Prefix
-- `global_address_variable` (String) Variable name
-- `link_local_address` (String) Use link-local IPv6 Address
-- `link_local_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_vrrps.secondary_addresses`
-
-Optional:
-
-- `prefix` (String) IPv6 Secondary IP address
-- `prefix_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_service_lan_vpn_interface_svi_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/service_lan_vpn_profile_parcel.md b/docs/resources/service_lan_vpn_profile_parcel.md
deleted file mode 100644
index 970fa808a..000000000
--- a/docs/resources/service_lan_vpn_profile_parcel.md
+++ /dev/null
@@ -1,595 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_lan_vpn_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Service LAN VPN profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_service_lan_vpn_profile_parcel (Resource)
-
-This resource can manage a Service LAN VPN profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_service_lan_vpn_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- vpn = 1
- config_description = "VPN1"
- omp_admin_distance_ipv4 = 1
- omp_admin_distance_ipv6 = 1
- enable_sdwan_remote_access = false
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- host_mappings = [
- {
- host_name = "HOSTMAPPING1"
- list_of_ips = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2001:0:0:1::0/12"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "FW"
- ipv4_addresses = ["1.2.3.4"]
- tracking = true
- }
- ]
- service_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- service = "SIG"
- vpn = 0
- }
- ]
- gre_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- interface = ["gre01"]
- vpn = 0
- }
- ]
- ipsec_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- interface = ["ipsec01"]
- }
- ]
- nat_pools = [
- {
- nat_pool_name = 1
- prefix_length = 3
- range_start = "1.2.3.4"
- range_end = "2.3.4.5"
- overload = true
- direction = "inside"
- }
- ]
- nat_port_forwards = [
- {
- nat_pool_name = 2
- source_port = 122
- translate_port = 330
- source_ip = "1.2.3.4"
- translated_source_ip = "2.3.4.5"
- protocol = "TCP"
- }
- ]
- static_nats = [
- {
- nat_pool_name = 3
- source_ip = "1.2.3.4"
- translated_source_ip = "2.3.4.5"
- static_nat_direction = "inside"
- }
- ]
- nat_64_v4_pools = [
- {
- name = "NATPOOL1"
- range_start = "1.2.3.4"
- range_end = "2.3.4.5"
- overload = false
- }
- ]
- ipv4_import_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
- ipv4_export_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
- ipv6_import_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
- ipv6_export_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `advertise_omp_ipv4s` (Attributes List) OMP Advertise IPv4 (see [below for nested schema](#nestedatt--advertise_omp_ipv4s))
-- `advertise_omp_ipv6s` (Attributes List) OMP Advertise IPv6 (see [below for nested schema](#nestedatt--advertise_omp_ipv6s))
-- `config_description` (String) Name
-- `config_description_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `enable_sdwan_remote_access` (Boolean) Enable SDWAN Remote Access
- - Default value: `false`
-- `gre_routes` (Attributes List) IPv4 Static GRE Route (see [below for nested schema](#nestedatt--gre_routes))
-- `host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--host_mappings))
-- `ipsec_routes` (Attributes List) IPv4 Static IPSEC Route (see [below for nested schema](#nestedatt--ipsec_routes))
-- `ipv4_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_export_route_targets))
-- `ipv4_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv4_import_route_targets))
-- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
-- `ipv6_export_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_export_route_targets))
-- `ipv6_import_route_targets` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_import_route_targets))
-- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
-- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
-- `nat_pools` (Attributes List) NAT Pool (see [below for nested schema](#nestedatt--nat_pools))
-- `nat_port_forwards` (Attributes List) NAT Port Forward (see [below for nested schema](#nestedatt--nat_port_forwards))
-- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
- - Range: `1`-`255`
-- `omp_admin_distance_ipv4_variable` (String) Variable name
-- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
- - Range: `1`-`255`
-- `omp_admin_distance_ipv6_variable` (String) Variable name
-- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
-- `primary_dns_address_ipv4_variable` (String) Variable name
-- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
-- `primary_dns_address_ipv6_variable` (String) Variable name
-- `route_leak_from_global_vpns` (Attributes List) Enable route leaking from Global to Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns))
-- `route_leak_from_other_services` (Attributes List) Enable route leak from another Service VPN to current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services))
-- `route_leak_to_global_vpns` (Attributes List) Enable route leaking from Service to Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns))
-- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
-- `secondary_dns_address_ipv4_variable` (String) Variable name
-- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
-- `secondary_dns_address_ipv6_variable` (String) Variable name
-- `service_routes` (Attributes List) Service (see [below for nested schema](#nestedatt--service_routes))
-- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
-- `static_nats` (Attributes List) Static NAT Rules (see [below for nested schema](#nestedatt--static_nats))
-- `vpn` (Number) VPN
- - Range: `1`-`65527`
- - Default value: `0`
-- `vpn_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `advertise_omp_ipv4s`
-
-Optional:
-
-- `prefixes` (Attributes List) IPv4 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv4s--prefixes))
-- `protocol` (String) Protocol
- - Choices: `bgp`, `ospf`, `ospfv3`, `connected`, `static`, `network`, `aggregate`, `eigrp`, `lisp`, `isis`
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-### Nested Schema for `advertise_omp_ipv4s.prefixes`
-
-Optional:
-
-- `aggregate_only` (Boolean) Aggregate Only
- - Default value: `false`
-- `network_address` (String)
-- `network_address_variable` (String) Variable name
-- `region` (String) Applied to Region
- - Choices: `core-and-access`, `core`, `access`
- - Default value: `core-and-access`
-- `region_variable` (String) Variable name
-- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `advertise_omp_ipv6s`
-
-Optional:
-
-- `prefixes` (Attributes List) IPv6 Prefix List (see [below for nested schema](#nestedatt--advertise_omp_ipv6s--prefixes))
-- `protocol` (String) Protocol
- - Choices: `BGP`, `OSPF`, `Connected`, `Static`, `Network`, `Aggregate`
-- `protocol_sub_type` (String) Protocol Sub Type
- - Choices: `External`
-- `protocol_sub_type_variable` (String) Variable name
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-### Nested Schema for `advertise_omp_ipv6s.prefixes`
-
-Optional:
-
-- `aggregate_only` (Boolean) Aggregate Only
- - Default value: `false`
-- `prefix` (String) IPv6 Prefix
-- `prefix_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `gre_routes`
-
-Optional:
-
-- `interface` (Set of String) Interface
-- `interface_variable` (String) Variable name
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-- `vpn` (Number) Service
-
-
-
-### Nested Schema for `host_mappings`
-
-Optional:
-
-- `host_name` (String) Hostname
-- `host_name_variable` (String) Variable name
-- `list_of_ips` (Set of String) List of IP
-- `list_of_ips_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipsec_routes`
-
-Optional:
-
-- `interface` (Set of String) Interface
-- `interface_variable` (String) Variable name
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_export_route_targets`
-
-Optional:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_import_route_targets`
-
-Optional:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_static_routes`
-
-Optional:
-
-- `gateway_dhcp` (Boolean) IPv4 Route Gateway DHCP
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `next_hop_with_trackers` (Attributes List) IPv4 Route Gateway Next Hop with Tracker (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hop_with_trackers))
-- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
-- `null0` (Boolean) IPv4 Route Gateway Next Hop
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-- `vpn` (Boolean) IPv4 Route Gateway VPN
-
-
-### Nested Schema for `ipv4_static_routes.next_hop_with_trackers`
-
-Optional:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
- - Range: `1`-`255`
-- `administrative_distance_variable` (String) Variable name
-- `tracker_id` (String)
-
-
-
-### Nested Schema for `ipv4_static_routes.next_hops`
-
-Optional:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
- - Range: `1`-`255`
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_export_route_targets`
-
-Optional:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_import_route_targets`
-
-Optional:
-
-- `route_target` (String) Route target
-- `route_target_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_static_routes`
-
-Optional:
-
-- `nat` (String) IPv6 Nat
- - Choices: `NAT64`, `NAT66`
-- `nat_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
-- `null0` (Boolean) IPv6 Route Gateway Next Hop
-- `prefix` (String) Prefix
-- `prefix_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_static_routes.next_hops`
-
-Optional:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
- - Range: `1`-`254`
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `nat_64_v4_pools`
-
-Optional:
-
-- `name` (String) NAT64 v4 Pool Name
-- `name_variable` (String) Variable name
-- `overload` (Boolean) NAT64 Overload
- - Default value: `false`
-- `overload_variable` (String) Variable name
-- `range_end` (String) NAT64 Pool Range End
-- `range_end_variable` (String) Variable name
-- `range_start` (String) NAT64 Pool Range Start
-- `range_start_variable` (String) Variable name
-
-
-
-### Nested Schema for `nat_pools`
-
-Optional:
-
-- `direction` (String) NAT Direction
- - Choices: `inside`, `outside`
-- `direction_variable` (String) Variable name
-- `nat_pool_name` (Number) NAT Pool Name
- - Range: `1`-`32`
-- `nat_pool_name_variable` (String) Variable name
-- `overload` (Boolean) NAT Overload
- - Default value: `true`
-- `overload_variable` (String) Variable name
-- `prefix_length` (Number) NAT Pool Prefix Length
- - Range: `1`-`32`
-- `prefix_length_variable` (String) Variable name
-- `range_end` (String) NAT Pool Range End
-- `range_end_variable` (String) Variable name
-- `range_start` (String) NAT Pool Range Start
-- `range_start_variable` (String) Variable name
-- `tracker_object_id` (String)
-
-
-
-### Nested Schema for `nat_port_forwards`
-
-Optional:
-
-- `nat_pool_name` (Number) NAT Pool Name
- - Range: `1`-`32`
-- `nat_pool_name_variable` (String) Variable name
-- `protocol` (String) Protocol
- - Choices: `TCP`, `UDP`
-- `protocol_variable` (String) Variable name
-- `source_ip` (String) Source IP Address
-- `source_ip_variable` (String) Variable name
-- `source_port` (Number) Source Port
-- `source_port_variable` (String) Variable name
-- `translate_port` (Number) Translate Port
-- `translate_port_variable` (String) Variable name
-- `translated_source_ip` (String) Translated Source IP Address
-- `translated_source_ip_variable` (String) Variable name
-
-
-
-### Nested Schema for `route_leak_from_global_vpns`
-
-Optional:
-
-- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Service VPN (see [below for nested schema](#nestedatt--route_leak_from_global_vpns--redistributions))
-- `route_policy_id` (String)
-- `route_protocol` (String) Leak Routes of particular protocol from Global to Service VPN
- - Choices: `static`, `connected`, `bgp`, `ospf`
-- `route_protocol_variable` (String) Variable name
-
-
-### Nested Schema for `route_leak_from_global_vpns.redistributions`
-
-Optional:
-
-- `protocol` (String) Protocol to restributed leaked routes
- - Choices: `bgp`, `ospf`
-- `protocol_variable` (String) Variable name
-- `redistribution_policy_id` (String)
-
-
-
-
-### Nested Schema for `route_leak_from_other_services`
-
-Optional:
-
-- `redistributions` (Attributes List) Redistribute Route to specific Protocol on Current Service VPN (see [below for nested schema](#nestedatt--route_leak_from_other_services--redistributions))
-- `route_policy_id` (String)
-- `route_protocol` (String) Leak Route of particular protocol from Source Service VPN
- - Choices: `static`, `connected`, `bgp`, `ospf`
-- `route_protocol_variable` (String) Variable name
-- `source_vpn` (Number) Source Service VPN from where route are to be leaked
- - Range: `1`-`65530`
-- `source_vpn_variable` (String) Variable name
-
-
-### Nested Schema for `route_leak_from_other_services.redistributions`
-
-Optional:
-
-- `protocol` (String) Protocol to restributed leaked routes
- - Choices: `bgp`, `ospf`
-- `protocol_variable` (String) Variable name
-- `redistribution_policy_id` (String)
-
-
-
-
-### Nested Schema for `route_leak_to_global_vpns`
-
-Optional:
-
-- `redistributions` (Attributes List) Redistribute Routes to specific Protocol on Global VPN (see [below for nested schema](#nestedatt--route_leak_to_global_vpns--redistributions))
-- `route_policy_id` (String)
-- `route_protocol` (String) Leak Routes of particular protocol from Service to Global VPN
- - Choices: `static`, `connected`, `bgp`, `ospf`
-- `route_protocol_variable` (String) Variable name
-
-
-### Nested Schema for `route_leak_to_global_vpns.redistributions`
-
-Optional:
-
-- `protocol` (String) Protocol to restributed leaked routes
- - Choices: `bgp`, `ospf`
-- `protocol_variable` (String) Variable name
-- `redistribution_policy_id` (String)
-
-
-
-
-### Nested Schema for `service_routes`
-
-Optional:
-
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `service` (String) Service
- - Choices: `SIG`
- - Default value: `SIG`
-- `service_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-- `vpn` (Number) Service
-
-
-
-### Nested Schema for `services`
-
-Optional:
-
-- `ipv4_addresses` (Set of String) IPv4 Addresses (Maximum: 4)
-- `ipv4_addresses_variable` (String) Variable name
-- `service_type` (String) Service Type
- - Choices: `FW`, `IDS`, `IDP`, `netsvc1`, `netsvc2`, `netsvc3`, `netsvc4`, `TE`, `appqoe`
-- `service_type_variable` (String) Variable name
-- `tracking` (Boolean) Tracking
- - Default value: `true`
-- `tracking_variable` (String) Variable name
-
-
-
-### Nested Schema for `static_nats`
-
-Optional:
-
-- `nat_pool_name` (Number) NAT Pool Name
- - Range: `1`-`32`
-- `nat_pool_name_variable` (String) Variable name
-- `source_ip` (String) Source IP Address
-- `source_ip_variable` (String) Variable name
-- `static_nat_direction` (String) Static NAT Direction
- - Choices: `inside`, `outside`
-- `static_nat_direction_variable` (String) Variable name
-- `tracker_object_id` (String)
-- `translated_source_ip` (String) Translated Source IP Address
-- `translated_source_ip_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_service_lan_vpn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/service_object_tracker_feature.md b/docs/resources/service_object_tracker_feature.md
new file mode 100644
index 000000000..4b59f7d4c
--- /dev/null
+++ b/docs/resources/service_object_tracker_feature.md
@@ -0,0 +1,67 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_object_tracker_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Object Tracker Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_object_tracker_feature (Resource)
+
+This resource can manage a Service Object Tracker Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_object_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ object_tracker_id = 10
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+- `object_tracker_type` (String) objectTrackerType:Interface SIG Route
+ - Choices: `Interface`, `SIG`, `Route`
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `interface` (String) interface name
+- `interface_variable` (String) Variable name
+- `object_tracker_id` (Number) Object tracker ID
+ - Range: `1`-`1000`
+- `object_tracker_id_variable` (String) Variable name
+- `route_ip` (String) IP address
+- `route_ip_variable` (String) Variable name
+- `route_mask` (String) IP mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+ - Default value: `0.0.0.0`
+- `route_mask_variable` (String) Variable name
+- `vpn` (Number) VPN
+ - Range: `0`-`65530`
+- `vpn_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_object_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_object_tracker_group_feature.md b/docs/resources/service_object_tracker_group_feature.md
new file mode 100644
index 000000000..87d67a18f
--- /dev/null
+++ b/docs/resources/service_object_tracker_group_feature.md
@@ -0,0 +1,70 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_object_tracker_group_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Object Tracker Group Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_object_tracker_group_feature (Resource)
+
+This resource can manage a Service Object Tracker Group Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_object_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ object_tracker_id = 10
+ tracker_elements = [
+ {
+ object_tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ reachable = "or"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `object_tracker_id` (Number) Object ID
+ - Range: `1`-`1000`
+- `object_tracker_id_variable` (String) Variable name
+- `reachable` (String) tracker ref list criteria boolean and or
+ - Choices: `and`, `or`
+ - Default value: `or`
+- `reachable_variable` (String) Variable name
+- `tracker_elements` (Attributes List) Group Tracks ID Refs (see [below for nested schema](#nestedatt--tracker_elements))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Optional:
+
+- `object_tracker_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_object_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_route_policy_feature.md b/docs/resources/service_route_policy_feature.md
new file mode 100644
index 000000000..1385d7369
--- /dev/null
+++ b/docs/resources/service_route_policy_feature.md
@@ -0,0 +1,151 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_route_policy_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Route Policy Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_route_policy_feature (Resource)
+
+This resource can manage a Service Route Policy Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_route_policy_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "accept"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "reject"
+ protocol = "IPV4"
+ actions = [
+ {
+ as_path_prepend = [65521]
+ community_additive = false
+ community = ["internet"]
+ local_preference = 100
+ metric = 20
+ metric_type = "type1"
+ omp_tag = 200
+ origin = "EGP"
+ ospf_tag = 1200
+ weight = 2200
+ ipv4_next_hop = "10.0.0.1"
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `default_action` (String) Default Action
+ - Choices: `reject`, `accept`
+ - Default value: `reject`
+- `description` (String) The description of the Feature
+- `sequences` (Attributes List) Route Policy List (see [below for nested schema](#nestedatt--sequences))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Optional:
+
+- `actions` (Attributes List) Define list of actions (see [below for nested schema](#nestedatt--sequences--actions))
+- `base_action` (String) Base Action
+ - Choices: `reject`, `accept`
+ - Default value: `reject`
+- `id` (Number) Sequence Id
+ - Range: `1`-`65536`
+- `match_entries` (Attributes List) Define match conditions (see [below for nested schema](#nestedatt--sequences--match_entries))
+- `name` (String) Sequence Name
+- `protocol` (String) protocol such as IPV4, IPV6, or BOTH
+ - Choices: `IPV4`, `IPV6`, `BOTH`
+ - Default value: `IPV4`
+
+
+### Nested Schema for `sequences.actions`
+
+Optional:
+
+- `as_path_prepend` (Set of Number)
+- `community` (Set of String)
+- `community_additive` (Boolean) - Default value: `false`
+- `community_variable` (String) Variable name
+- `ipv4_next_hop` (String) Set Ipv4 Next Hop
+- `ipv6_next_hop` (String) Set Ipv6 Next Hop
+- `local_preference` (Number) Set Local Preference
+ - Range: `0`-`4294967295`
+- `metric` (Number) Set Metric
+ - Range: `0`-`4294967295`
+- `metric_type` (String) Set Metric Type
+ - Choices: `type1`, `type2`
+- `omp_tag` (Number) Set OMP Tag
+ - Range: `0`-`4294967295`
+- `origin` (String) Set Origin
+ - Choices: `EGP`, `IGP`, `Incomplete`
+- `ospf_tag` (Number) Set OSPF Tag
+ - Range: `0`-`4294967295`
+- `weight` (Number) Set Weight
+ - Range: `0`-`65535`
+
+
+
+### Nested Schema for `sequences.match_entries`
+
+Optional:
+
+- `as_path_list_id` (String)
+- `bgp_local_preference` (Number) BGP Local Preference
+ - Range: `0`-`4294967295`
+- `expanded_community_list_id` (String)
+- `extended_community_list_id` (String)
+- `ipv4_address_prefix_list_id` (String)
+- `ipv4_next_hop_prefix_list_id` (String)
+- `ipv6_address_prefix_list_id` (String)
+- `ipv6_next_hop_prefix_list_id` (String)
+- `metric` (Number) Select Metric
+ - Range: `0`-`4294967295`
+- `omp_tag` (Number) Select OMP Tag
+ - Range: `0`-`4294967295`
+- `ospf_tag` (Number) Select OSPF Tag
+ - Range: `0`-`4294967295`
+- `standard_community_list_criteria` (String) Select a condition such as OR, AND or EXACT
+ - Choices: `OR`, `AND`, `EXACT`
+- `standard_community_lists` (Attributes List) Select a standard community list (see [below for nested schema](#nestedatt--sequences--match_entries--standard_community_lists))
+
+
+### Nested Schema for `sequences.match_entries.standard_community_lists`
+
+Optional:
+
+- `id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_route_policy_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_routing_bgp_feature.md b/docs/resources/service_routing_bgp_feature.md
new file mode 100644
index 000000000..e7365c4a5
--- /dev/null
+++ b/docs/resources/service_routing_bgp_feature.md
@@ -0,0 +1,442 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_bgp_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Routing BGP Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_routing_bgp_feature (Resource)
+
+This resource can manage a Service Routing BGP Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_routing_bgp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ as_number = 429
+ router_id = "1.2.3.4"
+ propagate_as_path = false
+ propagate_community = false
+ external_routes_distance = 20
+ internal_routes_distance = 200
+ local_routes_distance = 20
+ keepalive_time = 60
+ hold_time = 180
+ always_compare_med = false
+ deterministic_med = false
+ missing_med_as_worst = false
+ compare_router_id = false
+ multipath_relax = false
+ ipv4_neighbors = [
+ {
+ address = "1.2.3.4"
+ description = "neighbor1"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 40
+ hold_time = 200
+ update_source_interface = "GigabitEthernet0"
+ next_hop_self = false
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 1
+ password = "myPassword"
+ send_label = true
+ as_override = false
+ allowas_in_number = 1
+ address_families = [
+ {
+ family_type = "ipv4-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv6_neighbors = [
+ {
+ address = "2001::1"
+ description = "neighbor2"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 180
+ hold_time = 60
+ update_source_interface = "Loopback1"
+ next_hop_self = true
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 3
+ password = "myPassword"
+ as_override = true
+ allowas_in_number = 3
+ address_families = [
+ {
+ family_type = "ipv6-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv4_aggregate_addresses = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv4_networks = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ }
+ ]
+ ipv4_eibgp_maximum_paths = 1
+ ipv4_originate = false
+ ipv4_table_map_filter = false
+ ipv6_aggregate_addresses = [
+ {
+ aggregate_prefix = "3001::1/128"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv6_networks = [
+ {
+ network_prefix = "2001:0DB8:0000:000b::/64"
+ }
+ ]
+ ipv6_eibgp_maximum_paths = 2
+ ipv6_originate = true
+ ipv6_table_map_filter = false
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `always_compare_med` (Boolean) Compare MEDs from all ASs when selecting active BGP paths
+ - Default value: `false`
+- `always_compare_med_variable` (String) Variable name
+- `as_number` (Number) Set autonomous system number <1..4294967295> or
+- `as_number_variable` (String) Variable name
+- `compare_router_id` (Boolean) Compare router IDs when selecting active BGP paths
+ - Default value: `false`
+- `compare_router_id_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `deterministic_med` (Boolean) Compare MEDs from all routes from same AS when selecting active BGP paths
+ - Default value: `false`
+- `deterministic_med_variable` (String) Variable name
+- `external_routes_distance` (Number) Set administrative distance for external BGP routes
+ - Range: `1`-`255`
+ - Default value: `20`
+- `external_routes_distance_variable` (String) Variable name
+- `feature_profile_id` (String) Feature Profile ID
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+ - Range: `0`-`65535`
+ - Default value: `180`
+- `hold_time_variable` (String) Variable name
+- `internal_routes_distance` (Number) Set administrative distance for internal BGP routes
+ - Range: `1`-`255`
+ - Default value: `200`
+- `internal_routes_distance_variable` (String) Variable name
+- `ipv4_aggregate_addresses` (Attributes List) Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv4_aggregate_addresses))
+- `ipv4_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+ - Range: `1`-`32`
+- `ipv4_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv4_neighbors` (Attributes List) Set BGP IPv4 neighbors (see [below for nested schema](#nestedatt--ipv4_neighbors))
+- `ipv4_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv4_networks))
+- `ipv4_originate` (Boolean) BGP Default Information Originate
+ - Default value: `false`
+- `ipv4_originate_variable` (String) Variable name
+- `ipv4_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv4_redistributes))
+- `ipv4_table_map_filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `ipv4_table_map_filter_variable` (String) Variable name
+- `ipv4_table_map_route_policy_id` (String)
+- `ipv6_aggregate_addresses` (Attributes List) IPv6 Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv6_aggregate_addresses))
+- `ipv6_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+ - Range: `1`-`32`
+- `ipv6_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv6_neighbors` (Attributes List) Set BGP IPv6 neighbors (see [below for nested schema](#nestedatt--ipv6_neighbors))
+- `ipv6_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv6_networks))
+- `ipv6_originate` (Boolean) BGP Default Information Originate
+ - Default value: `false`
+- `ipv6_originate_variable` (String) Variable name
+- `ipv6_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv6_redistributes))
+- `ipv6_table_map_filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `ipv6_table_map_filter_variable` (String) Variable name
+- `ipv6_table_map_route_policy_id` (String)
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+ - Range: `0`-`65535`
+ - Default value: `60`
+- `keepalive_time_variable` (String) Variable name
+- `local_routes_distance` (Number) Set administrative distance for local BGP routes
+ - Range: `1`-`255`
+ - Default value: `20`
+- `local_routes_distance_variable` (String) Variable name
+- `missing_med_as_worst` (Boolean) If path has no MED, consider it to be worst path when selecting active BGP paths
+ - Default value: `false`
+- `missing_med_as_worst_variable` (String) Variable name
+- `multipath_relax` (Boolean) Ignore AS for multipath selection
+ - Default value: `false`
+- `multipath_relax_variable` (String) Variable name
+- `propagate_as_path` (Boolean) Propagate AS Path
+ - Default value: `false`
+- `propagate_as_path_variable` (String) Variable name
+- `propagate_community` (Boolean) Propagate Community
+ - Default value: `false`
+- `propagate_community_variable` (String) Variable name
+- `router_id` (String) Configure BGP router identifier
+- `router_id_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_aggregate_addresses`
+
+Optional:
+
+- `as_set_path` (Boolean) Set AS set path information
+ - Default value: `false`
+- `as_set_path_variable` (String) Variable name
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+ - Default value: `false`
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_neighbors`
+
+Optional:
+
+- `address` (String) Set neighbor address
+- `address_families` (Attributes List) Set BGP address family (see [below for nested schema](#nestedatt--ipv4_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+ - Range: `1`-`10`
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+ - Default value: `false`
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+ - Range: `1`-`255`
+ - Default value: `1`
+- `ebgp_multihop_variable` (String) Variable name
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+ - Range: `0`-`65535`
+ - Default value: `180`
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+ - Range: `0`-`65535`
+ - Default value: `60`
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+ - Default value: `false`
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+ - Default value: `true`
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+ - Default value: `true`
+- `send_extended_community_variable` (String) Variable name
+- `send_label` (Boolean) Send label
+ - Default value: `false`
+- `send_label_variable` (String) Variable name
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_neighbors.address_families`
+
+Optional:
+
+- `family_type` (String) Set IPv4 unicast address family
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+ - Range: `1`-`4294967295`
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+ - Range: `1`-`65535`
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+ - Range: `1`-`100`
+ - Default value: `75`
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv4_networks`
+
+Optional:
+
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_redistributes`
+
+Optional:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+ - Choices: `static`, `connected`, `omp`, `nat`, `ospf`, `ospfv3`, `eigrp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `ipv6_aggregate_addresses`
+
+Optional:
+
+- `aggregate_prefix` (String) Configure the IPv6 prefixes to aggregate
+- `aggregate_prefix_variable` (String) Variable name
+- `as_set_path` (Boolean) Set AS set path information
+ - Default value: `false`
+- `as_set_path_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+ - Default value: `false`
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_neighbors`
+
+Optional:
+
+- `address` (String) Set IPv6 neighbor address
+- `address_families` (Attributes List) Set IPv6 BGP address family (see [below for nested schema](#nestedatt--ipv6_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+ - Range: `1`-`10`
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+ - Default value: `false`
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+ - Range: `1`-`255`
+ - Default value: `1`
+- `ebgp_multihop_variable` (String) Variable name
+- `hold_time` (Number) Set how long to wait since receiving a keepalive message to consider BGP peer unavailable
+ - Range: `0`-`65535`
+ - Default value: `180`
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Set how often to advertise keepalive messages to BGP peer
+ - Range: `0`-`65535`
+ - Default value: `60`
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+ - Default value: `false`
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+ - Default value: `true`
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+ - Default value: `true`
+- `send_extended_community_variable` (String) Variable name
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_neighbors.address_families`
+
+Optional:
+
+- `family_type` (String) Set IPv6 unicast address family
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+ - Range: `1`-`4294967295`
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+ - Range: `1`-`65535`
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+ - Range: `1`-`100`
+ - Default value: `75`
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_networks`
+
+Optional:
+
+- `network_prefix` (String) Configure the prefixes for BGP to announce
+- `network_prefix_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_redistributes`
+
+Optional:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+ - Choices: `static`, `connected`, `ospf`, `omp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_routing_bgp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_routing_ospf_feature.md b/docs/resources/service_routing_ospf_feature.md
new file mode 100644
index 000000000..ae542c7d5
--- /dev/null
+++ b/docs/resources/service_routing_ospf_feature.md
@@ -0,0 +1,254 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_ospf_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Routing OSPF Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_routing_ospf_feature (Resource)
+
+This resource can manage a Service Routing OSPF Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_routing_ospf_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ redistributes = [
+ {
+ protocol = "static"
+ nat_dia = true
+ }
+ ]
+ router_lsas = [
+ {
+ type = "on-startup"
+ time = 5
+ }
+ ]
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ no_summary = false
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ designated_router_priority = 1
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "message-digest"
+ message_digest_key_id = 7
+ message_digest_key = "sdjfhsghbjdjr"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `areas` (Attributes List) Configure OSPF area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF
+ - Default value: `false`
+- `default_information_originate_always` (Boolean) Always advertise default route
+ - Default value: `false`
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+ - Range: `0`-`16777214`
+- `default_information_originate_metric_type` (String) Set default route type
+ - Choices: `type1`, `type2`
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance_external` (Number) Set distance for external routes
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_intra_area_variable` (String) Variable name
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+ - Range: `1`-`4294967`
+ - Default value: `100`
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+ - Default value: `true`
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsas` (Attributes List) Advertise own router LSA with infinite distance (see [below for nested schema](#nestedatt--router_lsas))
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+ - Range: `1`-`600000`
+ - Default value: `200`
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `1000`
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `10000`
+- `spf_maximum_hold_time_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Optional:
+
+- `area_number` (Number) Set OSPF area number
+ - Range: `0`-`4294967295`
+- `area_number_variable` (String) Variable name
+- `area_type` (String) set the area type
+ - Choices: `stub`, `nssa`
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject interarea routes into STUB or NSSA
+ - Default value: `false`
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Optional:
+
+- `authentication_type` (String) Set OSPF interface authentication type
+ - Choices: `message-digest`
+- `authentication_type_variable` (String) Variable name
+- `cost` (Number) Set cost of OSPF interface
+ - Range: `1`-`65535`
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+ - Range: `1`-`65535`
+ - Default value: `40`
+- `dead_interval_variable` (String) Variable name
+- `designated_router_priority` (Number) Set router’s priority to be elected as designated router
+ - Range: `0`-`255`
+ - Default value: `1`
+- `designated_router_priority_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+ - Range: `1`-`65535`
+ - Default value: `10`
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+ - Range: `1`-`65535`
+ - Default value: `5`
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `message_digest_key` (String) Set MD5 authentication key
+- `message_digest_key_id` (Number) Set MD5 message digest key
+ - Range: `1`-`255`
+- `message_digest_key_id_variable` (String) Variable name
+- `message_digest_key_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+ - Choices: `broadcast`, `point-to-point`, `non-broadcast`, `point-to-multipoint`
+ - Default value: `broadcast`
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+ - Default value: `false`
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Optional:
+
+- `cost` (Number) Set cost for this range
+ - Range: `0`-`16777214`
+- `cost_variable` (String) Variable name
+- `ip_address` (String) IP Address
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+ - Default value: `false`
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Optional:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+ - Default value: `true`
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+ - Choices: `static`, `connected`, `bgp`, `omp`, `nat`, `eigrp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `router_lsas`
+
+Optional:
+
+- `time` (Number) Set how long to advertise maximum metric after router starts up
+ - Range: `5`-`86400`
+- `time_variable` (String) Variable name
+- `type` (String) Set the router LSA advertisement type
+ - Choices: `administrative`, `on-startup`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_routing_ospf_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_routing_ospfv3_ipv4_feature.md b/docs/resources/service_routing_ospfv3_ipv4_feature.md
new file mode 100644
index 000000000..4ffde9224
--- /dev/null
+++ b/docs/resources/service_routing_ospfv3_ipv4_feature.md
@@ -0,0 +1,238 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_ospfv3_ipv4_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Routing OSPFv3 IPv4 Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_routing_ospfv3_ipv4_feature (Resource)
+
+This resource can manage a Service Routing OSPFv3 IPv4 Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_routing_ospfv3_ipv4_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "nat-route"
+ nat_dia = true
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `areas` (Attributes List) Configure OSPFv3 IPv4 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+ - Range: `0`-`16777214`
+- `default_information_originate_metric_type` (String) Set default route metric type
+ - Choices: `type1`, `type2`
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_external` (Number) Set distance for external routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `filter_variable` (String) Variable name
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+ - Range: `1`-`4294967`
+ - Default value: `100`
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+ - Default value: `true`
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+ - Range: `5`-`86400`
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+ - Range: `1`-`600000`
+ - Default value: `200`
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `1000`
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `10000`
+- `spf_maximum_hold_time_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Optional:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+ - Range: `0`-`4294967295`
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+ - Choices: `stub`
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Optional:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+ - Range: `256`-`4294967295`
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+ - Choices: `no-auth`
+- `cost` (Number) Set cost of OSPF interface
+ - Range: `1`-`65535`
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+ - Range: `1`-`65535`
+ - Default value: `40`
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+ - Range: `1`-`65535`
+ - Default value: `10`
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+ - Range: `1`-`65535`
+ - Default value: `5`
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+ - Choices: `broadcast`, `point-to-point`, `non-broadcast`, `point-to-multipoint`
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+ - Default value: `false`
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Optional:
+
+- `cost` (Number) Set cost for this range
+ - Range: `0`-`16777214`
+- `cost_variable` (String) Variable name
+- `ip_address` (String)
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+ - Default value: `false`
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Optional:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+ - Default value: `true`
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+ - Choices: `connected`, `static`, `omp`, `nat-route`, `bgp`, `eigrp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_routing_ospfv3_ipv4_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_routing_ospfv3_ipv6_feature.md b/docs/resources/service_routing_ospfv3_ipv6_feature.md
new file mode 100644
index 000000000..b15712a11
--- /dev/null
+++ b/docs/resources/service_routing_ospfv3_ipv6_feature.md
@@ -0,0 +1,231 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_routing_ospfv3_ipv6_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Routing OSPFv3 IPv6 Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_routing_ospfv3_ipv6_feature (Resource)
+
+This resource can manage a Service Routing OSPFv3 IPv6 Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_routing_ospfv3_ipv6_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "static"
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ prefix = "3002::/96"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `areas` (Attributes List) Configure OSPFv3 IPv6 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+ - Range: `0`-`16777214`
+- `default_information_originate_metric_type` (String) Set default route metric type
+ - Choices: `type1`, `type2`
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_external` (Number) Set distance for external routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `filter_variable` (String) Variable name
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+ - Range: `1`-`4294967`
+ - Default value: `100`
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+ - Default value: `true`
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+ - Range: `5`-`86400`
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+ - Range: `1`-`600000`
+ - Default value: `200`
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `1000`
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `10000`
+- `spf_maximum_hold_time_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Optional:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+ - Range: `0`-`4294967295`
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+ - Choices: `stub`
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Optional:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+ - Range: `256`-`4294967295`
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+ - Choices: `no-auth`
+- `cost` (Number) Set cost of OSPF interface
+ - Range: `1`-`65535`
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+ - Range: `1`-`65535`
+ - Default value: `40`
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+ - Range: `1`-`65535`
+ - Default value: `10`
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+ - Range: `1`-`65535`
+ - Default value: `5`
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+ - Choices: `broadcast`, `point-to-point`, `non-broadcast`, `point-to-multipoint`
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+ - Default value: `false`
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Optional:
+
+- `cost` (Number) Set cost for this range
+ - Range: `0`-`16777214`
+- `cost_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+ - Default value: `false`
+- `no_advertise_variable` (String) Variable name
+- `prefix` (String) IPv6 prefix,for example 2001::/64
+- `prefix_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Optional:
+
+- `protocol` (String) Set the protocol
+ - Choices: `connected`, `static`, `omp`, `bgp`, `eigrp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_routing_ospfv3_ipv6_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_switchport_feature.md b/docs/resources/service_switchport_feature.md
new file mode 100644
index 000000000..4929885f4
--- /dev/null
+++ b/docs/resources/service_switchport_feature.md
@@ -0,0 +1,164 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_switchport_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Switchport Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_switchport_feature (Resource)
+
+This resource can manage a Service Switchport Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_switchport_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ interfaces = [
+ {
+ interface_name = "GigabitEthernet"
+ mode = "access"
+ shutdown = true
+ speed = "10"
+ duplex = "full"
+ switchport_access_vlan = 1
+ switchport_trunk_allowed_vlans = "1"
+ switchport_trunk_native_vlan = 1
+ port_control = "auto"
+ voice_vlan = 1
+ pae_enable = true
+ mac_authentication_bypass = false
+ host_mode = "single-host"
+ enable_periodic_reauth = false
+ inactivity = 60
+ reauthentication = 1
+ control_direction = "both"
+ restricted_vlan = 1
+ guest_vlan = 1
+ critical_vlan = 1
+ enable_voice = false
+ }
+ ]
+ age_out_time = 300
+ static_mac_addresses = [
+ {
+ mac_address = "01:02:03:04:05:06"
+ vlan_id = 1
+ interface_name = "GigabitEthernet0/0/0"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `age_out_time` (Number) Set when a MAC table entry ages out (0 to disable, 10-1000000 otherwise)
+ - Range: `0`-`1000000`
+ - Default value: `300`
+- `age_out_time_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interfaces` (Attributes List) Interface name: GigabitEthernet0/<>/<> when present (see [below for nested schema](#nestedatt--interfaces))
+- `static_mac_addresses` (Attributes List) Add static MAC address entries for interface (see [below for nested schema](#nestedatt--static_mac_addresses))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `interfaces`
+
+Optional:
+
+- `control_direction` (String) Set uni or bi directional authorization mode
+ - Choices: `both`, `in`
+- `control_direction_variable` (String) Variable name
+- `critical_vlan` (Number) Set Critical VLAN
+ - Range: `1`-`4094`
+- `critical_vlan_variable` (String) Variable name
+- `duplex` (String) Duplex mode
+ - Choices: `full`, `half`
+- `duplex_variable` (String) Variable name
+- `enable_periodic_reauth` (Boolean) Enable Periodic Reauthentication
+- `enable_periodic_reauth_variable` (String) Variable name
+- `enable_voice` (Boolean) Enable Critical Voice VLAN
+- `enable_voice_variable` (String) Variable name
+- `guest_vlan` (Number) Set vlan to drop non-802.1x enabled clients into if client is not in MAB list
+ - Range: `1`-`4094`
+- `guest_vlan_variable` (String) Variable name
+- `host_mode` (String) Set host mode
+ - Choices: `single-host`, `multi-auth`, `multi-host`, `multi-domain`
+- `host_mode_variable` (String) Variable name
+- `inactivity` (Number) Periodic Reauthentication Inactivity Timeout (in seconds)
+ - Range: `1`-`65535`
+- `inactivity_variable` (String) Variable name
+- `interface_name` (String) Set Interface name
+- `interface_name_variable` (String) Variable name
+- `mac_authentication_bypass` (Boolean) MAC Authentication Bypass
+- `mac_authentication_bypass_variable` (String) Variable name
+- `mode` (String) Set type of switch port: access/trunk
+ - Choices: `access`, `trunk`
+- `pae_enable` (Boolean) Set 802.1x Interface Pae Type
+- `pae_enable_variable` (String) Variable name
+- `port_control` (String) Set Port-Control Mode
+ - Choices: `auto`, `force-unauthorized`, `force-authorized`
+- `port_control_variable` (String) Variable name
+- `reauthentication` (Number) Periodic Reauthentication Interval (in seconds)
+ - Range: `1`-`1073741823`
+ - Default value: `3600`
+- `reauthentication_variable` (String) Variable name
+- `restricted_vlan` (Number) Set Restricted VLAN ID
+ - Range: `1`-`4094`
+- `restricted_vlan_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+ - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+ - Choices: `10`, `100`, `1000`, `2500`, `10000`
+- `speed_variable` (String) Variable name
+- `switchport_access_vlan` (Number) Set VLAN identifier associated with bridging domain
+ - Range: `1`-`4094`
+- `switchport_access_vlan_variable` (String) Variable name
+- `switchport_trunk_allowed_vlans` (String) Configure VLAN IDs used with the trunk
+- `switchport_trunk_allowed_vlans_variable` (String) Variable name
+- `switchport_trunk_native_vlan` (Number) Configure VLAN ID used for native VLAN
+ - Range: `1`-`4094`
+- `switchport_trunk_native_vlan_variable` (String) Variable name
+- `voice_vlan` (Number) Configure Voice Vlan
+ - Range: `1`-`4094`
+- `voice_vlan_variable` (String) Variable name
+
+
+
+### Nested Schema for `static_mac_addresses`
+
+Optional:
+
+- `interface_name` (String) Interface name: GigabitEthernet0/<>/<>
+- `interface_name_variable` (String) Variable name
+- `mac_address` (String) Set MAC address in xxxx.xxxx.xxxx format
+- `mac_address_variable` (String) Variable name
+- `vlan_id` (Number) Configure VLAN ID used with the mac and interface
+ - Range: `1`-`4094`
+- `vlan_id_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_switchport_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_tracker_feature.md b/docs/resources/service_tracker_feature.md
new file mode 100644
index 000000000..282ff69a5
--- /dev/null
+++ b/docs/resources/service_tracker_feature.md
@@ -0,0 +1,91 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_tracker_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Tracker Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_tracker_feature (Resource)
+
+This resource can manage a Service Tracker Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_2"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ protocol = "tcp"
+ port = 123
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "static-route"
+ tracker_type = "endpoint"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `endpoint_api_url` (String) API url of endpoint
+- `endpoint_api_url_variable` (String) Variable name
+- `endpoint_dns_name` (String) Endpoint DNS Name
+- `endpoint_dns_name_variable` (String) Variable name
+- `endpoint_ip` (String) Endpoint IP
+- `endpoint_ip_variable` (String) Variable name
+- `endpoint_tracker_type` (String) Endpoint Tracker Type
+ - Choices: `static-route`
+ - Default value: `static-route`
+- `endpoint_tracker_type_variable` (String) Variable name
+- `interval` (Number) Interval
+ - Range: `20`-`600`
+ - Default value: `60`
+- `interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+ - Range: `1`-`10`
+ - Default value: `3`
+- `multiplier_variable` (String) Variable name
+- `port` (Number) - Range: `1`-`65535`
+- `port_variable` (String) Variable name
+- `protocol` (String) - Choices: `tcp`, `udp`
+- `protocol_variable` (String) Variable name
+- `threshold` (Number) Threshold
+ - Range: `100`-`1000`
+ - Default value: `300`
+- `threshold_variable` (String) Variable name
+- `tracker_name` (String) Tracker Name
+- `tracker_name_variable` (String) Variable name
+- `tracker_type` (String) Tracker Type
+ - Choices: `endpoint`
+ - Default value: `endpoint`
+- `tracker_type_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_tracker_group_feature.md b/docs/resources/service_tracker_group_feature.md
new file mode 100644
index 000000000..61ef25b7b
--- /dev/null
+++ b/docs/resources/service_tracker_group_feature.md
@@ -0,0 +1,66 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_service_tracker_group_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Service Tracker Group Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_service_tracker_group_feature (Resource)
+
+This resource can manage a Service Tracker Group Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_service_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_elements = [
+ {
+ tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ tracker_boolean = "or"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `tracker_boolean` (String) tracker ref list combine boolean and or
+ - Choices: `and`, `or`
+ - Default value: `or`
+- `tracker_boolean_variable` (String) Variable name
+- `tracker_elements` (Attributes List) tracker parcel ref list (see [below for nested schema](#nestedatt--tracker_elements))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Optional:
+
+- `tracker_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_service_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/service_tracker_profile_parcel.md b/docs/resources/service_tracker_profile_parcel.md
deleted file mode 100644
index 34cb00302..000000000
--- a/docs/resources/service_tracker_profile_parcel.md
+++ /dev/null
@@ -1,91 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_service_tracker_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Service Tracker profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_service_tracker_profile_parcel (Resource)
-
-This resource can manage a Service Tracker profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_service_tracker_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- tracker_name = "TRACKER_2"
- endpoint_api_url = "google.com"
- endpoint_dns_name = "google.com"
- endpoint_ip = "1.2.3.4"
- protocol = "tcp"
- port = 123
- interval = 30
- multiplier = 3
- threshold = 300
- endpoint_tracker_type = "static-route"
- tracker_type = "endpoint"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `endpoint_api_url` (String) API url of endpoint
-- `endpoint_api_url_variable` (String) Variable name
-- `endpoint_dns_name` (String) Endpoint DNS Name
-- `endpoint_dns_name_variable` (String) Variable name
-- `endpoint_ip` (String) Endpoint IP
-- `endpoint_ip_variable` (String) Variable name
-- `endpoint_tracker_type` (String) Endpoint Tracker Type
- - Choices: `static-route`
- - Default value: `static-route`
-- `endpoint_tracker_type_variable` (String) Variable name
-- `interval` (Number) Interval
- - Range: `20`-`600`
- - Default value: `60`
-- `interval_variable` (String) Variable name
-- `multiplier` (Number) Multiplier
- - Range: `1`-`10`
- - Default value: `3`
-- `multiplier_variable` (String) Variable name
-- `port` (Number) - Range: `1`-`65535`
-- `port_variable` (String) Variable name
-- `protocol` (String) - Choices: `tcp`, `udp`
-- `protocol_variable` (String) Variable name
-- `threshold` (Number) Threshold
- - Range: `100`-`1000`
- - Default value: `300`
-- `threshold_variable` (String) Variable name
-- `tracker_name` (String) Tracker Name
-- `tracker_name_variable` (String) Variable name
-- `tracker_type` (String) Tracker Type
- - Choices: `endpoint`
- - Default value: `endpoint`
-- `tracker_type_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_service_tracker_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/sig_security_feature_profile.md b/docs/resources/sig_security_feature_profile.md
new file mode 100644
index 000000000..c45f9fe4f
--- /dev/null
+++ b/docs/resources/sig_security_feature_profile.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_sig_security_feature_profile Resource - terraform-provider-sdwan"
+subcategory: "Feature Profiles"
+description: |-
+ This resource can manage a SIG Security Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_sig_security_feature_profile (Resource)
+
+This resource can manage a SIG Security Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_sig_security_feature_profile" "example" {
+ name = "SIG_SECURITY_FP_1"
+ description = "My sig security feature profile 1"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `description` (String) Description
+- `name` (String) The name of the sig security feature profile
+
+### Read-Only
+
+- `id` (String) The id of the object
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_sig_security_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/site_list_policy_object.md b/docs/resources/site_list_policy_object.md
index 2f139e9d4..91babccc1 100644
--- a/docs/resources/site_list_policy_object.md
+++ b/docs/resources/site_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_site_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Site List Policy Object .
---
diff --git a/docs/resources/sla_class_policy_object.md b/docs/resources/sla_class_policy_object.md
index 152b3a321..4b8df5a26 100644
--- a/docs/resources/sla_class_policy_object.md
+++ b/docs/resources/sla_class_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_sla_class_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a SLA Class Policy Object .
---
diff --git a/docs/resources/standard_community_list_policy_object.md b/docs/resources/standard_community_list_policy_object.md
index 3f229fbc6..4c1a0a00c 100644
--- a/docs/resources/standard_community_list_policy_object.md
+++ b/docs/resources/standard_community_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_standard_community_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Standard Community List Policy Object .
---
diff --git a/docs/resources/switchport_feature_template.md b/docs/resources/switchport_feature_template.md
index 6ee9f2968..eb1eb5f47 100644
--- a/docs/resources/switchport_feature_template.md
+++ b/docs/resources/switchport_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_switchport_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a Switchport feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/system_aaa_feature.md b/docs/resources/system_aaa_feature.md
new file mode 100644
index 000000000..cb75e8c21
--- /dev/null
+++ b/docs/resources/system_aaa_feature.md
@@ -0,0 +1,276 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_aaa_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System AAA Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_aaa_feature (Resource)
+
+This resource can manage a System AAA Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_aaa_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ authentication_group = true
+ accounting_group = true
+ server_auth_order = ["local"]
+ users = [
+ {
+ name = "User1"
+ password = "cisco123"
+ privilege = "15"
+ public_keys = [
+ {
+ key_string = "AAAAB3NzaC1yc2"
+ key_type = "ssh-rsa"
+ }
+ ]
+ }
+ ]
+ radius_groups = [
+ {
+ group_name = "RGROUP1"
+ vpn = 10
+ source_interface = "GigabitEthernet0"
+ servers = [
+ {
+ address = "1.2.3.4"
+ auth_port = 1812
+ acct_port = 1813
+ timeout = 5
+ retransmit = 3
+ key = "cisco123"
+ secret_key = "cisco123"
+ key_enum = "7"
+ key_type = "key"
+ }
+ ]
+ }
+ ]
+ tacacs_groups = [
+ {
+ group_name = "TGROUP1"
+ vpn = 10
+ source_interface = "GigabitEthernet0"
+ servers = [
+ {
+ address = "1.2.3.4"
+ port = 49
+ timeout = 5
+ key = "cisco123"
+ secret_key = "cisco123"
+ key_enum = "7"
+ }
+ ]
+ }
+ ]
+ accounting_rules = [
+ {
+ rule_id = "1"
+ method = "commands"
+ level = "15"
+ start_stop = true
+ group = ["RGROUP1"]
+ }
+ ]
+ authorization_console = true
+ authorization_config_commands = true
+ authorization_rules = [
+ {
+ rule_id = "1"
+ method = "commands"
+ level = "15"
+ group = ["RGROUP1"]
+ if_authenticated = true
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+- `server_auth_order` (Set of String) ServerGroups priority order
+
+### Optional
+
+- `accounting_group` (Boolean) Accounting configurations parameters
+ - Default value: `false`
+- `accounting_group_variable` (String) Variable name
+- `accounting_rules` (Attributes List) Configure the accounting rules (see [below for nested schema](#nestedatt--accounting_rules))
+- `authentication_group` (Boolean) Authentication configurations parameters
+ - Default value: `false`
+- `authentication_group_variable` (String) Variable name
+- `authorization_config_commands` (Boolean) For configuration mode commands.
+ - Default value: `false`
+- `authorization_config_commands_variable` (String) Variable name
+- `authorization_console` (Boolean) For enabling console authorization
+ - Default value: `false`
+- `authorization_console_variable` (String) Variable name
+- `authorization_rules` (Attributes List) Configure the Authorization Rules (see [below for nested schema](#nestedatt--authorization_rules))
+- `description` (String) The description of the Feature
+- `radius_groups` (Attributes List) Configure the Radius serverGroup (see [below for nested schema](#nestedatt--radius_groups))
+- `tacacs_groups` (Attributes List) Configure the TACACS serverGroup (see [below for nested schema](#nestedatt--tacacs_groups))
+- `users` (Attributes List) Create local login account (see [below for nested schema](#nestedatt--users))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `accounting_rules`
+
+Optional:
+
+- `group` (Set of String) Use Server-group
+- `level` (String) Privilege level when method is commands
+ - Choices: `1`, `15`
+- `method` (String) Configure Accounting Method
+ - Choices: `commands`, `exec`, `network`, `system`
+- `rule_id` (String) Configure Accounting Rule ID
+- `start_stop` (Boolean) Record start and stop without waiting
+ - Default value: `true`
+- `start_stop_variable` (String) Variable name
+
+
+
+### Nested Schema for `authorization_rules`
+
+Optional:
+
+- `group` (Set of String) Use Server-group
+- `if_authenticated` (Boolean) Succeed if user has authenticated
+ - Default value: `false`
+- `level` (String) Privilege level when method is commands
+ - Choices: `1`, `15`
+- `method` (String) Method
+ - Choices: `commands`
+- `rule_id` (String) Configure Authorization Rule ID
+
+
+
+### Nested Schema for `radius_groups`
+
+Optional:
+
+- `group_name` (String) Set Radius server Group Name
+- `servers` (Attributes List) Configure the Radius server (see [below for nested schema](#nestedatt--radius_groups--servers))
+- `source_interface` (String) Set interface to use to reach Radius server
+- `source_interface_variable` (String) Variable name
+- `vpn` (Number) Set VPN in which Radius server is located
+ - Range: `0`-`65530`
+ - Default value: `0`
+
+
+### Nested Schema for `radius_groups.servers`
+
+Optional:
+
+- `acct_port` (Number) Set Accounting port to use to connect to Radius server
+ - Range: `1`-`65534`
+ - Default value: `1813`
+- `acct_port_variable` (String) Variable name
+- `address` (String) Set IP address of Radius server
+- `auth_port` (Number) Set Authentication port to use to connect to Radius server
+ - Range: `1`-`65534`
+ - Default value: `1812`
+- `auth_port_variable` (String) Variable name
+- `key` (String) Set the Radius server shared key
+- `key_enum` (String) Type of encyption. To be used for type 6
+ - Choices: `6`, `7`
+- `key_type` (String) key type
+ - Choices: `key`, `pac`
+ - Default value: `key`
+- `key_type_variable` (String) Variable name
+- `retransmit` (Number) Configure how many times to contact this Radius server
+ - Range: `1`-`100`
+ - Default value: `3`
+- `retransmit_variable` (String) Variable name
+- `secret_key` (String) Set the Radius server shared type 7 encrypted key
+- `secret_key_variable` (String) Variable name
+- `timeout` (Number) Configure how long to wait for replies from the Radius server
+ - Range: `1`-`1000`
+ - Default value: `5`
+- `timeout_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `tacacs_groups`
+
+Optional:
+
+- `group_name` (String) Set TACACS server Group Name
+- `servers` (Attributes List) Configure the TACACS server (see [below for nested schema](#nestedatt--tacacs_groups--servers))
+- `source_interface` (String) Set interface to use to reach TACACS server
+- `source_interface_variable` (String) Variable name
+- `vpn` (Number) Set VPN in which TACACS server is located
+ - Range: `0`-`65530`
+ - Default value: `0`
+
+
+### Nested Schema for `tacacs_groups.servers`
+
+Optional:
+
+- `address` (String) Set IP address of TACACS server
+- `key` (String) Set the TACACS server shared key
+- `key_enum` (String) Type of encyption. To be used for type 6
+ - Choices: `6`, `7`
+- `port` (Number) TACACS Port
+ - Range: `1`-`65535`
+ - Default value: `49`
+- `port_variable` (String) Variable name
+- `secret_key` (String) Set the TACACS server shared type 7 encrypted key
+- `secret_key_variable` (String) Variable name
+- `timeout` (Number) Configure how long to wait for replies from the TACACS server
+ - Range: `1`-`1000`
+ - Default value: `5`
+- `timeout_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `users`
+
+Optional:
+
+- `name` (String) Set the username
+- `name_variable` (String) Variable name
+- `password` (String) Set the user password
+- `password_variable` (String) Variable name
+- `privilege` (String) Set Privilege Level for this user
+ - Choices: `1`, `15`
+ - Default value: `15`
+- `privilege_variable` (String) Variable name
+- `public_keys` (Attributes List) List of RSA public-keys per user (see [below for nested schema](#nestedatt--users--public_keys))
+
+
+### Nested Schema for `users.public_keys`
+
+Optional:
+
+- `key_string` (String) Set the RSA key string
+- `key_type` (String) Only RSA is supported
+- `key_type_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_aaa_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_aaa_profile_parcel.md b/docs/resources/system_aaa_profile_parcel.md
deleted file mode 100644
index f9777e042..000000000
--- a/docs/resources/system_aaa_profile_parcel.md
+++ /dev/null
@@ -1,276 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_aaa_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System AAA profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_aaa_profile_parcel (Resource)
-
-This resource can manage a System AAA profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_aaa_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- authentication_group = true
- accounting_group = true
- server_auth_order = ["local"]
- users = [
- {
- name = "User1"
- password = "cisco123"
- privilege = "15"
- public_keys = [
- {
- key_string = "AAAAB3NzaC1yc2"
- key_type = "ssh-rsa"
- }
- ]
- }
- ]
- radius_groups = [
- {
- group_name = "RGROUP1"
- vpn = 10
- source_interface = "GigabitEthernet0"
- servers = [
- {
- address = "1.2.3.4"
- auth_port = 1812
- acct_port = 1813
- timeout = 5
- retransmit = 3
- key = "cisco123"
- secret_key = "cisco123"
- key_enum = "7"
- key_type = "key"
- }
- ]
- }
- ]
- tacacs_groups = [
- {
- group_name = "TGROUP1"
- vpn = 10
- source_interface = "GigabitEthernet0"
- servers = [
- {
- address = "1.2.3.4"
- port = 49
- timeout = 5
- key = "cisco123"
- secret_key = "cisco123"
- key_enum = "7"
- }
- ]
- }
- ]
- accounting_rules = [
- {
- rule_id = "1"
- method = "commands"
- level = "15"
- start_stop = true
- group = ["RGROUP1"]
- }
- ]
- authorization_console = true
- authorization_config_commands = true
- authorization_rules = [
- {
- rule_id = "1"
- method = "commands"
- level = "15"
- group = ["RGROUP1"]
- if_authenticated = true
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-- `server_auth_order` (Set of String) ServerGroups priority order
-
-### Optional
-
-- `accounting_group` (Boolean) Accounting configurations parameters
- - Default value: `false`
-- `accounting_group_variable` (String) Variable name
-- `accounting_rules` (Attributes List) Configure the accounting rules (see [below for nested schema](#nestedatt--accounting_rules))
-- `authentication_group` (Boolean) Authentication configurations parameters
- - Default value: `false`
-- `authentication_group_variable` (String) Variable name
-- `authorization_config_commands` (Boolean) For configuration mode commands.
- - Default value: `false`
-- `authorization_config_commands_variable` (String) Variable name
-- `authorization_console` (Boolean) For enabling console authorization
- - Default value: `false`
-- `authorization_console_variable` (String) Variable name
-- `authorization_rules` (Attributes List) Configure the Authorization Rules (see [below for nested schema](#nestedatt--authorization_rules))
-- `description` (String) The description of the profile parcel
-- `radius_groups` (Attributes List) Configure the Radius serverGroup (see [below for nested schema](#nestedatt--radius_groups))
-- `tacacs_groups` (Attributes List) Configure the TACACS serverGroup (see [below for nested schema](#nestedatt--tacacs_groups))
-- `users` (Attributes List) Create local login account (see [below for nested schema](#nestedatt--users))
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `accounting_rules`
-
-Optional:
-
-- `group` (Set of String) Use Server-group
-- `level` (String) Privilege level when method is commands
- - Choices: `1`, `15`
-- `method` (String) Configure Accounting Method
- - Choices: `commands`, `exec`, `network`, `system`
-- `rule_id` (String) Configure Accounting Rule ID
-- `start_stop` (Boolean) Record start and stop without waiting
- - Default value: `true`
-- `start_stop_variable` (String) Variable name
-
-
-
-### Nested Schema for `authorization_rules`
-
-Optional:
-
-- `group` (Set of String) Use Server-group
-- `if_authenticated` (Boolean) Succeed if user has authenticated
- - Default value: `false`
-- `level` (String) Privilege level when method is commands
- - Choices: `1`, `15`
-- `method` (String) Method
- - Choices: `commands`
-- `rule_id` (String) Configure Authorization Rule ID
-
-
-
-### Nested Schema for `radius_groups`
-
-Optional:
-
-- `group_name` (String) Set Radius server Group Name
-- `servers` (Attributes List) Configure the Radius server (see [below for nested schema](#nestedatt--radius_groups--servers))
-- `source_interface` (String) Set interface to use to reach Radius server
-- `source_interface_variable` (String) Variable name
-- `vpn` (Number) Set VPN in which Radius server is located
- - Range: `0`-`65530`
- - Default value: `0`
-
-
-### Nested Schema for `radius_groups.servers`
-
-Optional:
-
-- `acct_port` (Number) Set Accounting port to use to connect to Radius server
- - Range: `1`-`65534`
- - Default value: `1813`
-- `acct_port_variable` (String) Variable name
-- `address` (String) Set IP address of Radius server
-- `auth_port` (Number) Set Authentication port to use to connect to Radius server
- - Range: `1`-`65534`
- - Default value: `1812`
-- `auth_port_variable` (String) Variable name
-- `key` (String) Set the Radius server shared key
-- `key_enum` (String) Type of encyption. To be used for type 6
- - Choices: `6`, `7`
-- `key_type` (String) key type
- - Choices: `key`, `pac`
- - Default value: `key`
-- `key_type_variable` (String) Variable name
-- `retransmit` (Number) Configure how many times to contact this Radius server
- - Range: `1`-`100`
- - Default value: `3`
-- `retransmit_variable` (String) Variable name
-- `secret_key` (String) Set the Radius server shared type 7 encrypted key
-- `secret_key_variable` (String) Variable name
-- `timeout` (Number) Configure how long to wait for replies from the Radius server
- - Range: `1`-`1000`
- - Default value: `5`
-- `timeout_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `tacacs_groups`
-
-Optional:
-
-- `group_name` (String) Set TACACS server Group Name
-- `servers` (Attributes List) Configure the TACACS server (see [below for nested schema](#nestedatt--tacacs_groups--servers))
-- `source_interface` (String) Set interface to use to reach TACACS server
-- `source_interface_variable` (String) Variable name
-- `vpn` (Number) Set VPN in which TACACS server is located
- - Range: `0`-`65530`
- - Default value: `0`
-
-
-### Nested Schema for `tacacs_groups.servers`
-
-Optional:
-
-- `address` (String) Set IP address of TACACS server
-- `key` (String) Set the TACACS server shared key
-- `key_enum` (String) Type of encyption. To be used for type 6
- - Choices: `6`, `7`
-- `port` (Number) TACACS Port
- - Range: `1`-`65535`
- - Default value: `49`
-- `port_variable` (String) Variable name
-- `secret_key` (String) Set the TACACS server shared type 7 encrypted key
-- `secret_key_variable` (String) Variable name
-- `timeout` (Number) Configure how long to wait for replies from the TACACS server
- - Range: `1`-`1000`
- - Default value: `5`
-- `timeout_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `users`
-
-Optional:
-
-- `name` (String) Set the username
-- `name_variable` (String) Variable name
-- `password` (String) Set the user password
-- `password_variable` (String) Variable name
-- `privilege` (String) Set Privilege Level for this user
- - Choices: `1`, `15`
- - Default value: `15`
-- `privilege_variable` (String) Variable name
-- `public_keys` (Attributes List) List of RSA public-keys per user (see [below for nested schema](#nestedatt--users--public_keys))
-
-
-### Nested Schema for `users.public_keys`
-
-Optional:
-
-- `key_string` (String) Set the RSA key string
-- `key_type` (String) Only RSA is supported
-- `key_type_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_aaa_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_banner_feature.md b/docs/resources/system_banner_feature.md
new file mode 100644
index 000000000..c37cbbd0b
--- /dev/null
+++ b/docs/resources/system_banner_feature.md
@@ -0,0 +1,54 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_banner_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Banner Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_banner_feature (Resource)
+
+This resource can manage a System Banner Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_banner_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ login = "My login banner"
+ motd = "My motd banner"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `login` (String)
+- `login_variable` (String) Variable name
+- `motd` (String)
+- `motd_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_banner_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_banner_profile_parcel.md b/docs/resources/system_banner_profile_parcel.md
deleted file mode 100644
index c92861c02..000000000
--- a/docs/resources/system_banner_profile_parcel.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_banner_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Banner profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_banner_profile_parcel (Resource)
-
-This resource can manage a System Banner profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_banner_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- login = "My login banner"
- motd = "My motd banner"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `login` (String)
-- `login_variable` (String) Variable name
-- `motd` (String)
-- `motd_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_banner_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_basic_feature.md b/docs/resources/system_basic_feature.md
new file mode 100644
index 000000000..79b30dadf
--- /dev/null
+++ b/docs/resources/system_basic_feature.md
@@ -0,0 +1,201 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_basic_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Basic Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_basic_feature (Resource)
+
+This resource can manage a System Basic Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_basic_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ timezone = "UTC"
+ config_description = "example"
+ location = "example"
+ gps_longitude = -77
+ gps_latitude = 38
+ gps_geo_fencing_enable = true
+ gps_geo_fencing_range = 100
+ gps_sms_enable = true
+ gps_sms_mobile_numbers = [
+ {
+ number = "+11111233"
+ }
+ ]
+ device_groups = ["example"]
+ controller_groups = [1]
+ overlay_id = 1
+ port_offset = 19
+ port_hopping = true
+ control_session_pps = 300
+ track_transport = true
+ track_interface_tag = 2
+ console_baud_rate = "9600"
+ max_omp_sessions = 24
+ multi_tenant = false
+ track_default_gateway = true
+ admin_tech_on_failure = true
+ idle_timeout = 10
+ on_demand_enable = true
+ on_demand_idle_timeout = 10
+ transport_gateway = false
+ enhanced_app_aware_routing = "aggressive"
+ site_types = ["type-1"]
+ affinity_group_number = 1
+ affinity_group_preferences = [1]
+ affinity_preference_auto = false
+ affinity_per_vrfs = [
+ {
+ affinity_group_number = 1
+ vrf_range = "123-456"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `admin_tech_on_failure` (Boolean) Collect admin-tech before reboot due to daemon failure
+ - Default value: `true`
+- `admin_tech_on_failure_variable` (String) Variable name
+- `affinity_group_number` (Number) Affinity Group Number
+ - Range: `1`-`63`
+- `affinity_group_number_variable` (String) Variable name
+- `affinity_group_preferences` (Set of Number) Affinity Group Preference
+- `affinity_group_preferences_variable` (String) Variable name
+- `affinity_per_vrfs` (Attributes List) Affinity Group Number for VRFs (see [below for nested schema](#nestedatt--affinity_per_vrfs))
+- `affinity_preference_auto` (Boolean) Affinity Group Preference Auto
+ - Default value: `false`
+- `affinity_preference_auto_variable` (String) Variable name
+- `config_description` (String) Set a text description of the device
+- `config_description_variable` (String) Variable name
+- `console_baud_rate` (String) Set the console baud rate
+ - Choices: `1200`, `2400`, `4800`, `9600`, `19200`, `38400`, `57600`, `115200`
+ - Default value: `9600`
+- `console_baud_rate_variable` (String) Variable name
+- `control_session_pps` (Number) Set the policer rate for control sessions
+ - Range: `1`-`65535`
+ - Default value: `300`
+- `control_session_pps_variable` (String) Variable name
+- `controller_groups` (Set of Number) Configure a list of comma-separated controller groups
+- `controller_groups_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `device_groups` (Set of String) Device groups
+- `device_groups_variable` (String) Variable name
+- `enhanced_app_aware_routing` (String) Enable SLA Dampening and Enhanced App Routing.
+ - Choices: `disabled`, `aggressive`, `moderate`, `conservative`
+ - Default value: `disabled`
+- `enhanced_app_aware_routing_variable` (String) Variable name
+- `feature_profile_id` (String) Feature Profile ID
+- `gps_geo_fencing_enable` (Boolean) Enable Geo fencing
+ - Default value: `false`
+- `gps_geo_fencing_range` (Number) Set the device’s geo fencing range
+ - Range: `100`-`10000`
+ - Default value: `100`
+- `gps_geo_fencing_range_variable` (String) Variable name
+- `gps_latitude` (Number) Set the device physical latitude
+ - Range: `-90`-`90`
+- `gps_latitude_variable` (String) Variable name
+- `gps_longitude` (Number) Set the device physical longitude
+ - Range: `-180`-`180`
+- `gps_longitude_variable` (String) Variable name
+- `gps_sms_enable` (Boolean) Enable device’s geo fencing SMS
+ - Default value: `false`
+- `gps_sms_mobile_numbers` (Attributes List) Set device’s geo fencing SMS phone number (see [below for nested schema](#nestedatt--gps_sms_mobile_numbers))
+- `idle_timeout` (Number) Idle CLI timeout in minutes
+ - Range: `0`-`300`
+- `idle_timeout_variable` (String) Variable name
+- `location` (String) Set the location of the device
+- `location_variable` (String) Variable name
+- `max_omp_sessions` (Number) Set the maximum number of OMP sessions <1..100> the device can have
+ - Range: `1`-`100`
+- `max_omp_sessions_variable` (String) Variable name
+- `multi_tenant` (Boolean) Device is multi-tenant
+ - Default value: `false`
+- `multi_tenant_variable` (String) Variable name
+- `on_demand_enable` (Boolean) Enable or disable On-demand Tunnel
+ - Default value: `false`
+- `on_demand_enable_variable` (String) Variable name
+- `on_demand_idle_timeout` (Number) Set the idle timeout for on-demand tunnels
+ - Range: `1`-`65535`
+ - Default value: `10`
+- `on_demand_idle_timeout_variable` (String) Variable name
+- `overlay_id` (Number) Set the Overlay ID
+ - Range: `1`-`4294967295`
+ - Default value: `1`
+- `overlay_id_variable` (String) Variable name
+- `port_hopping` (Boolean) Enable port hopping
+ - Default value: `true`
+- `port_hopping_variable` (String) Variable name
+- `port_offset` (Number) Set the TLOC port offset when multiple devices are behind a NAT
+ - Range: `0`-`19`
+ - Default value: `0`
+- `port_offset_variable` (String) Variable name
+- `site_types` (Set of String) Site Type
+- `site_types_variable` (String) Variable name
+- `timezone` (String) Set the timezone
+ - Choices: `Europe/Andorra`, `Asia/Dubai`, `Asia/Kabul`, `America/Antigua`, `America/Anguilla`, `Europe/Tirane`, `Asia/Yerevan`, `Africa/Luanda`, `Antarctica/McMurdo`, `Antarctica/Rothera`, `Antarctica/Palmer`, `Antarctica/Mawson`, `Antarctica/Davis`, `Antarctica/Casey`, `Antarctica/Vostok`, `Antarctica/DumontDUrville`, `Antarctica/Syowa`, `America/Argentina/Buenos_Aires`, `America/Argentina/Cordoba`, `America/Argentina/Salta`, `America/Argentina/Jujuy`, `America/Argentina/Tucuman`, `America/Argentina/Catamarca`, `America/Argentina/La_Rioja`, `America/Argentina/San_Juan`, `America/Argentina/Mendoza`, `America/Argentina/San_Luis`, `America/Argentina/Rio_Gallegos`, `America/Argentina/Ushuaia`, `Pacific/Pago_Pago`, `Europe/Vienna`, `Australia/Lord_Howe`, `Antarctica/Macquarie`, `Australia/Hobart`, `Australia/Currie`, `Australia/Melbourne`, `Australia/Sydney`, `Australia/Broken_Hill`, `Australia/Brisbane`, `Australia/Lindeman`, `Australia/Adelaide`, `Australia/Darwin`, `Australia/Perth`, `Australia/Eucla`, `America/Aruba`, `Europe/Mariehamn`, `Asia/Baku`, `Europe/Sarajevo`, `America/Barbados`, `Asia/Dhaka`, `Europe/Brussels`, `Africa/Ouagadougou`, `Europe/Sofia`, `Asia/Bahrain`, `Africa/Bujumbura`, `Africa/Porto-Novo`, `America/St_Barthelemy`, `Atlantic/Bermuda`, `Asia/Brunei`, `America/La_Paz`, `America/Kralendijk`, `America/Noronha`, `America/Belem`, `America/Fortaleza`, `America/Recife`, `America/Araguaina`, `America/Maceio`, `America/Bahia`, `America/Sao_Paulo`, `America/Campo_Grande`, `America/Cuiaba`, `America/Santarem`, `America/Porto_Velho`, `America/Boa_Vista`, `America/Manaus`, `America/Eirunepe`, `America/Rio_Branco`, `America/Nassau`, `Asia/Thimphu`, `Africa/Gaborone`, `Europe/Minsk`, `America/Belize`, `America/St_Johns`, `America/Halifax`, `America/Glace_Bay`, `America/Moncton`, `America/Goose_Bay`, `America/Blanc-Sablon`, `America/Toronto`, `America/Nipigon`, `America/Thunder_Bay`, `America/Iqaluit`, `America/Pangnirtung`, `America/Resolute`, `America/Atikokan`, `America/Rankin_Inlet`, `America/Winnipeg`, `America/Rainy_River`, `America/Regina`, `America/Swift_Current`, `America/Edmonton`, `America/Cambridge_Bay`, `America/Yellowknife`, `America/Inuvik`, `America/Creston`, `America/Dawson_Creek`, `America/Vancouver`, `America/Whitehorse`, `America/Dawson`, `Indian/Cocos`, `Africa/Kinshasa`, `Africa/Lubumbashi`, `Africa/Bangui`, `Africa/Brazzaville`, `Europe/Zurich`, `Africa/Abidjan`, `Pacific/Rarotonga`, `America/Santiago`, `Pacific/Easter`, `Africa/Douala`, `Asia/Shanghai`, `Asia/Harbin`, `Asia/Chongqing`, `Asia/Urumqi`, `Asia/Kashgar`, `America/Bogota`, `America/Costa_Rica`, `America/Havana`, `Atlantic/Cape_Verde`, `America/Curacao`, `Indian/Christmas`, `Asia/Nicosia`, `Europe/Prague`, `Europe/Berlin`, `Europe/Busingen`, `Africa/Djibouti`, `Europe/Copenhagen`, `America/Dominica`, `America/Santo_Domingo`, `Africa/Algiers`, `America/Guayaquil`, `Pacific/Galapagos`, `Europe/Tallinn`, `Africa/Cairo`, `Africa/El_Aaiun`, `Africa/Asmara`, `Europe/Madrid`, `Africa/Ceuta`, `Atlantic/Canary`, `Africa/Addis_Ababa`, `Europe/Helsinki`, `Pacific/Fiji`, `Atlantic/Stanley`, `Pacific/Chuuk`, `Pacific/Pohnpei`, `Pacific/Kosrae`, `Atlantic/Faroe`, `Europe/Paris`, `Africa/Libreville`, `Europe/London`, `America/Grenada`, `Asia/Tbilisi`, `America/Cayenne`, `Europe/Guernsey`, `Africa/Accra`, `Europe/Gibraltar`, `America/Godthab`, `America/Danmarkshavn`, `America/Scoresbysund`, `America/Thule`, `Africa/Banjul`, `Africa/Conakry`, `America/Guadeloupe`, `Africa/Malabo`, `Europe/Athens`, `Atlantic/South_Georgia`, `America/Guatemala`, `Pacific/Guam`, `Africa/Bissau`, `America/Guyana`, `Asia/Hong_Kong`, `America/Tegucigalpa`, `Europe/Zagreb`, `America/Port-au-Prince`, `Europe/Budapest`, `Asia/Jakarta`, `Asia/Pontianak`, `Asia/Makassar`, `Asia/Jayapura`, `Europe/Dublin`, `Asia/Jerusalem`, `Europe/Isle_of_Man`, `Asia/Kolkata`, `Indian/Chagos`, `Asia/Baghdad`, `Asia/Tehran`, `Atlantic/Reykjavik`, `Europe/Rome`, `Europe/Jersey`, `America/Jamaica`, `Asia/Amman`, `Asia/Tokyo`, `Africa/Nairobi`, `Asia/Bishkek`, `Asia/Phnom_Penh`, `Pacific/Tarawa`, `Pacific/Enderbury`, `Pacific/Kiritimati`, `Indian/Comoro`, `America/St_Kitts`, `Asia/Pyongyang`, `Asia/Seoul`, `Asia/Kuwait`, `America/Cayman`, `Asia/Almaty`, `Asia/Qyzylorda`, `Asia/Aqtobe`, `Asia/Aqtau`, `Asia/Oral`, `Asia/Vientiane`, `Asia/Beirut`, `America/St_Lucia`, `Europe/Vaduz`, `Asia/Colombo`, `Africa/Monrovia`, `Africa/Maseru`, `Europe/Vilnius`, `Europe/Luxembourg`, `Europe/Riga`, `Africa/Tripoli`, `Africa/Casablanca`, `Europe/Monaco`, `Europe/Chisinau`, `Europe/Podgorica`, `America/Marigot`, `Indian/Antananarivo`, `Pacific/Majuro`, `Pacific/Kwajalein`, `Europe/Skopje`, `Africa/Bamako`, `Asia/Rangoon`, `Asia/Ulaanbaatar`, `Asia/Hovd`, `Asia/Choibalsan`, `Asia/Macau`, `Pacific/Saipan`, `America/Martinique`, `Africa/Nouakchott`, `America/Montserrat`, `Europe/Malta`, `Indian/Mauritius`, `Indian/Maldives`, `Africa/Blantyre`, `America/Mexico_City`, `America/Cancun`, `America/Merida`, `America/Monterrey`, `America/Matamoros`, `America/Mazatlan`, `America/Chihuahua`, `America/Ojinaga`, `America/Hermosillo`, `America/Tijuana`, `America/Santa_Isabel`, `America/Bahia_Banderas`, `Asia/Kuala_Lumpur`, `Asia/Kuching`, `Africa/Maputo`, `Africa/Windhoek`, `Pacific/Noumea`, `Africa/Niamey`, `Pacific/Norfolk`, `Africa/Lagos`, `America/Managua`, `Europe/Amsterdam`, `Europe/Oslo`, `Asia/Kathmandu`, `Pacific/Nauru`, `Pacific/Niue`, `Pacific/Auckland`, `Pacific/Chatham`, `Asia/Muscat`, `America/Panama`, `America/Lima`, `Pacific/Tahiti`, `Pacific/Marquesas`, `Pacific/Gambier`, `Pacific/Port_Moresby`, `Asia/Manila`, `Asia/Karachi`, `Europe/Warsaw`, `America/Miquelon`, `Pacific/Pitcairn`, `America/Puerto_Rico`, `Asia/Gaza`, `Asia/Hebron`, `Europe/Lisbon`, `Atlantic/Madeira`, `Atlantic/Azores`, `Pacific/Palau`, `America/Asuncion`, `Asia/Qatar`, `Indian/Reunion`, `Europe/Bucharest`, `Europe/Belgrade`, `Europe/Kaliningrad`, `Europe/Moscow`, `Europe/Volgograd`, `Europe/Samara`, `Asia/Yekaterinburg`, `Asia/Omsk`, `Asia/Novosibirsk`, `Asia/Novokuznetsk`, `Asia/Krasnoyarsk`, `Asia/Irkutsk`, `Asia/Yakutsk`, `Asia/Khandyga`, `Asia/Vladivostok`, `Asia/Sakhalin`, `Asia/Ust-Nera`, `Asia/Magadan`, `Asia/Kamchatka`, `Asia/Anadyr`, `Africa/Kigali`, `Asia/Riyadh`, `Pacific/Guadalcanal`, `Indian/Mahe`, `Africa/Khartoum`, `Europe/Stockholm`, `Asia/Singapore`, `Atlantic/St_Helena`, `Europe/Ljubljana`, `Arctic/Longyearbyen`, `Europe/Bratislava`, `Africa/Freetown`, `Europe/San_Marino`, `Africa/Dakar`, `Africa/Mogadishu`, `America/Paramaribo`, `Africa/Juba`, `Africa/Sao_Tome`, `America/El_Salvador`, `America/Lower_Princes`, `Asia/Damascus`, `Africa/Mbabane`, `America/Grand_Turk`, `Africa/Ndjamena`, `Indian/Kerguelen`, `Africa/Lome`, `Asia/Bangkok`, `Asia/Dushanbe`, `Pacific/Fakaofo`, `Asia/Dili`, `Asia/Ashgabat`, `Africa/Tunis`, `Pacific/Tongatapu`, `Europe/Istanbul`, `America/Port_of_Spain`, `Pacific/Funafuti`, `Asia/Taipei`, `Africa/Dar_es_Salaam`, `Europe/Kiev`, `Europe/Uzhgorod`, `Europe/Zaporozhye`, `Europe/Simferopol`, `Africa/Kampala`, `Pacific/Johnston`, `Pacific/Midway`, `Pacific/Wake`, `America/New_York`, `America/Detroit`, `America/Kentucky/Louisville`, `America/Kentucky/Monticello`, `America/Indiana/Indianapolis`, `America/Indiana/Vincennes`, `America/Indiana/Winamac`, `America/Indiana/Marengo`, `America/Indiana/Petersburg`, `America/Indiana/Vevay`, `America/Chicago`, `America/Indiana/Tell_City`, `America/Indiana/Knox`, `America/Menominee`, `America/North_Dakota/Center`, `America/North_Dakota/New_Salem`, `America/North_Dakota/Beulah`, `America/Denver`, `America/Boise`, `America/Phoenix`, `America/Los_Angeles`, `America/Anchorage`, `America/Juneau`, `America/Sitka`, `America/Yakutat`, `America/Nome`, `America/Adak`, `America/Metlakatla`, `Pacific/Honolulu`, `America/Montevideo`, `Asia/Samarkand`, `Asia/Tashkent`, `Europe/Vatican`, `America/St_Vincent`, `America/Caracas`, `America/Tortola`, `America/St_Thomas`, `Asia/Ho_Chi_Minh`, `Pacific/Efate`, `Pacific/Wallis`, `Pacific/Apia`, `Asia/Aden`, `Indian/Mayotte`, `Africa/Johannesburg`, `Africa/Lusaka`, `Africa/Harare`, `UTC`
+ - Default value: `UTC`
+- `timezone_variable` (String) Variable name
+- `track_default_gateway` (Boolean) Enable or disable default gateway tracking
+ - Default value: `true`
+- `track_default_gateway_variable` (String) Variable name
+- `track_interface_tag` (Number) OMP Tag attached to routes based on interface tracking
+ - Range: `1`-`4294967295`
+- `track_interface_tag_variable` (String) Variable name
+- `track_transport` (Boolean) Configure tracking of transport
+ - Default value: `true`
+- `track_transport_variable` (String) Variable name
+- `transport_gateway` (Boolean) Enable transport gateway
+ - Default value: `false`
+- `transport_gateway_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `affinity_per_vrfs`
+
+Optional:
+
+- `affinity_group_number` (Number) Affinity Group Number
+ - Range: `1`-`63`
+- `affinity_group_number_variable` (String) Variable name
+- `vrf_range` (String) Range of VRFs
+- `vrf_range_variable` (String) Variable name
+
+
+
+### Nested Schema for `gps_sms_mobile_numbers`
+
+Optional:
+
+- `number` (String) Mobile number, ex: 1231234414
+- `number_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_basic_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_basic_profile_parcel.md b/docs/resources/system_basic_profile_parcel.md
deleted file mode 100644
index a36f115bc..000000000
--- a/docs/resources/system_basic_profile_parcel.md
+++ /dev/null
@@ -1,201 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_basic_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Basic profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_basic_profile_parcel (Resource)
-
-This resource can manage a System Basic profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_basic_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- timezone = "UTC"
- config_description = "example"
- location = "example"
- gps_longitude = -77
- gps_latitude = 38
- gps_geo_fencing_enable = true
- gps_geo_fencing_range = 100
- gps_sms_enable = true
- gps_sms_mobile_numbers = [
- {
- number = "+11111233"
- }
- ]
- device_groups = ["example"]
- controller_groups = [1]
- overlay_id = 1
- port_offset = 19
- port_hopping = true
- control_session_pps = 300
- track_transport = true
- track_interface_tag = 2
- console_baud_rate = "9600"
- max_omp_sessions = 24
- multi_tenant = false
- track_default_gateway = true
- admin_tech_on_failure = true
- idle_timeout = 10
- on_demand_enable = true
- on_demand_idle_timeout = 10
- transport_gateway = false
- enhanced_app_aware_routing = "aggressive"
- site_types = ["type-1"]
- affinity_group_number = 1
- affinity_group_preferences = [1]
- affinity_preference_auto = false
- affinity_per_vrfs = [
- {
- affinity_group_number = 1
- vrf_range = "123-456"
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `admin_tech_on_failure` (Boolean) Collect admin-tech before reboot due to daemon failure
- - Default value: `true`
-- `admin_tech_on_failure_variable` (String) Variable name
-- `affinity_group_number` (Number) Affinity Group Number
- - Range: `1`-`63`
-- `affinity_group_number_variable` (String) Variable name
-- `affinity_group_preferences` (Set of Number) Affinity Group Preference
-- `affinity_group_preferences_variable` (String) Variable name
-- `affinity_per_vrfs` (Attributes List) Affinity Group Number for VRFs (see [below for nested schema](#nestedatt--affinity_per_vrfs))
-- `affinity_preference_auto` (Boolean) Affinity Group Preference Auto
- - Default value: `false`
-- `affinity_preference_auto_variable` (String) Variable name
-- `config_description` (String) Set a text description of the device
-- `config_description_variable` (String) Variable name
-- `console_baud_rate` (String) Set the console baud rate
- - Choices: `1200`, `2400`, `4800`, `9600`, `19200`, `38400`, `57600`, `115200`
- - Default value: `9600`
-- `console_baud_rate_variable` (String) Variable name
-- `control_session_pps` (Number) Set the policer rate for control sessions
- - Range: `1`-`65535`
- - Default value: `300`
-- `control_session_pps_variable` (String) Variable name
-- `controller_groups` (Set of Number) Configure a list of comma-separated controller groups
-- `controller_groups_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `device_groups` (Set of String) Device groups
-- `device_groups_variable` (String) Variable name
-- `enhanced_app_aware_routing` (String) Enable SLA Dampening and Enhanced App Routing.
- - Choices: `disabled`, `aggressive`, `moderate`, `conservative`
- - Default value: `disabled`
-- `enhanced_app_aware_routing_variable` (String) Variable name
-- `feature_profile_id` (String) Feature Profile ID
-- `gps_geo_fencing_enable` (Boolean) Enable Geo fencing
- - Default value: `false`
-- `gps_geo_fencing_range` (Number) Set the device’s geo fencing range
- - Range: `100`-`10000`
- - Default value: `100`
-- `gps_geo_fencing_range_variable` (String) Variable name
-- `gps_latitude` (Number) Set the device physical latitude
- - Range: `-90`-`90`
-- `gps_latitude_variable` (String) Variable name
-- `gps_longitude` (Number) Set the device physical longitude
- - Range: `-180`-`180`
-- `gps_longitude_variable` (String) Variable name
-- `gps_sms_enable` (Boolean) Enable device’s geo fencing SMS
- - Default value: `false`
-- `gps_sms_mobile_numbers` (Attributes List) Set device’s geo fencing SMS phone number (see [below for nested schema](#nestedatt--gps_sms_mobile_numbers))
-- `idle_timeout` (Number) Idle CLI timeout in minutes
- - Range: `0`-`300`
-- `idle_timeout_variable` (String) Variable name
-- `location` (String) Set the location of the device
-- `location_variable` (String) Variable name
-- `max_omp_sessions` (Number) Set the maximum number of OMP sessions <1..100> the device can have
- - Range: `1`-`100`
-- `max_omp_sessions_variable` (String) Variable name
-- `multi_tenant` (Boolean) Device is multi-tenant
- - Default value: `false`
-- `multi_tenant_variable` (String) Variable name
-- `on_demand_enable` (Boolean) Enable or disable On-demand Tunnel
- - Default value: `false`
-- `on_demand_enable_variable` (String) Variable name
-- `on_demand_idle_timeout` (Number) Set the idle timeout for on-demand tunnels
- - Range: `1`-`65535`
- - Default value: `10`
-- `on_demand_idle_timeout_variable` (String) Variable name
-- `overlay_id` (Number) Set the Overlay ID
- - Range: `1`-`4294967295`
- - Default value: `1`
-- `overlay_id_variable` (String) Variable name
-- `port_hopping` (Boolean) Enable port hopping
- - Default value: `true`
-- `port_hopping_variable` (String) Variable name
-- `port_offset` (Number) Set the TLOC port offset when multiple devices are behind a NAT
- - Range: `0`-`19`
- - Default value: `0`
-- `port_offset_variable` (String) Variable name
-- `site_types` (Set of String) Site Type
-- `site_types_variable` (String) Variable name
-- `timezone` (String) Set the timezone
- - Choices: `Europe/Andorra`, `Asia/Dubai`, `Asia/Kabul`, `America/Antigua`, `America/Anguilla`, `Europe/Tirane`, `Asia/Yerevan`, `Africa/Luanda`, `Antarctica/McMurdo`, `Antarctica/Rothera`, `Antarctica/Palmer`, `Antarctica/Mawson`, `Antarctica/Davis`, `Antarctica/Casey`, `Antarctica/Vostok`, `Antarctica/DumontDUrville`, `Antarctica/Syowa`, `America/Argentina/Buenos_Aires`, `America/Argentina/Cordoba`, `America/Argentina/Salta`, `America/Argentina/Jujuy`, `America/Argentina/Tucuman`, `America/Argentina/Catamarca`, `America/Argentina/La_Rioja`, `America/Argentina/San_Juan`, `America/Argentina/Mendoza`, `America/Argentina/San_Luis`, `America/Argentina/Rio_Gallegos`, `America/Argentina/Ushuaia`, `Pacific/Pago_Pago`, `Europe/Vienna`, `Australia/Lord_Howe`, `Antarctica/Macquarie`, `Australia/Hobart`, `Australia/Currie`, `Australia/Melbourne`, `Australia/Sydney`, `Australia/Broken_Hill`, `Australia/Brisbane`, `Australia/Lindeman`, `Australia/Adelaide`, `Australia/Darwin`, `Australia/Perth`, `Australia/Eucla`, `America/Aruba`, `Europe/Mariehamn`, `Asia/Baku`, `Europe/Sarajevo`, `America/Barbados`, `Asia/Dhaka`, `Europe/Brussels`, `Africa/Ouagadougou`, `Europe/Sofia`, `Asia/Bahrain`, `Africa/Bujumbura`, `Africa/Porto-Novo`, `America/St_Barthelemy`, `Atlantic/Bermuda`, `Asia/Brunei`, `America/La_Paz`, `America/Kralendijk`, `America/Noronha`, `America/Belem`, `America/Fortaleza`, `America/Recife`, `America/Araguaina`, `America/Maceio`, `America/Bahia`, `America/Sao_Paulo`, `America/Campo_Grande`, `America/Cuiaba`, `America/Santarem`, `America/Porto_Velho`, `America/Boa_Vista`, `America/Manaus`, `America/Eirunepe`, `America/Rio_Branco`, `America/Nassau`, `Asia/Thimphu`, `Africa/Gaborone`, `Europe/Minsk`, `America/Belize`, `America/St_Johns`, `America/Halifax`, `America/Glace_Bay`, `America/Moncton`, `America/Goose_Bay`, `America/Blanc-Sablon`, `America/Toronto`, `America/Nipigon`, `America/Thunder_Bay`, `America/Iqaluit`, `America/Pangnirtung`, `America/Resolute`, `America/Atikokan`, `America/Rankin_Inlet`, `America/Winnipeg`, `America/Rainy_River`, `America/Regina`, `America/Swift_Current`, `America/Edmonton`, `America/Cambridge_Bay`, `America/Yellowknife`, `America/Inuvik`, `America/Creston`, `America/Dawson_Creek`, `America/Vancouver`, `America/Whitehorse`, `America/Dawson`, `Indian/Cocos`, `Africa/Kinshasa`, `Africa/Lubumbashi`, `Africa/Bangui`, `Africa/Brazzaville`, `Europe/Zurich`, `Africa/Abidjan`, `Pacific/Rarotonga`, `America/Santiago`, `Pacific/Easter`, `Africa/Douala`, `Asia/Shanghai`, `Asia/Harbin`, `Asia/Chongqing`, `Asia/Urumqi`, `Asia/Kashgar`, `America/Bogota`, `America/Costa_Rica`, `America/Havana`, `Atlantic/Cape_Verde`, `America/Curacao`, `Indian/Christmas`, `Asia/Nicosia`, `Europe/Prague`, `Europe/Berlin`, `Europe/Busingen`, `Africa/Djibouti`, `Europe/Copenhagen`, `America/Dominica`, `America/Santo_Domingo`, `Africa/Algiers`, `America/Guayaquil`, `Pacific/Galapagos`, `Europe/Tallinn`, `Africa/Cairo`, `Africa/El_Aaiun`, `Africa/Asmara`, `Europe/Madrid`, `Africa/Ceuta`, `Atlantic/Canary`, `Africa/Addis_Ababa`, `Europe/Helsinki`, `Pacific/Fiji`, `Atlantic/Stanley`, `Pacific/Chuuk`, `Pacific/Pohnpei`, `Pacific/Kosrae`, `Atlantic/Faroe`, `Europe/Paris`, `Africa/Libreville`, `Europe/London`, `America/Grenada`, `Asia/Tbilisi`, `America/Cayenne`, `Europe/Guernsey`, `Africa/Accra`, `Europe/Gibraltar`, `America/Godthab`, `America/Danmarkshavn`, `America/Scoresbysund`, `America/Thule`, `Africa/Banjul`, `Africa/Conakry`, `America/Guadeloupe`, `Africa/Malabo`, `Europe/Athens`, `Atlantic/South_Georgia`, `America/Guatemala`, `Pacific/Guam`, `Africa/Bissau`, `America/Guyana`, `Asia/Hong_Kong`, `America/Tegucigalpa`, `Europe/Zagreb`, `America/Port-au-Prince`, `Europe/Budapest`, `Asia/Jakarta`, `Asia/Pontianak`, `Asia/Makassar`, `Asia/Jayapura`, `Europe/Dublin`, `Asia/Jerusalem`, `Europe/Isle_of_Man`, `Asia/Kolkata`, `Indian/Chagos`, `Asia/Baghdad`, `Asia/Tehran`, `Atlantic/Reykjavik`, `Europe/Rome`, `Europe/Jersey`, `America/Jamaica`, `Asia/Amman`, `Asia/Tokyo`, `Africa/Nairobi`, `Asia/Bishkek`, `Asia/Phnom_Penh`, `Pacific/Tarawa`, `Pacific/Enderbury`, `Pacific/Kiritimati`, `Indian/Comoro`, `America/St_Kitts`, `Asia/Pyongyang`, `Asia/Seoul`, `Asia/Kuwait`, `America/Cayman`, `Asia/Almaty`, `Asia/Qyzylorda`, `Asia/Aqtobe`, `Asia/Aqtau`, `Asia/Oral`, `Asia/Vientiane`, `Asia/Beirut`, `America/St_Lucia`, `Europe/Vaduz`, `Asia/Colombo`, `Africa/Monrovia`, `Africa/Maseru`, `Europe/Vilnius`, `Europe/Luxembourg`, `Europe/Riga`, `Africa/Tripoli`, `Africa/Casablanca`, `Europe/Monaco`, `Europe/Chisinau`, `Europe/Podgorica`, `America/Marigot`, `Indian/Antananarivo`, `Pacific/Majuro`, `Pacific/Kwajalein`, `Europe/Skopje`, `Africa/Bamako`, `Asia/Rangoon`, `Asia/Ulaanbaatar`, `Asia/Hovd`, `Asia/Choibalsan`, `Asia/Macau`, `Pacific/Saipan`, `America/Martinique`, `Africa/Nouakchott`, `America/Montserrat`, `Europe/Malta`, `Indian/Mauritius`, `Indian/Maldives`, `Africa/Blantyre`, `America/Mexico_City`, `America/Cancun`, `America/Merida`, `America/Monterrey`, `America/Matamoros`, `America/Mazatlan`, `America/Chihuahua`, `America/Ojinaga`, `America/Hermosillo`, `America/Tijuana`, `America/Santa_Isabel`, `America/Bahia_Banderas`, `Asia/Kuala_Lumpur`, `Asia/Kuching`, `Africa/Maputo`, `Africa/Windhoek`, `Pacific/Noumea`, `Africa/Niamey`, `Pacific/Norfolk`, `Africa/Lagos`, `America/Managua`, `Europe/Amsterdam`, `Europe/Oslo`, `Asia/Kathmandu`, `Pacific/Nauru`, `Pacific/Niue`, `Pacific/Auckland`, `Pacific/Chatham`, `Asia/Muscat`, `America/Panama`, `America/Lima`, `Pacific/Tahiti`, `Pacific/Marquesas`, `Pacific/Gambier`, `Pacific/Port_Moresby`, `Asia/Manila`, `Asia/Karachi`, `Europe/Warsaw`, `America/Miquelon`, `Pacific/Pitcairn`, `America/Puerto_Rico`, `Asia/Gaza`, `Asia/Hebron`, `Europe/Lisbon`, `Atlantic/Madeira`, `Atlantic/Azores`, `Pacific/Palau`, `America/Asuncion`, `Asia/Qatar`, `Indian/Reunion`, `Europe/Bucharest`, `Europe/Belgrade`, `Europe/Kaliningrad`, `Europe/Moscow`, `Europe/Volgograd`, `Europe/Samara`, `Asia/Yekaterinburg`, `Asia/Omsk`, `Asia/Novosibirsk`, `Asia/Novokuznetsk`, `Asia/Krasnoyarsk`, `Asia/Irkutsk`, `Asia/Yakutsk`, `Asia/Khandyga`, `Asia/Vladivostok`, `Asia/Sakhalin`, `Asia/Ust-Nera`, `Asia/Magadan`, `Asia/Kamchatka`, `Asia/Anadyr`, `Africa/Kigali`, `Asia/Riyadh`, `Pacific/Guadalcanal`, `Indian/Mahe`, `Africa/Khartoum`, `Europe/Stockholm`, `Asia/Singapore`, `Atlantic/St_Helena`, `Europe/Ljubljana`, `Arctic/Longyearbyen`, `Europe/Bratislava`, `Africa/Freetown`, `Europe/San_Marino`, `Africa/Dakar`, `Africa/Mogadishu`, `America/Paramaribo`, `Africa/Juba`, `Africa/Sao_Tome`, `America/El_Salvador`, `America/Lower_Princes`, `Asia/Damascus`, `Africa/Mbabane`, `America/Grand_Turk`, `Africa/Ndjamena`, `Indian/Kerguelen`, `Africa/Lome`, `Asia/Bangkok`, `Asia/Dushanbe`, `Pacific/Fakaofo`, `Asia/Dili`, `Asia/Ashgabat`, `Africa/Tunis`, `Pacific/Tongatapu`, `Europe/Istanbul`, `America/Port_of_Spain`, `Pacific/Funafuti`, `Asia/Taipei`, `Africa/Dar_es_Salaam`, `Europe/Kiev`, `Europe/Uzhgorod`, `Europe/Zaporozhye`, `Europe/Simferopol`, `Africa/Kampala`, `Pacific/Johnston`, `Pacific/Midway`, `Pacific/Wake`, `America/New_York`, `America/Detroit`, `America/Kentucky/Louisville`, `America/Kentucky/Monticello`, `America/Indiana/Indianapolis`, `America/Indiana/Vincennes`, `America/Indiana/Winamac`, `America/Indiana/Marengo`, `America/Indiana/Petersburg`, `America/Indiana/Vevay`, `America/Chicago`, `America/Indiana/Tell_City`, `America/Indiana/Knox`, `America/Menominee`, `America/North_Dakota/Center`, `America/North_Dakota/New_Salem`, `America/North_Dakota/Beulah`, `America/Denver`, `America/Boise`, `America/Phoenix`, `America/Los_Angeles`, `America/Anchorage`, `America/Juneau`, `America/Sitka`, `America/Yakutat`, `America/Nome`, `America/Adak`, `America/Metlakatla`, `Pacific/Honolulu`, `America/Montevideo`, `Asia/Samarkand`, `Asia/Tashkent`, `Europe/Vatican`, `America/St_Vincent`, `America/Caracas`, `America/Tortola`, `America/St_Thomas`, `Asia/Ho_Chi_Minh`, `Pacific/Efate`, `Pacific/Wallis`, `Pacific/Apia`, `Asia/Aden`, `Indian/Mayotte`, `Africa/Johannesburg`, `Africa/Lusaka`, `Africa/Harare`, `UTC`
- - Default value: `UTC`
-- `timezone_variable` (String) Variable name
-- `track_default_gateway` (Boolean) Enable or disable default gateway tracking
- - Default value: `true`
-- `track_default_gateway_variable` (String) Variable name
-- `track_interface_tag` (Number) OMP Tag attached to routes based on interface tracking
- - Range: `1`-`4294967295`
-- `track_interface_tag_variable` (String) Variable name
-- `track_transport` (Boolean) Configure tracking of transport
- - Default value: `true`
-- `track_transport_variable` (String) Variable name
-- `transport_gateway` (Boolean) Enable transport gateway
- - Default value: `false`
-- `transport_gateway_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `affinity_per_vrfs`
-
-Optional:
-
-- `affinity_group_number` (Number) Affinity Group Number
- - Range: `1`-`63`
-- `affinity_group_number_variable` (String) Variable name
-- `vrf_range` (String) Range of VRFs
-- `vrf_range_variable` (String) Variable name
-
-
-
-### Nested Schema for `gps_sms_mobile_numbers`
-
-Optional:
-
-- `number` (String) Mobile number, ex: 1231234414
-- `number_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_basic_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_bfd_feature.md b/docs/resources/system_bfd_feature.md
new file mode 100644
index 000000000..75306ef88
--- /dev/null
+++ b/docs/resources/system_bfd_feature.md
@@ -0,0 +1,94 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_bfd_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System BFD Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_bfd_feature (Resource)
+
+This resource can manage a System BFD Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_bfd_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ multiplier = 3
+ poll_interval = 100
+ default_dscp = 8
+ colors = [
+ {
+ color = "3g"
+ hello_interval = 200
+ multiplier = 3
+ pmtu_discovery = true
+ dscp = 16
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `colors` (Attributes List) Set color that identifies the WAN transport tunnel (see [below for nested schema](#nestedatt--colors))
+- `default_dscp` (Number) - Range: `0`-`63`
+ - Default value: `48`
+- `default_dscp_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `multiplier` (Number) - Range: `1`-`6`
+ - Default value: `6`
+- `multiplier_variable` (String) Variable name
+- `poll_interval` (Number) - Range: `1`-`4294967295`
+ - Default value: `600000`
+- `poll_interval_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `colors`
+
+Optional:
+
+- `color` (String) Color that identifies the WAN transport tunnel
+ - Choices: `default`, `mpls`, `metro-ethernet`, `biz-internet`, `public-internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
+- `color_variable` (String) Variable name
+- `dscp` (Number) BFD Default DSCP value for tloc color
+ - Range: `0`-`63`
+ - Default value: `48`
+- `dscp_variable` (String) Variable name
+- `hello_interval` (Number) Hello Interval (milliseconds)
+ - Range: `100`-`300000`
+ - Default value: `1000`
+- `hello_interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+ - Range: `1`-`60`
+ - Default value: `7`
+- `multiplier_variable` (String) Variable name
+- `pmtu_discovery` (Boolean) Path MTU Discovery
+ - Default value: `true`
+- `pmtu_discovery_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_bfd_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_bfd_profile_parcel.md b/docs/resources/system_bfd_profile_parcel.md
deleted file mode 100644
index 60cf3d0da..000000000
--- a/docs/resources/system_bfd_profile_parcel.md
+++ /dev/null
@@ -1,94 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_bfd_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System BFD profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_bfd_profile_parcel (Resource)
-
-This resource can manage a System BFD profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_bfd_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- multiplier = 3
- poll_interval = 100
- default_dscp = 8
- colors = [
- {
- color = "3g"
- hello_interval = 200
- multiplier = 3
- pmtu_discovery = true
- dscp = 16
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `colors` (Attributes List) Set color that identifies the WAN transport tunnel (see [below for nested schema](#nestedatt--colors))
-- `default_dscp` (Number) - Range: `0`-`63`
- - Default value: `48`
-- `default_dscp_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `multiplier` (Number) - Range: `1`-`6`
- - Default value: `6`
-- `multiplier_variable` (String) Variable name
-- `poll_interval` (Number) - Range: `1`-`4294967295`
- - Default value: `600000`
-- `poll_interval_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `colors`
-
-Optional:
-
-- `color` (String) Color that identifies the WAN transport tunnel
- - Choices: `default`, `mpls`, `metro-ethernet`, `biz-internet`, `public-internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
-- `color_variable` (String) Variable name
-- `dscp` (Number) BFD Default DSCP value for tloc color
- - Range: `0`-`63`
- - Default value: `48`
-- `dscp_variable` (String) Variable name
-- `hello_interval` (Number) Hello Interval (milliseconds)
- - Range: `100`-`300000`
- - Default value: `1000`
-- `hello_interval_variable` (String) Variable name
-- `multiplier` (Number) Multiplier
- - Range: `1`-`60`
- - Default value: `7`
-- `multiplier_variable` (String) Variable name
-- `pmtu_discovery` (Boolean) Path MTU Discovery
- - Default value: `true`
-- `pmtu_discovery_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_bfd_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_feature_profile.md b/docs/resources/system_feature_profile.md
index 4db029f33..63472042f 100644
--- a/docs/resources/system_feature_profile.md
+++ b/docs/resources/system_feature_profile.md
@@ -4,11 +4,13 @@ page_title: "sdwan_system_feature_profile Resource - terraform-provider-sdwan"
subcategory: "Feature Profiles"
description: |-
This resource can manage a System Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
---
# sdwan_system_feature_profile (Resource)
This resource can manage a System Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
## Example Usage
diff --git a/docs/resources/system_flexible_port_speed_feature.md b/docs/resources/system_flexible_port_speed_feature.md
new file mode 100644
index 000000000..435f154e9
--- /dev/null
+++ b/docs/resources/system_flexible_port_speed_feature.md
@@ -0,0 +1,53 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_flexible_port_speed_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Flexible Port Speed Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_flexible_port_speed_feature (Resource)
+
+This resource can manage a System Flexible Port Speed Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_flexible_port_speed_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ port_type = "12 ports of 1/10GE + 3 ports 40GE"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `port_type` (String) port Type
+ - Choices: `12 ports of 1/10GE + 3 ports 40GE`, `8 ports of 1/10GE + 4 ports of 40GE`, `2 ports of 100 GE`, `12 ports of 1/10GE + 1 port of 100GE`, `8 ports of 1/10GE + 1 port of 40GE + 1 port of 100GE`, `3 ports of 40GE + 1port of 100GE`
+ - Default value: `12 ports of 1/10GE + 3 ports 40GE`
+- `port_type_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_flexible_port_speed_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_flexible_port_speed_profile_parcel.md b/docs/resources/system_flexible_port_speed_profile_parcel.md
deleted file mode 100644
index 7baa8dee8..000000000
--- a/docs/resources/system_flexible_port_speed_profile_parcel.md
+++ /dev/null
@@ -1,53 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_flexible_port_speed_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Flexible Port Speed profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_flexible_port_speed_profile_parcel (Resource)
-
-This resource can manage a System Flexible Port Speed profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_flexible_port_speed_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- port_type = "12 ports of 1/10GE + 3 ports 40GE"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `port_type` (String) port Type
- - Choices: `12 ports of 1/10GE + 3 ports 40GE`, `8 ports of 1/10GE + 4 ports of 40GE`, `2 ports of 100 GE`, `12 ports of 1/10GE + 1 port of 100GE`, `8 ports of 1/10GE + 1 port of 40GE + 1 port of 100GE`, `3 ports of 40GE + 1port of 100GE`
- - Default value: `12 ports of 1/10GE + 3 ports 40GE`
-- `port_type_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_flexible_port_speed_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_global_feature.md b/docs/resources/system_global_feature.md
new file mode 100644
index 000000000..9eb4d5521
--- /dev/null
+++ b/docs/resources/system_global_feature.md
@@ -0,0 +1,141 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_global_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Global Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_global_feature (Resource)
+
+This resource can manage a System Global Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_global_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ http_server = false
+ https_server = false
+ ftp_passive = false
+ domain_lookup = false
+ arp_proxy = false
+ rsh_rcp = false
+ line_vty = false
+ cdp = true
+ lldp = true
+ source_interface = "GigabitEthernet0/0/1"
+ tcp_keepalives_in = true
+ tcp_keepalives_out = true
+ tcp_small_servers = false
+ udp_small_servers = false
+ console_logging = true
+ ip_source_routing = false
+ vty_line_logging = false
+ snmp_ifindex_persist = true
+ ignore_bootp = true
+ nat64_udp_timeout = 300
+ nat64_tcp_timeout = 3600
+ http_authentication = "aaa"
+ ssh_version = "2"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `arp_proxy` (Boolean) Set ARP Proxy
+ - Default value: `false`
+- `arp_proxy_variable` (String) Variable name
+- `cdp` (Boolean) Configure CDP
+ - Default value: `true`
+- `cdp_variable` (String) Variable name
+- `console_logging` (Boolean) Configure Console Logging
+ - Default value: `true`
+- `console_logging_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `domain_lookup` (Boolean) Configure Domain-Lookup
+ - Default value: `false`
+- `domain_lookup_variable` (String) Variable name
+- `ftp_passive` (Boolean) Set Passive FTP
+ - Default value: `false`
+- `ftp_passive_variable` (String) Variable name
+- `http_authentication` (String) Set preference for HTTP Authentication
+ - Choices: `local`, `aaa`
+- `http_authentication_variable` (String) Variable name
+- `http_server` (Boolean) Set a HTTP Server
+ - Default value: `false`
+- `http_server_variable` (String) Variable name
+- `https_server` (Boolean) Set a HTTPS Server
+ - Default value: `false`
+- `https_server_variable` (String) Variable name
+- `ignore_bootp` (Boolean) Configure Ignore BOOTP
+ - Default value: `true`
+- `ignore_bootp_variable` (String) Variable name
+- `ip_source_routing` (Boolean) Set Source Route
+ - Default value: `false`
+- `ip_source_routing_variable` (String) Variable name
+- `line_vty` (Boolean) Configure Telnet (Outbound)
+ - Default value: `false`
+- `line_vty_variable` (String) Variable name
+- `lldp` (Boolean) Configure LLDP
+ - Default value: `true`
+- `lldp_variable` (String) Variable name
+- `nat64_tcp_timeout` (Number) Set NAT64 TCP session timeout, in seconds
+ - Range: `1`-`536870`
+ - Default value: `3600`
+- `nat64_tcp_timeout_variable` (String) Variable name
+- `nat64_udp_timeout` (Number) Set NAT64 UDP session timeout, in seconds
+ - Range: `1`-`536870`
+ - Default value: `300`
+- `nat64_udp_timeout_variable` (String) Variable name
+- `rsh_rcp` (Boolean) Set RSH/RCP
+ - Default value: `false`
+- `rsh_rcp_variable` (String) Variable name
+- `snmp_ifindex_persist` (Boolean) Configure SNMP Ifindex Persist
+ - Default value: `true`
+- `snmp_ifindex_persist_variable` (String) Variable name
+- `source_interface` (String) Specify interface for source address in all HTTP(S) client connections
+- `source_interface_variable` (String) Variable name
+- `ssh_version` (String) Set SSH version
+ - Choices: `2`
+- `ssh_version_variable` (String) Variable name
+- `tcp_keepalives_in` (Boolean) Configure tcp-keepalives-in
+ - Default value: `true`
+- `tcp_keepalives_in_variable` (String) Variable name
+- `tcp_keepalives_out` (Boolean) Configure tcp-keepalives-out
+ - Default value: `true`
+- `tcp_keepalives_out_variable` (String) Variable name
+- `tcp_small_servers` (Boolean) Configure tcp-small-servers
+ - Default value: `false`
+- `tcp_small_servers_variable` (String) Variable name
+- `udp_small_servers` (Boolean) Configure udp-small-servers
+ - Default value: `false`
+- `udp_small_servers_variable` (String) Variable name
+- `vty_line_logging` (Boolean) Configure VTY Line Logging
+ - Default value: `false`
+- `vty_line_logging_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_global_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_global_profile_parcel.md b/docs/resources/system_global_profile_parcel.md
deleted file mode 100644
index bbb641993..000000000
--- a/docs/resources/system_global_profile_parcel.md
+++ /dev/null
@@ -1,141 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_global_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Global profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_global_profile_parcel (Resource)
-
-This resource can manage a System Global profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_global_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- http_server = false
- https_server = false
- ftp_passive = false
- domain_lookup = false
- arp_proxy = false
- rsh_rcp = false
- line_vty = false
- cdp = true
- lldp = true
- source_interface = "GigabitEthernet0/0/1"
- tcp_keepalives_in = true
- tcp_keepalives_out = true
- tcp_small_servers = false
- udp_small_servers = false
- console_logging = true
- ip_source_routing = false
- vty_line_logging = false
- snmp_ifindex_persist = true
- ignore_bootp = true
- nat64_udp_timeout = 300
- nat64_tcp_timeout = 3600
- http_authentication = "aaa"
- ssh_version = "2"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `arp_proxy` (Boolean) Set ARP Proxy
- - Default value: `false`
-- `arp_proxy_variable` (String) Variable name
-- `cdp` (Boolean) Configure CDP
- - Default value: `true`
-- `cdp_variable` (String) Variable name
-- `console_logging` (Boolean) Configure Console Logging
- - Default value: `true`
-- `console_logging_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `domain_lookup` (Boolean) Configure Domain-Lookup
- - Default value: `false`
-- `domain_lookup_variable` (String) Variable name
-- `ftp_passive` (Boolean) Set Passive FTP
- - Default value: `false`
-- `ftp_passive_variable` (String) Variable name
-- `http_authentication` (String) Set preference for HTTP Authentication
- - Choices: `local`, `aaa`
-- `http_authentication_variable` (String) Variable name
-- `http_server` (Boolean) Set a HTTP Server
- - Default value: `false`
-- `http_server_variable` (String) Variable name
-- `https_server` (Boolean) Set a HTTPS Server
- - Default value: `false`
-- `https_server_variable` (String) Variable name
-- `ignore_bootp` (Boolean) Configure Ignore BOOTP
- - Default value: `true`
-- `ignore_bootp_variable` (String) Variable name
-- `ip_source_routing` (Boolean) Set Source Route
- - Default value: `false`
-- `ip_source_routing_variable` (String) Variable name
-- `line_vty` (Boolean) Configure Telnet (Outbound)
- - Default value: `false`
-- `line_vty_variable` (String) Variable name
-- `lldp` (Boolean) Configure LLDP
- - Default value: `true`
-- `lldp_variable` (String) Variable name
-- `nat64_tcp_timeout` (Number) Set NAT64 TCP session timeout, in seconds
- - Range: `1`-`536870`
- - Default value: `3600`
-- `nat64_tcp_timeout_variable` (String) Variable name
-- `nat64_udp_timeout` (Number) Set NAT64 UDP session timeout, in seconds
- - Range: `1`-`536870`
- - Default value: `300`
-- `nat64_udp_timeout_variable` (String) Variable name
-- `rsh_rcp` (Boolean) Set RSH/RCP
- - Default value: `false`
-- `rsh_rcp_variable` (String) Variable name
-- `snmp_ifindex_persist` (Boolean) Configure SNMP Ifindex Persist
- - Default value: `true`
-- `snmp_ifindex_persist_variable` (String) Variable name
-- `source_interface` (String) Specify interface for source address in all HTTP(S) client connections
-- `source_interface_variable` (String) Variable name
-- `ssh_version` (String) Set SSH version
- - Choices: `2`
-- `ssh_version_variable` (String) Variable name
-- `tcp_keepalives_in` (Boolean) Configure tcp-keepalives-in
- - Default value: `true`
-- `tcp_keepalives_in_variable` (String) Variable name
-- `tcp_keepalives_out` (Boolean) Configure tcp-keepalives-out
- - Default value: `true`
-- `tcp_keepalives_out_variable` (String) Variable name
-- `tcp_small_servers` (Boolean) Configure tcp-small-servers
- - Default value: `false`
-- `tcp_small_servers_variable` (String) Variable name
-- `udp_small_servers` (Boolean) Configure udp-small-servers
- - Default value: `false`
-- `udp_small_servers_variable` (String) Variable name
-- `vty_line_logging` (Boolean) Configure VTY Line Logging
- - Default value: `false`
-- `vty_line_logging_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_global_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_ipv4_device_access_feature.md b/docs/resources/system_ipv4_device_access_feature.md
new file mode 100644
index 000000000..1f390ed54
--- /dev/null
+++ b/docs/resources/system_ipv4_device_access_feature.md
@@ -0,0 +1,80 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_ipv4_device_access_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System IPv4 Device Access Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_ipv4_device_access_feature (Resource)
+
+This resource can manage a System IPv4 Device Access Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_ipv4_device_access_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "drop"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "accept"
+ device_access_port = 161
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `default_action` (String) Default Action
+ - Choices: `drop`, `accept`
+ - Default value: `drop`
+- `description` (String) The description of the Feature
+- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Optional:
+
+- `base_action` (String) Base Action
+ - Choices: `drop`, `accept`
+- `destination_data_prefix_list_id` (String)
+- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
+- `destination_ip_prefix_list_variable` (String) Variable name
+- `device_access_port` (Number) device access protocol
+- `id` (Number) Sequence Id
+ - Range: `1`-`65536`
+- `name` (String) Sequence Name
+- `source_data_prefix_list_id` (String)
+- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
+- `source_ip_prefix_list_variable` (String) Variable name
+- `source_ports` (Set of Number) Source Port List
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_ipv4_device_access_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_ipv4_device_access_profile_parcel.md b/docs/resources/system_ipv4_device_access_profile_parcel.md
deleted file mode 100644
index 7c48220c3..000000000
--- a/docs/resources/system_ipv4_device_access_profile_parcel.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_ipv4_device_access_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System IPv4 Device Access profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_ipv4_device_access_profile_parcel (Resource)
-
-This resource can manage a System IPv4 Device Access profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_ipv4_device_access_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- default_action = "drop"
- sequences = [
- {
- id = 1
- name = "SEQ_1"
- base_action = "accept"
- device_access_port = 161
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `default_action` (String) Default Action
- - Choices: `drop`, `accept`
- - Default value: `drop`
-- `description` (String) The description of the profile parcel
-- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `sequences`
-
-Optional:
-
-- `base_action` (String) Base Action
- - Choices: `drop`, `accept`
-- `destination_data_prefix_list_id` (String)
-- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
-- `destination_ip_prefix_list_variable` (String) Variable name
-- `device_access_port` (Number) device access protocol
-- `id` (Number) Sequence Id
- - Range: `1`-`65536`
-- `name` (String) Sequence Name
-- `source_data_prefix_list_id` (String)
-- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
-- `source_ip_prefix_list_variable` (String) Variable name
-- `source_ports` (Set of Number) Source Port List
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_ipv4_device_access_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_ipv6_device_access_feature.md b/docs/resources/system_ipv6_device_access_feature.md
new file mode 100644
index 000000000..c8c87a3b2
--- /dev/null
+++ b/docs/resources/system_ipv6_device_access_feature.md
@@ -0,0 +1,81 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_ipv6_device_access_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System IPv6 Device Access Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_ipv6_device_access_feature (Resource)
+
+This resource can manage a System IPv6 Device Access Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_ipv6_device_access_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "drop"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "accept"
+ device_access_port = 22
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `default_action` (String) Default Action
+ - Choices: `drop`, `accept`
+ - Default value: `drop`
+- `description` (String) The description of the Feature
+- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Optional:
+
+- `base_action` (String) Base Action
+ - Choices: `drop`, `accept`
+ - Default value: `accept`
+- `destination_data_prefix_list_id` (String)
+- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
+- `destination_ip_prefix_list_variable` (String) Variable name
+- `device_access_port` (Number) device access protocol
+- `id` (Number) Sequence Id
+ - Range: `1`-`65536`
+- `name` (String) Sequence Name
+- `source_data_prefix_list_id` (String)
+- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
+- `source_ip_prefix_list_variable` (String) Variable name
+- `source_ports` (Set of Number) Source Port List
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_ipv6_device_access_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_ipv6_device_access_profile_parcel.md b/docs/resources/system_ipv6_device_access_profile_parcel.md
deleted file mode 100644
index 0f89b28e3..000000000
--- a/docs/resources/system_ipv6_device_access_profile_parcel.md
+++ /dev/null
@@ -1,81 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_ipv6_device_access_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System IPv6 Device Access profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_ipv6_device_access_profile_parcel (Resource)
-
-This resource can manage a System IPv6 Device Access profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_ipv6_device_access_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- default_action = "drop"
- sequences = [
- {
- id = 1
- name = "SEQ_1"
- base_action = "accept"
- device_access_port = 22
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `default_action` (String) Default Action
- - Choices: `drop`, `accept`
- - Default value: `drop`
-- `description` (String) The description of the profile parcel
-- `sequences` (Attributes List) Device Access Control List (see [below for nested schema](#nestedatt--sequences))
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `sequences`
-
-Optional:
-
-- `base_action` (String) Base Action
- - Choices: `drop`, `accept`
- - Default value: `accept`
-- `destination_data_prefix_list_id` (String)
-- `destination_ip_prefix_list` (Set of String) Destination Data IP Prefix List
-- `destination_ip_prefix_list_variable` (String) Variable name
-- `device_access_port` (Number) device access protocol
-- `id` (Number) Sequence Id
- - Range: `1`-`65536`
-- `name` (String) Sequence Name
-- `source_data_prefix_list_id` (String)
-- `source_ip_prefix_list` (Set of String) Source Data IP Prefix List
-- `source_ip_prefix_list_variable` (String) Variable name
-- `source_ports` (Set of Number) Source Port List
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_ipv6_device_access_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_logging_feature.md b/docs/resources/system_logging_feature.md
new file mode 100644
index 000000000..c37ee14a2
--- /dev/null
+++ b/docs/resources/system_logging_feature.md
@@ -0,0 +1,162 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_logging_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Logging Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_logging_feature (Resource)
+
+This resource can manage a System Logging Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_logging_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ disk_enable = true
+ disk_file_size = 9
+ disk_file_rotate = 10
+ tls_profiles = [
+ {
+ profile = "test"
+ tls_version = "TLSv1.1"
+ cipher_suites = ["aes-128-cbc-sha"]
+ }
+ ]
+ ipv4_servers = [
+ {
+ hostname_ip = "1.1.1.1"
+ vpn = 512
+ source_interface = "GigabitEthernet1"
+ priority = "informational"
+ tls_enable = true
+ tls_properties_custom_profile = true
+ tls_properties_profile = "test"
+ }
+ ]
+ ipv6_servers = [
+ {
+ hostname_ip = "1.1.1.1"
+ vpn = 512
+ source_interface = "GigabitEthernet1"
+ priority = "informational"
+ tls_enable = true
+ tls_properties_custom_profile = true
+ tls_properties_profile = "test"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `disk_enable` (Boolean) Enable logging to local disk
+ - Default value: `true`
+- `disk_enable_variable` (String) Variable name
+- `disk_file_rotate` (Number) Set number of syslog files to create before discarding oldest files
+ - Range: `1`-`10`
+ - Default value: `10`
+- `disk_file_rotate_variable` (String) Variable name
+- `disk_file_size` (Number) Set maximum size of file before it is rotated
+ - Range: `1`-`20`
+ - Default value: `10`
+- `disk_file_size_variable` (String) Variable name
+- `feature_profile_id` (String) Feature Profile ID
+- `ipv4_servers` (Attributes List) Enable logging to remote server (see [below for nested schema](#nestedatt--ipv4_servers))
+- `ipv6_servers` (Attributes List) Enable logging to remote ipv6 server (see [below for nested schema](#nestedatt--ipv6_servers))
+- `tls_profiles` (Attributes List) Configure a TLS profile (see [below for nested schema](#nestedatt--tls_profiles))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_servers`
+
+Optional:
+
+- `hostname_ip` (String) Set hostname or IPv4 address of server
+- `hostname_ip_variable` (String) Variable name
+- `priority` (String) Set logging level for messages logged to server
+ - Choices: `informational`, `debugging`, `notice`, `warn`, `error`, `critical`, `alert`, `emergency`
+ - Default value: `informational`
+- `priority_variable` (String) Variable name
+- `source_interface` (String) Set interface to use to reach syslog server
+- `source_interface_variable` (String) Variable name
+- `tls_enable` (Boolean) Enable TLS Profile
+ - Default value: `false`
+- `tls_enable_variable` (String) Variable name
+- `tls_properties_custom_profile` (Boolean) Define custom profile
+ - Default value: `false`
+- `tls_properties_custom_profile_variable` (String) Variable name
+- `tls_properties_profile` (String) Configure a TLS profile
+- `tls_properties_profile_variable` (String) Variable name
+- `vpn` (Number) Set hostname or IPv4 address of server
+ - Range: `0`-`65530`
+ - Default value: `0`
+- `vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_servers`
+
+Optional:
+
+- `hostname_ip` (String) Set IPv6 hostname or IPv6 address of server
+- `hostname_ip_variable` (String) Variable name
+- `priority` (String) Set logging level for messages logged to server
+ - Choices: `informational`, `debugging`, `notice`, `warn`, `error`, `critical`, `alert`, `emergency`
+ - Default value: `informational`
+- `priority_variable` (String) Variable name
+- `source_interface` (String) Set interface to use to reach syslog server
+- `source_interface_variable` (String) Variable name
+- `tls_enable` (Boolean) Enable TLS Profile
+ - Default value: `false`
+- `tls_enable_variable` (String) Variable name
+- `tls_properties_custom_profile` (Boolean) Define custom profile
+ - Default value: `false`
+- `tls_properties_custom_profile_variable` (String) Variable name
+- `tls_properties_profile` (String) Configure a TLS profile
+- `tls_properties_profile_variable` (String) Variable name
+- `vpn` (Number) Set hostname or IPv4 address of server
+ - Range: `0`-`65530`
+ - Default value: `0`
+- `vpn_variable` (String) Variable name
+
+
+
+### Nested Schema for `tls_profiles`
+
+Optional:
+
+- `cipher_suites` (Set of String) Syslog secure server ciphersuites
+- `cipher_suites_variable` (String) Variable name
+- `profile` (String) Specify the name of the TLS profile
+- `profile_variable` (String) Variable name
+- `tls_version` (String) TLS Version
+ - Choices: `TLSv1.1`, `TLSv1.2`
+ - Default value: `TLSv1.1`
+- `tls_version_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_logging_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_logging_profile_parcel.md b/docs/resources/system_logging_profile_parcel.md
deleted file mode 100644
index a6cf8f27e..000000000
--- a/docs/resources/system_logging_profile_parcel.md
+++ /dev/null
@@ -1,162 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_logging_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Logging profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_logging_profile_parcel (Resource)
-
-This resource can manage a System Logging profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_logging_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- disk_enable = true
- disk_file_size = 9
- disk_file_rotate = 10
- tls_profiles = [
- {
- profile = "test"
- tls_version = "TLSv1.1"
- cipher_suites = ["aes-128-cbc-sha"]
- }
- ]
- ipv4_servers = [
- {
- hostname_ip = "1.1.1.1"
- vpn = 512
- source_interface = "GigabitEthernet1"
- priority = "informational"
- tls_enable = true
- tls_properties_custom_profile = true
- tls_properties_profile = "test"
- }
- ]
- ipv6_servers = [
- {
- hostname_ip = "1.1.1.1"
- vpn = 512
- source_interface = "GigabitEthernet1"
- priority = "informational"
- tls_enable = true
- tls_properties_custom_profile = true
- tls_properties_profile = "test"
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `disk_enable` (Boolean) Enable logging to local disk
- - Default value: `true`
-- `disk_enable_variable` (String) Variable name
-- `disk_file_rotate` (Number) Set number of syslog files to create before discarding oldest files
- - Range: `1`-`10`
- - Default value: `10`
-- `disk_file_rotate_variable` (String) Variable name
-- `disk_file_size` (Number) Set maximum size of file before it is rotated
- - Range: `1`-`20`
- - Default value: `10`
-- `disk_file_size_variable` (String) Variable name
-- `feature_profile_id` (String) Feature Profile ID
-- `ipv4_servers` (Attributes List) Enable logging to remote server (see [below for nested schema](#nestedatt--ipv4_servers))
-- `ipv6_servers` (Attributes List) Enable logging to remote ipv6 server (see [below for nested schema](#nestedatt--ipv6_servers))
-- `tls_profiles` (Attributes List) Configure a TLS profile (see [below for nested schema](#nestedatt--tls_profiles))
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `ipv4_servers`
-
-Optional:
-
-- `hostname_ip` (String) Set hostname or IPv4 address of server
-- `hostname_ip_variable` (String) Variable name
-- `priority` (String) Set logging level for messages logged to server
- - Choices: `informational`, `debugging`, `notice`, `warn`, `error`, `critical`, `alert`, `emergency`
- - Default value: `informational`
-- `priority_variable` (String) Variable name
-- `source_interface` (String) Set interface to use to reach syslog server
-- `source_interface_variable` (String) Variable name
-- `tls_enable` (Boolean) Enable TLS Profile
- - Default value: `false`
-- `tls_enable_variable` (String) Variable name
-- `tls_properties_custom_profile` (Boolean) Define custom profile
- - Default value: `false`
-- `tls_properties_custom_profile_variable` (String) Variable name
-- `tls_properties_profile` (String) Configure a TLS profile
-- `tls_properties_profile_variable` (String) Variable name
-- `vpn` (Number) Set hostname or IPv4 address of server
- - Range: `0`-`65530`
- - Default value: `0`
-- `vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_servers`
-
-Optional:
-
-- `hostname_ip` (String) Set IPv6 hostname or IPv6 address of server
-- `hostname_ip_variable` (String) Variable name
-- `priority` (String) Set logging level for messages logged to server
- - Choices: `informational`, `debugging`, `notice`, `warn`, `error`, `critical`, `alert`, `emergency`
- - Default value: `informational`
-- `priority_variable` (String) Variable name
-- `source_interface` (String) Set interface to use to reach syslog server
-- `source_interface_variable` (String) Variable name
-- `tls_enable` (Boolean) Enable TLS Profile
- - Default value: `false`
-- `tls_enable_variable` (String) Variable name
-- `tls_properties_custom_profile` (Boolean) Define custom profile
- - Default value: `false`
-- `tls_properties_custom_profile_variable` (String) Variable name
-- `tls_properties_profile` (String) Configure a TLS profile
-- `tls_properties_profile_variable` (String) Variable name
-- `vpn` (Number) Set hostname or IPv4 address of server
- - Range: `0`-`65530`
- - Default value: `0`
-- `vpn_variable` (String) Variable name
-
-
-
-### Nested Schema for `tls_profiles`
-
-Optional:
-
-- `cipher_suites` (Set of String) Syslog secure server ciphersuites
-- `cipher_suites_variable` (String) Variable name
-- `profile` (String) Specify the name of the TLS profile
-- `profile_variable` (String) Variable name
-- `tls_version` (String) TLS Version
- - Choices: `TLSv1.1`, `TLSv1.2`
- - Default value: `TLSv1.1`
-- `tls_version_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_logging_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_mrf_feature.md b/docs/resources/system_mrf_feature.md
new file mode 100644
index 000000000..a6f72c75d
--- /dev/null
+++ b/docs/resources/system_mrf_feature.md
@@ -0,0 +1,65 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_mrf_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System MRF Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_mrf_feature (Resource)
+
+This resource can manage a System MRF Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_mrf_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ region_id = 1
+ secondary_region_id = 2
+ role = "edge-router"
+ enable_migration_to_mrf = "enabled"
+ migration_bgp_community = 100
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `enable_migration_to_mrf` (String) Enable migration mode to Multi-Region Fabric
+ - Choices: `enabled`, `enabled-from-bgp-core`
+- `feature_profile_id` (String) Feature Profile ID
+- `migration_bgp_community` (Number) Set BGP community during migration from BGP-core based network
+ - Range: `1`-`4294967295`
+- `region_id` (Number) Set region ID
+ - Range: `1`-`63`
+- `role` (String) Set the role for router
+ - Choices: `edge-router`, `border-router`
+- `role_variable` (String) Variable name
+- `secondary_region_id` (Number) Set secondary region ID
+ - Range: `1`-`63`
+- `secondary_region_id_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_mrf_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_mrf_profile_parcel.md b/docs/resources/system_mrf_profile_parcel.md
deleted file mode 100644
index 105ea6f29..000000000
--- a/docs/resources/system_mrf_profile_parcel.md
+++ /dev/null
@@ -1,65 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_mrf_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System MRF profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_mrf_profile_parcel (Resource)
-
-This resource can manage a System MRF profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_mrf_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- region_id = 1
- secondary_region_id = 2
- role = "edge-router"
- enable_migration_to_mrf = "enabled"
- migration_bgp_community = 100
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `enable_migration_to_mrf` (String) Enable migration mode to Multi-Region Fabric
- - Choices: `enabled`, `enabled-from-bgp-core`
-- `feature_profile_id` (String) Feature Profile ID
-- `migration_bgp_community` (Number) Set BGP community during migration from BGP-core based network
- - Range: `1`-`4294967295`
-- `region_id` (Number) Set region ID
- - Range: `1`-`63`
-- `role` (String) Set the role for router
- - Choices: `edge-router`, `border-router`
-- `role_variable` (String) Variable name
-- `secondary_region_id` (Number) Set secondary region ID
- - Range: `1`-`63`
-- `secondary_region_id_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_mrf_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_ntp_feature.md b/docs/resources/system_ntp_feature.md
new file mode 100644
index 000000000..7dcb5656d
--- /dev/null
+++ b/docs/resources/system_ntp_feature.md
@@ -0,0 +1,116 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_ntp_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System NTP Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_ntp_feature (Resource)
+
+This resource can manage a System NTP Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_ntp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ servers = [
+ {
+ hostname_ip_address = "1.1.1.1"
+ authentication_key = 41673
+ vpn = 1
+ ntp_version = 4
+ source_interface = "Ethernet"
+ prefer_this_ntp_server = false
+ }
+ ]
+ authentication_keys = [
+ {
+ key_id = 49737
+ md5_value = "$CRYPT_CLUSTER"
+ }
+ ]
+ trusted_keys = [49737]
+ authoritative_ntp_server = false
+ stratum = 1
+ source_interface = "ATM"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `authentication_keys` (Attributes List) Set MD5 authentication key (see [below for nested schema](#nestedatt--authentication_keys))
+- `authoritative_ntp_server` (Boolean) Enable device as NTP Leader
+ - Default value: `false`
+- `authoritative_ntp_server_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `feature_profile_id` (String) Feature Profile ID
+- `servers` (Attributes List) Configure NTP servers (see [below for nested schema](#nestedatt--servers))
+- `source_interface` (String) Enable device as NTP Leader
+- `source_interface_variable` (String) Variable name
+- `stratum` (Number) Enable device as NTP Leader
+ - Range: `1`-`15`
+- `stratum_variable` (String) Variable name
+- `trusted_keys` (Set of Number) Designate authentication key as trustworthy
+- `trusted_keys_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `authentication_keys`
+
+Optional:
+
+- `key_id` (Number) MD5 authentication key ID
+ - Range: `1`-`65535`
+- `key_id_variable` (String) Variable name
+- `md5_value` (String) Enter cleartext or AES-encrypted MD5 authentication key
+- `md5_value_variable` (String) Variable name
+
+
+
+### Nested Schema for `servers`
+
+Optional:
+
+- `authentication_key` (Number) Set authentication key for the server
+ - Range: `1`-`65535`
+- `authentication_key_variable` (String) Variable name
+- `hostname_ip_address` (String) Set hostname or IP address of server
+- `hostname_ip_address_variable` (String) Variable name
+- `ntp_version` (Number) Set NTP version
+ - Range: `1`-`4`
+ - Default value: `4`
+- `ntp_version_variable` (String) Variable name
+- `prefer_this_ntp_server` (Boolean) Prefer this NTP server
+ - Default value: `false`
+- `prefer_this_ntp_server_variable` (String) Variable name
+- `source_interface` (String) Set interface to use to reach NTP server
+- `source_interface_variable` (String) Variable name
+- `vpn` (Number) Set VPN in which NTP server is located
+ - Range: `0`-`65530`
+ - Default value: `0`
+- `vpn_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_ntp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_ntp_profile_parcel.md b/docs/resources/system_ntp_profile_parcel.md
deleted file mode 100644
index f4d6c64e0..000000000
--- a/docs/resources/system_ntp_profile_parcel.md
+++ /dev/null
@@ -1,116 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_ntp_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System NTP profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_ntp_profile_parcel (Resource)
-
-This resource can manage a System NTP profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_ntp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- servers = [
- {
- hostname_ip_address = "1.1.1.1"
- authentication_key = 41673
- vpn = 1
- ntp_version = 4
- source_interface = "Ethernet"
- prefer_this_ntp_server = false
- }
- ]
- authentication_keys = [
- {
- key_id = 49737
- md5_value = "$CRYPT_CLUSTER"
- }
- ]
- trusted_keys = [49737]
- authoritative_ntp_server = false
- stratum = 1
- source_interface = "ATM"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `authentication_keys` (Attributes List) Set MD5 authentication key (see [below for nested schema](#nestedatt--authentication_keys))
-- `authoritative_ntp_server` (Boolean) Enable device as NTP Leader
- - Default value: `false`
-- `authoritative_ntp_server_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `feature_profile_id` (String) Feature Profile ID
-- `servers` (Attributes List) Configure NTP servers (see [below for nested schema](#nestedatt--servers))
-- `source_interface` (String) Enable device as NTP Leader
-- `source_interface_variable` (String) Variable name
-- `stratum` (Number) Enable device as NTP Leader
- - Range: `1`-`15`
-- `stratum_variable` (String) Variable name
-- `trusted_keys` (Set of Number) Designate authentication key as trustworthy
-- `trusted_keys_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `authentication_keys`
-
-Optional:
-
-- `key_id` (Number) MD5 authentication key ID
- - Range: `1`-`65535`
-- `key_id_variable` (String) Variable name
-- `md5_value` (String) Enter cleartext or AES-encrypted MD5 authentication key
-- `md5_value_variable` (String) Variable name
-
-
-
-### Nested Schema for `servers`
-
-Optional:
-
-- `authentication_key` (Number) Set authentication key for the server
- - Range: `1`-`65535`
-- `authentication_key_variable` (String) Variable name
-- `hostname_ip_address` (String) Set hostname or IP address of server
-- `hostname_ip_address_variable` (String) Variable name
-- `ntp_version` (Number) Set NTP version
- - Range: `1`-`4`
- - Default value: `4`
-- `ntp_version_variable` (String) Variable name
-- `prefer_this_ntp_server` (Boolean) Prefer this NTP server
- - Default value: `false`
-- `prefer_this_ntp_server_variable` (String) Variable name
-- `source_interface` (String) Set interface to use to reach NTP server
-- `source_interface_variable` (String) Variable name
-- `vpn` (Number) Set VPN in which NTP server is located
- - Range: `0`-`65530`
- - Default value: `0`
-- `vpn_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_ntp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_omp_feature.md b/docs/resources/system_omp_feature.md
new file mode 100644
index 000000000..a04281620
--- /dev/null
+++ b/docs/resources/system_omp_feature.md
@@ -0,0 +1,170 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_omp_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System OMP Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_omp_feature (Resource)
+
+This resource can manage a System OMP Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_omp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ graceful_restart = true
+ overlay_as = 10
+ paths_advertised_per_prefix = 4
+ ecmp_limit = 4
+ shutdown = false
+ omp_admin_distance_ipv4 = 10
+ omp_admin_distance_ipv6 = 20
+ advertisement_interval = 1
+ graceful_restart_timer = 43200
+ eor_timer = 300
+ holdtime = 60
+ advertise_ipv4_bgp = false
+ advertise_ipv4_ospf = false
+ advertise_ipv4_ospf_v3 = false
+ advertise_ipv4_connected = false
+ advertise_ipv4_static = false
+ advertise_ipv4_eigrp = false
+ advertise_ipv4_lisp = false
+ advertise_ipv4_isis = false
+ advertise_ipv6_bgp = true
+ advertise_ipv6_ospf = true
+ advertise_ipv6_connected = true
+ advertise_ipv6_static = true
+ advertise_ipv6_eigrp = true
+ advertise_ipv6_lisp = true
+ advertise_ipv6_isis = true
+ ignore_region_path_length = false
+ transport_gateway = "prefer"
+ site_types = ["type-1"]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `advertise_ipv4_bgp` (Boolean) BGP
+ - Default value: `false`
+- `advertise_ipv4_bgp_variable` (String) Variable name
+- `advertise_ipv4_connected` (Boolean) Connected
+ - Default value: `true`
+- `advertise_ipv4_connected_variable` (String) Variable name
+- `advertise_ipv4_eigrp` (Boolean) EIGRP
+ - Default value: `false`
+- `advertise_ipv4_eigrp_variable` (String) Variable name
+- `advertise_ipv4_isis` (Boolean) ISIS
+ - Default value: `false`
+- `advertise_ipv4_isis_variable` (String) Variable name
+- `advertise_ipv4_lisp` (Boolean) LISP
+ - Default value: `false`
+- `advertise_ipv4_lisp_variable` (String) Variable name
+- `advertise_ipv4_ospf` (Boolean) OSPF
+ - Default value: `false`
+- `advertise_ipv4_ospf_v3` (Boolean) OSPFV3
+ - Default value: `false`
+- `advertise_ipv4_ospf_v3_variable` (String) Variable name
+- `advertise_ipv4_ospf_variable` (String) Variable name
+- `advertise_ipv4_static` (Boolean) Static
+ - Default value: `true`
+- `advertise_ipv4_static_variable` (String) Variable name
+- `advertise_ipv6_bgp` (Boolean) BGP
+ - Default value: `false`
+- `advertise_ipv6_bgp_variable` (String) Variable name
+- `advertise_ipv6_connected` (Boolean) Connected
+ - Default value: `false`
+- `advertise_ipv6_connected_variable` (String) Variable name
+- `advertise_ipv6_eigrp` (Boolean) EIGRP
+ - Default value: `false`
+- `advertise_ipv6_eigrp_variable` (String) Variable name
+- `advertise_ipv6_isis` (Boolean) ISIS
+ - Default value: `false`
+- `advertise_ipv6_isis_variable` (String) Variable name
+- `advertise_ipv6_lisp` (Boolean) LISP
+ - Default value: `false`
+- `advertise_ipv6_lisp_variable` (String) Variable name
+- `advertise_ipv6_ospf` (Boolean) OSPF
+ - Default value: `false`
+- `advertise_ipv6_ospf_variable` (String) Variable name
+- `advertise_ipv6_static` (Boolean) Static
+ - Default value: `false`
+- `advertise_ipv6_static_variable` (String) Variable name
+- `advertisement_interval` (Number) Advertisement Interval (seconds)
+ - Range: `0`-`65535`
+ - Default value: `1`
+- `advertisement_interval_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `ecmp_limit` (Number) Set maximum number of OMP paths to install in cEdge route table
+ - Range: `1`-`0`
+ - Default value: `4`
+- `ecmp_limit_variable` (String) Variable name
+- `eor_timer` (Number) EOR Timer
+ - Range: `1`-`3600`
+ - Default value: `300`
+- `eor_timer_variable` (String) Variable name
+- `graceful_restart` (Boolean) Graceful Restart for OMP
+ - Default value: `true`
+- `graceful_restart_timer` (Number) Graceful Restart Timer (seconds)
+ - Range: `1`-`604800`
+ - Default value: `43200`
+- `graceful_restart_timer_variable` (String) Variable name
+- `graceful_restart_variable` (String) Variable name
+- `holdtime` (Number) Hold Time (seconds)
+ - Default value: `60`
+- `holdtime_variable` (String) Variable name
+- `ignore_region_path_length` (Boolean) Treat hierarchical and direct (secondary region) paths equally
+ - Default value: `false`
+- `ignore_region_path_length_variable` (String) Variable name
+- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
+ - Range: `1`-`255`
+ - Default value: `251`
+- `omp_admin_distance_ipv4_variable` (String) Variable name
+- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
+ - Range: `1`-`255`
+ - Default value: `251`
+- `omp_admin_distance_ipv6_variable` (String) Variable name
+- `overlay_as` (Number) Overlay AS Number
+ - Range: `1`-`4294967295`
+- `overlay_as_variable` (String) Variable name
+- `paths_advertised_per_prefix` (Number) Number of Paths Advertised per Prefix
+ - Range: `1`-`16`
+ - Default value: `4`
+- `paths_advertised_per_prefix_variable` (String) Variable name
+- `shutdown` (Boolean) Shutdown
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `site_types` (Set of String) Site Types
+- `site_types_variable` (String) Variable name
+- `transport_gateway` (String) Transport Gateway Path Behavior
+ - Choices: `prefer`, `ecmp-with-direct-path`
+- `transport_gateway_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_omp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_omp_profile_parcel.md b/docs/resources/system_omp_profile_parcel.md
deleted file mode 100644
index 206727693..000000000
--- a/docs/resources/system_omp_profile_parcel.md
+++ /dev/null
@@ -1,170 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_omp_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System OMP profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_omp_profile_parcel (Resource)
-
-This resource can manage a System OMP profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_omp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- graceful_restart = true
- overlay_as = 10
- paths_advertised_per_prefix = 4
- ecmp_limit = 4
- shutdown = false
- omp_admin_distance_ipv4 = 10
- omp_admin_distance_ipv6 = 20
- advertisement_interval = 1
- graceful_restart_timer = 43200
- eor_timer = 300
- holdtime = 60
- advertise_ipv4_bgp = false
- advertise_ipv4_ospf = false
- advertise_ipv4_ospf_v3 = false
- advertise_ipv4_connected = false
- advertise_ipv4_static = false
- advertise_ipv4_eigrp = false
- advertise_ipv4_lisp = false
- advertise_ipv4_isis = false
- advertise_ipv6_bgp = true
- advertise_ipv6_ospf = true
- advertise_ipv6_connected = true
- advertise_ipv6_static = true
- advertise_ipv6_eigrp = true
- advertise_ipv6_lisp = true
- advertise_ipv6_isis = true
- ignore_region_path_length = false
- transport_gateway = "prefer"
- site_types = ["type-1"]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `advertise_ipv4_bgp` (Boolean) BGP
- - Default value: `false`
-- `advertise_ipv4_bgp_variable` (String) Variable name
-- `advertise_ipv4_connected` (Boolean) Connected
- - Default value: `true`
-- `advertise_ipv4_connected_variable` (String) Variable name
-- `advertise_ipv4_eigrp` (Boolean) EIGRP
- - Default value: `false`
-- `advertise_ipv4_eigrp_variable` (String) Variable name
-- `advertise_ipv4_isis` (Boolean) ISIS
- - Default value: `false`
-- `advertise_ipv4_isis_variable` (String) Variable name
-- `advertise_ipv4_lisp` (Boolean) LISP
- - Default value: `false`
-- `advertise_ipv4_lisp_variable` (String) Variable name
-- `advertise_ipv4_ospf` (Boolean) OSPF
- - Default value: `false`
-- `advertise_ipv4_ospf_v3` (Boolean) OSPFV3
- - Default value: `false`
-- `advertise_ipv4_ospf_v3_variable` (String) Variable name
-- `advertise_ipv4_ospf_variable` (String) Variable name
-- `advertise_ipv4_static` (Boolean) Static
- - Default value: `true`
-- `advertise_ipv4_static_variable` (String) Variable name
-- `advertise_ipv6_bgp` (Boolean) BGP
- - Default value: `false`
-- `advertise_ipv6_bgp_variable` (String) Variable name
-- `advertise_ipv6_connected` (Boolean) Connected
- - Default value: `false`
-- `advertise_ipv6_connected_variable` (String) Variable name
-- `advertise_ipv6_eigrp` (Boolean) EIGRP
- - Default value: `false`
-- `advertise_ipv6_eigrp_variable` (String) Variable name
-- `advertise_ipv6_isis` (Boolean) ISIS
- - Default value: `false`
-- `advertise_ipv6_isis_variable` (String) Variable name
-- `advertise_ipv6_lisp` (Boolean) LISP
- - Default value: `false`
-- `advertise_ipv6_lisp_variable` (String) Variable name
-- `advertise_ipv6_ospf` (Boolean) OSPF
- - Default value: `false`
-- `advertise_ipv6_ospf_variable` (String) Variable name
-- `advertise_ipv6_static` (Boolean) Static
- - Default value: `false`
-- `advertise_ipv6_static_variable` (String) Variable name
-- `advertisement_interval` (Number) Advertisement Interval (seconds)
- - Range: `0`-`65535`
- - Default value: `1`
-- `advertisement_interval_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `ecmp_limit` (Number) Set maximum number of OMP paths to install in cEdge route table
- - Range: `1`-`0`
- - Default value: `4`
-- `ecmp_limit_variable` (String) Variable name
-- `eor_timer` (Number) EOR Timer
- - Range: `1`-`3600`
- - Default value: `300`
-- `eor_timer_variable` (String) Variable name
-- `graceful_restart` (Boolean) Graceful Restart for OMP
- - Default value: `true`
-- `graceful_restart_timer` (Number) Graceful Restart Timer (seconds)
- - Range: `1`-`604800`
- - Default value: `43200`
-- `graceful_restart_timer_variable` (String) Variable name
-- `graceful_restart_variable` (String) Variable name
-- `holdtime` (Number) Hold Time (seconds)
- - Default value: `60`
-- `holdtime_variable` (String) Variable name
-- `ignore_region_path_length` (Boolean) Treat hierarchical and direct (secondary region) paths equally
- - Default value: `false`
-- `ignore_region_path_length_variable` (String) Variable name
-- `omp_admin_distance_ipv4` (Number) OMP Admin Distance IPv4
- - Range: `1`-`255`
- - Default value: `251`
-- `omp_admin_distance_ipv4_variable` (String) Variable name
-- `omp_admin_distance_ipv6` (Number) OMP Admin Distance IPv6
- - Range: `1`-`255`
- - Default value: `251`
-- `omp_admin_distance_ipv6_variable` (String) Variable name
-- `overlay_as` (Number) Overlay AS Number
- - Range: `1`-`4294967295`
-- `overlay_as_variable` (String) Variable name
-- `paths_advertised_per_prefix` (Number) Number of Paths Advertised per Prefix
- - Range: `1`-`16`
- - Default value: `4`
-- `paths_advertised_per_prefix_variable` (String) Variable name
-- `shutdown` (Boolean) Shutdown
- - Default value: `false`
-- `shutdown_variable` (String) Variable name
-- `site_types` (Set of String) Site Types
-- `site_types_variable` (String) Variable name
-- `transport_gateway` (String) Transport Gateway Path Behavior
- - Choices: `prefer`, `ecmp-with-direct-path`
-- `transport_gateway_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_omp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_performance_monitoring_feature.md b/docs/resources/system_performance_monitoring_feature.md
new file mode 100644
index 000000000..ddcf500ef
--- /dev/null
+++ b/docs/resources/system_performance_monitoring_feature.md
@@ -0,0 +1,64 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_performance_monitoring_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Performance Monitoring Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_performance_monitoring_feature (Resource)
+
+This resource can manage a System Performance Monitoring Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_performance_monitoring_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ app_perf_monitor_enabled = true
+ app_perf_monitor_app_group = ["amazon-group"]
+ monitoring_config_enabled = true
+ monitoring_config_interval = "30"
+ event_driven_config_enabled = true
+ event_driven_events = ["SLA_CHANGE"]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `app_perf_monitor_app_group` (Set of String) Application groups to be monitored
+- `app_perf_monitor_enabled` (Boolean) Application performance monitoring enable or disable
+ - Default value: `false`
+- `description` (String) The description of the Feature
+- `event_driven_config_enabled` (Boolean) UMTS event driven monitoring enable or disable
+ - Default value: `false`
+- `event_driven_events` (Set of String) UMTS events
+- `feature_profile_id` (String) Feature Profile ID
+- `monitoring_config_enabled` (Boolean) UMTS monitoring enable or disable
+ - Default value: `false`
+- `monitoring_config_interval` (String) UMTS monitoring interval(Minutes)
+ - Choices: `30`, `60`
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_performance_monitoring_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_performance_monitoring_profile_parcel.md b/docs/resources/system_performance_monitoring_profile_parcel.md
deleted file mode 100644
index aeaa80741..000000000
--- a/docs/resources/system_performance_monitoring_profile_parcel.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_performance_monitoring_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Performance Monitoring profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_performance_monitoring_profile_parcel (Resource)
-
-This resource can manage a System Performance Monitoring profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_performance_monitoring_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- app_perf_monitor_enabled = true
- app_perf_monitor_app_group = ["amazon-group"]
- monitoring_config_enabled = true
- monitoring_config_interval = "30"
- event_driven_config_enabled = true
- event_driven_events = ["SLA_CHANGE"]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `app_perf_monitor_app_group` (Set of String) Application groups to be monitored
-- `app_perf_monitor_enabled` (Boolean) Application performance monitoring enable or disable
- - Default value: `false`
-- `description` (String) The description of the profile parcel
-- `event_driven_config_enabled` (Boolean) UMTS event driven monitoring enable or disable
- - Default value: `false`
-- `event_driven_events` (Set of String) UMTS events
-- `feature_profile_id` (String) Feature Profile ID
-- `monitoring_config_enabled` (Boolean) UMTS monitoring enable or disable
- - Default value: `false`
-- `monitoring_config_interval` (String) UMTS monitoring interval(Minutes)
- - Choices: `30`, `60`
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_performance_monitoring_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_remote_access_feature.md b/docs/resources/system_remote_access_feature.md
new file mode 100644
index 000000000..20a630c32
--- /dev/null
+++ b/docs/resources/system_remote_access_feature.md
@@ -0,0 +1,120 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_remote_access_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Remote Access Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_remote_access_feature (Resource)
+
+This resource can manage a System Remote Access Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_remote_access_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ connection_type_ssl = false
+ any_connect_eap_authentication_type = "user"
+ ipv4_pool_size = 50
+ ipv6_pool_size = 1024
+ enable_certificate_list_check = false
+ psk_authentication_type = "aaa"
+ radius_group_name = "radius-1"
+ aaa_derive_name_from_peer_identity = "MyPassword"
+ aaa_enable_accounting = false
+ ikev2_local_ike_identity_type = "EMAIL"
+ ikev2_local_ike_identity_value = "abc@xyz.com"
+ ikev2_security_association_lifetime = 86400
+ ikev2_anti_dos_threshold = 99
+ ipsec_enable_anti_replay = false
+ ipsec_security_association_lifetime = 3600
+ ipsec_enable_perfect_foward_secrecy = false
+}
+```
+
+
+## Schema
+
+### Required
+
+- `any_connect_eap_authentication_type` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Choices: `user`, `device`
+- `name` (String) The name of the Feature
+- `radius_group_name` (String)
+
+### Optional
+
+- `aaa_derive_name_from_peer_domain` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
+- `aaa_derive_name_from_peer_domain_variable` (String) Variable name
+- `aaa_derive_name_from_peer_identity` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
+- `aaa_derive_name_from_peer_identity_variable` (String) Variable name
+- `aaa_enable_accounting` (Boolean) Enable Accounting
+ - Default value: `true`
+- `aaa_enable_accounting_variable` (String) Variable name
+- `aaa_specify_name_policy_name` (String)
+- `aaa_specify_name_policy_name_variable` (String) Variable name
+- `aaa_specify_name_policy_password` (String)
+- `aaa_specify_name_policy_password_variable` (String) Variable name
+- `connection_type_ssl` (Boolean) Enabled SSL VPN
+ - Default value: `false`
+- `description` (String) The description of the Feature
+- `enable_certificate_list_check` (Boolean) - Default value: `false`
+- `enable_certificate_list_check_variable` (String) Variable name
+- `feature_profile_id` (String) Feature Profile ID
+- `ikev2_anti_dos_threshold` (Number) Anti-DOS Threshold, Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Range: `10`-`1000`
+ - Default value: `100`
+- `ikev2_anti_dos_threshold_variable` (String) Variable name
+- `ikev2_local_ike_identity_type` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Choices: `EMAIL`, `FQDN`, `KEYID`, `IPv4 ADDRESS`, `IPv6 ADDRESS`
+- `ikev2_local_ike_identity_type_variable` (String) Variable name
+- `ikev2_local_ike_identity_value` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
+- `ikev2_local_ike_identity_value_variable` (String) Variable name
+- `ikev2_security_association_lifetime` (Number) Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Range: `3600`-`86400`
+ - Default value: `86400`
+- `ikev2_security_association_lifetime_variable` (String) Variable name
+- `ipsec_anti_replay_window_size` (Number) security Association Lifetime, Attribute conditional on `ipsec_enable_anti_replay` being equal to `true`
+ - Default value: `64`
+- `ipsec_anti_replay_window_size_variable` (String) Variable name
+- `ipsec_enable_anti_replay` (Boolean) Enable Anti-Replay, Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Default value: `true`
+- `ipsec_enable_anti_replay_variable` (String) Variable name
+- `ipsec_enable_perfect_foward_secrecy` (Boolean) security Association Lifetime, Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Default value: `false`
+- `ipsec_enable_perfect_foward_secrecy_variable` (String) Variable name
+- `ipsec_security_association_lifetime` (Number) Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Range: `3600`-`86400`
+ - Default value: `3600`
+- `ipsec_security_association_lifetime_variable` (String) Variable name
+- `ipv4_pool_size` (Number) IPv4 Pool Size
+ - Default value: `1000`
+- `ipv4_pool_size_variable` (String) Variable name
+- `ipv6_pool_size` (Number) IPv6 Pool Size
+ - Default value: `1024`
+- `ipv6_pool_size_variable` (String) Variable name
+- `psk_authentication_pre_shared_key` (String) PSK Pre Shared Key, Attribute conditional on `psk_authentication_type` being equal to `group`
+- `psk_authentication_pre_shared_key_variable` (String) Variable name
+- `psk_authentication_type` (String) PSK Selection, Attribute conditional on `connection_type_ssl` being equal to `false`
+ - Choices: `aaa`, `group`
+- `psk_authentication_type_variable` (String) Variable name
+- `radius_group_name_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_remote_access_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_remote_access_profile_parcel.md b/docs/resources/system_remote_access_profile_parcel.md
deleted file mode 100644
index e93549ca4..000000000
--- a/docs/resources/system_remote_access_profile_parcel.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_remote_access_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Remote Access profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_remote_access_profile_parcel (Resource)
-
-This resource can manage a System Remote Access profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_remote_access_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- connection_type_ssl = false
- any_connect_eap_authentication_type = "user"
- ipv4_pool_size = 50
- ipv6_pool_size = 1024
- enable_certificate_list_check = false
- psk_authentication_type = "aaa"
- psk_authentication_pre_shared_key = "Cisco123"
- radius_group_name = "radius-1"
- aaa_derive_name_from_peer_identity = "MyPassword"
- aaa_enable_accounting = false
- ikev2_local_ike_identity_type = "EMAIL"
- ikev2_local_ike_identity_value = "abc@xyz.com"
- ikev2_security_association_lifetime = 86400
- ikev2_anti_dos_threshold = 99
- ipsec_enable_anti_replay = false
- ipsec_anti_replay_window_size = 64
- ipsec_security_association_lifetime = 3600
- ipsec_enable_perfect_foward_secrecy = false
-}
-```
-
-
-## Schema
-
-### Required
-
-- `any_connect_eap_authentication_type` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
- - Choices: `user`, `device`
-- `name` (String) The name of the profile parcel
-- `radius_group_name` (String)
-
-### Optional
-
-- `aaa_derive_name_from_peer_domain` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
-- `aaa_derive_name_from_peer_domain_variable` (String) Variable name
-- `aaa_derive_name_from_peer_identity` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
-- `aaa_derive_name_from_peer_identity_variable` (String) Variable name
-- `aaa_enable_accounting` (Boolean) Enable Accounting
- - Default value: `true`
-- `aaa_enable_accounting_variable` (String) Variable name
-- `aaa_specify_name_policy_name` (String)
-- `aaa_specify_name_policy_name_variable` (String) Variable name
-- `aaa_specify_name_policy_password` (String)
-- `aaa_specify_name_policy_password_variable` (String) Variable name
-- `connection_type_ssl` (Boolean) Enabled SSL VPN
- - Default value: `false`
-- `description` (String) The description of the profile parcel
-- `enable_certificate_list_check` (Boolean) - Default value: `false`
-- `enable_certificate_list_check_variable` (String) Variable name
-- `feature_profile_id` (String) Feature Profile ID
-- `ikev2_anti_dos_threshold` (Number) Anti-DOS Threshold, Attribute conditional on `connection_type_ssl` being equal to `false`
- - Range: `10`-`1000`
- - Default value: `100`
-- `ikev2_anti_dos_threshold_variable` (String) Variable name
-- `ikev2_local_ike_identity_type` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
- - Choices: `EMAIL`, `FQDN`, `KEYID`, `IPv4 ADDRESS`, `IPv6 ADDRESS`
-- `ikev2_local_ike_identity_type_variable` (String) Variable name
-- `ikev2_local_ike_identity_value` (String) , Attribute conditional on `connection_type_ssl` being equal to `false`
-- `ikev2_local_ike_identity_value_variable` (String) Variable name
-- `ikev2_security_association_lifetime` (Number) Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`
- - Range: `3600`-`86400`
- - Default value: `86400`
-- `ikev2_security_association_lifetime_variable` (String) Variable name
-- `ipsec_anti_replay_window_size` (Number) security Association Lifetime, Attribute conditional on `ipsec_enable_anti_replay` being equal to `true`
- - Default value: `64`
-- `ipsec_anti_replay_window_size_variable` (String) Variable name
-- `ipsec_enable_anti_replay` (Boolean) Enable Anti-Replay, Attribute conditional on `connection_type_ssl` being equal to `false`
- - Default value: `true`
-- `ipsec_enable_anti_replay_variable` (String) Variable name
-- `ipsec_enable_perfect_foward_secrecy` (Boolean) security Association Lifetime, Attribute conditional on `connection_type_ssl` being equal to `false`
- - Default value: `false`
-- `ipsec_enable_perfect_foward_secrecy_variable` (String) Variable name
-- `ipsec_security_association_lifetime` (Number) Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`
- - Range: `3600`-`86400`
- - Default value: `3600`
-- `ipsec_security_association_lifetime_variable` (String) Variable name
-- `ipv4_pool_size` (Number) IPv4 Pool Size
- - Default value: `1000`
-- `ipv4_pool_size_variable` (String) Variable name
-- `ipv6_pool_size` (Number) IPv6 Pool Size
- - Default value: `1024`
-- `ipv6_pool_size_variable` (String) Variable name
-- `psk_authentication_pre_shared_key` (String) PSK Pre Shared Key, Attribute conditional on `psk_authentication_type` being equal to `group`
-- `psk_authentication_pre_shared_key_variable` (String) Variable name
-- `psk_authentication_type` (String) PSK Selection, Attribute conditional on `connection_type_ssl` being equal to `false`
- - Choices: `aaa`, `group`
-- `psk_authentication_type_variable` (String) Variable name
-- `radius_group_name_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_remote_access_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_security_feature.md b/docs/resources/system_security_feature.md
new file mode 100644
index 000000000..cb6b97194
--- /dev/null
+++ b/docs/resources/system_security_feature.md
@@ -0,0 +1,150 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_security_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System Security Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_security_feature (Resource)
+
+This resource can manage a System Security Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_security_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ rekey = 86400
+ anti_replay_window = "512"
+ extended_anti_replay_window = 256
+ ipsec_pairwise_keying = false
+ integrity_type = ["esp"]
+ keychains = [
+ {
+ key_chain_name = "aaa"
+ key_id = 1
+ }
+ ]
+ keys = [
+ {
+ id = 0
+ name = "aaa"
+ send_id = 1
+ receiver_id = 2
+ include_tcp_options = false
+ accept_ao_mismatch = false
+ crypto_algorithm = "aes-128-cmac"
+ key_string = "abcabc"
+ send_life_time_local = true
+ send_life_time_start_epoch = 1659284400
+ send_life_time_infinite = true
+ accept_life_time_local = true
+ accept_life_time_start_epoch = 1659284400
+ accept_life_time_infinite = true
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `anti_replay_window` (String) Set the sliding replay window size
+ - Choices: `64`, `128`, `256`, `512`, `1024`, `2048`, `4096`, `8192`
+ - Default value: `512`
+- `anti_replay_window_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `extended_anti_replay_window` (Number) Extended Anti-Replay Window
+ - Range: `10`-`2048`
+ - Default value: `256`
+- `extended_anti_replay_window_variable` (String) Variable name
+- `feature_profile_id` (String) Feature Profile ID
+- `integrity_type` (Set of String) Set the authentication type for DTLS connections
+- `integrity_type_variable` (String) Variable name
+- `ipsec_pairwise_keying` (Boolean) Enable or disable IPsec pairwise-keying
+ - Default value: `false`
+- `ipsec_pairwise_keying_variable` (String) Variable name
+- `keychains` (Attributes List) Configure a Keychain (see [below for nested schema](#nestedatt--keychains))
+- `keys` (Attributes List) Configure a Key (see [below for nested schema](#nestedatt--keys))
+- `rekey` (Number) Set how often to change the AES key for DTLS connections
+ - Range: `10`-`1209600`
+ - Default value: `86400`
+- `rekey_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `keychains`
+
+Optional:
+
+- `key_chain_name` (String) Specify the name of the Keychain
+- `key_id` (Number) Specify the Key ID
+ - Range: `0`-`2147483647`
+
+
+
+### Nested Schema for `keys`
+
+Optional:
+
+- `accept_ao_mismatch` (Boolean) Configure Accept AO Mismatch
+ - Default value: `false`
+- `accept_ao_mismatch_variable` (String) Variable name
+- `accept_life_time_duration` (Number) Send lifetime Duration (seconds)
+ - Range: `1`-`2147483646`
+- `accept_life_time_duration_variable` (String) Variable name
+- `accept_life_time_exact` (Number) Configure Key lifetime end time
+- `accept_life_time_infinite` (Boolean) Infinite lifetime
+- `accept_life_time_infinite_variable` (String) Variable name
+- `accept_life_time_local` (Boolean) Configure Send lifetime Local
+ - Default value: `false`
+- `accept_life_time_local_variable` (String) Variable name
+- `accept_life_time_start_epoch` (Number) Configure Key lifetime start time
+- `crypto_algorithm` (String) Crypto Algorithm
+ - Choices: `aes-128-cmac`, `hmac-sha-1`, `hmac-sha-256`
+- `id` (Number) Select the Key ID
+- `include_tcp_options` (Boolean) Configure Include TCP Options
+ - Default value: `false`
+- `include_tcp_options_variable` (String) Variable name
+- `key_string` (String) Specify the Key String
+- `key_string_variable` (String) Variable name
+- `name` (String) Select the chain name
+- `receiver_id` (Number) Specify the Receiver ID
+ - Range: `0`-`255`
+- `receiver_id_variable` (String) Variable name
+- `send_id` (Number) Specify the Send ID
+ - Range: `0`-`255`
+- `send_id_variable` (String) Variable name
+- `send_life_time_duration` (Number) Send lifetime Duration (seconds)
+ - Range: `1`-`2147483646`
+- `send_life_time_duration_variable` (String) Variable name
+- `send_life_time_exact` (Number) Configure Key lifetime end time
+- `send_life_time_infinite` (Boolean) Infinite lifetime
+- `send_life_time_infinite_variable` (String) Variable name
+- `send_life_time_local` (Boolean) Configure Send lifetime Local
+ - Default value: `false`
+- `send_life_time_local_variable` (String) Variable name
+- `send_life_time_start_epoch` (Number) Configure Key lifetime start time
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_security_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_security_profile_parcel.md b/docs/resources/system_security_profile_parcel.md
deleted file mode 100644
index e1731c646..000000000
--- a/docs/resources/system_security_profile_parcel.md
+++ /dev/null
@@ -1,150 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_security_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System Security profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_security_profile_parcel (Resource)
-
-This resource can manage a System Security profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_security_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- rekey = 86400
- anti_replay_window = "512"
- extended_anti_replay_window = 256
- ipsec_pairwise_keying = false
- integrity_type = ["esp"]
- keychains = [
- {
- key_chain_name = "aaa"
- key_id = 1
- }
- ]
- keys = [
- {
- id = 0
- name = "aaa"
- send_id = 1
- receiver_id = 2
- include_tcp_options = false
- accept_ao_mismatch = false
- crypto_algorithm = "aes-128-cmac"
- key_string = "abcabc"
- send_life_time_local = true
- send_life_time_start_epoch = 1659284400
- send_life_time_infinite = true
- accept_life_time_local = true
- accept_life_time_start_epoch = 1659284400
- accept_life_time_infinite = true
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `anti_replay_window` (String) Set the sliding replay window size
- - Choices: `64`, `128`, `256`, `512`, `1024`, `2048`, `4096`, `8192`
- - Default value: `512`
-- `anti_replay_window_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `extended_anti_replay_window` (Number) Extended Anti-Replay Window
- - Range: `10`-`2048`
- - Default value: `256`
-- `extended_anti_replay_window_variable` (String) Variable name
-- `feature_profile_id` (String) Feature Profile ID
-- `integrity_type` (Set of String) Set the authentication type for DTLS connections
-- `integrity_type_variable` (String) Variable name
-- `ipsec_pairwise_keying` (Boolean) Enable or disable IPsec pairwise-keying
- - Default value: `false`
-- `ipsec_pairwise_keying_variable` (String) Variable name
-- `keychains` (Attributes List) Configure a Keychain (see [below for nested schema](#nestedatt--keychains))
-- `keys` (Attributes List) Configure a Key (see [below for nested schema](#nestedatt--keys))
-- `rekey` (Number) Set how often to change the AES key for DTLS connections
- - Range: `10`-`1209600`
- - Default value: `86400`
-- `rekey_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `keychains`
-
-Optional:
-
-- `key_chain_name` (String) Specify the name of the Keychain
-- `key_id` (Number) Specify the Key ID
- - Range: `0`-`2147483647`
-
-
-
-### Nested Schema for `keys`
-
-Optional:
-
-- `accept_ao_mismatch` (Boolean) Configure Accept AO Mismatch
- - Default value: `false`
-- `accept_ao_mismatch_variable` (String) Variable name
-- `accept_life_time_duration` (Number) Send lifetime Duration (seconds)
- - Range: `1`-`2147483646`
-- `accept_life_time_duration_variable` (String) Variable name
-- `accept_life_time_exact` (Number) Configure Key lifetime end time
-- `accept_life_time_infinite` (Boolean) Infinite lifetime
-- `accept_life_time_infinite_variable` (String) Variable name
-- `accept_life_time_local` (Boolean) Configure Send lifetime Local
- - Default value: `false`
-- `accept_life_time_local_variable` (String) Variable name
-- `accept_life_time_start_epoch` (Number) Configure Key lifetime start time
-- `crypto_algorithm` (String) Crypto Algorithm
- - Choices: `aes-128-cmac`, `hmac-sha-1`, `hmac-sha-256`
-- `id` (Number) Select the Key ID
-- `include_tcp_options` (Boolean) Configure Include TCP Options
- - Default value: `false`
-- `include_tcp_options_variable` (String) Variable name
-- `key_string` (String) Specify the Key String
-- `key_string_variable` (String) Variable name
-- `name` (String) Select the chain name
-- `receiver_id` (Number) Specify the Receiver ID
- - Range: `0`-`255`
-- `receiver_id_variable` (String) Variable name
-- `send_id` (Number) Specify the Send ID
- - Range: `0`-`255`
-- `send_id_variable` (String) Variable name
-- `send_life_time_duration` (Number) Send lifetime Duration (seconds)
- - Range: `1`-`2147483646`
-- `send_life_time_duration_variable` (String) Variable name
-- `send_life_time_exact` (Number) Configure Key lifetime end time
-- `send_life_time_infinite` (Boolean) Infinite lifetime
-- `send_life_time_infinite_variable` (String) Variable name
-- `send_life_time_local` (Boolean) Configure Send lifetime Local
- - Default value: `false`
-- `send_life_time_local_variable` (String) Variable name
-- `send_life_time_start_epoch` (Number) Configure Key lifetime start time
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_security_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/system_snmp_feature.md b/docs/resources/system_snmp_feature.md
new file mode 100644
index 000000000..2c157be59
--- /dev/null
+++ b/docs/resources/system_snmp_feature.md
@@ -0,0 +1,194 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_system_snmp_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a System SNMP Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_system_snmp_feature (Resource)
+
+This resource can manage a System SNMP Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_system_snmp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ shutdown = false
+ contact_person = "wixie.cisco"
+ location_of_device = "SHANGHAI"
+ views = [
+ {
+ name = "VIEW1"
+ oids = [
+ {
+ id = "1.3.6.1.4.1.9.9.394"
+ exclude = false
+ }
+ ]
+ }
+ ]
+ communities = [
+ {
+ name = "example"
+ user_label = "COMMUNITY1"
+ view = "VIEW1"
+ authorization = "read-only"
+ }
+ ]
+ groups = [
+ {
+ name = "GROUP1"
+ security_level = "auth-priv"
+ view = "VIEW1"
+ }
+ ]
+ users = [
+ {
+ name = "USER1"
+ authentication_protocol = "sha"
+ authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
+ privacy_protocol = "aes-256-cfb-128"
+ privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
+ group = "GROUP1"
+ }
+ ]
+ trap_target_servers = [
+ {
+ vpn_id = 1
+ ip = "10.75.221.156"
+ port = 161
+ user_label = "TARGET1"
+ user = "USER1"
+ source_interface = "GigabitEthernet1"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `communities` (Attributes List) Configure SNMP community (see [below for nested schema](#nestedatt--communities))
+- `contact_person` (String) Set the contact for this managed node
+- `contact_person_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `feature_profile_id` (String) Feature Profile ID
+- `groups` (Attributes List) Configure an SNMP group (see [below for nested schema](#nestedatt--groups))
+- `location_of_device` (String) Set the physical location of this managed node
+- `location_of_device_variable` (String) Variable name
+- `shutdown` (Boolean) Enable or disable SNMP
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `trap_target_servers` (Attributes List) Configure SNMP server to receive SNMP traps (see [below for nested schema](#nestedatt--trap_target_servers))
+- `users` (Attributes List) Configure an SNMP user (see [below for nested schema](#nestedatt--users))
+- `views` (Attributes List) Configure a view record (see [below for nested schema](#nestedatt--views))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `communities`
+
+Optional:
+
+- `authorization` (String) Configure access permissions
+ - Choices: `read-only`, `read-write`
+- `authorization_variable` (String) Variable name
+- `name` (String) Set name of the SNMP community
+- `user_label` (String) Set user label of the SNMP community
+- `view` (String) Set name of the SNMP view
+- `view_variable` (String) Variable name
+
+
+
+### Nested Schema for `groups`
+
+Optional:
+
+- `name` (String) Name of the SNMP group
+- `security_level` (String) Configure security level
+ - Choices: `no-auth-no-priv`, `auth-no-priv`, `auth-priv`
+- `view` (String) Name of the SNMP view
+- `view_variable` (String) Variable name
+
+
+
+### Nested Schema for `trap_target_servers`
+
+Optional:
+
+- `ip` (String) Set IPv4/IPv6 address of SNMP server
+- `ip_variable` (String) Variable name
+- `port` (Number) Set UDP port number to connect to SNMP server
+ - Range: `1`-`65535`
+- `port_variable` (String) Variable name
+- `source_interface` (String) Source interface for outgoing SNMP traps
+- `source_interface_variable` (String) Variable name
+- `user` (String) Set name of the SNMP user
+- `user_label` (String) Set user label of the SNMP community
+- `user_variable` (String) Variable name
+- `vpn_id` (Number) Set VPN in which SNMP server is located
+ - Range: `0`-`65530`
+- `vpn_id_variable` (String) Variable name
+
+
+
+### Nested Schema for `users`
+
+Optional:
+
+- `authentication_password` (String) Specify authentication protocol password
+- `authentication_password_variable` (String) Variable name
+- `authentication_protocol` (String) Configure authentication protocol
+ - Choices: `sha`
+- `authentication_protocol_variable` (String) Variable name
+- `group` (String) Name of the SNMP group
+- `group_variable` (String) Variable name
+- `name` (String) Name of the SNMP user
+- `privacy_password` (String) Specify privacy protocol password
+- `privacy_password_variable` (String) Variable name
+- `privacy_protocol` (String) Configure privacy protocol
+ - Choices: `aes-cfb-128`, `aes-256-cfb-128`
+- `privacy_protocol_variable` (String) Variable name
+
+
+
+### Nested Schema for `views`
+
+Optional:
+
+- `name` (String) Set the name of the SNMP view
+- `oids` (Attributes List) Configure SNMP object identifier (see [below for nested schema](#nestedatt--views--oids))
+
+
+### Nested Schema for `views.oids`
+
+Optional:
+
+- `exclude` (Boolean) Exclude the OID
+ - Default value: `false`
+- `exclude_variable` (String) Variable name
+- `id` (String) Configure identifier of subtree of MIB objects
+- `id_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_system_snmp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/system_snmp_profile_parcel.md b/docs/resources/system_snmp_profile_parcel.md
deleted file mode 100644
index 540b23b36..000000000
--- a/docs/resources/system_snmp_profile_parcel.md
+++ /dev/null
@@ -1,194 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_system_snmp_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a System SNMP profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_system_snmp_profile_parcel (Resource)
-
-This resource can manage a System SNMP profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_system_snmp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- shutdown = false
- contact_person = "wixie.cisco"
- location_of_device = "SHANGHAI"
- views = [
- {
- name = "VIEW1"
- oids = [
- {
- id = "1.3.6.1.4.1.9.9.394"
- exclude = false
- }
- ]
- }
- ]
- communities = [
- {
- name = "example"
- user_label = "COMMUNITY1"
- view = "VIEW1"
- authorization = "read-only"
- }
- ]
- groups = [
- {
- name = "GROUP1"
- security_level = "auth-priv"
- view = "VIEW1"
- }
- ]
- users = [
- {
- name = "USER1"
- authentication_protocol = "sha"
- authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
- privacy_protocol = "aes-256-cfb-128"
- privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
- group = "GROUP1"
- }
- ]
- trap_target_servers = [
- {
- vpn_id = 1
- ip = "10.75.221.156"
- port = 161
- user_label = "TARGET1"
- user = "USER1"
- source_interface = "GigabitEthernet1"
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `communities` (Attributes List) Configure SNMP community (see [below for nested schema](#nestedatt--communities))
-- `contact_person` (String) Set the contact for this managed node
-- `contact_person_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `feature_profile_id` (String) Feature Profile ID
-- `groups` (Attributes List) Configure an SNMP group (see [below for nested schema](#nestedatt--groups))
-- `location_of_device` (String) Set the physical location of this managed node
-- `location_of_device_variable` (String) Variable name
-- `shutdown` (Boolean) Enable or disable SNMP
- - Default value: `false`
-- `shutdown_variable` (String) Variable name
-- `trap_target_servers` (Attributes List) Configure SNMP server to receive SNMP traps (see [below for nested schema](#nestedatt--trap_target_servers))
-- `users` (Attributes List) Configure an SNMP user (see [below for nested schema](#nestedatt--users))
-- `views` (Attributes List) Configure a view record (see [below for nested schema](#nestedatt--views))
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `communities`
-
-Optional:
-
-- `authorization` (String) Configure access permissions
- - Choices: `read-only`, `read-write`
-- `authorization_variable` (String) Variable name
-- `name` (String) Set name of the SNMP community
-- `user_label` (String) Set user label of the SNMP community
-- `view` (String) Set name of the SNMP view
-- `view_variable` (String) Variable name
-
-
-
-### Nested Schema for `groups`
-
-Optional:
-
-- `name` (String) Name of the SNMP group
-- `security_level` (String) Configure security level
- - Choices: `no-auth-no-priv`, `auth-no-priv`, `auth-priv`
-- `view` (String) Name of the SNMP view
-- `view_variable` (String) Variable name
-
-
-
-### Nested Schema for `trap_target_servers`
-
-Optional:
-
-- `ip` (String) Set IPv4/IPv6 address of SNMP server
-- `ip_variable` (String) Variable name
-- `port` (Number) Set UDP port number to connect to SNMP server
- - Range: `1`-`65535`
-- `port_variable` (String) Variable name
-- `source_interface` (String) Source interface for outgoing SNMP traps
-- `source_interface_variable` (String) Variable name
-- `user` (String) Set name of the SNMP user
-- `user_label` (String) Set user label of the SNMP community
-- `user_variable` (String) Variable name
-- `vpn_id` (Number) Set VPN in which SNMP server is located
- - Range: `0`-`65530`
-- `vpn_id_variable` (String) Variable name
-
-
-
-### Nested Schema for `users`
-
-Optional:
-
-- `authentication_password` (String) Specify authentication protocol password
-- `authentication_password_variable` (String) Variable name
-- `authentication_protocol` (String) Configure authentication protocol
- - Choices: `sha`
-- `authentication_protocol_variable` (String) Variable name
-- `group` (String) Name of the SNMP group
-- `group_variable` (String) Variable name
-- `name` (String) Name of the SNMP user
-- `privacy_password` (String) Specify privacy protocol password
-- `privacy_password_variable` (String) Variable name
-- `privacy_protocol` (String) Configure privacy protocol
- - Choices: `aes-cfb-128`, `aes-256-cfb-128`
-- `privacy_protocol_variable` (String) Variable name
-
-
-
-### Nested Schema for `views`
-
-Optional:
-
-- `name` (String) Set the name of the SNMP view
-- `oids` (Attributes List) Configure SNMP object identifier (see [below for nested schema](#nestedatt--views--oids))
-
-
-### Nested Schema for `views.oids`
-
-Optional:
-
-- `exclude` (Boolean) Exclude the OID
- - Default value: `false`
-- `exclude_variable` (String) Variable name
-- `id` (String) Configure identifier of subtree of MIB objects
-- `id_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_system_snmp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/tloc_list_policy_object.md b/docs/resources/tloc_list_policy_object.md
index 2b5d45715..635407f8b 100644
--- a/docs/resources/tloc_list_policy_object.md
+++ b/docs/resources/tloc_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_tloc_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a TLOC List Policy Object .
---
diff --git a/docs/resources/tls_ssl_decryption_policy_definition.md b/docs/resources/tls_ssl_decryption_policy_definition.md
index 5a3cef670..f14386edc 100644
--- a/docs/resources/tls_ssl_decryption_policy_definition.md
+++ b/docs/resources/tls_ssl_decryption_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_tls_ssl_decryption_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a TLS SSL Decryption Policy Definition .
---
diff --git a/docs/resources/tls_ssl_profile_policy_definition.md b/docs/resources/tls_ssl_profile_policy_definition.md
index 12efb7e41..513b01370 100644
--- a/docs/resources/tls_ssl_profile_policy_definition.md
+++ b/docs/resources/tls_ssl_profile_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_tls_ssl_profile_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a TLS SSL Profile Policy Definition .
---
diff --git a/docs/resources/traffic_data_policy_definition.md b/docs/resources/traffic_data_policy_definition.md
index f9d6be24f..979680d6c 100644
--- a/docs/resources/traffic_data_policy_definition.md
+++ b/docs/resources/traffic_data_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_traffic_data_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a Traffic Data Policy Definition .
---
@@ -99,8 +99,7 @@ Optional:
- Choices: `fecAdaptive`, `fecAlways`, `packetDuplication`
- `loss_correction_fec` (String) Loss correction FEC
- Choices: `fecAdaptive`, `fecAlways`, `packetDuplication`
-- `loss_correction_fec_threshold` (Number) Loss correction FEC threshold
- - Range: `1`-`5`
+- `loss_correction_fec_threshold` (String) Loss correction FEC threshold
- `loss_correction_packet_duplication` (String) Loss correction packet duplication
- Choices: `fecAdaptive`, `fecAlways`, `packetDuplication`
- `nat_parameters` (Attributes List) List of NAT parameters (see [below for nested schema](#nestedatt--sequences--action_entries--nat_parameters))
@@ -184,7 +183,7 @@ Optional:
Required:
- `type` (String) Type of match entry
- - Choices: `appList`, `dnsAppList`, `dns`, `dscp`, `packetLength`, `plp`, `protocol`, `sourceDataPrefixList`, `sourceIp`, `sourcePort`, `destinationDataPrefixList`, `destinationIp`, `destinationRegion`, `destinationPort`, `tcp`, `trafficTo`
+ - Choices: `appList`, `dnsAppList`, `dns`, `dscp`, `packetLength`, `plp`, `protocol`, `sourceDataPrefixList`, `sourceIp`, `sourcePort`, `destinationDataPrefixList`, `destinationIp`, `destinationRegion`, `destinationPort`, `tcp`, `trafficTo`, `icmpMessage`
Optional:
@@ -202,6 +201,7 @@ Optional:
- `dns_application_list_version` (Number) DNS Application list version
- `dscp` (Number) DSCP value
- Range: `0`-`63`
+- `icmp_message` (String) ICMP Message
- `packet_length` (Number) Packet length
- Range: `0`-`65535`
- `plp` (String) PLP
diff --git a/docs/resources/transport_feature_profile.md b/docs/resources/transport_feature_profile.md
index 18b33f02c..ea10cae1e 100644
--- a/docs/resources/transport_feature_profile.md
+++ b/docs/resources/transport_feature_profile.md
@@ -4,11 +4,13 @@ page_title: "sdwan_transport_feature_profile Resource - terraform-provider-sdwan
subcategory: "Feature Profiles"
description: |-
This resource can manage a Transport Feature Profile .
+ Minimum SD-WAN Manager version: 20.12.0
---
# sdwan_transport_feature_profile (Resource)
This resource can manage a Transport Feature Profile .
+ - Minimum SD-WAN Manager version: `20.12.0`
## Example Usage
diff --git a/docs/resources/transport_gps_feature.md b/docs/resources/transport_gps_feature.md
new file mode 100644
index 000000000..917c5eb00
--- /dev/null
+++ b/docs/resources/transport_gps_feature.md
@@ -0,0 +1,71 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_gps_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport GPS Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_gps_feature (Resource)
+
+This resource can manage a Transport GPS Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_gps_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ gps_enable = false
+ gps_mode = "ms-based"
+ nmea_enable = false
+ nmea_source_address = "1.2.3.4"
+ nmea_destination_address = "2.3.4.5"
+ nmea_destination_port = 22
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `gps_enable` (Boolean) Enable/disable GPS
+ - Default value: `false`
+- `gps_enable_variable` (String) Variable name
+- `gps_mode` (String) Select GPS mode
+ - Choices: `ms-based`, `standalone`
+ - Default value: `ms-based`
+- `gps_mode_variable` (String) Variable name
+- `nmea_destination_address` (String) Destination address
+- `nmea_destination_address_variable` (String) Variable name
+- `nmea_destination_port` (Number) Destination port
+ - Range: `1`-`65535`
+- `nmea_destination_port_variable` (String) Variable name
+- `nmea_enable` (Boolean) Enable/disable NMEA data
+ - Default value: `false`
+- `nmea_enable_variable` (String) Variable name
+- `nmea_source_address` (String) Source address
+- `nmea_source_address_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_gps_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_ipv6_tracker_feature.md b/docs/resources/transport_ipv6_tracker_feature.md
new file mode 100644
index 000000000..90891521b
--- /dev/null
+++ b/docs/resources/transport_ipv6_tracker_feature.md
@@ -0,0 +1,85 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_ipv6_tracker_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport IPv6 Tracker Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_ipv6_tracker_feature (Resource)
+
+This resource can manage a Transport IPv6 Tracker Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_ipv6_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `endpoint_api_url` (String) API url of endpoint
+- `endpoint_api_url_variable` (String) Variable name
+- `endpoint_dns_name` (String) Endpoint DNS Name
+- `endpoint_dns_name_variable` (String) Variable name
+- `endpoint_ip` (String) Endpoint IP
+- `endpoint_ip_variable` (String) Variable name
+- `endpoint_tracker_type` (String) Endpoint Tracker Type
+ - Choices: `ipv6-interface`
+ - Default value: `ipv6-interface`
+- `endpoint_tracker_type_variable` (String) Variable name
+- `interval` (Number) Interval
+ - Range: `20`-`600`
+ - Default value: `60`
+- `interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+ - Range: `1`-`10`
+ - Default value: `3`
+- `multiplier_variable` (String) Variable name
+- `threshold` (Number) Threshold
+ - Range: `100`-`1000`
+ - Default value: `300`
+- `threshold_variable` (String) Variable name
+- `tracker_name` (String) Tracker Name
+- `tracker_name_variable` (String) Variable name
+- `tracker_type` (String) Tracker Type
+ - Choices: `endpoint`
+ - Default value: `endpoint`
+- `tracker_type_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_ipv6_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_ipv6_tracker_group_feature.md b/docs/resources/transport_ipv6_tracker_group_feature.md
new file mode 100644
index 000000000..bf9a52a5d
--- /dev/null
+++ b/docs/resources/transport_ipv6_tracker_group_feature.md
@@ -0,0 +1,69 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_ipv6_tracker_group_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport IPv6 Tracker Group Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_ipv6_tracker_group_feature (Resource)
+
+This resource can manage a Transport IPv6 Tracker Group Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_ipv6_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_GROUP_1"
+ tracker_elements = [
+ {
+ tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ tracker_boolean = "or"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+- `tracker_name` (String) Tracker Name
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `tracker_boolean` (String) tracker ref list combine boolean and or
+ - Choices: `and`, `or`
+ - Default value: `or`
+- `tracker_boolean_variable` (String) Variable name
+- `tracker_elements` (Attributes List) trackers ref list (see [below for nested schema](#nestedatt--tracker_elements))
+- `tracker_name_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Optional:
+
+- `tracker_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_ipv6_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_ipv6_tracker_profile_parcel.md b/docs/resources/transport_ipv6_tracker_profile_parcel.md
deleted file mode 100644
index 07779c9b2..000000000
--- a/docs/resources/transport_ipv6_tracker_profile_parcel.md
+++ /dev/null
@@ -1,85 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_ipv6_tracker_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport IPv6 Tracker profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_ipv6_tracker_profile_parcel (Resource)
-
-This resource can manage a Transport IPv6 Tracker profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_ipv6_tracker_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- tracker_name = "TRACKER_1"
- endpoint_api_url = "google.com"
- endpoint_dns_name = "google.com"
- endpoint_ip = "2001:0:0:1::0"
- interval = 30
- multiplier = 3
- threshold = 300
- endpoint_tracker_type = "ipv6-interface"
- tracker_type = "endpoint"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `endpoint_api_url` (String) API url of endpoint
-- `endpoint_api_url_variable` (String) Variable name
-- `endpoint_dns_name` (String) Endpoint DNS Name
-- `endpoint_dns_name_variable` (String) Variable name
-- `endpoint_ip` (String) Endpoint IP
-- `endpoint_ip_variable` (String) Variable name
-- `endpoint_tracker_type` (String) Endpoint Tracker Type
- - Choices: `ipv6-interface`
- - Default value: `ipv6-interface`
-- `endpoint_tracker_type_variable` (String) Variable name
-- `interval` (Number) Interval
- - Range: `20`-`600`
- - Default value: `60`
-- `interval_variable` (String) Variable name
-- `multiplier` (Number) Multiplier
- - Range: `1`-`10`
- - Default value: `3`
-- `multiplier_variable` (String) Variable name
-- `threshold` (Number) Threshold
- - Range: `100`-`1000`
- - Default value: `300`
-- `threshold_variable` (String) Variable name
-- `tracker_name` (String) Tracker Name
-- `tracker_name_variable` (String) Variable name
-- `tracker_type` (String) Tracker Type
- - Choices: `endpoint`
- - Default value: `endpoint`
-- `tracker_type_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_ipv6_tracker_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_management_vpn_feature.md b/docs/resources/transport_management_vpn_feature.md
new file mode 100644
index 000000000..4e2dc4142
--- /dev/null
+++ b/docs/resources/transport_management_vpn_feature.md
@@ -0,0 +1,169 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_management_vpn_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Management VPN Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_management_vpn_feature (Resource)
+
+This resource can manage a Transport Management VPN Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_management_vpn_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ vpn_description = "example"
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ gateway = "next_hop"
+ next_hops = [
+ {
+ address = "2001:0:0:1::1"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `feature_profile_id` (String) Feature Profile ID
+- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
+- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
+- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
+- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
+- `primary_dns_address_ipv4_variable` (String) Variable name
+- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
+- `primary_dns_address_ipv6_variable` (String) Variable name
+- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
+- `secondary_dns_address_ipv4_variable` (String) Variable name
+- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
+- `secondary_dns_address_ipv6_variable` (String) Variable name
+- `vpn_description` (String) Name
+- `vpn_description_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_static_routes`
+
+Optional:
+
+- `administrative_distance` (Number) Administrative distance, Attribute conditional on `gateway` being equal to `null0`
+ - Range: `1`-`255`
+ - Default value: `1`
+- `administrative_distance_variable` (String) Variable name
+- `gateway` (String) Gateway
+ - Choices: `nextHop`, `dhcp`, `null0`
+ - Default value: `nextHop`
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_static_routes.next_hops`
+
+Optional:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+ - Range: `1`-`255`
+ - Default value: `1`
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_static_routes`
+
+Optional:
+
+- `gateway` (String) Gateway
+ - Choices: `next_hop`, `null0`, `nat`
+- `nat` (String) IPv6 Nat, Attribute conditional on `gateway` being equal to `nat`
+ - Choices: `NAT64`, `NAT66`
+- `nat_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `next_hop` (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
+- `null0` (Boolean) IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `null0`
+- `prefix` (String) Prefix
+- `prefix_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_static_routes.next_hops`
+
+Optional:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+ - Range: `1`-`254`
+ - Default value: `1`
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `new_host_mappings`
+
+Optional:
+
+- `host_name` (String) Hostname
+- `host_name_variable` (String) Variable name
+- `list_of_ip_addresses` (Set of String) List of IP
+- `list_of_ip_addresses_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_management_vpn_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_management_vpn_interface_ethernet_feature.md b/docs/resources/transport_management_vpn_interface_ethernet_feature.md
new file mode 100644
index 000000000..c5dbedf53
--- /dev/null
+++ b/docs/resources/transport_management_vpn_interface_ethernet_feature.md
@@ -0,0 +1,176 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_management_vpn_interface_ethernet_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Management VPN Interface Ethernet Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_management_vpn_interface_ethernet_feature (Resource)
+
+This resource can manage a Transport Management VPN Interface Ethernet Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_management_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "GigabitEthernet1"
+ interface_description = "Transport Management VPN Interface Ethernet"
+ ipv4_configuration_type = "static"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ ipv4_iperf_server = "example"
+ ipv4_auto_detect_bandwidth = false
+ ipv6_configuration_type = "static"
+ ipv6_address = "2001:0:0:1::/64"
+ arp_entries = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ duplex = "full"
+ mac_address = "00-B0-D0-63-C2-26"
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 505
+ speed = "2500"
+ arp_timeout = 1200
+ autonegotiate = false
+ media_type = "rj45"
+ load_interval = 30
+ icmp_redirect_disable = true
+ ip_directed_broadcast = false
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `arp_entries` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arp_entries))
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+ - Range: `0`-`2147483`
+ - Default value: `1200`
+- `arp_timeout_variable` (String) Variable name
+- `autonegotiate` (Boolean) Link autonegotiation
+- `autonegotiate_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `duplex` (String) Duplex mode
+ - Choices: `full`, `half`, `auto`
+- `duplex_variable` (String) Variable name
+- `enable_dhcpv6` (Boolean) Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`
+- `feature_profile_id` (String) Feature Profile ID
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+ - Default value: `true`
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU
+ - Range: `1500`-`9216`
+ - Default value: `1500`
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+ - Default value: `false`
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+ - Range: `576`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String) IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
+ - Default value: `false`
+- `ipv4_auto_detect_bandwidth_variable` (String) Variable name
+- `ipv4_configuration_type` (String) IPv4 Configuration Type
+ - Choices: `dynamic`, `static`
+- `ipv4_dhcp_distance` (Number) DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`
+ - Range: `1`-`65536`
+ - Default value: `1`
+- `ipv4_dhcp_distance_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `ipv4_iperf_server` (String) Iperf server for auto bandwidth detect
+- `ipv4_iperf_server_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask` (String) Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv6_address` (String) IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_configuration_type` (String) IPv6 Configuration Type
+ - Choices: `dynamic`, `static`, `none`
+- `load_interval` (Number) Interval for interface load calculation
+ - Range: `30`-`600`
+ - Default value: `30`
+- `load_interval_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+- `media_type` (String) Media type
+ - Choices: `auto-select`, `rj45`, `sfp`
+- `media_type_variable` (String) Variable name
+- `shutdown` (Boolean) - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+ - Choices: `10`, `100`, `1000`, `2500`, `10000`
+- `speed_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `transport_management_vpn_feature_id` (String) Transport Management VPN Feature ID
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arp_entries`
+
+Optional:
+
+- `ip_address` (String) IPV4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Optional:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_management_vpn_interface_ethernet_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_management_vpn_interface_ethernet_profile_parcel.md b/docs/resources/transport_management_vpn_interface_ethernet_profile_parcel.md
deleted file mode 100644
index 130e41482..000000000
--- a/docs/resources/transport_management_vpn_interface_ethernet_profile_parcel.md
+++ /dev/null
@@ -1,176 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_management_vpn_interface_ethernet_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport Management VPN Interface Ethernet profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_management_vpn_interface_ethernet_profile_parcel (Resource)
-
-This resource can manage a Transport Management VPN Interface Ethernet profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_management_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "GigabitEthernet1"
- interface_description = "Transport Management VPN Interface Ethernet"
- ipv4_configuration_type = "static"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helper = ["1.2.3.4"]
- ipv4_iperf_server = "example"
- ipv4_auto_detect_bandwidth = false
- ipv6_configuration_type = "static"
- ipv6_address = "2001:0:0:1::/64"
- arp_entries = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- duplex = "full"
- mac_address = "00-B0-D0-63-C2-26"
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 505
- speed = "2500"
- arp_timeout = 1200
- autonegotiate = false
- media_type = "rj45"
- load_interval = 30
- icmp_redirect_disable = true
- ip_directed_broadcast = false
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `arp_entries` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arp_entries))
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
- - Range: `0`-`2147483`
- - Default value: `1200`
-- `arp_timeout_variable` (String) Variable name
-- `autonegotiate` (Boolean) Link autonegotiation
-- `autonegotiate_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `duplex` (String) Duplex mode
- - Choices: `full`, `half`, `auto`
-- `duplex_variable` (String) Variable name
-- `enable_dhcpv6` (Boolean) Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`
-- `feature_profile_id` (String) Feature Profile ID
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
- - Default value: `true`
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU
- - Range: `1500`-`9216`
- - Default value: `1500`
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
- - Default value: `false`
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
- - Range: `576`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String) IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
- - Default value: `false`
-- `ipv4_auto_detect_bandwidth_variable` (String) Variable name
-- `ipv4_configuration_type` (String) IPv4 Configuration Type
- - Choices: `dynamic`, `static`
-- `ipv4_dhcp_distance` (Number) DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`
- - Range: `1`-`65536`
- - Default value: `1`
-- `ipv4_dhcp_distance_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `ipv4_iperf_server` (String) Iperf server for auto bandwidth detect
-- `ipv4_iperf_server_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask` (String) Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv6_address` (String) IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_configuration_type` (String) IPv6 Configuration Type
- - Choices: `dynamic`, `static`, `none`
-- `load_interval` (Number) Interval for interface load calculation
- - Range: `30`-`600`
- - Default value: `30`
-- `load_interval_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-- `media_type` (String) Media type
- - Choices: `auto-select`, `rj45`, `sfp`
-- `media_type_variable` (String) Variable name
-- `shutdown` (Boolean) - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `speed` (String) Set interface speed
- - Choices: `10`, `100`, `1000`, `2500`, `10000`
-- `speed_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `transport_management_vpn_profile_parcel_id` (String) Transport Management VPN Profile Parcel ID
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arp_entries`
-
-Optional:
-
-- `ip_address` (String) IPV4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Optional:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_management_vpn_interface_ethernet_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_management_vpn_profile_parcel.md b/docs/resources/transport_management_vpn_profile_parcel.md
deleted file mode 100644
index 103676e37..000000000
--- a/docs/resources/transport_management_vpn_profile_parcel.md
+++ /dev/null
@@ -1,170 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_management_vpn_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport Management VPN profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_management_vpn_profile_parcel (Resource)
-
-This resource can manage a Transport Management VPN profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_management_vpn_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- vpn_description = "example"
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- gateway = "next_hop"
- next_hops = [
- {
- address = "2001:0:0:1::1"
- administrative_distance = 1
- }
- ]
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `feature_profile_id` (String) Feature Profile ID
-- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
-- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
-- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
-- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
-- `primary_dns_address_ipv4_variable` (String) Variable name
-- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
-- `primary_dns_address_ipv6_variable` (String) Variable name
-- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
-- `secondary_dns_address_ipv4_variable` (String) Variable name
-- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
-- `secondary_dns_address_ipv6_variable` (String) Variable name
-- `vpn_description` (String) Name
-- `vpn_description_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `ipv4_static_routes`
-
-Optional:
-
-- `administrative_distance` (Number) Administrative distance, Attribute conditional on `gateway` being equal to `null0`
- - Range: `1`-`255`
- - Default value: `1`
-- `administrative_distance_variable` (String) Variable name
-- `gateway` (String) Gateway
- - Choices: `nextHop`, `dhcp`, `null0`
- - Default value: `nextHop`
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_static_routes.next_hops`
-
-Optional:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
- - Range: `1`-`255`
- - Default value: `1`
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_static_routes`
-
-Optional:
-
-- `gateway` (String) Gateway
- - Choices: `next_hop`, `null0`, `nat`
-- `nat` (String) IPv6 Nat, Attribute conditional on `gateway` being equal to `nat`
- - Choices: `NAT64`, `NAT66`
-- `nat_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `next_hop` (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
-- `null0` (Boolean) IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `null0`
-- `prefix` (String) Prefix
-- `prefix_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_static_routes.next_hops`
-
-Optional:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
- - Range: `1`-`254`
- - Default value: `1`
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `new_host_mappings`
-
-Optional:
-
-- `host_name` (String) Hostname
-- `host_name_variable` (String) Variable name
-- `list_of_ip_addresses` (Set of String) List of IP
-- `list_of_ip_addresses_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_management_vpn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_route_policy_feature.md b/docs/resources/transport_route_policy_feature.md
new file mode 100644
index 000000000..9c6f66721
--- /dev/null
+++ b/docs/resources/transport_route_policy_feature.md
@@ -0,0 +1,151 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_route_policy_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Route Policy Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_route_policy_feature (Resource)
+
+This resource can manage a Transport Route Policy Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_route_policy_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "accept"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "reject"
+ protocol = "IPV4"
+ actions = [
+ {
+ as_path_prepend = [65521]
+ community_additive = false
+ community = ["internet"]
+ local_preference = 100
+ metric = 20
+ metric_type = "type1"
+ omp_tag = 200
+ origin = "EGP"
+ ospf_tag = 1200
+ weight = 2200
+ ipv4_next_hop = "10.0.0.1"
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `default_action` (String) Default Action
+ - Choices: `reject`, `accept`
+ - Default value: `reject`
+- `description` (String) The description of the Feature
+- `sequences` (Attributes List) Route Policy List (see [below for nested schema](#nestedatt--sequences))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `sequences`
+
+Optional:
+
+- `actions` (Attributes List) Define list of actions (see [below for nested schema](#nestedatt--sequences--actions))
+- `base_action` (String) Base Action
+ - Choices: `reject`, `accept`
+ - Default value: `reject`
+- `id` (Number) Sequence Id
+ - Range: `1`-`65536`
+- `match_entries` (Attributes List) Define match conditions (see [below for nested schema](#nestedatt--sequences--match_entries))
+- `name` (String) Sequence Name
+- `protocol` (String) protocol such as IPV4, IPV6, or BOTH
+ - Choices: `IPV4`, `IPV6`, `BOTH`
+ - Default value: `IPV4`
+
+
+### Nested Schema for `sequences.actions`
+
+Optional:
+
+- `as_path_prepend` (Set of Number)
+- `community` (Set of String)
+- `community_additive` (Boolean) - Default value: `false`
+- `community_variable` (String) Variable name
+- `ipv4_next_hop` (String) Set Ipv4 Next Hop
+- `ipv6_next_hop` (String) Set Ipv6 Next Hop
+- `local_preference` (Number) Set Local Preference
+ - Range: `0`-`4294967295`
+- `metric` (Number) Set Metric
+ - Range: `0`-`4294967295`
+- `metric_type` (String) Set Metric Type
+ - Choices: `type1`, `type2`
+- `omp_tag` (Number) Set OMP Tag
+ - Range: `0`-`4294967295`
+- `origin` (String) Set Origin
+ - Choices: `EGP`, `IGP`, `Incomplete`
+- `ospf_tag` (Number) Set OSPF Tag
+ - Range: `0`-`4294967295`
+- `weight` (Number) Set Weight
+ - Range: `0`-`65535`
+
+
+
+### Nested Schema for `sequences.match_entries`
+
+Optional:
+
+- `as_path_list_id` (String)
+- `bgp_local_preference` (Number) BGP Local Preference
+ - Range: `0`-`4294967295`
+- `expanded_community_list_id` (String)
+- `extended_community_list_id` (String)
+- `ipv4_address_prefix_list_id` (String)
+- `ipv4_next_hop_prefix_list_id` (String)
+- `ipv6_address_prefix_list_id` (String)
+- `ipv6_next_hop_prefix_list_id` (String)
+- `metric` (Number) Select Metric
+ - Range: `0`-`4294967295`
+- `omp_tag` (Number) Select OMP Tag
+ - Range: `0`-`4294967295`
+- `ospf_tag` (Number) Select OSPF Tag
+ - Range: `0`-`4294967295`
+- `standard_community_list_criteria` (String) Select a condition such as OR, AND or EXACT
+ - Choices: `OR`, `AND`, `EXACT`
+- `standard_community_lists` (Attributes List) Select a standard community list (see [below for nested schema](#nestedatt--sequences--match_entries--standard_community_lists))
+
+
+### Nested Schema for `sequences.match_entries.standard_community_lists`
+
+Optional:
+
+- `id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_route_policy_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_routing_bgp_feature.md b/docs/resources/transport_routing_bgp_feature.md
new file mode 100644
index 000000000..777b5b67d
--- /dev/null
+++ b/docs/resources/transport_routing_bgp_feature.md
@@ -0,0 +1,462 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_bgp_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Routing BGP Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_routing_bgp_feature (Resource)
+
+This resource can manage a Transport Routing BGP Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_routing_bgp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ as_number = 429
+ router_id = "1.2.3.4"
+ propagate_as_path = false
+ propagate_community = false
+ external_routes_distance = 20
+ internal_routes_distance = 200
+ local_routes_distance = 20
+ keepalive_time = 60
+ hold_time = 180
+ always_compare_med = false
+ deterministic_med = false
+ missing_med_as_worst = false
+ compare_router_id = false
+ multipath_relax = false
+ ipv4_neighbors = [
+ {
+ address = "1.2.3.4"
+ description = "neighbor1"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 40
+ hold_time = 200
+ update_source_interface = "GigabitEthernet0"
+ next_hop_self = false
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 1
+ password = "myPassword"
+ send_label = true
+ explicit_null = false
+ as_override = false
+ allowas_in_number = 1
+ address_families = [
+ {
+ family_type = "ipv4-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv6_neighbors = [
+ {
+ address = "2001::1"
+ description = "neighbor2"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 180
+ hold_time = 60
+ update_source_interface = "Loopback1"
+ next_hop_self = true
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 3
+ password = "myPassword"
+ as_override = true
+ allowas_in_number = 3
+ address_families = [
+ {
+ family_type = "ipv6-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv4_aggregate_addresses = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv4_networks = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ }
+ ]
+ ipv4_eibgp_maximum_paths = 1
+ ipv4_originate = false
+ ipv4_table_map_filter = false
+ ipv6_aggregate_addresses = [
+ {
+ aggregate_prefix = "3001::1/128"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv6_networks = [
+ {
+ network_prefix = "2001:0DB8:0000:000b::/64"
+ }
+ ]
+ ipv6_eibgp_maximum_paths = 2
+ ipv6_originate = true
+ ipv6_table_map_filter = false
+ mpls_interfaces = [
+ {
+ interface_name = "GigabitEthernet1"
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `always_compare_med` (Boolean) Compare MEDs from all ASs when selecting active BGP paths
+ - Default value: `false`
+- `always_compare_med_variable` (String) Variable name
+- `as_number` (Number) Set autonomous system number <1..4294967295> or
+- `as_number_variable` (String) Variable name
+- `compare_router_id` (Boolean) Compare router IDs when selecting active BGP paths
+ - Default value: `false`
+- `compare_router_id_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `deterministic_med` (Boolean) Compare MEDs from all routes from same AS when selecting active BGP paths
+ - Default value: `false`
+- `deterministic_med_variable` (String) Variable name
+- `external_routes_distance` (Number) Set administrative distance for external BGP routes
+ - Range: `1`-`255`
+ - Default value: `20`
+- `external_routes_distance_variable` (String) Variable name
+- `feature_profile_id` (String) Feature Profile ID
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+ - Range: `0`-`65535`
+ - Default value: `180`
+- `hold_time_variable` (String) Variable name
+- `internal_routes_distance` (Number) Set administrative distance for internal BGP routes
+ - Range: `1`-`255`
+ - Default value: `200`
+- `internal_routes_distance_variable` (String) Variable name
+- `ipv4_aggregate_addresses` (Attributes List) Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv4_aggregate_addresses))
+- `ipv4_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+ - Range: `1`-`32`
+- `ipv4_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv4_neighbors` (Attributes List) Set BGP IPv4 neighbors (see [below for nested schema](#nestedatt--ipv4_neighbors))
+- `ipv4_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv4_networks))
+- `ipv4_originate` (Boolean) BGP Default Information Originate
+ - Default value: `false`
+- `ipv4_originate_variable` (String) Variable name
+- `ipv4_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv4_redistributes))
+- `ipv4_table_map_filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `ipv4_table_map_filter_variable` (String) Variable name
+- `ipv4_table_map_route_policy_id` (String)
+- `ipv6_aggregate_addresses` (Attributes List) IPv6 Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv6_aggregate_addresses))
+- `ipv6_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
+ - Range: `1`-`32`
+- `ipv6_eibgp_maximum_paths_variable` (String) Variable name
+- `ipv6_neighbors` (Attributes List) Set BGP IPv6 neighbors (see [below for nested schema](#nestedatt--ipv6_neighbors))
+- `ipv6_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv6_networks))
+- `ipv6_originate` (Boolean) BGP Default Information Originate
+ - Default value: `false`
+- `ipv6_originate_variable` (String) Variable name
+- `ipv6_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv6_redistributes))
+- `ipv6_table_map_filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `ipv6_table_map_filter_variable` (String) Variable name
+- `ipv6_table_map_route_policy_id` (String)
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+ - Range: `0`-`65535`
+ - Default value: `60`
+- `keepalive_time_variable` (String) Variable name
+- `local_routes_distance` (Number) Set administrative distance for local BGP routes
+ - Range: `1`-`255`
+ - Default value: `20`
+- `local_routes_distance_variable` (String) Variable name
+- `missing_med_as_worst` (Boolean) If path has no MED, consider it to be worst path when selecting active BGP paths
+ - Default value: `false`
+- `missing_med_as_worst_variable` (String) Variable name
+- `mpls_interfaces` (Attributes List) MPLS BGP Interface (see [below for nested schema](#nestedatt--mpls_interfaces))
+- `multipath_relax` (Boolean) Ignore AS for multipath selection
+ - Default value: `false`
+- `multipath_relax_variable` (String) Variable name
+- `propagate_as_path` (Boolean) Propagate AS Path
+ - Default value: `false`
+- `propagate_as_path_variable` (String) Variable name
+- `propagate_community` (Boolean) Propagate Community
+ - Default value: `false`
+- `propagate_community_variable` (String) Variable name
+- `router_id` (String) Configure BGP router identifier
+- `router_id_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_aggregate_addresses`
+
+Optional:
+
+- `as_set_path` (Boolean) Set AS set path information
+ - Default value: `false`
+- `as_set_path_variable` (String) Variable name
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+ - Default value: `false`
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_neighbors`
+
+Optional:
+
+- `address` (String) Set neighbor address
+- `address_families` (Attributes List) Set BGP address family (see [below for nested schema](#nestedatt--ipv4_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+ - Range: `1`-`10`
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+ - Default value: `false`
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+ - Range: `1`-`255`
+ - Default value: `1`
+- `ebgp_multihop_variable` (String) Variable name
+- `explicit_null` (Boolean) Send explicit null label
+ - Default value: `false`
+- `explicit_null_variable` (String) Variable name
+- `hold_time` (Number) Set how long to wait since receiving a keepalive message to consider BGP peer unavailable
+ - Range: `0`-`65535`
+ - Default value: `180`
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Set how often to advertise keepalive messages to BGP peer
+ - Range: `0`-`65535`
+ - Default value: `60`
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+ - Default value: `false`
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+ - Default value: `true`
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+ - Default value: `true`
+- `send_extended_community_variable` (String) Variable name
+- `send_label` (Boolean) Send label
+ - Default value: `false`
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_neighbors.address_families`
+
+Optional:
+
+- `family_type` (String) Set IPv4 unicast address family
+ - Choices: `ipv4-unicast`, `vpnv4-unicast`, `vpnv6-unicast`
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+ - Range: `1`-`4294967295`
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+ - Range: `1`-`65535`
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+ - Range: `1`-`100`
+ - Default value: `75`
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv4_networks`
+
+Optional:
+
+- `network_address` (String)
+- `network_address_variable` (String) Variable name
+- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_redistributes`
+
+Optional:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+ - Choices: `static`, `connected`, `ospf`, `ospfv3`, `nat`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `ipv6_aggregate_addresses`
+
+Optional:
+
+- `aggregate_prefix` (String) Configure the IPv6 prefixes to aggregate
+- `aggregate_prefix_variable` (String) Variable name
+- `as_set_path` (Boolean) Set AS set path information
+ - Default value: `false`
+- `as_set_path_variable` (String) Variable name
+- `summary_only` (Boolean) Filter out more specific routes from updates
+ - Default value: `false`
+- `summary_only_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_neighbors`
+
+Optional:
+
+- `address` (String) Set IPv6 neighbor address
+- `address_families` (Attributes List) Set IPv6 BGP address family (see [below for nested schema](#nestedatt--ipv6_neighbors--address_families))
+- `address_variable` (String) Variable name
+- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
+ - Range: `1`-`10`
+- `allowas_in_number_variable` (String) Variable name
+- `as_override` (Boolean) Override matching AS-number while sending update
+ - Default value: `false`
+- `as_override_variable` (String) Variable name
+- `description` (String) Set description
+- `description_variable` (String) Variable name
+- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
+ - Range: `1`-`255`
+ - Default value: `1`
+- `ebgp_multihop_variable` (String) Variable name
+- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
+ - Range: `0`-`65535`
+ - Default value: `180`
+- `hold_time_variable` (String) Variable name
+- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
+ - Range: `0`-`65535`
+ - Default value: `60`
+- `keepalive_time_variable` (String) Variable name
+- `local_as` (Number) Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
+- `local_as_variable` (String) Variable name
+- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
+ - Default value: `false`
+- `next_hop_self_variable` (String) Variable name
+- `password` (String) Set MD5 password on TCP connection with BGP peer
+- `password_variable` (String) Variable name
+- `remote_as` (Number) Set remote autonomous system number
+- `remote_as_variable` (String) Variable name
+- `send_community` (Boolean) Send community attribute
+ - Default value: `true`
+- `send_community_variable` (String) Variable name
+- `send_extended_community` (Boolean) Send extended community attribute
+ - Default value: `true`
+- `send_extended_community_variable` (String) Variable name
+- `shutdown` (Boolean) Enable or disable a BGP neighbor
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `update_source_interface` (String) Source interface name for BGP neighbor
+- `update_source_interface_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_neighbors.address_families`
+
+Optional:
+
+- `family_type` (String) Set IPv6 unicast address family
+ - Choices: `ipv6-unicast`, `vpnv6-unicast`
+- `in_route_policy_id` (String)
+- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
+ - Range: `1`-`4294967295`
+- `max_number_of_prefixes_variable` (String) Variable name
+- `out_route_policy_id` (String)
+- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
+- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
+ - Range: `1`-`65535`
+- `restart_interval_variable` (String) Variable name
+- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
+ - Range: `1`-`100`
+ - Default value: `75`
+- `threshold_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_networks`
+
+Optional:
+
+- `network_prefix` (String) Configure the prefixes for BGP to announce
+- `network_prefix_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_redistributes`
+
+Optional:
+
+- `protocol` (String) Set the protocol to redistribute routes from
+ - Choices: `static`, `connected`, `ospf`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `mpls_interfaces`
+
+Optional:
+
+- `interface_name` (String) Interface Name
+- `interface_name_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_routing_bgp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_routing_bgp_profile_parcel.md b/docs/resources/transport_routing_bgp_profile_parcel.md
deleted file mode 100644
index 13b68ef74..000000000
--- a/docs/resources/transport_routing_bgp_profile_parcel.md
+++ /dev/null
@@ -1,462 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_routing_bgp_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport Routing BGP profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_routing_bgp_profile_parcel (Resource)
-
-This resource can manage a Transport Routing BGP profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_routing_bgp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- as_number = 429
- router_id = "1.2.3.4"
- propagate_as_path = false
- propagate_community = false
- external_routes_distance = 20
- internal_routes_distance = 200
- local_routes_distance = 20
- keepalive_time = 60
- hold_time = 180
- always_compare_med = false
- deterministic_med = false
- missing_med_as_worst = false
- compare_router_id = false
- multipath_relax = false
- ipv4_neighbors = [
- {
- address = "1.2.3.4"
- description = "neighbor1"
- shutdown = false
- remote_as = 200
- local_as = 200
- keepalive_time = 40
- hold_time = 200
- update_source_interface = "GigabitEthernet0"
- next_hop_self = false
- send_community = true
- send_extended_community = true
- ebgp_multihop = 1
- password = "myPassword"
- send_label = true
- explicit_null = false
- as_override = false
- allowas_in_number = 1
- address_families = [
- {
- family_type = "ipv4-unicast"
- max_number_of_prefixes = 2000
- threshold = 75
- policy_type = "restart"
- restart_interval = 30
- }
- ]
- }
- ]
- ipv6_neighbors = [
- {
- address = "2001::1"
- description = "neighbor2"
- shutdown = false
- remote_as = 200
- local_as = 200
- keepalive_time = 180
- hold_time = 60
- update_source_interface = "Loopback1"
- next_hop_self = true
- send_community = true
- send_extended_community = true
- ebgp_multihop = 3
- password = "myPassword"
- as_override = true
- allowas_in_number = 3
- address_families = [
- {
- family_type = "ipv6-unicast"
- max_number_of_prefixes = 2000
- threshold = 75
- policy_type = "restart"
- restart_interval = 30
- }
- ]
- }
- ]
- ipv4_aggregate_addresses = [
- {
- network_address = "10.10.0.0"
- subnet_mask = "255.255.0.0"
- as_set_path = false
- summary_only = false
- }
- ]
- ipv4_networks = [
- {
- network_address = "10.10.0.0"
- subnet_mask = "255.255.0.0"
- }
- ]
- ipv4_eibgp_maximum_paths = 1
- ipv4_originate = false
- ipv4_table_map_filter = false
- ipv6_aggregate_addresses = [
- {
- aggregate_prefix = "3001::1/128"
- as_set_path = false
- summary_only = false
- }
- ]
- ipv6_networks = [
- {
- network_prefix = "2001:0DB8:0000:000b::/64"
- }
- ]
- ipv6_eibgp_maximum_paths = 2
- ipv6_originate = true
- ipv6_table_map_filter = false
- mpls_interfaces = [
- {
- interface_name = "GigabitEthernet1"
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `always_compare_med` (Boolean) Compare MEDs from all ASs when selecting active BGP paths
- - Default value: `false`
-- `always_compare_med_variable` (String) Variable name
-- `as_number` (Number) Set autonomous system number <1..4294967295> or
-- `as_number_variable` (String) Variable name
-- `compare_router_id` (Boolean) Compare router IDs when selecting active BGP paths
- - Default value: `false`
-- `compare_router_id_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `deterministic_med` (Boolean) Compare MEDs from all routes from same AS when selecting active BGP paths
- - Default value: `false`
-- `deterministic_med_variable` (String) Variable name
-- `external_routes_distance` (Number) Set administrative distance for external BGP routes
- - Range: `1`-`255`
- - Default value: `20`
-- `external_routes_distance_variable` (String) Variable name
-- `feature_profile_id` (String) Feature Profile ID
-- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
- - Range: `0`-`65535`
- - Default value: `180`
-- `hold_time_variable` (String) Variable name
-- `internal_routes_distance` (Number) Set administrative distance for internal BGP routes
- - Range: `1`-`255`
- - Default value: `200`
-- `internal_routes_distance_variable` (String) Variable name
-- `ipv4_aggregate_addresses` (Attributes List) Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv4_aggregate_addresses))
-- `ipv4_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
- - Range: `1`-`32`
-- `ipv4_eibgp_maximum_paths_variable` (String) Variable name
-- `ipv4_neighbors` (Attributes List) Set BGP IPv4 neighbors (see [below for nested schema](#nestedatt--ipv4_neighbors))
-- `ipv4_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv4_networks))
-- `ipv4_originate` (Boolean) BGP Default Information Originate
- - Default value: `false`
-- `ipv4_originate_variable` (String) Variable name
-- `ipv4_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv4_redistributes))
-- `ipv4_table_map_filter` (Boolean) Table map filtered or not
- - Default value: `false`
-- `ipv4_table_map_filter_variable` (String) Variable name
-- `ipv4_table_map_route_policy_id` (String)
-- `ipv6_aggregate_addresses` (Attributes List) IPv6 Aggregate prefixes in specific range (see [below for nested schema](#nestedatt--ipv6_aggregate_addresses))
-- `ipv6_eibgp_maximum_paths` (Number) Set maximum number of parallel IBGP paths for multipath load sharing
- - Range: `1`-`32`
-- `ipv6_eibgp_maximum_paths_variable` (String) Variable name
-- `ipv6_neighbors` (Attributes List) Set BGP IPv6 neighbors (see [below for nested schema](#nestedatt--ipv6_neighbors))
-- `ipv6_networks` (Attributes List) Configure the networks for BGP to advertise (see [below for nested schema](#nestedatt--ipv6_networks))
-- `ipv6_originate` (Boolean) BGP Default Information Originate
- - Default value: `false`
-- `ipv6_originate_variable` (String) Variable name
-- `ipv6_redistributes` (Attributes List) Redistribute routes into BGP (see [below for nested schema](#nestedatt--ipv6_redistributes))
-- `ipv6_table_map_filter` (Boolean) Table map filtered or not
- - Default value: `false`
-- `ipv6_table_map_filter_variable` (String) Variable name
-- `ipv6_table_map_route_policy_id` (String)
-- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
- - Range: `0`-`65535`
- - Default value: `60`
-- `keepalive_time_variable` (String) Variable name
-- `local_routes_distance` (Number) Set administrative distance for local BGP routes
- - Range: `1`-`255`
- - Default value: `20`
-- `local_routes_distance_variable` (String) Variable name
-- `missing_med_as_worst` (Boolean) If path has no MED, consider it to be worst path when selecting active BGP paths
- - Default value: `false`
-- `missing_med_as_worst_variable` (String) Variable name
-- `mpls_interfaces` (Attributes List) MPLS BGP Interface (see [below for nested schema](#nestedatt--mpls_interfaces))
-- `multipath_relax` (Boolean) Ignore AS for multipath selection
- - Default value: `false`
-- `multipath_relax_variable` (String) Variable name
-- `propagate_as_path` (Boolean) Propagate AS Path
- - Default value: `false`
-- `propagate_as_path_variable` (String) Variable name
-- `propagate_community` (Boolean) Propagate Community
- - Default value: `false`
-- `propagate_community_variable` (String) Variable name
-- `router_id` (String) Configure BGP router identifier
-- `router_id_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `ipv4_aggregate_addresses`
-
-Optional:
-
-- `as_set_path` (Boolean) Set AS set path information
- - Default value: `false`
-- `as_set_path_variable` (String) Variable name
-- `network_address` (String)
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-- `summary_only` (Boolean) Filter out more specific routes from updates
- - Default value: `false`
-- `summary_only_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_neighbors`
-
-Optional:
-
-- `address` (String) Set neighbor address
-- `address_families` (Attributes List) Set BGP address family (see [below for nested schema](#nestedatt--ipv4_neighbors--address_families))
-- `address_variable` (String) Variable name
-- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
- - Range: `1`-`10`
-- `allowas_in_number_variable` (String) Variable name
-- `as_override` (Boolean) Override matching AS-number while sending update
- - Default value: `false`
-- `as_override_variable` (String) Variable name
-- `description` (String) Set description
-- `description_variable` (String) Variable name
-- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
- - Range: `1`-`255`
- - Default value: `1`
-- `ebgp_multihop_variable` (String) Variable name
-- `explicit_null` (Boolean) Send explicit null label
- - Default value: `false`
-- `explicit_null_variable` (String) Variable name
-- `hold_time` (Number) Set how long to wait since receiving a keepalive message to consider BGP peer unavailable
- - Range: `0`-`65535`
- - Default value: `180`
-- `hold_time_variable` (String) Variable name
-- `keepalive_time` (Number) Set how often to advertise keepalive messages to BGP peer
- - Range: `0`-`65535`
- - Default value: `60`
-- `keepalive_time_variable` (String) Variable name
-- `local_as` (Number) Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
-- `local_as_variable` (String) Variable name
-- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
- - Default value: `false`
-- `next_hop_self_variable` (String) Variable name
-- `password` (String) Set MD5 password on TCP connection with BGP peer
-- `password_variable` (String) Variable name
-- `remote_as` (Number) Set remote autonomous system number
-- `remote_as_variable` (String) Variable name
-- `send_community` (Boolean) Send community attribute
- - Default value: `true`
-- `send_community_variable` (String) Variable name
-- `send_extended_community` (Boolean) Send extended community attribute
- - Default value: `true`
-- `send_extended_community_variable` (String) Variable name
-- `send_label` (Boolean) Send label
- - Default value: `false`
-- `shutdown` (Boolean) Enable or disable a BGP neighbor
- - Default value: `false`
-- `shutdown_variable` (String) Variable name
-- `update_source_interface` (String) Source interface name for BGP neighbor
-- `update_source_interface_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_neighbors.address_families`
-
-Optional:
-
-- `family_type` (String) Set IPv4 unicast address family
- - Choices: `ipv4-unicast`, `vpnv4-unicast`, `vpnv6-unicast`
-- `in_route_policy_id` (String)
-- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
- - Range: `1`-`4294967295`
-- `max_number_of_prefixes_variable` (String) Variable name
-- `out_route_policy_id` (String)
-- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
-- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
- - Range: `1`-`65535`
-- `restart_interval_variable` (String) Variable name
-- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
- - Range: `1`-`100`
- - Default value: `75`
-- `threshold_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv4_networks`
-
-Optional:
-
-- `network_address` (String)
-- `network_address_variable` (String) Variable name
-- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_redistributes`
-
-Optional:
-
-- `protocol` (String) Set the protocol to redistribute routes from
- - Choices: `static`, `connected`, `ospf`, `ospfv3`, `nat`
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-
-### Nested Schema for `ipv6_aggregate_addresses`
-
-Optional:
-
-- `aggregate_prefix` (String) Configure the IPv6 prefixes to aggregate
-- `aggregate_prefix_variable` (String) Variable name
-- `as_set_path` (Boolean) Set AS set path information
- - Default value: `false`
-- `as_set_path_variable` (String) Variable name
-- `summary_only` (Boolean) Filter out more specific routes from updates
- - Default value: `false`
-- `summary_only_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_neighbors`
-
-Optional:
-
-- `address` (String) Set IPv6 neighbor address
-- `address_families` (Attributes List) Set IPv6 BGP address family (see [below for nested schema](#nestedatt--ipv6_neighbors--address_families))
-- `address_variable` (String) Variable name
-- `allowas_in_number` (Number) The number of accept as-path with my AS present in it
- - Range: `1`-`10`
-- `allowas_in_number_variable` (String) Variable name
-- `as_override` (Boolean) Override matching AS-number while sending update
- - Default value: `false`
-- `as_override_variable` (String) Variable name
-- `description` (String) Set description
-- `description_variable` (String) Variable name
-- `ebgp_multihop` (Number) Set TTL value for peers that are not directly connected
- - Range: `1`-`255`
- - Default value: `1`
-- `ebgp_multihop_variable` (String) Variable name
-- `hold_time` (Number) Interval (seconds) not receiving a keepalive message declares a BGP peer down
- - Range: `0`-`65535`
- - Default value: `180`
-- `hold_time_variable` (String) Variable name
-- `keepalive_time` (Number) Interval (seconds) of keepalive messages sent to its BGP peer
- - Range: `0`-`65535`
- - Default value: `60`
-- `keepalive_time_variable` (String) Variable name
-- `local_as` (Number) Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.
-- `local_as_variable` (String) Variable name
-- `next_hop_self` (Boolean) Set router to be next hop for routes advertised to neighbor
- - Default value: `false`
-- `next_hop_self_variable` (String) Variable name
-- `password` (String) Set MD5 password on TCP connection with BGP peer
-- `password_variable` (String) Variable name
-- `remote_as` (Number) Set remote autonomous system number
-- `remote_as_variable` (String) Variable name
-- `send_community` (Boolean) Send community attribute
- - Default value: `true`
-- `send_community_variable` (String) Variable name
-- `send_extended_community` (Boolean) Send extended community attribute
- - Default value: `true`
-- `send_extended_community_variable` (String) Variable name
-- `shutdown` (Boolean) Enable or disable a BGP neighbor
- - Default value: `false`
-- `shutdown_variable` (String) Variable name
-- `update_source_interface` (String) Source interface name for BGP neighbor
-- `update_source_interface_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_neighbors.address_families`
-
-Optional:
-
-- `family_type` (String) Set IPv6 unicast address family
- - Choices: `ipv6-unicast`, `vpnv6-unicast`
-- `in_route_policy_id` (String)
-- `max_number_of_prefixes` (Number) Set maximum number of prefixes accepted from BGP peer
- - Range: `1`-`4294967295`
-- `max_number_of_prefixes_variable` (String) Variable name
-- `out_route_policy_id` (String)
-- `policy_type` (String) Neighbor received maximum prefix policy is disabled.
-- `restart_interval` (Number) Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded
- - Range: `1`-`65535`
-- `restart_interval_variable` (String) Variable name
-- `threshold` (Number) Set threshold(1 to 100) at which to generate a warning message
- - Range: `1`-`100`
- - Default value: `75`
-- `threshold_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_networks`
-
-Optional:
-
-- `network_prefix` (String) Configure the prefixes for BGP to announce
-- `network_prefix_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_redistributes`
-
-Optional:
-
-- `protocol` (String) Set the protocol to redistribute routes from
- - Choices: `static`, `connected`, `ospf`
-- `protocol_variable` (String) Variable name
-- `route_policy_id` (String)
-
-
-
-### Nested Schema for `mpls_interfaces`
-
-Optional:
-
-- `interface_name` (String) Interface Name
-- `interface_name_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_routing_bgp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_routing_ospf_feature.md b/docs/resources/transport_routing_ospf_feature.md
new file mode 100644
index 000000000..a4641f602
--- /dev/null
+++ b/docs/resources/transport_routing_ospf_feature.md
@@ -0,0 +1,254 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_ospf_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Routing OSPF Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_routing_ospf_feature (Resource)
+
+This resource can manage a Transport Routing OSPF Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_routing_ospf_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ redistributes = [
+ {
+ protocol = "static"
+ nat_dia = true
+ }
+ ]
+ router_lsas = [
+ {
+ type = "on-startup"
+ time = 5
+ }
+ ]
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ no_summary = false
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ designated_router_priority = 1
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "message-digest"
+ message_digest_key_id = 7
+ message_digest_key = "sdjfhsghbjdjr"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `areas` (Attributes List) Configure OSPF area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF
+ - Default value: `false`
+- `default_information_originate_always` (Boolean) Always advertise default route
+ - Default value: `false`
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+ - Range: `0`-`16777214`
+- `default_information_originate_metric_type` (String) Set default route type
+ - Choices: `type1`, `type2`
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance_external` (Number) Set distance for external routes
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_intra_area_variable` (String) Variable name
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+ - Range: `1`-`4294967`
+ - Default value: `100`
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+ - Default value: `true`
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsas` (Attributes List) Advertise own router LSA with infinite distance (see [below for nested schema](#nestedatt--router_lsas))
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+ - Range: `1`-`600000`
+ - Default value: `200`
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `1000`
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `10000`
+- `spf_maximum_hold_time_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Optional:
+
+- `area_number` (Number) Set OSPF area number
+ - Range: `0`-`4294967295`
+- `area_number_variable` (String) Variable name
+- `area_type` (String) set the area type
+ - Choices: `stub`, `nssa`
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject interarea routes into STUB or NSSA
+ - Default value: `false`
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Optional:
+
+- `authentication_type` (String) Set OSPF interface authentication type
+ - Choices: `message-digest`
+- `authentication_type_variable` (String) Variable name
+- `cost` (Number) Set cost of OSPF interface
+ - Range: `1`-`65535`
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+ - Range: `1`-`65535`
+ - Default value: `40`
+- `dead_interval_variable` (String) Variable name
+- `designated_router_priority` (Number) Set router’s priority to be elected as designated router
+ - Range: `0`-`255`
+ - Default value: `1`
+- `designated_router_priority_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+ - Range: `1`-`65535`
+ - Default value: `10`
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+ - Range: `1`-`65535`
+ - Default value: `5`
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `message_digest_key` (String) Set MD5 authentication key
+- `message_digest_key_id` (Number) Set MD5 message digest key
+ - Range: `1`-`255`
+- `message_digest_key_id_variable` (String) Variable name
+- `message_digest_key_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+ - Choices: `broadcast`, `point-to-point`, `non-broadcast`, `point-to-multipoint`
+ - Default value: `broadcast`
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+ - Default value: `false`
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Optional:
+
+- `cost` (Number) Set cost for this range
+ - Range: `0`-`16777214`
+- `cost_variable` (String) Variable name
+- `ip_address` (String) IP Address
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+ - Default value: `false`
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Optional:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+ - Default value: `true`
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+ - Choices: `static`, `connected`, `bgp`, `omp`, `nat`, `eigrp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+
+
+### Nested Schema for `router_lsas`
+
+Optional:
+
+- `time` (Number) Set how long to advertise maximum metric after router starts up
+ - Range: `5`-`86400`
+- `time_variable` (String) Variable name
+- `type` (String) Set the router LSA advertisement type
+ - Choices: `administrative`, `on-startup`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_routing_ospf_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_routing_ospfv3_ipv4_feature.md b/docs/resources/transport_routing_ospfv3_ipv4_feature.md
new file mode 100644
index 000000000..ec8ac56af
--- /dev/null
+++ b/docs/resources/transport_routing_ospfv3_ipv4_feature.md
@@ -0,0 +1,238 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_ospfv3_ipv4_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Routing OSPFv3 IPv4 Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_routing_ospfv3_ipv4_feature (Resource)
+
+This resource can manage a Transport Routing OSPFv3 IPv4 Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_routing_ospfv3_ipv4_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "nat-route"
+ nat_dia = true
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `areas` (Attributes List) Configure OSPFv3 IPv4 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+ - Range: `0`-`16777214`
+- `default_information_originate_metric_type` (String) Set default route metric type
+ - Choices: `type1`, `type2`
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+ - Range: `1`-`255`
+ - Default value: `110`
+- `distance_external` (Number) Set distance for external routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `filter_variable` (String) Variable name
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+ - Range: `1`-`4294967`
+ - Default value: `100`
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+ - Default value: `true`
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+ - Range: `5`-`86400`
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+ - Range: `1`-`600000`
+ - Default value: `200`
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `1000`
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `10000`
+- `spf_maximum_hold_time_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Optional:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+ - Range: `0`-`4294967295`
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+ - Choices: `stub`
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Optional:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+ - Range: `256`-`4294967295`
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+ - Choices: `no-auth`
+- `cost` (Number) Set cost of OSPF interface
+ - Range: `1`-`65535`
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+ - Range: `1`-`65535`
+ - Default value: `40`
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+ - Range: `1`-`65535`
+ - Default value: `10`
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+ - Range: `1`-`65535`
+ - Default value: `5`
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+ - Choices: `broadcast`, `point-to-point`, `non-broadcast`, `point-to-multipoint`
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+ - Default value: `false`
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Optional:
+
+- `cost` (Number) Set cost for this range
+ - Range: `0`-`16777214`
+- `cost_variable` (String) Variable name
+- `ip_address` (String)
+- `ip_address_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+ - Default value: `false`
+- `no_advertise_variable` (String) Variable name
+- `subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Optional:
+
+- `nat_dia` (Boolean) Enable NAT DIA for redistributed routes
+ - Default value: `true`
+- `nat_dia_variable` (String) Variable name
+- `protocol` (String) Set the protocol
+ - Choices: `connected`, `static`, `omp`, `nat-route`, `bgp`, `eigrp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_routing_ospfv3_ipv4_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_routing_ospfv3_ipv6_feature.md b/docs/resources/transport_routing_ospfv3_ipv6_feature.md
new file mode 100644
index 000000000..d958133fa
--- /dev/null
+++ b/docs/resources/transport_routing_ospfv3_ipv6_feature.md
@@ -0,0 +1,231 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_routing_ospfv3_ipv6_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Routing OSPFv3 IPv6 Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_routing_ospfv3_ipv6_feature (Resource)
+
+This resource can manage a Transport Routing OSPFv3 IPv6 Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_routing_ospfv3_ipv6_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "static"
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ prefix = "3002::/96"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `areas` (Attributes List) Configure OSPFv3 IPv6 area (see [below for nested schema](#nestedatt--areas))
+- `default_information_originate` (Boolean) Distribute default external route into OSPF disabled
+- `default_information_originate_always` (Boolean) Always advertise default route
+- `default_information_originate_always_variable` (String) Variable name
+- `default_information_originate_metric` (Number) Set metric used to generate default route <0..16777214>
+ - Range: `0`-`16777214`
+- `default_information_originate_metric_type` (String) Set default route metric type
+ - Choices: `type1`, `type2`
+- `default_information_originate_metric_type_variable` (String) Variable name
+- `default_information_originate_metric_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `distance` (Number) Distance
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_external` (Number) Set distance for external routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_external_variable` (String) Variable name
+- `distance_inter_area` (Number) Set distance for inter-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_inter_area_variable` (String) Variable name
+- `distance_intra_area` (Number) Set distance for intra-area routes
+ - Range: `1`-`254`
+ - Default value: `110`
+- `distance_intra_area_variable` (String) Variable name
+- `distance_variable` (String) Variable name
+- `filter` (Boolean) Table map filtered or not
+ - Default value: `false`
+- `filter_variable` (String) Variable name
+- `redistributes` (Attributes List) Redistribute routes (see [below for nested schema](#nestedatt--redistributes))
+- `reference_bandwidth` (Number) Set reference bandwidth method to assign OSPF cost
+ - Range: `1`-`4294967`
+ - Default value: `100`
+- `reference_bandwidth_variable` (String) Variable name
+- `rfc_1583_compatible` (Boolean) Calculate summary route cost based on RFC 1583
+ - Default value: `true`
+- `rfc_1583_compatible_variable` (String) Variable name
+- `route_policy_id` (String)
+- `router_id` (String) Set OSPF router ID to override system IP address
+- `router_id_variable` (String) Variable name
+- `router_lsa_action` (String) Not advertise maximum metric Router LSA policy by default
+- `router_lsa_on_startup_time` (Number) Set how long to advertise maximum metric after router boot up
+ - Range: `5`-`86400`
+- `router_lsa_on_startup_time_variable` (String) Variable name
+- `spf_calculation_delay` (Number) Set delay from first change received until performing SPF calculation
+ - Range: `1`-`600000`
+ - Default value: `200`
+- `spf_calculation_delay_variable` (String) Variable name
+- `spf_initial_hold_time` (Number) Set initial hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `1000`
+- `spf_initial_hold_time_variable` (String) Variable name
+- `spf_maximum_hold_time` (Number) Set maximum hold time between consecutive SPF calculations
+ - Range: `1`-`600000`
+ - Default value: `10000`
+- `spf_maximum_hold_time_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `areas`
+
+Optional:
+
+- `always_translate` (Boolean) Always translate type7 LSAs
+- `always_translate_variable` (String) Variable name
+- `area_number` (Number) Set OSPF area number
+ - Range: `0`-`4294967295`
+- `area_number_variable` (String) Variable name
+- `area_type` (String) stub area type
+ - Choices: `stub`
+- `interfaces` (Attributes List) Set OSPF interface parameters (see [below for nested schema](#nestedatt--areas--interfaces))
+- `no_summary` (Boolean) Do not inject inter-area routes
+- `no_summary_variable` (String) Variable name
+- `ranges` (Attributes List) Summarize OSPF routes at an area boundary (see [below for nested schema](#nestedatt--areas--ranges))
+
+
+### Nested Schema for `areas.interfaces`
+
+Optional:
+
+- `authentication_key` (String) Set OSPF interface authentication IPSEC key
+- `authentication_key_variable` (String) Variable name
+- `authentication_spi` (Number) Set OSPF interface authentication IPSec SPI, range 256..4294967295
+ - Range: `256`-`4294967295`
+- `authentication_spi_variable` (String) Variable name
+- `authentication_type` (String) No Authentication by default
+ - Choices: `no-auth`
+- `cost` (Number) Set cost of OSPF interface
+ - Range: `1`-`65535`
+- `cost_variable` (String) Variable name
+- `dead_interval` (Number) Set interval after which neighbor is declared to be down
+ - Range: `1`-`65535`
+ - Default value: `40`
+- `dead_interval_variable` (String) Variable name
+- `hello_interval` (Number) Set interval between OSPF hello packets
+ - Range: `1`-`65535`
+ - Default value: `10`
+- `hello_interval_variable` (String) Variable name
+- `lsa_retransmit_interval` (Number) Set time between retransmitting LSAs
+ - Range: `1`-`65535`
+ - Default value: `5`
+- `lsa_retransmit_interval_variable` (String) Variable name
+- `name` (String) Set interface name
+- `name_variable` (String) Variable name
+- `network_type` (String) Set the OSPF network type
+ - Choices: `broadcast`, `point-to-point`, `non-broadcast`, `point-to-multipoint`
+- `network_type_variable` (String) Variable name
+- `passive_interface` (Boolean) Set the interface to advertise its address, but not to actively run OSPF
+ - Default value: `false`
+- `passive_interface_variable` (String) Variable name
+
+
+
+### Nested Schema for `areas.ranges`
+
+Optional:
+
+- `cost` (Number) Set cost for this range
+ - Range: `0`-`16777214`
+- `cost_variable` (String) Variable name
+- `no_advertise` (Boolean) Do not advertise this range
+ - Default value: `false`
+- `no_advertise_variable` (String) Variable name
+- `prefix` (String) IPv6 prefix,for example 2001::/64
+- `prefix_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `redistributes`
+
+Optional:
+
+- `protocol` (String) Set the protocol
+ - Choices: `connected`, `static`, `omp`, `bgp`, `eigrp`
+- `protocol_variable` (String) Variable name
+- `route_policy_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_routing_ospfv3_ipv6_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_tracker_feature.md b/docs/resources/transport_tracker_feature.md
new file mode 100644
index 000000000..a1248fb57
--- /dev/null
+++ b/docs/resources/transport_tracker_feature.md
@@ -0,0 +1,85 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_tracker_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Tracker Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_tracker_feature (Resource)
+
+This resource can manage a Transport Tracker Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "interface"
+ tracker_type = "endpoint"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `endpoint_api_url` (String) API url of endpoint
+- `endpoint_api_url_variable` (String) Variable name
+- `endpoint_dns_name` (String) Endpoint DNS Name
+- `endpoint_dns_name_variable` (String) Variable name
+- `endpoint_ip` (String) Endpoint IP
+- `endpoint_ip_variable` (String) Variable name
+- `endpoint_tracker_type` (String) Endpoint Tracker Type
+ - Choices: `interface`
+ - Default value: `interface`
+- `endpoint_tracker_type_variable` (String) Variable name
+- `interval` (Number) Interval
+ - Range: `20`-`600`
+ - Default value: `60`
+- `interval_variable` (String) Variable name
+- `multiplier` (Number) Multiplier
+ - Range: `1`-`10`
+ - Default value: `3`
+- `multiplier_variable` (String) Variable name
+- `threshold` (Number) Threshold
+ - Range: `100`-`1000`
+ - Default value: `300`
+- `threshold_variable` (String) Variable name
+- `tracker_name` (String) Tracker Name
+- `tracker_name_variable` (String) Variable name
+- `tracker_type` (String) Tracker Type
+ - Choices: `endpoint`, `object`
+ - Default value: `endpoint`
+- `tracker_type_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_tracker_group_feature.md b/docs/resources/transport_tracker_group_feature.md
new file mode 100644
index 000000000..ecad17385
--- /dev/null
+++ b/docs/resources/transport_tracker_group_feature.md
@@ -0,0 +1,66 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_tracker_group_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport Tracker Group Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_tracker_group_feature (Resource)
+
+This resource can manage a Transport Tracker Group Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_elements = [
+ {
+ tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ tracker_boolean = "or"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `tracker_boolean` (String) tracker ref list combine boolean and or
+ - Choices: `and`, `or`
+ - Default value: `or`
+- `tracker_boolean_variable` (String) Variable name
+- `tracker_elements` (Attributes List) tracker parcel ref list (see [below for nested schema](#nestedatt--tracker_elements))
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tracker_elements`
+
+Optional:
+
+- `tracker_id` (String)
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_wan_vpn_feature.md b/docs/resources/transport_wan_vpn_feature.md
new file mode 100644
index 000000000..22d4f0bbe
--- /dev/null
+++ b/docs/resources/transport_wan_vpn_feature.md
@@ -0,0 +1,209 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport WAN VPN Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_wan_vpn_feature (Resource)
+
+This resource can manage a Transport WAN VPN Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_wan_vpn_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `description` (String) The description of the Feature
+- `enhance_ecmp_keying` (Boolean) Enhance ECMP Keying
+ - Default value: `false`
+- `enhance_ecmp_keying_variable` (String) Variable name
+- `feature_profile_id` (String) Feature Profile ID
+- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
+- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
+- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
+- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
+- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
+- `primary_dns_address_ipv4_variable` (String) Variable name
+- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
+- `primary_dns_address_ipv6_variable` (String) Variable name
+- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
+- `secondary_dns_address_ipv4_variable` (String) Variable name
+- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
+- `secondary_dns_address_ipv6_variable` (String) Variable name
+- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
+- `vpn` (Number) VPN
+ - Default value: `0`
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `ipv4_static_routes`
+
+Optional:
+
+- `administrative_distance` (Number) Administrative distance, Attribute conditional on `gateway` being equal to `null0`
+ - Range: `1`-`255`
+ - Default value: `1`
+- `administrative_distance_variable` (String) Variable name
+- `gateway` (String) Gateway
+ - Choices: `nextHop`, `dhcp`, `null0`
+ - Default value: `nextHop`
+- `network_address` (String) IP Address
+- `network_address_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+### Nested Schema for `ipv4_static_routes.next_hops`
+
+Optional:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+ - Range: `1`-`255`
+ - Default value: `1`
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `ipv6_static_routes`
+
+Optional:
+
+- `nat` (String) IPv6 Nat
+ - Choices: `NAT64`, `NAT66`
+- `nat_variable` (String) Variable name
+- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
+- `null0` (Boolean) IPv6 Route Gateway Next Hop
+- `prefix` (String) Prefix
+- `prefix_variable` (String) Variable name
+
+
+### Nested Schema for `ipv6_static_routes.next_hops`
+
+Optional:
+
+- `address` (String) Address
+- `address_variable` (String) Variable name
+- `administrative_distance` (Number) Administrative distance
+ - Range: `1`-`254`
+- `administrative_distance_variable` (String) Variable name
+
+
+
+
+### Nested Schema for `nat_64_v4_pools`
+
+Optional:
+
+- `nat64_v4_pool_name` (String) NAT64 v4 Pool Name
+- `nat64_v4_pool_name_variable` (String) Variable name
+- `nat64_v4_pool_overload` (Boolean) NAT64 Overload
+ - Default value: `false`
+- `nat64_v4_pool_overload_variable` (String) Variable name
+- `nat64_v4_pool_range_end` (String) NAT64 Pool Range End
+- `nat64_v4_pool_range_end_variable` (String) Variable name
+- `nat64_v4_pool_range_start` (String) NAT64 Pool Range Start
+- `nat64_v4_pool_range_start_variable` (String) Variable name
+
+
+
+### Nested Schema for `new_host_mappings`
+
+Optional:
+
+- `host_name` (String) Hostname
+- `host_name_variable` (String) Variable name
+- `list_of_ip_addresses` (Set of String) List of IP
+- `list_of_ip_addresses_variable` (String) Variable name
+
+
+
+### Nested Schema for `services`
+
+Optional:
+
+- `service_type` (String) Service Type
+ - Choices: `TE`
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_wan_vpn_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_wan_vpn_interface_cellular_feature.md b/docs/resources/transport_wan_vpn_interface_cellular_feature.md
new file mode 100644
index 000000000..5ac246c11
--- /dev/null
+++ b/docs/resources/transport_wan_vpn_interface_cellular_feature.md
@@ -0,0 +1,331 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_cellular_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport WAN VPN Interface Cellular Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_wan_vpn_interface_cellular_feature (Resource)
+
+This resource can manage a Transport WAN VPN Interface Cellular Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_wan_vpn_interface_cellular_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "GigabitEthernet1"
+ interface_description = "WAN"
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ service_provider = "example"
+ bandwidth_upstream = 21474836
+ bandwidth_downstream = 21474836
+ tunnel_interface = true
+ per_tunnel_qos = true
+ tunnel_qos_mode = "hub"
+ tunnel_bandwidth_percent = 82
+ tunnel_interface_bind_loopback_tunnel = "example"
+ tunnel_interface_carrier = "default"
+ tunnel_interface_color = "default"
+ tunnel_interface_hello_interval = 1000
+ tunnel_interface_hello_tolerance = 12
+ tunnel_interface_last_resort_circuit = false
+ tunnel_interface_color_restrict = true
+ tunnel_interface_groups = 42949672
+ tunnel_interface_border = false
+ tunnel_interface_max_control_connections = 62
+ tunnel_interface_nat_refresh_interval = 5
+ tunnel_interface_vbond_as_stun_server = false
+ tunnel_interface_exclude_controller_group_list = [2]
+ tunnel_interface_vmanage_connection_preference = 8
+ tunnel_interface_port_hop = true
+ tunnel_interface_low_bandwidth_link = false
+ tunnel_interface_tunnel_tcp_mss = 1460
+ tunnel_interface_clear_dont_fragment = false
+ tunnel_interface_network_broadcast = false
+ tunnel_interface_allow_all = false
+ tunnel_interface_allow_bgp = false
+ tunnel_interface_allow_dhcp = true
+ tunnel_interface_allow_ntp = false
+ tunnel_interface_allow_ssh = false
+ tunnel_interface_allow_dns = true
+ tunnel_interface_allow_icmp = true
+ tunnel_interface_allow_https = true
+ tunnel_interface_allow_ospf = false
+ tunnel_interface_allow_stun = false
+ tunnel_interface_allow_snmp = false
+ tunnel_interface_allow_netconf = false
+ tunnel_interface_allow_bfd = false
+ tunnel_interface_encapsulations = [
+ {
+ encapsulation = "gre"
+ preference = 4294967
+ weight = 250
+ }
+ ]
+ nat_ipv4 = true
+ nat_udp_timeout = 1
+ nat_tcp_timeout = 60
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 505
+ tloc_extension = "tloc"
+ tracker = "example"
+ ip_directed_broadcast = false
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
+- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
+ - Range: `1`-`2147483647`
+- `bandwidth_downstream_variable` (String) Variable name
+- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
+ - Range: `1`-`2147483647`
+- `bandwidth_upstream_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
+ - Range: `1500`-`9216`
+ - Default value: `1500`
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+ - Default value: `false`
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+ - Range: `576`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `nat_ipv4` (Boolean) Network Address Translation on this interface
+ - Default value: `false`
+- `nat_ipv4_variable` (String) Variable name
+- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
+ - Range: `1`-`8947`
+ - Default value: `60`
+- `nat_tcp_timeout_variable` (String) Variable name
+- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
+ - Range: `1`-`8947`
+ - Default value: `1`
+- `nat_udp_timeout_variable` (String) Variable name
+- `per_tunnel_qos` (Boolean) Per-tunnel Qos
+ - Default value: `false`
+- `per_tunnel_qos_variable` (String) Variable name
+- `qos_adaptive` (Boolean) Adaptive QoS
+ - Default value: `false`
+- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
+ - Default value: `false`
+- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
+ - Default value: `false`
+- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_default_downstream_variable` (String) Variable name
+- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_default_upstream_variable` (String) Variable name
+- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_max_downstream_variable` (String) Variable name
+- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_max_upstream_variable` (String) Variable name
+- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_min_downstream_variable` (String) Variable name
+- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_min_upstream_variable` (String) Variable name
+- `qos_adaptive_period` (Number) Adapt Period(Minutes)
+ - Range: `1`-`720`
+ - Default value: `15`
+- `qos_adaptive_period_variable` (String) Variable name
+- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
+ - Range: `8`-`100000000`
+- `qos_shaping_rate_variable` (String) Variable name
+- `service_provider` (String) Service Provider Name
+- `service_provider_variable` (String) Variable name
+- `shutdown` (Boolean) - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
+- `tloc_extension_variable` (String) Variable name
+- `tracker` (String) Enable tracker for this interface
+- `tracker_variable` (String) Variable name
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
+ - Range: `1`-`100`
+ - Default value: `50`
+- `tunnel_bandwidth_percent_variable` (String) Variable name
+- `tunnel_interface` (Boolean) Tunnel Interface on/off
+ - Default value: `false`
+- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
+ - Default value: `false`
+- `tunnel_interface_allow_all_variable` (String) Variable name
+- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
+ - Default value: `false`
+- `tunnel_interface_allow_bfd_variable` (String) Variable name
+- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
+ - Default value: `false`
+- `tunnel_interface_allow_bgp_variable` (String) Variable name
+- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
+ - Default value: `true`
+- `tunnel_interface_allow_dhcp_variable` (String) Variable name
+- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
+ - Default value: `true`
+- `tunnel_interface_allow_dns_variable` (String) Variable name
+- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
+ - Default value: `true`
+- `tunnel_interface_allow_https_variable` (String) Variable name
+- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
+ - Default value: `true`
+- `tunnel_interface_allow_icmp_variable` (String) Variable name
+- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
+ - Default value: `false`
+- `tunnel_interface_allow_netconf_variable` (String) Variable name
+- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
+ - Default value: `true`
+- `tunnel_interface_allow_ntp_variable` (String) Variable name
+- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
+ - Default value: `false`
+- `tunnel_interface_allow_ospf_variable` (String) Variable name
+- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
+ - Default value: `false`
+- `tunnel_interface_allow_snmp_variable` (String) Variable name
+- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
+ - Default value: `true`
+- `tunnel_interface_allow_ssh_variable` (String) Variable name
+- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
+ - Default value: `false`
+- `tunnel_interface_allow_stun_variable` (String) Variable name
+- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
+- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
+- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
+ - Default value: `false`
+- `tunnel_interface_border_variable` (String) Variable name
+- `tunnel_interface_carrier` (String) Set carrier for TLOC
+ - Choices: `default`, `carrier1`, `carrier2`, `carrier3`, `carrier4`, `carrier5`, `carrier6`, `carrier7`, `carrier8`
+ - Default value: `default`
+- `tunnel_interface_carrier_variable` (String) Variable name
+- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+ - Default value: `false`
+- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
+- `tunnel_interface_color` (String) Set color for TLOC
+ - Choices: `default`, `mpls`, `metro ethernet`, `biz internet`, `public internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
+ - Default value: `mpls`
+- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
+ - Default value: `false`
+- `tunnel_interface_color_restrict_variable` (String) Variable name
+- `tunnel_interface_color_variable` (String) Variable name
+- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
+- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
+- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
+- `tunnel_interface_groups` (Number) List of groups
+ - Range: `1`-`4294967295`
+- `tunnel_interface_groups_variable` (String) Variable name
+- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
+ - Range: `100`-`600000`
+ - Default value: `1000`
+- `tunnel_interface_hello_interval_variable` (String) Variable name
+- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
+ - Range: `12`-`6000`
+ - Default value: `12`
+- `tunnel_interface_hello_tolerance_variable` (String) Variable name
+- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
+ - Default value: `false`
+- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
+- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
+ - Default value: `false`
+- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
+- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
+ - Range: `0`-`100`
+- `tunnel_interface_max_control_connections_variable` (String) Variable name
+- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
+ - Range: `1`-`60`
+ - Default value: `5`
+- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
+- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
+ - Default value: `false`
+- `tunnel_interface_network_broadcast_variable` (String) Variable name
+- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
+ - Default value: `true`
+- `tunnel_interface_port_hop_variable` (String) Variable name
+- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
+- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
+ - Default value: `false`
+- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
+- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
+ - Range: `0`-`8`
+ - Default value: `5`
+- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
+- `tunnel_qos_mode` (String) Set tunnel QoS mode
+ - Choices: `hub`, `spoke`
+- `tunnel_qos_mode_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arps`
+
+Optional:
+
+- `ip_address` (String) IP V4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `tunnel_interface_encapsulations`
+
+Optional:
+
+- `encapsulation` (String) Encapsulation
+ - Choices: `gre`, `ipsec`
+- `preference` (Number) Set preference for TLOC
+ - Range: `0`-`4294967295`
+- `preference_variable` (String) Variable name
+- `weight` (Number) Set weight for TLOC
+ - Range: `1`-`255`
+ - Default value: `1`
+- `weight_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_wan_vpn_interface_cellular_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_wan_vpn_interface_cellular_profile_parcel.md b/docs/resources/transport_wan_vpn_interface_cellular_profile_parcel.md
deleted file mode 100644
index 2d97b6bdc..000000000
--- a/docs/resources/transport_wan_vpn_interface_cellular_profile_parcel.md
+++ /dev/null
@@ -1,331 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_cellular_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport WAN VPN Interface Cellular profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_wan_vpn_interface_cellular_profile_parcel (Resource)
-
-This resource can manage a Transport WAN VPN Interface Cellular profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "GigabitEthernet1"
- interface_description = "WAN"
- ipv4_dhcp_helper = ["1.2.3.4"]
- service_provider = "example"
- bandwidth_upstream = 21474836
- bandwidth_downstream = 21474836
- tunnel_interface = true
- per_tunnel_qos = true
- tunnel_qos_mode = "hub"
- tunnel_bandwidth_percent = 82
- tunnel_interface_bind_loopback_tunnel = "example"
- tunnel_interface_carrier = "default"
- tunnel_interface_color = "default"
- tunnel_interface_hello_interval = 1000
- tunnel_interface_hello_tolerance = 12
- tunnel_interface_last_resort_circuit = false
- tunnel_interface_color_restrict = true
- tunnel_interface_groups = 42949672
- tunnel_interface_border = false
- tunnel_interface_max_control_connections = 62
- tunnel_interface_nat_refresh_interval = 5
- tunnel_interface_vbond_as_stun_server = false
- tunnel_interface_exclude_controller_group_list = [2]
- tunnel_interface_vmanage_connection_preference = 8
- tunnel_interface_port_hop = true
- tunnel_interface_low_bandwidth_link = false
- tunnel_interface_tunnel_tcp_mss = 1460
- tunnel_interface_clear_dont_fragment = false
- tunnel_interface_network_broadcast = false
- tunnel_interface_allow_all = false
- tunnel_interface_allow_bgp = false
- tunnel_interface_allow_dhcp = true
- tunnel_interface_allow_ntp = false
- tunnel_interface_allow_ssh = false
- tunnel_interface_allow_dns = true
- tunnel_interface_allow_icmp = true
- tunnel_interface_allow_https = true
- tunnel_interface_allow_ospf = false
- tunnel_interface_allow_stun = false
- tunnel_interface_allow_snmp = false
- tunnel_interface_allow_netconf = false
- tunnel_interface_allow_bfd = false
- tunnel_interface_encapsulations = [
- {
- encapsulation = "gre"
- preference = 4294967
- weight = 250
- }
- ]
- nat_ipv4 = true
- nat_udp_timeout = 1
- nat_tcp_timeout = 60
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 505
- tloc_extension = "tloc"
- tracker = "example"
- ip_directed_broadcast = false
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
-- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
- - Range: `1`-`2147483647`
-- `bandwidth_downstream_variable` (String) Variable name
-- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
- - Range: `1`-`2147483647`
-- `bandwidth_upstream_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
- - Range: `1500`-`9216`
- - Default value: `1500`
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
- - Default value: `false`
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
- - Range: `576`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `nat_ipv4` (Boolean) Network Address Translation on this interface
- - Default value: `false`
-- `nat_ipv4_variable` (String) Variable name
-- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
- - Range: `1`-`8947`
- - Default value: `60`
-- `nat_tcp_timeout_variable` (String) Variable name
-- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
- - Range: `1`-`8947`
- - Default value: `1`
-- `nat_udp_timeout_variable` (String) Variable name
-- `per_tunnel_qos` (Boolean) Per-tunnel Qos
- - Default value: `false`
-- `per_tunnel_qos_variable` (String) Variable name
-- `qos_adaptive` (Boolean) Adaptive QoS
- - Default value: `false`
-- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
- - Default value: `false`
-- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
- - Default value: `false`
-- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_default_downstream_variable` (String) Variable name
-- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_default_upstream_variable` (String) Variable name
-- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_max_downstream_variable` (String) Variable name
-- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_max_upstream_variable` (String) Variable name
-- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_min_downstream_variable` (String) Variable name
-- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_min_upstream_variable` (String) Variable name
-- `qos_adaptive_period` (Number) Adapt Period(Minutes)
- - Range: `1`-`720`
- - Default value: `15`
-- `qos_adaptive_period_variable` (String) Variable name
-- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
- - Range: `8`-`100000000`
-- `qos_shaping_rate_variable` (String) Variable name
-- `service_provider` (String) Service Provider Name
-- `service_provider_variable` (String) Variable name
-- `shutdown` (Boolean) - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
-- `tloc_extension_variable` (String) Variable name
-- `tracker` (String) Enable tracker for this interface
-- `tracker_variable` (String) Variable name
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
- - Range: `1`-`100`
- - Default value: `50`
-- `tunnel_bandwidth_percent_variable` (String) Variable name
-- `tunnel_interface` (Boolean) Tunnel Interface on/off
- - Default value: `false`
-- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
- - Default value: `false`
-- `tunnel_interface_allow_all_variable` (String) Variable name
-- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
- - Default value: `false`
-- `tunnel_interface_allow_bfd_variable` (String) Variable name
-- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
- - Default value: `false`
-- `tunnel_interface_allow_bgp_variable` (String) Variable name
-- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
- - Default value: `true`
-- `tunnel_interface_allow_dhcp_variable` (String) Variable name
-- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
- - Default value: `true`
-- `tunnel_interface_allow_dns_variable` (String) Variable name
-- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
- - Default value: `true`
-- `tunnel_interface_allow_https_variable` (String) Variable name
-- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
- - Default value: `true`
-- `tunnel_interface_allow_icmp_variable` (String) Variable name
-- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
- - Default value: `false`
-- `tunnel_interface_allow_netconf_variable` (String) Variable name
-- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
- - Default value: `true`
-- `tunnel_interface_allow_ntp_variable` (String) Variable name
-- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
- - Default value: `false`
-- `tunnel_interface_allow_ospf_variable` (String) Variable name
-- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
- - Default value: `false`
-- `tunnel_interface_allow_snmp_variable` (String) Variable name
-- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
- - Default value: `true`
-- `tunnel_interface_allow_ssh_variable` (String) Variable name
-- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
- - Default value: `false`
-- `tunnel_interface_allow_stun_variable` (String) Variable name
-- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
-- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
-- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
- - Default value: `false`
-- `tunnel_interface_border_variable` (String) Variable name
-- `tunnel_interface_carrier` (String) Set carrier for TLOC
- - Choices: `default`, `carrier1`, `carrier2`, `carrier3`, `carrier4`, `carrier5`, `carrier6`, `carrier7`, `carrier8`
- - Default value: `default`
-- `tunnel_interface_carrier_variable` (String) Variable name
-- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
- - Default value: `false`
-- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
-- `tunnel_interface_color` (String) Set color for TLOC
- - Choices: `default`, `mpls`, `metro ethernet`, `biz internet`, `public internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
- - Default value: `mpls`
-- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
- - Default value: `false`
-- `tunnel_interface_color_restrict_variable` (String) Variable name
-- `tunnel_interface_color_variable` (String) Variable name
-- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
-- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
-- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
-- `tunnel_interface_groups` (Number) List of groups
- - Range: `1`-`4294967295`
-- `tunnel_interface_groups_variable` (String) Variable name
-- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
- - Range: `100`-`600000`
- - Default value: `1000`
-- `tunnel_interface_hello_interval_variable` (String) Variable name
-- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
- - Range: `12`-`6000`
- - Default value: `12`
-- `tunnel_interface_hello_tolerance_variable` (String) Variable name
-- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
- - Default value: `false`
-- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
-- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
- - Default value: `false`
-- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
-- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
- - Range: `0`-`100`
-- `tunnel_interface_max_control_connections_variable` (String) Variable name
-- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
- - Range: `1`-`60`
- - Default value: `5`
-- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
-- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
- - Default value: `false`
-- `tunnel_interface_network_broadcast_variable` (String) Variable name
-- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
- - Default value: `true`
-- `tunnel_interface_port_hop_variable` (String) Variable name
-- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
-- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
- - Default value: `false`
-- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
-- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
- - Range: `0`-`8`
- - Default value: `5`
-- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
-- `tunnel_qos_mode` (String) Set tunnel QoS mode
- - Choices: `hub`, `spoke`
-- `tunnel_qos_mode_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arps`
-
-Optional:
-
-- `ip_address` (String) IP V4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `tunnel_interface_encapsulations`
-
-Optional:
-
-- `encapsulation` (String) Encapsulation
- - Choices: `gre`, `ipsec`
-- `preference` (Number) Set preference for TLOC
- - Range: `0`-`4294967295`
-- `preference_variable` (String) Variable name
-- `weight` (Number) Set weight for TLOC
- - Range: `1`-`255`
- - Default value: `1`
-- `weight_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_wan_vpn_interface_cellular_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_wan_vpn_interface_ethernet_feature.md b/docs/resources/transport_wan_vpn_interface_ethernet_feature.md
new file mode 100644
index 000000000..1b61f3e40
--- /dev/null
+++ b/docs/resources/transport_wan_vpn_interface_ethernet_feature.md
@@ -0,0 +1,522 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_ethernet_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport WAN VPN Interface Ethernet Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_wan_vpn_interface_ethernet_feature (Resource)
+
+This resource can manage a Transport WAN VPN Interface Ethernet Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "GigabitEthernet1"
+ interface_description = "WAN"
+ ipv4_configuration_type = "static"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ ipv6_configuration_type = "static"
+ iperf_server = "example"
+ block_non_source_ip = false
+ service_provider = "example"
+ bandwidth_upstream = 21474836
+ bandwidth_downstream = 21474836
+ auto_detect_bandwidth = false
+ tunnel_interface = true
+ per_tunnel_qos = true
+ tunnel_qos_mode = "hub"
+ tunnel_bandwidth_percent = 82
+ tunnel_interface_bind_loopback_tunnel = "example"
+ tunnel_interface_carrier = "default"
+ tunnel_interface_color = "default"
+ tunnel_interface_hello_interval = 1000
+ tunnel_interface_hello_tolerance = 12
+ tunnel_interface_last_resort_circuit = false
+ tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"
+ tunnel_interface_color_restrict = true
+ tunnel_interface_groups = 42949672
+ tunnel_interface_border = false
+ tunnel_interface_max_control_connections = 62
+ tunnel_interface_nat_refresh_interval = 5
+ tunnel_interface_vbond_as_stun_server = false
+ tunnel_interface_exclude_controller_group_list = [2]
+ tunnel_interface_vmanage_connection_preference = 8
+ tunnel_interface_port_hop = true
+ tunnel_interface_low_bandwidth_link = false
+ tunnel_interface_tunnel_tcp_mss = 1460
+ tunnel_interface_clear_dont_fragment = false
+ tunnel_interface_cts_sgt_propagation = false
+ tunnel_interface_network_broadcast = false
+ tunnel_interface_allow_all = false
+ tunnel_interface_allow_bgp = false
+ tunnel_interface_allow_dhcp = true
+ tunnel_interface_allow_ntp = false
+ tunnel_interface_allow_ssh = false
+ tunnel_interface_allow_dns = true
+ tunnel_interface_allow_icmp = true
+ tunnel_interface_allow_https = true
+ tunnel_interface_allow_ospf = false
+ tunnel_interface_allow_stun = false
+ tunnel_interface_allow_snmp = false
+ tunnel_interface_allow_netconf = false
+ tunnel_interface_allow_bfd = false
+ tunnel_interface_encapsulations = [
+ {
+ encapsulation = "gre"
+ preference = 4294967
+ weight = 250
+ }
+ ]
+ nat_ipv4 = true
+ nat_type = "interface"
+ nat_udp_timeout = 1
+ nat_tcp_timeout = 60
+ new_static_nats = [
+ {
+ source_ip = "1.2.3.4"
+ translated_ip = "2.3.4.5"
+ direction = "inside"
+ source_vpn = 3
+ }
+ ]
+ nat_ipv6 = true
+ nat64 = false
+ nat66 = true
+ static_nat66 = [
+ {
+ source_prefix = "2001:0db8:85a3::/48"
+ translated_source_prefix = "abcd:1234:5678::/48"
+ source_vpn_id = 4
+ }
+ ]
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ icmp_redirect_disable = true
+ duplex = "full"
+ mac_address = "00-B0-D0-63-C2-26"
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 505
+ speed = "2500"
+ arp_timeout = 1200
+ autonegotiate = false
+ media_type = "rj45"
+ tloc_extension = "tloc"
+ gre_tunnel_source_ip = "1.2.3.4"
+ xconnect = "example"
+ load_interval = 30
+ tracker = "example"
+ ip_directed_broadcast = false
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
+ - Range: `0`-`2147483`
+ - Default value: `1200`
+- `arp_timeout_variable` (String) Variable name
+- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
+- `auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
+ - Default value: `false`
+- `auto_detect_bandwidth_variable` (String) Variable name
+- `autonegotiate` (Boolean) Link autonegotiation
+- `autonegotiate_variable` (String) Variable name
+- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
+ - Range: `1`-`2147483647`
+- `bandwidth_downstream_variable` (String) Variable name
+- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
+ - Range: `1`-`2147483647`
+- `bandwidth_upstream_variable` (String) Variable name
+- `block_non_source_ip` (Boolean) Block packets originating from IP address that is not from this source
+ - Default value: `false`
+- `block_non_source_ip_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `duplex` (String) Duplex mode
+ - Choices: `full`, `half`, `auto`
+- `duplex_variable` (String) Variable name
+- `enable_dhcpv6` (Boolean) Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`
+- `gre_tunnel_source_ip` (String) GRE tunnel source IP
+- `gre_tunnel_source_ip_variable` (String) Variable name
+- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
+ - Default value: `true`
+- `icmp_redirect_disable_variable` (String) Variable name
+- `interface_description` (String)
+- `interface_description_variable` (String) Variable name
+- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
+ - Range: `1500`-`9216`
+ - Default value: `1500`
+- `interface_mtu_variable` (String) Variable name
+- `interface_name` (String)
+- `interface_name_variable` (String) Variable name
+- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
+ - Default value: `false`
+- `ip_directed_broadcast_variable` (String) Variable name
+- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
+ - Range: `576`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `iperf_server` (String) Iperf server for auto bandwidth detect
+- `iperf_server_variable` (String) Variable name
+- `ipv4_address` (String) IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_configuration_type` (String) IPv4 Configuration Type
+ - Choices: `dynamic`, `static`
+- `ipv4_dhcp_distance` (Number) DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`
+ - Range: `1`-`65536`
+ - Default value: `1`
+- `ipv4_dhcp_distance_variable` (String) Variable name
+- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
+- `ipv4_dhcp_helper_variable` (String) Variable name
+- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
+- `ipv4_subnet_mask` (String) Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv6_address` (String) IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`
+- `ipv6_address_variable` (String) Variable name
+- `ipv6_configuration_type` (String) IPv6 Configuration Type
+ - Choices: `dynamic`, `static`, `none`
+- `ipv6_dhcp_secondary_address` (Attributes List) secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic` (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_address))
+- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
+- `load_interval` (Number) Interval for interface load calculation
+ - Range: `30`-`600`
+ - Default value: `30`
+- `load_interval_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+- `media_type` (String) Media type
+ - Choices: `auto-select`, `rj45`, `sfp`
+- `media_type_variable` (String) Variable name
+- `nat64` (Boolean) NAT64 on this interface
+ - Default value: `false`
+- `nat66` (Boolean) NAT66 on this interface
+ - Default value: `false`
+- `nat_ipv4` (Boolean) enable Network Address Translation on this interface
+ - Default value: `false`
+- `nat_ipv4_variable` (String) Variable name
+- `nat_ipv6` (Boolean) enable Network Address Translation ipv6 on this interface
+ - Default value: `false`
+- `nat_ipv6_variable` (String) Variable name
+- `nat_loopback` (String) NAT Inside Source Loopback Interface
+- `nat_loopback_variable` (String) Variable name
+- `nat_overload` (Boolean) NAT Overload
+ - Default value: `true`
+- `nat_overload_variable` (String) Variable name
+- `nat_prefix_length` (Number) NAT Pool Prefix Length
+ - Range: `1`-`32`
+- `nat_prefix_length_variable` (String) Variable name
+- `nat_range_end` (String) NAT Pool Range End
+- `nat_range_end_variable` (String) Variable name
+- `nat_range_start` (String) NAT Pool Range Start
+- `nat_range_start_variable` (String) Variable name
+- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
+ - Range: `1`-`8947`
+ - Default value: `60`
+- `nat_tcp_timeout_variable` (String) Variable name
+- `nat_type` (String) NAT Type
+ - Choices: `interface`, `pool`, `loopback`
+ - Default value: `interface`
+- `nat_type_variable` (String) Variable name
+- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
+ - Range: `1`-`8947`
+ - Default value: `1`
+- `nat_udp_timeout_variable` (String) Variable name
+- `new_static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--new_static_nats))
+- `per_tunnel_qos` (Boolean) Per-tunnel Qos
+ - Default value: `false`
+- `per_tunnel_qos_variable` (String) Variable name
+- `qos_adaptive` (Boolean) Adaptive QoS
+ - Default value: `false`
+- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
+ - Default value: `false`
+- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
+ - Default value: `false`
+- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_default_downstream_variable` (String) Variable name
+- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_default_upstream_variable` (String) Variable name
+- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_max_downstream_variable` (String) Variable name
+- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_max_upstream_variable` (String) Variable name
+- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_min_downstream_variable` (String) Variable name
+- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
+ - Range: `8`-`100000000`
+- `qos_adaptive_min_upstream_variable` (String) Variable name
+- `qos_adaptive_period` (Number) Adapt Period(Minutes)
+ - Range: `1`-`720`
+ - Default value: `15`
+- `qos_adaptive_period_variable` (String) Variable name
+- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
+ - Range: `8`-`100000000`
+- `qos_shaping_rate_variable` (String) Variable name
+- `service_provider` (String) Service Provider Name
+- `service_provider_variable` (String) Variable name
+- `shutdown` (Boolean) - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `speed` (String) Set interface speed
+ - Choices: `10`, `100`, `1000`, `2500`, `10000`
+- `speed_variable` (String) Variable name
+- `static_nat66` (Attributes List) static NAT66 (see [below for nested schema](#nestedatt--static_nat66))
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
+- `tloc_extension_variable` (String) Variable name
+- `tracker` (String) Enable tracker for this interface
+- `tracker_variable` (String) Variable name
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
+ - Range: `1`-`100`
+ - Default value: `50`
+- `tunnel_bandwidth_percent_variable` (String) Variable name
+- `tunnel_interface` (Boolean) Tunnel Interface on/off
+ - Default value: `false`
+- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
+ - Default value: `false`
+- `tunnel_interface_allow_all_variable` (String) Variable name
+- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
+ - Default value: `false`
+- `tunnel_interface_allow_bfd_variable` (String) Variable name
+- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
+ - Default value: `false`
+- `tunnel_interface_allow_bgp_variable` (String) Variable name
+- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
+ - Default value: `true`
+- `tunnel_interface_allow_dhcp_variable` (String) Variable name
+- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
+ - Default value: `true`
+- `tunnel_interface_allow_dns_variable` (String) Variable name
+- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
+ - Default value: `true`
+- `tunnel_interface_allow_https_variable` (String) Variable name
+- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
+ - Default value: `true`
+- `tunnel_interface_allow_icmp_variable` (String) Variable name
+- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
+ - Default value: `false`
+- `tunnel_interface_allow_netconf_variable` (String) Variable name
+- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
+ - Default value: `true`
+- `tunnel_interface_allow_ntp_variable` (String) Variable name
+- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
+ - Default value: `false`
+- `tunnel_interface_allow_ospf_variable` (String) Variable name
+- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
+ - Default value: `false`
+- `tunnel_interface_allow_snmp_variable` (String) Variable name
+- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
+ - Default value: `true`
+- `tunnel_interface_allow_ssh_variable` (String) Variable name
+- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
+ - Default value: `false`
+- `tunnel_interface_allow_stun_variable` (String) Variable name
+- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
+- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
+- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
+ - Default value: `false`
+- `tunnel_interface_border_variable` (String) Variable name
+- `tunnel_interface_carrier` (String) Set carrier for TLOC
+ - Choices: `default`, `carrier1`, `carrier2`, `carrier3`, `carrier4`, `carrier5`, `carrier6`, `carrier7`, `carrier8`
+ - Default value: `default`
+- `tunnel_interface_carrier_variable` (String) Variable name
+- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+ - Default value: `false`
+- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
+- `tunnel_interface_color` (String) Set color for TLOC
+ - Choices: `default`, `mpls`, `metro-ethernet`, `biz-internet`, `public-internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
+ - Default value: `mpls`
+- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
+ - Default value: `false`
+- `tunnel_interface_color_restrict_variable` (String) Variable name
+- `tunnel_interface_color_variable` (String) Variable name
+- `tunnel_interface_cts_sgt_propagation` (Boolean) CTS SGT Propagation configuration
+ - Default value: `false`
+- `tunnel_interface_cts_sgt_propagation_variable` (String) Variable name
+- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
+- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
+- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
+- `tunnel_interface_gre_tunnel_destination_ip` (String) GRE tunnel destination IP
+- `tunnel_interface_gre_tunnel_destination_ip_variable` (String) Variable name
+- `tunnel_interface_groups` (Number) List of groups
+ - Range: `1`-`4294967295`
+- `tunnel_interface_groups_variable` (String) Variable name
+- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
+ - Range: `100`-`600000`
+ - Default value: `1000`
+- `tunnel_interface_hello_interval_variable` (String) Variable name
+- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
+ - Range: `12`-`6000`
+ - Default value: `12`
+- `tunnel_interface_hello_tolerance_variable` (String) Variable name
+- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
+ - Default value: `false`
+- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
+- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
+ - Default value: `false`
+- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
+- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
+ - Range: `0`-`100`
+- `tunnel_interface_max_control_connections_variable` (String) Variable name
+- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
+ - Range: `1`-`60`
+ - Default value: `5`
+- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
+- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
+ - Default value: `false`
+- `tunnel_interface_network_broadcast_variable` (String) Variable name
+- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
+ - Default value: `true`
+- `tunnel_interface_port_hop_variable` (String) Variable name
+- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
+- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
+ - Default value: `false`
+- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
+- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
+ - Range: `0`-`8`
+ - Default value: `5`
+- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
+- `tunnel_qos_mode` (String) Set tunnel QoS mode
+ - Choices: `hub`, `spoke`
+- `tunnel_qos_mode_variable` (String) Variable name
+- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local WAN interface
+- `xconnect_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `arps`
+
+Optional:
+
+- `ip_address` (String) IP V4 Address
+- `ip_address_variable` (String) Variable name
+- `mac_address` (String) MAC Address
+- `mac_address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv4_secondary_addresses`
+
+Optional:
+
+- `address` (String) IpV4 Address
+- `address_variable` (String) Variable name
+- `subnet_mask` (String) Subnet Mask
+ - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `subnet_mask_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_dhcp_secondary_address`
+
+Optional:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `ipv6_secondary_addresses`
+
+Optional:
+
+- `address` (String) IPv6 Address Secondary
+- `address_variable` (String) Variable name
+
+
+
+### Nested Schema for `new_static_nats`
+
+Optional:
+
+- `direction` (String) Direction of static NAT translation
+ - Choices: `inside`, `outside`
+ - Default value: `inside`
+- `source_ip` (String) Source IP address to be translated
+- `source_ip_variable` (String) Variable name
+- `source_vpn` (Number) Source VPN ID
+ - Range: `0`-`65530`
+ - Default value: `0`
+- `source_vpn_variable` (String) Variable name
+- `translated_ip` (String) Statically translated source IP address
+- `translated_ip_variable` (String) Variable name
+
+
+
+### Nested Schema for `static_nat66`
+
+Optional:
+
+- `source_prefix` (String) Source Prefix
+- `source_prefix_variable` (String) Variable name
+- `source_vpn_id` (Number) Source VPN ID
+ - Range: `0`-`65530`
+- `source_vpn_id_variable` (String) Variable name
+- `translated_source_prefix` (String) Translated Source Prefix
+- `translated_source_prefix_variable` (String) Variable name
+
+
+
+### Nested Schema for `tunnel_interface_encapsulations`
+
+Optional:
+
+- `encapsulation` (String) Encapsulation
+ - Choices: `gre`, `ipsec`
+- `preference` (Number) Set preference for TLOC
+ - Range: `0`-`4294967295`
+- `preference_variable` (String) Variable name
+- `weight` (Number) Set weight for TLOC
+ - Range: `1`-`255`
+ - Default value: `1`
+- `weight_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_wan_vpn_interface_ethernet_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_wan_vpn_interface_ethernet_profile_parcel.md b/docs/resources/transport_wan_vpn_interface_ethernet_profile_parcel.md
deleted file mode 100644
index b67a34826..000000000
--- a/docs/resources/transport_wan_vpn_interface_ethernet_profile_parcel.md
+++ /dev/null
@@ -1,522 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport WAN VPN Interface Ethernet profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_wan_vpn_interface_ethernet_profile_parcel (Resource)
-
-This resource can manage a Transport WAN VPN Interface Ethernet profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "GigabitEthernet1"
- interface_description = "WAN"
- ipv4_configuration_type = "static"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helper = ["1.2.3.4"]
- ipv6_configuration_type = "static"
- iperf_server = "example"
- block_non_source_ip = false
- service_provider = "example"
- bandwidth_upstream = 21474836
- bandwidth_downstream = 21474836
- auto_detect_bandwidth = false
- tunnel_interface = true
- per_tunnel_qos = true
- tunnel_qos_mode = "hub"
- tunnel_bandwidth_percent = 82
- tunnel_interface_bind_loopback_tunnel = "example"
- tunnel_interface_carrier = "default"
- tunnel_interface_color = "default"
- tunnel_interface_hello_interval = 1000
- tunnel_interface_hello_tolerance = 12
- tunnel_interface_last_resort_circuit = false
- tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"
- tunnel_interface_color_restrict = true
- tunnel_interface_groups = 42949672
- tunnel_interface_border = false
- tunnel_interface_max_control_connections = 62
- tunnel_interface_nat_refresh_interval = 5
- tunnel_interface_vbond_as_stun_server = false
- tunnel_interface_exclude_controller_group_list = [2]
- tunnel_interface_vmanage_connection_preference = 8
- tunnel_interface_port_hop = true
- tunnel_interface_low_bandwidth_link = false
- tunnel_interface_tunnel_tcp_mss = 1460
- tunnel_interface_clear_dont_fragment = false
- tunnel_interface_cts_sgt_propagation = false
- tunnel_interface_network_broadcast = false
- tunnel_interface_allow_all = false
- tunnel_interface_allow_bgp = false
- tunnel_interface_allow_dhcp = true
- tunnel_interface_allow_ntp = false
- tunnel_interface_allow_ssh = false
- tunnel_interface_allow_dns = true
- tunnel_interface_allow_icmp = true
- tunnel_interface_allow_https = true
- tunnel_interface_allow_ospf = false
- tunnel_interface_allow_stun = false
- tunnel_interface_allow_snmp = false
- tunnel_interface_allow_netconf = false
- tunnel_interface_allow_bfd = false
- tunnel_interface_encapsulations = [
- {
- encapsulation = "gre"
- preference = 4294967
- weight = 250
- }
- ]
- nat_ipv4 = true
- nat_type = "interface"
- nat_udp_timeout = 1
- nat_tcp_timeout = 60
- new_static_nats = [
- {
- source_ip = "1.2.3.4"
- translated_ip = "2.3.4.5"
- direction = "inside"
- source_vpn = 3
- }
- ]
- nat_ipv6 = true
- nat64 = false
- nat66 = true
- static_nat66 = [
- {
- source_prefix = "2001:0db8:85a3::/48"
- translated_source_prefix = "abcd:1234:5678::/48"
- source_vpn_id = 4
- }
- ]
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- icmp_redirect_disable = true
- duplex = "full"
- mac_address = "00-B0-D0-63-C2-26"
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 505
- speed = "2500"
- arp_timeout = 1200
- autonegotiate = false
- media_type = "rj45"
- tloc_extension = "tloc"
- gre_tunnel_source_ip = "1.2.3.4"
- xconnect = "example"
- load_interval = 30
- tracker = "example"
- ip_directed_broadcast = false
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `arp_timeout` (Number) Timeout value for dynamically learned ARP entries, <0..2678400> seconds
- - Range: `0`-`2147483`
- - Default value: `1200`
-- `arp_timeout_variable` (String) Variable name
-- `arps` (Attributes List) Configure ARP entries (see [below for nested schema](#nestedatt--arps))
-- `auto_detect_bandwidth` (Boolean) Interface auto detect bandwidth
- - Default value: `false`
-- `auto_detect_bandwidth_variable` (String) Variable name
-- `autonegotiate` (Boolean) Link autonegotiation
-- `autonegotiate_variable` (String) Variable name
-- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
- - Range: `1`-`2147483647`
-- `bandwidth_downstream_variable` (String) Variable name
-- `bandwidth_upstream` (Number) Interface upstream bandwidth capacity, in kbps
- - Range: `1`-`2147483647`
-- `bandwidth_upstream_variable` (String) Variable name
-- `block_non_source_ip` (Boolean) Block packets originating from IP address that is not from this source
- - Default value: `false`
-- `block_non_source_ip_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `duplex` (String) Duplex mode
- - Choices: `full`, `half`, `auto`
-- `duplex_variable` (String) Variable name
-- `enable_dhcpv6` (Boolean) Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`
-- `gre_tunnel_source_ip` (String) GRE tunnel source IP
-- `gre_tunnel_source_ip_variable` (String) Variable name
-- `icmp_redirect_disable` (Boolean) ICMP/ICMPv6 Redirect Disable
- - Default value: `true`
-- `icmp_redirect_disable_variable` (String) Variable name
-- `interface_description` (String)
-- `interface_description_variable` (String) Variable name
-- `interface_mtu` (Number) Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes
- - Range: `1500`-`9216`
- - Default value: `1500`
-- `interface_mtu_variable` (String) Variable name
-- `interface_name` (String)
-- `interface_name_variable` (String) Variable name
-- `ip_directed_broadcast` (Boolean) IP Directed-Broadcast
- - Default value: `false`
-- `ip_directed_broadcast_variable` (String) Variable name
-- `ip_mtu` (Number) IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes
- - Range: `576`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `iperf_server` (String) Iperf server for auto bandwidth detect
-- `iperf_server_variable` (String) Variable name
-- `ipv4_address` (String) IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_configuration_type` (String) IPv4 Configuration Type
- - Choices: `dynamic`, `static`
-- `ipv4_dhcp_distance` (Number) DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`
- - Range: `1`-`65536`
- - Default value: `1`
-- `ipv4_dhcp_distance_variable` (String) Variable name
-- `ipv4_dhcp_helper` (Set of String) List of DHCP IPv4 helper addresses (min 1, max 8)
-- `ipv4_dhcp_helper_variable` (String) Variable name
-- `ipv4_secondary_addresses` (Attributes List) Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv4_secondary_addresses))
-- `ipv4_subnet_mask` (String) Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv6_address` (String) IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`
-- `ipv6_address_variable` (String) Variable name
-- `ipv6_configuration_type` (String) IPv6 Configuration Type
- - Choices: `dynamic`, `static`, `none`
-- `ipv6_dhcp_secondary_address` (Attributes List) secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic` (see [below for nested schema](#nestedatt--ipv6_dhcp_secondary_address))
-- `ipv6_secondary_addresses` (Attributes List) Static secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `static` (see [below for nested schema](#nestedatt--ipv6_secondary_addresses))
-- `load_interval` (Number) Interval for interface load calculation
- - Range: `30`-`600`
- - Default value: `30`
-- `load_interval_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-- `media_type` (String) Media type
- - Choices: `auto-select`, `rj45`, `sfp`
-- `media_type_variable` (String) Variable name
-- `nat64` (Boolean) NAT64 on this interface
- - Default value: `false`
-- `nat66` (Boolean) NAT66 on this interface
- - Default value: `false`
-- `nat_ipv4` (Boolean) enable Network Address Translation on this interface
- - Default value: `false`
-- `nat_ipv4_variable` (String) Variable name
-- `nat_ipv6` (Boolean) enable Network Address Translation ipv6 on this interface
- - Default value: `false`
-- `nat_ipv6_variable` (String) Variable name
-- `nat_loopback` (String) NAT Inside Source Loopback Interface
-- `nat_loopback_variable` (String) Variable name
-- `nat_overload` (Boolean) NAT Overload
- - Default value: `true`
-- `nat_overload_variable` (String) Variable name
-- `nat_prefix_length` (Number) NAT Pool Prefix Length
- - Range: `1`-`32`
-- `nat_prefix_length_variable` (String) Variable name
-- `nat_range_end` (String) NAT Pool Range End
-- `nat_range_end_variable` (String) Variable name
-- `nat_range_start` (String) NAT Pool Range Start
-- `nat_range_start_variable` (String) Variable name
-- `nat_tcp_timeout` (Number) Set NAT TCP session timeout, in minutes
- - Range: `1`-`8947`
- - Default value: `60`
-- `nat_tcp_timeout_variable` (String) Variable name
-- `nat_type` (String) NAT Type
- - Choices: `interface`, `pool`, `loopback`
- - Default value: `interface`
-- `nat_type_variable` (String) Variable name
-- `nat_udp_timeout` (Number) Set NAT UDP session timeout, in minutes
- - Range: `1`-`8947`
- - Default value: `1`
-- `nat_udp_timeout_variable` (String) Variable name
-- `new_static_nats` (Attributes List) static NAT (see [below for nested schema](#nestedatt--new_static_nats))
-- `per_tunnel_qos` (Boolean) Per-tunnel Qos
- - Default value: `false`
-- `per_tunnel_qos_variable` (String) Variable name
-- `qos_adaptive` (Boolean) Adaptive QoS
- - Default value: `false`
-- `qos_adaptive_bandwidth_downstream` (Boolean) Shaping Rate Downstream
- - Default value: `false`
-- `qos_adaptive_bandwidth_upstream` (Boolean) Shaping Rate Upstream
- - Default value: `false`
-- `qos_adaptive_default_downstream` (Number) Adaptive QoS default downstream bandwidth (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_default_downstream_variable` (String) Variable name
-- `qos_adaptive_default_upstream` (Number) Adaptive QoS default upstream bandwidth (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_default_upstream_variable` (String) Variable name
-- `qos_adaptive_max_downstream` (Number) Downstream max bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_max_downstream_variable` (String) Variable name
-- `qos_adaptive_max_upstream` (Number) Upstream max bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_max_upstream_variable` (String) Variable name
-- `qos_adaptive_min_downstream` (Number) Downstream min bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_min_downstream_variable` (String) Variable name
-- `qos_adaptive_min_upstream` (Number) Upstream min bandwidth limit (kbps)
- - Range: `8`-`100000000`
-- `qos_adaptive_min_upstream_variable` (String) Variable name
-- `qos_adaptive_period` (Number) Adapt Period(Minutes)
- - Range: `1`-`720`
- - Default value: `15`
-- `qos_adaptive_period_variable` (String) Variable name
-- `qos_shaping_rate` (Number) Shaping Rate (Kbps)
- - Range: `8`-`100000000`
-- `qos_shaping_rate_variable` (String) Variable name
-- `service_provider` (String) Service Provider Name
-- `service_provider_variable` (String) Variable name
-- `shutdown` (Boolean) - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `speed` (String) Set interface speed
- - Choices: `10`, `100`, `1000`, `2500`, `10000`
-- `speed_variable` (String) Variable name
-- `static_nat66` (Attributes List) static NAT66 (see [below for nested schema](#nestedatt--static_nat66))
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
-- `tloc_extension_variable` (String) Variable name
-- `tracker` (String) Enable tracker for this interface
-- `tracker_variable` (String) Variable name
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-- `tunnel_bandwidth_percent` (Number) Tunnels Bandwidth Percent
- - Range: `1`-`100`
- - Default value: `50`
-- `tunnel_bandwidth_percent_variable` (String) Variable name
-- `tunnel_interface` (Boolean) Tunnel Interface on/off
- - Default value: `false`
-- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
- - Default value: `false`
-- `tunnel_interface_allow_all_variable` (String) Variable name
-- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
- - Default value: `false`
-- `tunnel_interface_allow_bfd_variable` (String) Variable name
-- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
- - Default value: `false`
-- `tunnel_interface_allow_bgp_variable` (String) Variable name
-- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
- - Default value: `true`
-- `tunnel_interface_allow_dhcp_variable` (String) Variable name
-- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
- - Default value: `true`
-- `tunnel_interface_allow_dns_variable` (String) Variable name
-- `tunnel_interface_allow_https` (Boolean) Allow/Deny HTTPS
- - Default value: `true`
-- `tunnel_interface_allow_https_variable` (String) Variable name
-- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
- - Default value: `true`
-- `tunnel_interface_allow_icmp_variable` (String) Variable name
-- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
- - Default value: `false`
-- `tunnel_interface_allow_netconf_variable` (String) Variable name
-- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
- - Default value: `true`
-- `tunnel_interface_allow_ntp_variable` (String) Variable name
-- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
- - Default value: `false`
-- `tunnel_interface_allow_ospf_variable` (String) Variable name
-- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
- - Default value: `false`
-- `tunnel_interface_allow_snmp_variable` (String) Variable name
-- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
- - Default value: `true`
-- `tunnel_interface_allow_ssh_variable` (String) Variable name
-- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
- - Default value: `false`
-- `tunnel_interface_allow_stun_variable` (String) Variable name
-- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
-- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
-- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
- - Default value: `false`
-- `tunnel_interface_border_variable` (String) Variable name
-- `tunnel_interface_carrier` (String) Set carrier for TLOC
- - Choices: `default`, `carrier1`, `carrier2`, `carrier3`, `carrier4`, `carrier5`, `carrier6`, `carrier7`, `carrier8`
- - Default value: `default`
-- `tunnel_interface_carrier_variable` (String) Variable name
-- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
- - Default value: `false`
-- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
-- `tunnel_interface_color` (String) Set color for TLOC
- - Choices: `default`, `mpls`, `metro-ethernet`, `biz-internet`, `public-internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
- - Default value: `mpls`
-- `tunnel_interface_color_restrict` (Boolean) Restrict this TLOC behavior
- - Default value: `false`
-- `tunnel_interface_color_restrict_variable` (String) Variable name
-- `tunnel_interface_color_variable` (String) Variable name
-- `tunnel_interface_cts_sgt_propagation` (Boolean) CTS SGT Propagation configuration
- - Default value: `false`
-- `tunnel_interface_cts_sgt_propagation_variable` (String) Variable name
-- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
-- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list.
-- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
-- `tunnel_interface_gre_tunnel_destination_ip` (String) GRE tunnel destination IP
-- `tunnel_interface_gre_tunnel_destination_ip_variable` (String) Variable name
-- `tunnel_interface_groups` (Number) List of groups
- - Range: `1`-`4294967295`
-- `tunnel_interface_groups_variable` (String) Variable name
-- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
- - Range: `100`-`600000`
- - Default value: `1000`
-- `tunnel_interface_hello_interval_variable` (String) Variable name
-- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
- - Range: `12`-`6000`
- - Default value: `12`
-- `tunnel_interface_hello_tolerance_variable` (String) Variable name
-- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
- - Default value: `false`
-- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
-- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
- - Default value: `false`
-- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
-- `tunnel_interface_max_control_connections` (Number) Maximum Control Connections
- - Range: `0`-`100`
-- `tunnel_interface_max_control_connections_variable` (String) Variable name
-- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
- - Range: `1`-`60`
- - Default value: `5`
-- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
-- `tunnel_interface_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts
- - Default value: `false`
-- `tunnel_interface_network_broadcast_variable` (String) Variable name
-- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
- - Default value: `true`
-- `tunnel_interface_port_hop_variable` (String) Variable name
-- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
-- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
- - Default value: `false`
-- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
-- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
- - Range: `0`-`8`
- - Default value: `5`
-- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
-- `tunnel_qos_mode` (String) Set tunnel QoS mode
- - Choices: `hub`, `spoke`
-- `tunnel_qos_mode_variable` (String) Variable name
-- `xconnect` (String) Extend remote TLOC over a GRE tunnel to a local WAN interface
-- `xconnect_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `arps`
-
-Optional:
-
-- `ip_address` (String) IP V4 Address
-- `ip_address_variable` (String) Variable name
-- `mac_address` (String) MAC Address
-- `mac_address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv4_secondary_addresses`
-
-Optional:
-
-- `address` (String) IpV4 Address
-- `address_variable` (String) Variable name
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_dhcp_secondary_address`
-
-Optional:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `ipv6_secondary_addresses`
-
-Optional:
-
-- `address` (String) IPv6 Address Secondary
-- `address_variable` (String) Variable name
-
-
-
-### Nested Schema for `new_static_nats`
-
-Optional:
-
-- `direction` (String) Direction of static NAT translation
- - Choices: `inside`, `outside`
- - Default value: `inside`
-- `source_ip` (String) Source IP address to be translated
-- `source_ip_variable` (String) Variable name
-- `source_vpn` (Number) Source VPN ID
- - Range: `0`-`65530`
- - Default value: `0`
-- `source_vpn_variable` (String) Variable name
-- `translated_ip` (String) Statically translated source IP address
-- `translated_ip_variable` (String) Variable name
-
-
-
-### Nested Schema for `static_nat66`
-
-Optional:
-
-- `source_prefix` (String) Source Prefix
-- `source_prefix_variable` (String) Variable name
-- `source_vpn_id` (Number) Source VPN ID
- - Range: `0`-`65530`
-- `source_vpn_id_variable` (String) Variable name
-- `translated_source_prefix` (String) Translated Source Prefix
-- `translated_source_prefix_variable` (String) Variable name
-
-
-
-### Nested Schema for `tunnel_interface_encapsulations`
-
-Optional:
-
-- `encapsulation` (String) Encapsulation
- - Choices: `gre`, `ipsec`
-- `preference` (Number) Set preference for TLOC
- - Range: `0`-`4294967295`
-- `preference_variable` (String) Variable name
-- `weight` (Number) Set weight for TLOC
- - Range: `1`-`255`
- - Default value: `1`
-- `weight_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_wan_vpn_interface_gre_feature.md b/docs/resources/transport_wan_vpn_interface_gre_feature.md
new file mode 100644
index 000000000..589ccf148
--- /dev/null
+++ b/docs/resources/transport_wan_vpn_interface_gre_feature.md
@@ -0,0 +1,95 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_gre_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport WAN VPN Interface GRE Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_wan_vpn_interface_gre_feature (Resource)
+
+This resource can manage a Transport WAN VPN Interface GRE Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_wan_vpn_interface_gre_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "gre1"
+ interface_description = "gre1"
+ ipv4_address = "70.1.1.1"
+ ipv4_subnet_mask = "255.255.255.0"
+ shutdown = true
+ tunnel_source_ipv4_address = "78.1.1.1"
+ tunnel_destination_ipv4_address = "79.1.1.1"
+ ip_mtu = 1500
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ application_tunnel_type = "none"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+ - Choices: `none`, `sig`
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+ - Default value: `false`
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name` (String) Interface name (1..255)
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
+ - Range: `576`-`9976`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+ - Default value: `false`
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
+- `tunnel_route_via_loopback_variable` (String) Variable name
+- `tunnel_source_interface` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
+- `tunnel_source_interface_loopback_variable` (String) Variable name
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_wan_vpn_interface_gre_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_wan_vpn_interface_gre_profile_parcel.md b/docs/resources/transport_wan_vpn_interface_gre_profile_parcel.md
deleted file mode 100644
index 2749f81cd..000000000
--- a/docs/resources/transport_wan_vpn_interface_gre_profile_parcel.md
+++ /dev/null
@@ -1,95 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_gre_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport WAN VPN Interface GRE profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_wan_vpn_interface_gre_profile_parcel (Resource)
-
-This resource can manage a Transport WAN VPN Interface GRE profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "gre1"
- interface_description = "gre1"
- ipv4_address = "70.1.1.1"
- ipv4_subnet_mask = "255.255.255.0"
- shutdown = true
- tunnel_source_ipv4_address = "78.1.1.1"
- tunnel_destination_ipv4_address = "79.1.1.1"
- ip_mtu = 1500
- tcp_mss = 1460
- clear_dont_fragment = false
- application_tunnel_type = "none"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `interface_name` (String) Interface name (1..255)
-- `ipv4_address` (String)
-- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `name` (String) The name of the profile parcel
-- `tunnel_destination_ipv4_address` (String) Tunnel destination IP Address
-
-### Optional
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
- - Choices: `none`, `sig`
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
- - Default value: `false`
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <576..9976>, in bytes
- - Range: `576`-`9976`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `shutdown` (Boolean) Administrative state
- - Default value: `false`
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_route_via_loopback` (String) <1..32 characters> Interface name, can't be Loopback interface
-- `tunnel_route_via_loopback_variable` (String) Variable name
-- `tunnel_source_interface` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback` (String) <1..32 characters> Interface name
-- `tunnel_source_interface_loopback_variable` (String) Variable name
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address` (String) Tunnel source IP Address
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_wan_vpn_interface_gre_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_wan_vpn_interface_ipsec_feature.md b/docs/resources/transport_wan_vpn_interface_ipsec_feature.md
new file mode 100644
index 000000000..d8fe0e1e5
--- /dev/null
+++ b/docs/resources/transport_wan_vpn_interface_ipsec_feature.md
@@ -0,0 +1,166 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_ipsec_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport WAN VPN Interface IPSEC Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_wan_vpn_interface_ipsec_feature (Resource)
+
+This resource can manage a Transport WAN VPN Interface IPSEC Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_wan_vpn_interface_ipsec_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "ipsec987"
+ shutdown = true
+ interface_description = "ipsec987"
+ ipv4_address = "9.7.5.4"
+ ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_ipv4_address = "1.3.5.88"
+ tunnel_source_ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_interface = "GigabitEthernet8"
+ tunnel_destination_ipv4_address = "2.55.67.99"
+ tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
+ application_tunnel_type = "none"
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ ip_mtu = 1500
+ dpd_interval = 10
+ dpd_retries = 3
+ ike_preshared_key = "123"
+ ike_version = 1
+ ike_integrity_protocol = "main"
+ ike_rekey_interval = 14400
+ ike_ciphersuite = "aes256-cbc-sha1"
+ ike_diffie_hellman_group = "16"
+ ike_id_local_end_point = "xxx"
+ ike_id_remote_end_point = "xxx"
+ ipsec_rekey_interval = 3600
+ ipsec_replay_window = 512
+ ipsec_ciphersuite = "aes256-gcm"
+ perfect_forward_secrecy = "group-16"
+ tunnel_route_via = "2222"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `application_tunnel_type` (String) Enable Application Tunnel Type
+ - Choices: `none`, `sig`
+- `application_tunnel_type_variable` (String) Variable name
+- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+ - Default value: `false`
+- `clear_dont_fragment_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `dpd_interval` (Number) IKE keepalive interval (seconds)
+ - Range: `10`-`3600`
+ - Default value: `10`
+- `dpd_interval_variable` (String) Variable name
+- `dpd_retries` (Number) IKE keepalive retries
+ - Range: `2`-`60`
+ - Default value: `3`
+- `dpd_retries_variable` (String) Variable name
+- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
+ - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha2`, `aes128-cbc-sha1`, `aes128-cbc-sha2`
+ - Default value: `aes256-cbc-sha1`
+- `ike_ciphersuite_variable` (String) Variable name
+- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
+ - Choices: `2`, `14`, `15`, `16`, `19`, `20`, `21`, `24`
+ - Default value: `16`
+- `ike_diffie_hellman_group_variable` (String) Variable name
+- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_local_end_point_variable` (String) Variable name
+- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
+- `ike_id_remote_end_point_variable` (String) Variable name
+- `ike_integrity_protocol` (String) IKE integrity protocol
+ - Choices: `main`, `aggressive`
+ - Default value: `main`
+- `ike_integrity_protocol_variable` (String) Variable name
+- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
+- `ike_preshared_key_variable` (String) Variable name
+- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
+ - Range: `60`-`86400`
+ - Default value: `14400`
+- `ike_rekey_interval_variable` (String) Variable name
+- `ike_version` (Number) IKE Version <1..2>
+ - Range: `1`-`2`
+ - Default value: `1`
+- `interface_description` (String) Interface description
+- `interface_description_variable` (String) Variable name
+- `interface_name` (String) Interface name: IPsec when present
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
+ - Range: `68`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
+ - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha384`, `aes256-cbc-sha256`, `aes256-cbc-sha512`, `aes256-gcm`, `null-sha1`, `null-sha384`, `null-sha256`, `null-sha512`
+ - Default value: `aes256-gcm`
+- `ipsec_ciphersuite_variable` (String) Variable name
+- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
+ - Range: `120`-`2592000`
+ - Default value: `3600`
+- `ipsec_rekey_interval_variable` (String) Variable name
+- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
+ - Range: `64`-`4096`
+ - Default value: `512`
+- `ipsec_replay_window_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
+ - Choices: `group-1`, `group-2`, `group-5`, `group-14`, `group-15`, `group-16`, `group-19`, `group-20`, `group-21`, `group-24`, `none`
+ - Default value: `group-16`
+- `perfect_forward_secrecy_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+ - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `tracker_id` (String) Enable tracker for this interface
+- `tracker_id_variable` (String) Variable name
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+- `tunnel_destination_ipv4_address` (String)
+- `tunnel_destination_ipv4_address_variable` (String) Variable name
+- `tunnel_destination_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
+- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_route_via_variable` (String) Variable name
+- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
+- `tunnel_source_interface_variable` (String) Variable name
+- `tunnel_source_ipv4_address` (String)
+- `tunnel_source_ipv4_address_variable` (String) Variable name
+- `tunnel_source_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_wan_vpn_interface_ipsec_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_wan_vpn_interface_ipsec_profile_parcel.md b/docs/resources/transport_wan_vpn_interface_ipsec_profile_parcel.md
deleted file mode 100644
index 0047ea7aa..000000000
--- a/docs/resources/transport_wan_vpn_interface_ipsec_profile_parcel.md
+++ /dev/null
@@ -1,166 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport WAN VPN Interface IPSEC profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_wan_vpn_interface_ipsec_profile_parcel (Resource)
-
-This resource can manage a Transport WAN VPN Interface IPSEC profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "ipsec987"
- shutdown = true
- interface_description = "ipsec987"
- ipv4_address = "9.7.5.4"
- ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_ipv4_address = "1.3.5.88"
- tunnel_source_ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_interface = "GigabitEthernet8"
- tunnel_destination_ipv4_address = "2.55.67.99"
- tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
- application_tunnel_type = "none"
- tcp_mss = 1460
- clear_dont_fragment = false
- ip_mtu = 1500
- dpd_interval = 10
- dpd_retries = 3
- ike_preshared_key = "123"
- ike_version = 1
- ike_integrity_protocol = "main"
- ike_rekey_interval = 14400
- ike_ciphersuite = "aes256-cbc-sha1"
- ike_diffie_hellman_group = "16"
- ike_id_local_end_point = "xxx"
- ike_id_remote_end_point = "xxx"
- ipsec_rekey_interval = 3600
- ipsec_replay_window = 512
- ipsec_ciphersuite = "aes256-gcm"
- perfect_forward_secrecy = "group-16"
- tunnel_route_via = "2222"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `application_tunnel_type` (String) Enable Application Tunnel Type
- - Choices: `none`, `sig`
-- `feature_profile_id` (String) Feature Profile ID
-- `ike_preshared_key` (String) Use preshared key to authenticate IKE peer
-- `interface_name` (String) Interface name: IPsec when present
-- `ipv4_address` (String)
-- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `name` (String) The name of the profile parcel
-- `tunnel_destination_ipv4_address` (String)
-- `tunnel_destination_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `tunnel_source_interface` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_source_ipv4_address` (String)
-- `tunnel_source_ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-
-### Optional
-
-- `application_tunnel_type_variable` (String) Variable name
-- `clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
- - Default value: `false`
-- `clear_dont_fragment_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `dpd_interval` (Number) IKE keepalive interval (seconds)
- - Range: `10`-`3600`
- - Default value: `10`
-- `dpd_interval_variable` (String) Variable name
-- `dpd_retries` (Number) IKE keepalive retries
- - Range: `2`-`60`
- - Default value: `3`
-- `dpd_retries_variable` (String) Variable name
-- `ike_ciphersuite` (String) IKE identity the IKE preshared secret belongs to
- - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha2`, `aes128-cbc-sha1`, `aes128-cbc-sha2`
- - Default value: `aes256-cbc-sha1`
-- `ike_ciphersuite_variable` (String) Variable name
-- `ike_diffie_hellman_group` (String) IKE Diffie Hellman Groups
- - Choices: `2`, `14`, `15`, `16`, `19`, `20`, `21`, `24`
- - Default value: `16`
-- `ike_diffie_hellman_group_variable` (String) Variable name
-- `ike_id_local_end_point` (String) IKE ID for the local endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_local_end_point_variable` (String) Variable name
-- `ike_id_remote_end_point` (String) IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address
-- `ike_id_remote_end_point_variable` (String) Variable name
-- `ike_integrity_protocol` (String) IKE integrity protocol
- - Choices: `main`, `aggressive`
- - Default value: `main`
-- `ike_integrity_protocol_variable` (String) Variable name
-- `ike_preshared_key_variable` (String) Variable name
-- `ike_rekey_interval` (Number) IKE rekey interval <60..86400> seconds
- - Range: `60`-`86400`
- - Default value: `14400`
-- `ike_rekey_interval_variable` (String) Variable name
-- `ike_version` (Number) IKE Version <1..2>
- - Range: `1`-`2`
- - Default value: `1`
-- `interface_description` (String) Interface description
-- `interface_description_variable` (String) Variable name
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Interface MTU <68..9216>, in bytes
- - Range: `68`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipsec_ciphersuite` (String) IPsec(ESP) encryption and integrity protocol
- - Choices: `aes256-cbc-sha1`, `aes256-cbc-sha384`, `aes256-cbc-sha256`, `aes256-cbc-sha512`, `aes256-gcm`, `null-sha1`, `null-sha384`, `null-sha256`, `null-sha512`
- - Default value: `aes256-gcm`
-- `ipsec_ciphersuite_variable` (String) Variable name
-- `ipsec_rekey_interval` (Number) IPsec rekey interval <300..1209600> seconds
- - Range: `120`-`2592000`
- - Default value: `3600`
-- `ipsec_rekey_interval_variable` (String) Variable name
-- `ipsec_replay_window` (Number) Replay window size 32..8192 (must be a power of 2)
- - Range: `64`-`4096`
- - Default value: `512`
-- `ipsec_replay_window_variable` (String) Variable name
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `perfect_forward_secrecy` (String) IPsec perfect forward secrecy settings
- - Choices: `group-1`, `group-2`, `group-5`, `group-14`, `group-15`, `group-16`, `group-19`, `group-20`, `group-21`, `group-24`, `none`
- - Default value: `group-16`
-- `perfect_forward_secrecy_variable` (String) Variable name
-- `shutdown` (Boolean) Administrative state
- - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `tracker_id` (String) Enable tracker for this interface
-- `tracker_id_variable` (String) Variable name
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-- `tunnel_destination_ipv4_address_variable` (String) Variable name
-- `tunnel_destination_ipv4_subnet_mask_variable` (String) Variable name
-- `tunnel_route_via` (String) <1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid
-- `tunnel_route_via_variable` (String) Variable name
-- `tunnel_source_interface_variable` (String) Variable name
-- `tunnel_source_ipv4_address_variable` (String) Variable name
-- `tunnel_source_ipv4_subnet_mask_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_wan_vpn_interface_t1_e1_serial_feature.md b/docs/resources/transport_wan_vpn_interface_t1_e1_serial_feature.md
new file mode 100644
index 000000000..516d45fc9
--- /dev/null
+++ b/docs/resources/transport_wan_vpn_interface_t1_e1_serial_feature.md
@@ -0,0 +1,272 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature Resource - terraform-provider-sdwan"
+subcategory: "Features"
+description: |-
+ This resource can manage a Transport WAN VPN Interface T1 E1 Serial Feature.
+ Minimum SD-WAN Manager version: 20.12.0
+---
+
+# sdwan_transport_wan_vpn_interface_t1_e1_serial_feature (Resource)
+
+This resource can manage a Transport WAN VPN Interface T1 E1 Serial Feature.
+ - Minimum SD-WAN Manager version: `20.12.0`
+
+## Example Usage
+
+```terraform
+resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "Serial0"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv6_address = "2001:0:0:1::/64"
+ bandwidth = 123456
+ bandwidth_downstream = 123456
+ clock_rate = "1200"
+ encapsulation = "ppp"
+ tunnel_interface = true
+ per_tunnel_qos = true
+ per_tunnel_qos_aggregator = false
+ tunnel_qos_mode = "hub"
+ tunnel_interface_color = "mpls"
+ tunnel_interface_restrict = true
+ tunnel_interface_groups = 42949672
+ tunnel_interface_border = false
+ tunnel_interface_max_control_connections = 62
+ tunnel_interface_vbond_as_stun_server = false
+ tunnel_interface_exclude_controller_group_list = [2]
+ tunnel_interface_vmanage_connection_preference = 8
+ tunnel_interface_port_hop = true
+ tunnel_interface_low_bandwidth_link = false
+ tunnel_interface_tunnel_tcp_mss = 1460
+ tunnel_interface_clear_dont_fragment = false
+ tunnel_interface_clear_network_broadcast = false
+ tunnel_interface_carrier = "default"
+ tunnel_interface_bind_loopback_tunnel = "example"
+ tunnel_interface_last_resort_circuit = false
+ tunnel_interface_nat_refresh_interval = 5
+ tunnel_interface_hello_interval = 1000
+ tunnel_interface_hello_tolerance = 12
+ tunnel_interface_allow_all = false
+ tunnel_interface_allow_bgp = false
+ tunnel_interface_allow_dhcp = true
+ tunnel_interface_allow_dns = true
+ tunnel_interface_allow_icmp = true
+ tunnel_interface_allow_netconf = false
+ tunnel_interface_allow_ntp = false
+ tunnel_interface_allow_ospf = false
+ tunnel_interface_allow_ssh = false
+ tunnel_interface_allow_stun = false
+ tunnel_interface_allow_https = true
+ tunnel_interface_allow_snmp = false
+ tunnel_interface_allow_bfd = false
+ tunnel_interface_encapsulations = [
+ {
+ encapsulation = "gre"
+ preference = 4294967
+ weight = 250
+ }
+ ]
+ tcp_mss = 1460
+ mtu = 1500
+ ip_mtu = 1500
+ tloc_extension = "tloc"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `feature_profile_id` (String) Feature Profile ID
+- `name` (String) The name of the Feature
+
+### Optional
+
+- `bandwidth` (Number) Interface bandwidth capacity, in kbps
+ - Range: `1`-`200000000`
+- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
+ - Range: `1`-`2147483647`
+- `bandwidth_downstream_variable` (String) Variable name
+- `bandwidth_variable` (String) Variable name
+- `clock_rate` (String) Set preference for interface Clock speed
+ - Choices: `1200`, `2400`, `4800`, `9600`, `14400`, `19200`, `28800`, `32000`, `38400`, `48000`, `56000`, `57600`, `64000`, `72000`, `115200`, `125000`, `148000`, `192000`, `250000`, `256000`, `384000`, `500000`, `512000`, `768000`, `800000`, `1000000`, `2000000`, `4000000`, `5300000`, `8000000`
+- `clock_rate_variable` (String) Variable name
+- `description` (String) The description of the Feature
+- `encapsulation` (String) Configure Encapsulation for interface
+ - Choices: `hdlc`, `ppp`, `frame-relay`
+- `encapsulation_variable` (String) Variable name
+- `interface_name` (String) Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T
+- `interface_name_variable` (String) Variable name
+- `ip_mtu` (Number) Set ip mtu
+ - Range: `576`-`9216`
+ - Default value: `1500`
+- `ip_mtu_variable` (String) Variable name
+- `ipv4_address` (String)
+- `ipv4_address_variable` (String) Variable name
+- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
+- `ipv4_subnet_mask_variable` (String) Variable name
+- `ipv6_address` (String) Assign IPv6 address
+- `ipv6_address_variable` (String) Variable name
+- `mtu` (Number) Interface MTU <68...2000>, in bytes
+ - Range: `576`-`9216`
+ - Default value: `1500`
+- `mtu_variable` (String) Variable name
+- `per_tunnel_qos` (Boolean) Per-tunnel Qos
+ - Default value: `false`
+- `per_tunnel_qos_aggregator` (Boolean) Per-tunnel QoS Aggregator
+ - Default value: `false`
+- `per_tunnel_qos_aggregator_variable` (String) Variable name
+- `per_tunnel_qos_variable` (String) Variable name
+- `qos_shaping_rate` (Number) 1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps
+ - Range: `8`-`100000000`
+- `qos_shaping_rate_variable` (String) Variable name
+- `shutdown` (Boolean) Administrative state
+ - Default value: `true`
+- `shutdown_variable` (String) Variable name
+- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tcp_mss_variable` (String) Variable name
+- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
+- `tloc_extension_variable` (String) Variable name
+- `transport_wan_vpn_feature_id` (String) Transport WAN VPN Feature ID
+- `tunnel_interface` (Boolean) Tunnel Interface
+ - Default value: `false`
+- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
+ - Default value: `false`
+- `tunnel_interface_allow_all_variable` (String) Variable name
+- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
+ - Default value: `false`
+- `tunnel_interface_allow_bfd_variable` (String) Variable name
+- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
+ - Default value: `false`
+- `tunnel_interface_allow_bgp_variable` (String) Variable name
+- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
+ - Default value: `true`
+- `tunnel_interface_allow_dhcp_variable` (String) Variable name
+- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
+ - Default value: `true`
+- `tunnel_interface_allow_dns_variable` (String) Variable name
+- `tunnel_interface_allow_https` (Boolean) Allow/Deny Https
+ - Default value: `true`
+- `tunnel_interface_allow_https_variable` (String) Variable name
+- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
+ - Default value: `true`
+- `tunnel_interface_allow_icmp_variable` (String) Variable name
+- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
+ - Default value: `false`
+- `tunnel_interface_allow_netconf_variable` (String) Variable name
+- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
+ - Default value: `false`
+- `tunnel_interface_allow_ntp_variable` (String) Variable name
+- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
+ - Default value: `false`
+- `tunnel_interface_allow_ospf_variable` (String) Variable name
+- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
+ - Default value: `false`
+- `tunnel_interface_allow_snmp_variable` (String) Variable name
+- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
+ - Default value: `false`
+- `tunnel_interface_allow_ssh_variable` (String) Variable name
+- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
+ - Default value: `false`
+- `tunnel_interface_allow_stun_variable` (String) Variable name
+- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
+- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
+- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
+ - Default value: `false`
+- `tunnel_interface_border_variable` (String) Variable name
+- `tunnel_interface_carrier` (String) Set carrier for TLOC
+ - Choices: `default`, `carrier1`, `carrier2`, `carrier3`, `carrier4`, `carrier5`, `carrier6`, `carrier7`, `carrier8`
+ - Default value: `default`
+- `tunnel_interface_carrier_variable` (String) Variable name
+- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
+ - Default value: `false`
+- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
+- `tunnel_interface_clear_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts)
+ - Default value: `false`
+- `tunnel_interface_clear_network_broadcast_variable` (String) Variable name
+- `tunnel_interface_color` (String) Set color for TLOC
+ - Choices: `default`, `mpls`, `metro-ethernet`, `biz-internet`, `public-internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
+ - Default value: `default`
+- `tunnel_interface_color_variable` (String) Variable name
+- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
+- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list
+- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
+- `tunnel_interface_groups` (Number) List of groups
+ - Range: `1`-`4294967295`
+- `tunnel_interface_groups_variable` (String) Variable name
+- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
+ - Range: `100`-`600000`
+ - Default value: `1000`
+- `tunnel_interface_hello_interval_variable` (String) Variable name
+- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
+ - Range: `12`-`6000`
+ - Default value: `12`
+- `tunnel_interface_hello_tolerance_variable` (String) Variable name
+- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
+ - Default value: `false`
+- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
+- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
+ - Default value: `false`
+- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
+- `tunnel_interface_max_control_connections` (Number) Set the maximum number of control connections for this TLOC
+ - Range: `0`-`100`
+- `tunnel_interface_max_control_connections_variable` (String) Variable name
+- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
+ - Range: `1`-`60`
+ - Default value: `5`
+- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
+- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
+ - Default value: `true`
+- `tunnel_interface_port_hop_variable` (String) Variable name
+- `tunnel_interface_restrict` (Boolean) Restrict this TLOC behavior
+ - Default value: `false`
+- `tunnel_interface_restrict_variable` (String) Variable name
+- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
+ - Range: `500`-`1460`
+- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
+- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
+ - Default value: `false`
+- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
+- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
+ - Range: `0`-`8`
+ - Default value: `5`
+- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
+- `tunnel_qos_mode` (String) Set tunnel QoS mode
+ - Choices: `spoke`, `hub`
+- `tunnel_qos_mode_variable` (String) Variable name
+
+### Read-Only
+
+- `id` (String) The id of the Feature
+- `version` (Number) The version of the Feature
+
+
+### Nested Schema for `tunnel_interface_encapsulations`
+
+Optional:
+
+- `encapsulation` (String) Encapsulation
+ - Choices: `gre`, `ipsec`
+- `preference` (Number) Set preference for TLOC
+ - Range: `0`-`4294967295`
+- `preference_variable` (String) Variable name
+- `weight` (Number) Set weight for TLOC
+ - Range: `1`-`255`
+ - Default value: `1`
+- `weight_variable` (String) Variable name
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+```
diff --git a/docs/resources/transport_wan_vpn_interface_t1_e1_serial_profile_parcel.md b/docs/resources/transport_wan_vpn_interface_t1_e1_serial_profile_parcel.md
deleted file mode 100644
index 712aa88c1..000000000
--- a/docs/resources/transport_wan_vpn_interface_t1_e1_serial_profile_parcel.md
+++ /dev/null
@@ -1,272 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport WAN VPN Interface T1 E1 Serial profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel (Resource)
-
-This resource can manage a Transport WAN VPN Interface T1 E1 Serial profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "Serial0"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv6_address = "2001:0:0:1::/64"
- bandwidth = 123456
- bandwidth_downstream = 123456
- clock_rate = "1200"
- encapsulation = "ppp"
- tunnel_interface = true
- per_tunnel_qos = true
- per_tunnel_qos_aggregator = false
- tunnel_qos_mode = "hub"
- tunnel_interface_color = "mpls"
- tunnel_interface_restrict = true
- tunnel_interface_groups = 42949672
- tunnel_interface_border = false
- tunnel_interface_max_control_connections = 62
- tunnel_interface_vbond_as_stun_server = false
- tunnel_interface_exclude_controller_group_list = [2]
- tunnel_interface_vmanage_connection_preference = 8
- tunnel_interface_port_hop = true
- tunnel_interface_low_bandwidth_link = false
- tunnel_interface_tunnel_tcp_mss = 1460
- tunnel_interface_clear_dont_fragment = false
- tunnel_interface_clear_network_broadcast = false
- tunnel_interface_carrier = "default"
- tunnel_interface_bind_loopback_tunnel = "example"
- tunnel_interface_last_resort_circuit = false
- tunnel_interface_nat_refresh_interval = 5
- tunnel_interface_hello_interval = 1000
- tunnel_interface_hello_tolerance = 12
- tunnel_interface_allow_all = false
- tunnel_interface_allow_bgp = false
- tunnel_interface_allow_dhcp = true
- tunnel_interface_allow_dns = true
- tunnel_interface_allow_icmp = true
- tunnel_interface_allow_netconf = false
- tunnel_interface_allow_ntp = false
- tunnel_interface_allow_ospf = false
- tunnel_interface_allow_ssh = false
- tunnel_interface_allow_stun = false
- tunnel_interface_allow_https = true
- tunnel_interface_allow_snmp = false
- tunnel_interface_allow_bfd = false
- tunnel_interface_encapsulations = [
- {
- encapsulation = "gre"
- preference = 4294967
- weight = 250
- }
- ]
- tcp_mss = 1460
- mtu = 1500
- ip_mtu = 1500
- tloc_extension = "tloc"
-}
-```
-
-
-## Schema
-
-### Required
-
-- `feature_profile_id` (String) Feature Profile ID
-- `interface_name` (String) Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `bandwidth` (Number) Interface bandwidth capacity, in kbps
- - Range: `1`-`200000000`
-- `bandwidth_downstream` (Number) Interface downstream bandwidth capacity, in kbps
- - Range: `1`-`2147483647`
-- `bandwidth_downstream_variable` (String) Variable name
-- `bandwidth_variable` (String) Variable name
-- `clock_rate` (String) Set preference for interface Clock speed
- - Choices: `1200`, `2400`, `4800`, `9600`, `14400`, `19200`, `28800`, `32000`, `38400`, `48000`, `56000`, `57600`, `64000`, `72000`, `115200`, `125000`, `148000`, `192000`, `250000`, `256000`, `384000`, `500000`, `512000`, `768000`, `800000`, `1000000`, `2000000`, `4000000`, `5300000`, `8000000`
-- `clock_rate_variable` (String) Variable name
-- `description` (String) The description of the profile parcel
-- `encapsulation` (String) Configure Encapsulation for interface
- - Choices: `hdlc`, `ppp`, `frame-relay`
-- `encapsulation_variable` (String) Variable name
-- `interface_name_variable` (String) Variable name
-- `ip_mtu` (Number) Set ip mtu
- - Range: `576`-`9216`
- - Default value: `1500`
-- `ip_mtu_variable` (String) Variable name
-- `ipv4_address` (String)
-- `ipv4_address_variable` (String) Variable name
-- `ipv4_subnet_mask` (String) - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `ipv4_subnet_mask_variable` (String) Variable name
-- `ipv6_address` (String) Assign IPv6 address
-- `ipv6_address_variable` (String) Variable name
-- `mtu` (Number) Interface MTU <68...2000>, in bytes
- - Range: `576`-`9216`
- - Default value: `1500`
-- `mtu_variable` (String) Variable name
-- `per_tunnel_qos` (Boolean) Per-tunnel Qos
- - Default value: `false`
-- `per_tunnel_qos_aggregator` (Boolean) Per-tunnel QoS Aggregator
- - Default value: `false`
-- `per_tunnel_qos_aggregator_variable` (String) Variable name
-- `per_tunnel_qos_variable` (String) Variable name
-- `qos_shaping_rate` (Number) 1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps
- - Range: `8`-`100000000`
-- `qos_shaping_rate_variable` (String) Variable name
-- `shutdown` (Boolean) Administrative state
- - Default value: `true`
-- `shutdown_variable` (String) Variable name
-- `tcp_mss` (Number) TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tcp_mss_variable` (String) Variable name
-- `tloc_extension` (String) Extends a local TLOC to a remote node only for vpn 0
-- `tloc_extension_variable` (String) Variable name
-- `transport_wan_vpn_profile_parcel_id` (String) Transport WAN VPN Profile Parcel ID
-- `tunnel_interface` (Boolean) Tunnel Interface
- - Default value: `false`
-- `tunnel_interface_allow_all` (Boolean) Allow all traffic. Overrides all other allow-service options if allow-service all is set
- - Default value: `false`
-- `tunnel_interface_allow_all_variable` (String) Variable name
-- `tunnel_interface_allow_bfd` (Boolean) Allow/Deny BFD
- - Default value: `false`
-- `tunnel_interface_allow_bfd_variable` (String) Variable name
-- `tunnel_interface_allow_bgp` (Boolean) Allow/deny BGP
- - Default value: `false`
-- `tunnel_interface_allow_bgp_variable` (String) Variable name
-- `tunnel_interface_allow_dhcp` (Boolean) Allow/Deny DHCP
- - Default value: `true`
-- `tunnel_interface_allow_dhcp_variable` (String) Variable name
-- `tunnel_interface_allow_dns` (Boolean) Allow/Deny DNS
- - Default value: `true`
-- `tunnel_interface_allow_dns_variable` (String) Variable name
-- `tunnel_interface_allow_https` (Boolean) Allow/Deny Https
- - Default value: `true`
-- `tunnel_interface_allow_https_variable` (String) Variable name
-- `tunnel_interface_allow_icmp` (Boolean) Allow/Deny ICMP
- - Default value: `true`
-- `tunnel_interface_allow_icmp_variable` (String) Variable name
-- `tunnel_interface_allow_netconf` (Boolean) Allow/Deny NETCONF
- - Default value: `false`
-- `tunnel_interface_allow_netconf_variable` (String) Variable name
-- `tunnel_interface_allow_ntp` (Boolean) Allow/Deny NTP
- - Default value: `false`
-- `tunnel_interface_allow_ntp_variable` (String) Variable name
-- `tunnel_interface_allow_ospf` (Boolean) Allow/Deny OSPF
- - Default value: `false`
-- `tunnel_interface_allow_ospf_variable` (String) Variable name
-- `tunnel_interface_allow_snmp` (Boolean) Allow/Deny SNMP
- - Default value: `false`
-- `tunnel_interface_allow_snmp_variable` (String) Variable name
-- `tunnel_interface_allow_ssh` (Boolean) Allow/Deny SSH
- - Default value: `false`
-- `tunnel_interface_allow_ssh_variable` (String) Variable name
-- `tunnel_interface_allow_stun` (Boolean) Allow/Deny STUN
- - Default value: `false`
-- `tunnel_interface_allow_stun_variable` (String) Variable name
-- `tunnel_interface_bind_loopback_tunnel` (String) Bind loopback tunnel interface to a physical interface
-- `tunnel_interface_bind_loopback_tunnel_variable` (String) Variable name
-- `tunnel_interface_border` (Boolean) Set TLOC as border TLOC
- - Default value: `false`
-- `tunnel_interface_border_variable` (String) Variable name
-- `tunnel_interface_carrier` (String) Set carrier for TLOC
- - Choices: `default`, `carrier1`, `carrier2`, `carrier3`, `carrier4`, `carrier5`, `carrier6`, `carrier7`, `carrier8`
- - Default value: `default`
-- `tunnel_interface_carrier_variable` (String) Variable name
-- `tunnel_interface_clear_dont_fragment` (Boolean) Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)
- - Default value: `false`
-- `tunnel_interface_clear_dont_fragment_variable` (String) Variable name
-- `tunnel_interface_clear_network_broadcast` (Boolean) Accept and respond to network-prefix-directed broadcasts)
- - Default value: `false`
-- `tunnel_interface_clear_network_broadcast_variable` (String) Variable name
-- `tunnel_interface_color` (String) Set color for TLOC
- - Choices: `default`, `mpls`, `metro-ethernet`, `biz-internet`, `public-internet`, `lte`, `3g`, `red`, `green`, `blue`, `gold`, `silver`, `bronze`, `custom1`, `custom2`, `custom3`, `private1`, `private2`, `private3`, `private4`, `private5`, `private6`
- - Default value: `default`
-- `tunnel_interface_color_variable` (String) Variable name
-- `tunnel_interface_encapsulations` (Attributes List) Encapsulation for TLOC (see [below for nested schema](#nestedatt--tunnel_interface_encapsulations))
-- `tunnel_interface_exclude_controller_group_list` (Set of Number) Exclude the following controller groups defined in this list
-- `tunnel_interface_exclude_controller_group_list_variable` (String) Variable name
-- `tunnel_interface_groups` (Number) List of groups
- - Range: `1`-`4294967295`
-- `tunnel_interface_groups_variable` (String) Variable name
-- `tunnel_interface_hello_interval` (Number) Set time period of control hello packets <100..600000> milli seconds
- - Range: `100`-`600000`
- - Default value: `1000`
-- `tunnel_interface_hello_interval_variable` (String) Variable name
-- `tunnel_interface_hello_tolerance` (Number) Set tolerance of control hello packets <12..6000> seconds
- - Range: `12`-`6000`
- - Default value: `12`
-- `tunnel_interface_hello_tolerance_variable` (String) Variable name
-- `tunnel_interface_last_resort_circuit` (Boolean) Set TLOC as last resort
- - Default value: `false`
-- `tunnel_interface_last_resort_circuit_variable` (String) Variable name
-- `tunnel_interface_low_bandwidth_link` (Boolean) Set the interface as a low-bandwidth circuit
- - Default value: `false`
-- `tunnel_interface_low_bandwidth_link_variable` (String) Variable name
-- `tunnel_interface_max_control_connections` (Number) Set the maximum number of control connections for this TLOC
- - Range: `0`-`100`
-- `tunnel_interface_max_control_connections_variable` (String) Variable name
-- `tunnel_interface_nat_refresh_interval` (Number) Set time period of nat refresh packets <1...60> seconds
- - Range: `1`-`60`
- - Default value: `5`
-- `tunnel_interface_nat_refresh_interval_variable` (String) Variable name
-- `tunnel_interface_port_hop` (Boolean) Disallow port hopping on the tunnel interface
- - Default value: `true`
-- `tunnel_interface_port_hop_variable` (String) Variable name
-- `tunnel_interface_restrict` (Boolean) Restrict this TLOC behavior
- - Default value: `false`
-- `tunnel_interface_restrict_variable` (String) Variable name
-- `tunnel_interface_tunnel_tcp_mss` (Number) Tunnel TCP MSS on SYN packets, in bytes
- - Range: `500`-`1460`
-- `tunnel_interface_tunnel_tcp_mss_variable` (String) Variable name
-- `tunnel_interface_vbond_as_stun_server` (Boolean) Put this wan interface in STUN mode only
- - Default value: `false`
-- `tunnel_interface_vbond_as_stun_server_variable` (String) Variable name
-- `tunnel_interface_vmanage_connection_preference` (Number) Set interface preference for control connection to vManage <0..8>
- - Range: `0`-`8`
- - Default value: `5`
-- `tunnel_interface_vmanage_connection_preference_variable` (String) Variable name
-- `tunnel_qos_mode` (String) Set tunnel QoS mode
- - Choices: `spoke`, `hub`
-- `tunnel_qos_mode_variable` (String) Variable name
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `tunnel_interface_encapsulations`
-
-Optional:
-
-- `encapsulation` (String) Encapsulation
- - Choices: `gre`, `ipsec`
-- `preference` (Number) Set preference for TLOC
- - Range: `0`-`4294967295`
-- `preference_variable` (String) Variable name
-- `weight` (Number) Set weight for TLOC
- - Range: `1`-`255`
- - Default value: `1`
-- `weight_variable` (String) Variable name
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/transport_wan_vpn_profile_parcel.md b/docs/resources/transport_wan_vpn_profile_parcel.md
deleted file mode 100644
index 68e04bf1a..000000000
--- a/docs/resources/transport_wan_vpn_profile_parcel.md
+++ /dev/null
@@ -1,210 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "sdwan_transport_wan_vpn_profile_parcel Resource - terraform-provider-sdwan"
-subcategory: "Profile Parcels"
-description: |-
- This resource can manage a Transport WAN VPN profile parcel.
- Minimum SD-WAN Manager version: 20.12.0
----
-
-# sdwan_transport_wan_vpn_profile_parcel (Resource)
-
-This resource can manage a Transport WAN VPN profile parcel.
- - Minimum SD-WAN Manager version: `20.12.0`
-
-## Example Usage
-
-```terraform
-resource "sdwan_transport_wan_vpn_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-```
-
-
-## Schema
-
-### Required
-
-- `name` (String) The name of the profile parcel
-
-### Optional
-
-- `description` (String) The description of the profile parcel
-- `enhance_ecmp_keying` (Boolean) Enhance ECMP Keying
- - Default value: `false`
-- `enhance_ecmp_keying_variable` (String) Variable name
-- `feature_profile_id` (String) Feature Profile ID
-- `ipv4_static_routes` (Attributes List) IPv4 Static Route (see [below for nested schema](#nestedatt--ipv4_static_routes))
-- `ipv6_static_routes` (Attributes List) IPv6 Static Route (see [below for nested schema](#nestedatt--ipv6_static_routes))
-- `nat_64_v4_pools` (Attributes List) NAT64 V4 Pool (see [below for nested schema](#nestedatt--nat_64_v4_pools))
-- `new_host_mappings` (Attributes List) (see [below for nested schema](#nestedatt--new_host_mappings))
-- `primary_dns_address_ipv4` (String) Primary DNS Address (IPv4)
-- `primary_dns_address_ipv4_variable` (String) Variable name
-- `primary_dns_address_ipv6` (String) Primary DNS Address (IPv6)
-- `primary_dns_address_ipv6_variable` (String) Variable name
-- `secondary_dns_address_ipv4` (String) Secondary DNS Address (IPv4)
-- `secondary_dns_address_ipv4_variable` (String) Variable name
-- `secondary_dns_address_ipv6` (String) Secondary DNS Address (IPv6)
-- `secondary_dns_address_ipv6_variable` (String) Variable name
-- `services` (Attributes List) Service (see [below for nested schema](#nestedatt--services))
-- `vpn` (Number) VPN
- - Default value: `0`
-
-### Read-Only
-
-- `id` (String) The id of the profile parcel
-- `version` (Number) The version of the profile parcel
-
-
-### Nested Schema for `ipv4_static_routes`
-
-Optional:
-
-- `administrative_distance` (Number) Administrative distance, Attribute conditional on `gateway` being equal to `null0`
- - Range: `1`-`255`
- - Default value: `1`
-- `administrative_distance_variable` (String) Variable name
-- `gateway` (String) Gateway
- - Choices: `nextHop`, `dhcp`, `null0`
- - Default value: `nextHop`
-- `network_address` (String) IP Address
-- `network_address_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops))
-- `subnet_mask` (String) Subnet Mask
- - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0`
-- `subnet_mask_variable` (String) Variable name
-
-
-### Nested Schema for `ipv4_static_routes.next_hops`
-
-Optional:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
- - Range: `1`-`255`
- - Default value: `1`
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `ipv6_static_routes`
-
-Optional:
-
-- `nat` (String) IPv6 Nat
- - Choices: `NAT64`, `NAT66`
-- `nat_variable` (String) Variable name
-- `next_hops` (Attributes List) IPv6 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv6_static_routes--next_hops))
-- `null0` (Boolean) IPv6 Route Gateway Next Hop
-- `prefix` (String) Prefix
-- `prefix_variable` (String) Variable name
-
-
-### Nested Schema for `ipv6_static_routes.next_hops`
-
-Optional:
-
-- `address` (String) Address
-- `address_variable` (String) Variable name
-- `administrative_distance` (Number) Administrative distance
- - Range: `1`-`254`
-- `administrative_distance_variable` (String) Variable name
-
-
-
-
-### Nested Schema for `nat_64_v4_pools`
-
-Optional:
-
-- `nat64_v4_pool_name` (String) NAT64 v4 Pool Name
-- `nat64_v4_pool_name_variable` (String) Variable name
-- `nat64_v4_pool_overload` (Boolean) NAT64 Overload
- - Default value: `false`
-- `nat64_v4_pool_overload_variable` (String) Variable name
-- `nat64_v4_pool_range_end` (String) NAT64 Pool Range End
-- `nat64_v4_pool_range_end_variable` (String) Variable name
-- `nat64_v4_pool_range_start` (String) NAT64 Pool Range Start
-- `nat64_v4_pool_range_start_variable` (String) Variable name
-
-
-
-### Nested Schema for `new_host_mappings`
-
-Optional:
-
-- `host_name` (String) Hostname
-- `host_name_variable` (String) Variable name
-- `list_of_ip_addresses` (Set of String) List of IP
-- `list_of_ip_addresses_variable` (String) Variable name
-
-
-
-### Nested Schema for `services`
-
-Optional:
-
-- `service_type` (String) Service Type
- - Choices: `TE`
-
-## Import
-
-Import is supported using the following syntax:
-
-```shell
-terraform import sdwan_transport_wan_vpn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
-```
diff --git a/docs/resources/url_filtering_policy_definition.md b/docs/resources/url_filtering_policy_definition.md
index e1694934f..02003b762 100644
--- a/docs/resources/url_filtering_policy_definition.md
+++ b/docs/resources/url_filtering_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_url_filtering_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a URL Filtering Policy Definition .
---
diff --git a/docs/resources/vpn_interface_cellular_feature_template.md b/docs/resources/vpn_interface_cellular_feature_template.md
index 048dc2f35..f71e0c65c 100644
--- a/docs/resources/vpn_interface_cellular_feature_template.md
+++ b/docs/resources/vpn_interface_cellular_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_cellular_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface Cellular feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_interface_dsl_ipoe_feature_template.md b/docs/resources/vpn_interface_dsl_ipoe_feature_template.md
index 6631b56a4..ab8648554 100644
--- a/docs/resources/vpn_interface_dsl_ipoe_feature_template.md
+++ b/docs/resources/vpn_interface_dsl_ipoe_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_dsl_ipoe_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface DSL IPoE feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_interface_dsl_pppoa_feature_template.md b/docs/resources/vpn_interface_dsl_pppoa_feature_template.md
index a4c8febaa..930b0dab6 100644
--- a/docs/resources/vpn_interface_dsl_pppoa_feature_template.md
+++ b/docs/resources/vpn_interface_dsl_pppoa_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_dsl_pppoa_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface DSL PPPoA feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_interface_dsl_pppoe_feature_template.md b/docs/resources/vpn_interface_dsl_pppoe_feature_template.md
index d3f48bbd0..b75f4748d 100644
--- a/docs/resources/vpn_interface_dsl_pppoe_feature_template.md
+++ b/docs/resources/vpn_interface_dsl_pppoe_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_dsl_pppoe_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface DSL PPPoE feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_interface_ethernet_pppoe_feature_template.md b/docs/resources/vpn_interface_ethernet_pppoe_feature_template.md
index db4eca560..5d5e2b4c6 100644
--- a/docs/resources/vpn_interface_ethernet_pppoe_feature_template.md
+++ b/docs/resources/vpn_interface_ethernet_pppoe_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_ethernet_pppoe_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface Ethernet PPPoE feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_interface_multilink_feature_template.md b/docs/resources/vpn_interface_multilink_feature_template.md
index d91acc955..38327e0f7 100644
--- a/docs/resources/vpn_interface_multilink_feature_template.md
+++ b/docs/resources/vpn_interface_multilink_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_multilink_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface Multilink feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_interface_svi_feature_template.md b/docs/resources/vpn_interface_svi_feature_template.md
index 4793c4a7a..cb9b215fb 100644
--- a/docs/resources/vpn_interface_svi_feature_template.md
+++ b/docs/resources/vpn_interface_svi_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_svi_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface SVI feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_interface_t1_e1_serial_feature_template.md b/docs/resources/vpn_interface_t1_e1_serial_feature_template.md
index 93937fbd9..c6cb8b172 100644
--- a/docs/resources/vpn_interface_t1_e1_serial_feature_template.md
+++ b/docs/resources/vpn_interface_t1_e1_serial_feature_template.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_interface_t1_e1_serial_feature_template Resource - terraform-provider-sdwan"
-subcategory: "Feature Templates"
+subcategory: "(Classic) Feature Templates"
description: |-
This resource can manage a VPN Interface T1 E1 Serial feature template.
Minimum SD-WAN Manager version: 15.0.0
diff --git a/docs/resources/vpn_list_policy_object.md b/docs/resources/vpn_list_policy_object.md
index c577eff95..0235450c8 100644
--- a/docs/resources/vpn_list_policy_object.md
+++ b/docs/resources/vpn_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a VPN List Policy Object .
---
diff --git a/docs/resources/vpn_membership_policy_definition.md b/docs/resources/vpn_membership_policy_definition.md
index 9c0aa047c..c24125881 100644
--- a/docs/resources/vpn_membership_policy_definition.md
+++ b/docs/resources/vpn_membership_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_vpn_membership_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Centralized Policies"
+subcategory: "(Classic) Centralized Policies"
description: |-
This resource can manage a VPN Membership Policy Definition .
---
diff --git a/docs/resources/zone_based_firewall_policy_definition.md b/docs/resources/zone_based_firewall_policy_definition.md
index 212cf0f7e..9a1e37aa7 100644
--- a/docs/resources/zone_based_firewall_policy_definition.md
+++ b/docs/resources/zone_based_firewall_policy_definition.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_zone_based_firewall_policy_definition Resource - terraform-provider-sdwan"
-subcategory: "Security Policies"
+subcategory: "(Classic) Security Policies"
description: |-
This resource can manage a Zone Based Firewall Policy Definition .
---
diff --git a/docs/resources/zone_list_policy_object.md b/docs/resources/zone_list_policy_object.md
index a33eb0467..3f0023da8 100644
--- a/docs/resources/zone_list_policy_object.md
+++ b/docs/resources/zone_list_policy_object.md
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_zone_list_policy_object Resource - terraform-provider-sdwan"
-subcategory: "Policy Objects"
+subcategory: "(Classic) Policy Objects"
description: |-
This resource can manage a Zone List Policy Object .
---
diff --git a/examples/data-sources/sdwan_application_priority_qos_policy/data-source.tf b/examples/data-sources/sdwan_application_priority_qos_policy/data-source.tf
new file mode 100644
index 000000000..3cb1d0a1d
--- /dev/null
+++ b/examples/data-sources/sdwan_application_priority_qos_policy/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_application_priority_qos_policy" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_application_priority_qos_policy_profile_parcel/data-source.tf b/examples/data-sources/sdwan_application_priority_qos_policy_profile_parcel/data-source.tf
deleted file mode 100644
index 50abd835e..000000000
--- a/examples/data-sources/sdwan_application_priority_qos_policy_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_application_priority_qos_policy_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_cli_config_feature/data-source.tf b/examples/data-sources/sdwan_cli_config_feature/data-source.tf
new file mode 100644
index 000000000..e12f58b5b
--- /dev/null
+++ b/examples/data-sources/sdwan_cli_config_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_cli_config_feature" "example" {
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
diff --git a/examples/data-sources/sdwan_cli_config_profile_parcel/data-source.tf b/examples/data-sources/sdwan_cli_config_profile_parcel/data-source.tf
deleted file mode 100644
index 6e1433b14..000000000
--- a/examples/data-sources/sdwan_cli_config_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_cli_config_profile_parcel" "example" {
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
-}
diff --git a/examples/data-sources/sdwan_dns_security_feature_profile/data-source.tf b/examples/data-sources/sdwan_dns_security_feature_profile/data-source.tf
new file mode 100644
index 000000000..bf21a6f2b
--- /dev/null
+++ b/examples/data-sources/sdwan_dns_security_feature_profile/data-source.tf
@@ -0,0 +1,3 @@
+data "sdwan_dns_security_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
diff --git a/examples/data-sources/sdwan_embedded_security_feature_profile/data-source.tf b/examples/data-sources/sdwan_embedded_security_feature_profile/data-source.tf
new file mode 100644
index 000000000..78de5fdf7
--- /dev/null
+++ b/examples/data-sources/sdwan_embedded_security_feature_profile/data-source.tf
@@ -0,0 +1,3 @@
+data "sdwan_embedded_security_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
diff --git a/examples/data-sources/sdwan_other_feature_profile/data-source.tf b/examples/data-sources/sdwan_other_feature_profile/data-source.tf
new file mode 100644
index 000000000..bbe3e8c95
--- /dev/null
+++ b/examples/data-sources/sdwan_other_feature_profile/data-source.tf
@@ -0,0 +1,3 @@
+data "sdwan_other_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
diff --git a/examples/data-sources/sdwan_other_thousandeyes_feature/data-source.tf b/examples/data-sources/sdwan_other_thousandeyes_feature/data-source.tf
new file mode 100644
index 000000000..d4e0247d6
--- /dev/null
+++ b/examples/data-sources/sdwan_other_thousandeyes_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_other_thousandeyes_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_other_ucse_feature/data-source.tf b/examples/data-sources/sdwan_other_ucse_feature/data-source.tf
new file mode 100644
index 000000000..3917e8ba6
--- /dev/null
+++ b/examples/data-sources/sdwan_other_ucse_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_other_ucse_feature" "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_class/data-source.tf b/examples/data-sources/sdwan_policy_object_app_probe_class/data-source.tf
new file mode 100644
index 000000000..644c90010
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_app_probe_class/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_app_probe_class" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_application_list/data-source.tf b/examples/data-sources/sdwan_policy_object_application_list/data-source.tf
new file mode 100644
index 000000000..0ed73b297
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_application_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_application_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_as_path_list/data-source.tf b/examples/data-sources/sdwan_policy_object_as_path_list/data-source.tf
new file mode 100644
index 000000000..3afbcc2b4
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_as_path_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_as_path_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_class_map/data-source.tf b/examples/data-sources/sdwan_policy_object_class_map/data-source.tf
new file mode 100644
index 000000000..6afcfff22
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_class_map/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_class_map" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_color_list/data-source.tf b/examples/data-sources/sdwan_policy_object_color_list/data-source.tf
new file mode 100644
index 000000000..c06ca6bc0
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_color_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_color_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_data_ipv4_prefix_list/data-source.tf b/examples/data-sources/sdwan_policy_object_data_ipv4_prefix_list/data-source.tf
new file mode 100644
index 000000000..1395c01cd
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_data_ipv4_prefix_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_data_ipv4_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_data_ipv6_prefix_list/data-source.tf b/examples/data-sources/sdwan_policy_object_data_ipv6_prefix_list/data-source.tf
new file mode 100644
index 000000000..a69c1d38f
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_data_ipv6_prefix_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_data_ipv6_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_expanded_community_list/data-source.tf b/examples/data-sources/sdwan_policy_object_expanded_community_list/data-source.tf
new file mode 100644
index 000000000..34abdf9bd
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_expanded_community_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_expanded_community_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_extended_community_list/data-source.tf b/examples/data-sources/sdwan_policy_object_extended_community_list/data-source.tf
new file mode 100644
index 000000000..def09d855
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_extended_community_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_extended_community_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_feature_profile/data-source.tf b/examples/data-sources/sdwan_policy_object_feature_profile/data-source.tf
new file mode 100644
index 000000000..1a0ab4760
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_feature_profile/data-source.tf
@@ -0,0 +1,3 @@
+data "sdwan_policy_object_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
diff --git a/examples/data-sources/sdwan_policy_object_ipv4_prefix_list/data-source.tf b/examples/data-sources/sdwan_policy_object_ipv4_prefix_list/data-source.tf
new file mode 100644
index 000000000..b04a8ce20
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_ipv4_prefix_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_ipv4_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_ipv6_prefix_list/data-source.tf b/examples/data-sources/sdwan_policy_object_ipv6_prefix_list/data-source.tf
new file mode 100644
index 000000000..142ca4657
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_ipv6_prefix_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_ipv6_prefix_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_mirror/data-source.tf b/examples/data-sources/sdwan_policy_object_mirror/data-source.tf
new file mode 100644
index 000000000..3845bf3da
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_mirror/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_mirror" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_policer/data-source.tf b/examples/data-sources/sdwan_policy_object_policer/data-source.tf
new file mode 100644
index 000000000..00bc4f250
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_policer/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_policer" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_preferred_color_group/data-source.tf b/examples/data-sources/sdwan_policy_object_preferred_color_group/data-source.tf
new file mode 100644
index 000000000..9d9abb0b6
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_preferred_color_group/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_preferred_color_group" "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/data-source.tf b/examples/data-sources/sdwan_policy_object_security_data_ipv4_prefix_list/data-source.tf
new file mode 100644
index 000000000..eed34281a
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_data_ipv4_prefix_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_data_ipv4_prefix_list" "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_list/data-source.tf b/examples/data-sources/sdwan_policy_object_security_fqdn_list/data-source.tf
new file mode 100644
index 000000000..aeac8b930
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_fqdn_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_fqdn_list" "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_list/data-source.tf b/examples/data-sources/sdwan_policy_object_security_geolocation_list/data-source.tf
new file mode 100644
index 000000000..e24422cc8
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_geolocation_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_geolocation_list" "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_list/data-source.tf b/examples/data-sources/sdwan_policy_object_security_identity_list/data-source.tf
new file mode 100644
index 000000000..0acf77060
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_identity_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_identity_list" "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_ips_signature/data-source.tf b/examples/data-sources/sdwan_policy_object_security_ips_signature/data-source.tf
new file mode 100644
index 000000000..4cde1be9e
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_ips_signature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_ips_signature" "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/data-source.tf b/examples/data-sources/sdwan_policy_object_security_local_application_list/data-source.tf
new file mode 100644
index 000000000..f1ead41ba
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_local_application_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_local_application_list" "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/data-source.tf b/examples/data-sources/sdwan_policy_object_security_local_domain_list/data-source.tf
new file mode 100644
index 000000000..917e2a95e
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_local_domain_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_local_domain_list" "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_list/data-source.tf b/examples/data-sources/sdwan_policy_object_security_port_list/data-source.tf
new file mode 100644
index 000000000..44318b2ea
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_port_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_port_list" "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_list/data-source.tf b/examples/data-sources/sdwan_policy_object_security_scalable_group_tag_list/data-source.tf
new file mode 100644
index 000000000..4d8aa7cd2
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_scalable_group_tag_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_scalable_group_tag_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = ""
+}
diff --git a/examples/data-sources/sdwan_policy_object_security_url_list/data-source.tf b/examples/data-sources/sdwan_policy_object_security_url_list/data-source.tf
new file mode 100644
index 000000000..b1c7e1fab
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_security_url_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_security_url_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_sla_class_list/data-source.tf b/examples/data-sources/sdwan_policy_object_sla_class_list/data-source.tf
new file mode 100644
index 000000000..f4ab410cf
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_sla_class_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_sla_class_list" "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_list/data-source.tf b/examples/data-sources/sdwan_policy_object_standard_community_list/data-source.tf
new file mode 100644
index 000000000..5490c951a
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_standard_community_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_standard_community_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_tloc_list/data-source.tf b/examples/data-sources/sdwan_policy_object_tloc_list/data-source.tf
new file mode 100644
index 000000000..e45123ff1
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_tloc_list/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_tloc_list" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_policy_object_vpn_group/data-source.tf b/examples/data-sources/sdwan_policy_object_vpn_group/data-source.tf
new file mode 100644
index 000000000..5f6f7e9f0
--- /dev/null
+++ b/examples/data-sources/sdwan_policy_object_vpn_group/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_policy_object_vpn_group" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_feature/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_feature/data-source.tf
new file mode 100644
index 000000000..54cbe4181
--- /dev/null
+++ b/examples/data-sources/sdwan_service_lan_vpn_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_lan_vpn_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_ethernet_feature/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_ethernet_feature/data-source.tf
new file mode 100644
index 000000000..3c004219b
--- /dev/null
+++ b/examples/data-sources/sdwan_service_lan_vpn_interface_ethernet_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_service_lan_vpn_interface_ethernet_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/data-source.tf
deleted file mode 100644
index aeb80c37e..000000000
--- a/examples/data-sources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_gre_feature/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_gre_feature/data-source.tf
new file mode 100644
index 000000000..5c94efa31
--- /dev/null
+++ b/examples/data-sources/sdwan_service_lan_vpn_interface_gre_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_service_lan_vpn_interface_gre_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_gre_profile_parcel/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_gre_profile_parcel/data-source.tf
deleted file mode 100644
index 81980b8fb..000000000
--- a/examples/data-sources/sdwan_service_lan_vpn_interface_gre_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_service_lan_vpn_interface_gre_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_ipsec_feature/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_ipsec_feature/data-source.tf
new file mode 100644
index 000000000..57f7a40a5
--- /dev/null
+++ b/examples/data-sources/sdwan_service_lan_vpn_interface_ipsec_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_service_lan_vpn_interface_ipsec_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/data-source.tf
deleted file mode 100644
index 1aae358d4..000000000
--- a/examples/data-sources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_svi_feature/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_svi_feature/data-source.tf
new file mode 100644
index 000000000..9c6dae94f
--- /dev/null
+++ b/examples/data-sources/sdwan_service_lan_vpn_interface_svi_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_service_lan_vpn_interface_svi_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_interface_svi_profile_parcel/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_interface_svi_profile_parcel/data-source.tf
deleted file mode 100644
index 168447b42..000000000
--- a/examples/data-sources/sdwan_service_lan_vpn_interface_svi_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_service_lan_vpn_interface_svi_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_service_lan_vpn_profile_parcel/data-source.tf b/examples/data-sources/sdwan_service_lan_vpn_profile_parcel/data-source.tf
deleted file mode 100644
index 4b1dafb92..000000000
--- a/examples/data-sources/sdwan_service_lan_vpn_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_service_lan_vpn_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_service_object_tracker_feature/data-source.tf b/examples/data-sources/sdwan_service_object_tracker_feature/data-source.tf
new file mode 100644
index 000000000..2aeda862a
--- /dev/null
+++ b/examples/data-sources/sdwan_service_object_tracker_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_object_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_object_tracker_group_feature/data-source.tf b/examples/data-sources/sdwan_service_object_tracker_group_feature/data-source.tf
new file mode 100644
index 000000000..d58efa88a
--- /dev/null
+++ b/examples/data-sources/sdwan_service_object_tracker_group_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_object_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_route_policy_feature/data-source.tf b/examples/data-sources/sdwan_service_route_policy_feature/data-source.tf
new file mode 100644
index 000000000..dce0a162b
--- /dev/null
+++ b/examples/data-sources/sdwan_service_route_policy_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_route_policy_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_routing_bgp_feature/data-source.tf b/examples/data-sources/sdwan_service_routing_bgp_feature/data-source.tf
new file mode 100644
index 000000000..04bd8aadf
--- /dev/null
+++ b/examples/data-sources/sdwan_service_routing_bgp_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_routing_bgp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_routing_ospf_feature/data-source.tf b/examples/data-sources/sdwan_service_routing_ospf_feature/data-source.tf
new file mode 100644
index 000000000..9cb674d25
--- /dev/null
+++ b/examples/data-sources/sdwan_service_routing_ospf_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_routing_ospf_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_routing_ospfv3_ipv4_feature/data-source.tf b/examples/data-sources/sdwan_service_routing_ospfv3_ipv4_feature/data-source.tf
new file mode 100644
index 000000000..4467dce1a
--- /dev/null
+++ b/examples/data-sources/sdwan_service_routing_ospfv3_ipv4_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_routing_ospfv3_ipv4_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_routing_ospfv3_ipv6_feature/data-source.tf b/examples/data-sources/sdwan_service_routing_ospfv3_ipv6_feature/data-source.tf
new file mode 100644
index 000000000..1773657a0
--- /dev/null
+++ b/examples/data-sources/sdwan_service_routing_ospfv3_ipv6_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_routing_ospfv3_ipv6_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_switchport_feature/data-source.tf b/examples/data-sources/sdwan_service_switchport_feature/data-source.tf
new file mode 100644
index 000000000..80cff5301
--- /dev/null
+++ b/examples/data-sources/sdwan_service_switchport_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_switchport_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_tracker_feature/data-source.tf b/examples/data-sources/sdwan_service_tracker_feature/data-source.tf
new file mode 100644
index 000000000..b9e86ff40
--- /dev/null
+++ b/examples/data-sources/sdwan_service_tracker_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_tracker_group_feature/data-source.tf b/examples/data-sources/sdwan_service_tracker_group_feature/data-source.tf
new file mode 100644
index 000000000..8d2142482
--- /dev/null
+++ b/examples/data-sources/sdwan_service_tracker_group_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_service_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_service_tracker_profile_parcel/data-source.tf b/examples/data-sources/sdwan_service_tracker_profile_parcel/data-source.tf
deleted file mode 100644
index 3117ae663..000000000
--- a/examples/data-sources/sdwan_service_tracker_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_service_tracker_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_sig_security_feature_profile/data-source.tf b/examples/data-sources/sdwan_sig_security_feature_profile/data-source.tf
new file mode 100644
index 000000000..b179a0256
--- /dev/null
+++ b/examples/data-sources/sdwan_sig_security_feature_profile/data-source.tf
@@ -0,0 +1,3 @@
+data "sdwan_sig_security_feature_profile" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+}
diff --git a/examples/data-sources/sdwan_system_aaa_feature/data-source.tf b/examples/data-sources/sdwan_system_aaa_feature/data-source.tf
new file mode 100644
index 000000000..f3686c9f2
--- /dev/null
+++ b/examples/data-sources/sdwan_system_aaa_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_aaa_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_aaa_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_aaa_profile_parcel/data-source.tf
deleted file mode 100644
index c4b1debbb..000000000
--- a/examples/data-sources/sdwan_system_aaa_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_aaa_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_banner_feature/data-source.tf b/examples/data-sources/sdwan_system_banner_feature/data-source.tf
new file mode 100644
index 000000000..2174ba8b3
--- /dev/null
+++ b/examples/data-sources/sdwan_system_banner_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_banner_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_banner_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_banner_profile_parcel/data-source.tf
deleted file mode 100644
index eaa0dd1c4..000000000
--- a/examples/data-sources/sdwan_system_banner_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_banner_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_basic_feature/data-source.tf b/examples/data-sources/sdwan_system_basic_feature/data-source.tf
new file mode 100644
index 000000000..79bb8c3dc
--- /dev/null
+++ b/examples/data-sources/sdwan_system_basic_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_basic_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_basic_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_basic_profile_parcel/data-source.tf
deleted file mode 100644
index 1408d6cd7..000000000
--- a/examples/data-sources/sdwan_system_basic_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_basic_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_bfd_feature/data-source.tf b/examples/data-sources/sdwan_system_bfd_feature/data-source.tf
new file mode 100644
index 000000000..7af592dec
--- /dev/null
+++ b/examples/data-sources/sdwan_system_bfd_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_bfd_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_bfd_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_bfd_profile_parcel/data-source.tf
deleted file mode 100644
index 687ab5155..000000000
--- a/examples/data-sources/sdwan_system_bfd_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_bfd_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_flexible_port_speed_feature/data-source.tf b/examples/data-sources/sdwan_system_flexible_port_speed_feature/data-source.tf
new file mode 100644
index 000000000..3da24d654
--- /dev/null
+++ b/examples/data-sources/sdwan_system_flexible_port_speed_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_flexible_port_speed_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_flexible_port_speed_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_flexible_port_speed_profile_parcel/data-source.tf
deleted file mode 100644
index 44261622e..000000000
--- a/examples/data-sources/sdwan_system_flexible_port_speed_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_flexible_port_speed_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_global_feature/data-source.tf b/examples/data-sources/sdwan_system_global_feature/data-source.tf
new file mode 100644
index 000000000..40a65f0cd
--- /dev/null
+++ b/examples/data-sources/sdwan_system_global_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_global_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_global_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_global_profile_parcel/data-source.tf
deleted file mode 100644
index 99e1a041b..000000000
--- a/examples/data-sources/sdwan_system_global_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_global_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_ipv4_device_access_feature/data-source.tf b/examples/data-sources/sdwan_system_ipv4_device_access_feature/data-source.tf
new file mode 100644
index 000000000..7d2e1befd
--- /dev/null
+++ b/examples/data-sources/sdwan_system_ipv4_device_access_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_ipv4_device_access_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_ipv4_device_access_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_ipv4_device_access_profile_parcel/data-source.tf
deleted file mode 100644
index 1733882ff..000000000
--- a/examples/data-sources/sdwan_system_ipv4_device_access_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_ipv4_device_access_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_ipv6_device_access_feature/data-source.tf b/examples/data-sources/sdwan_system_ipv6_device_access_feature/data-source.tf
new file mode 100644
index 000000000..6dab66c02
--- /dev/null
+++ b/examples/data-sources/sdwan_system_ipv6_device_access_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_ipv6_device_access_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_ipv6_device_access_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_ipv6_device_access_profile_parcel/data-source.tf
deleted file mode 100644
index 5f39f110c..000000000
--- a/examples/data-sources/sdwan_system_ipv6_device_access_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_ipv6_device_access_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_logging_feature/data-source.tf b/examples/data-sources/sdwan_system_logging_feature/data-source.tf
new file mode 100644
index 000000000..9456242b3
--- /dev/null
+++ b/examples/data-sources/sdwan_system_logging_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_logging_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_logging_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_logging_profile_parcel/data-source.tf
deleted file mode 100644
index 860af48aa..000000000
--- a/examples/data-sources/sdwan_system_logging_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_logging_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_mrf_feature/data-source.tf b/examples/data-sources/sdwan_system_mrf_feature/data-source.tf
new file mode 100644
index 000000000..70890be94
--- /dev/null
+++ b/examples/data-sources/sdwan_system_mrf_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_mrf_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_mrf_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_mrf_profile_parcel/data-source.tf
deleted file mode 100644
index 41953cfcd..000000000
--- a/examples/data-sources/sdwan_system_mrf_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_mrf_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_ntp_feature/data-source.tf b/examples/data-sources/sdwan_system_ntp_feature/data-source.tf
new file mode 100644
index 000000000..20469416a
--- /dev/null
+++ b/examples/data-sources/sdwan_system_ntp_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_ntp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_ntp_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_ntp_profile_parcel/data-source.tf
deleted file mode 100644
index 189a37fba..000000000
--- a/examples/data-sources/sdwan_system_ntp_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_ntp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_omp_feature/data-source.tf b/examples/data-sources/sdwan_system_omp_feature/data-source.tf
new file mode 100644
index 000000000..4edc7f3ea
--- /dev/null
+++ b/examples/data-sources/sdwan_system_omp_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_omp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_omp_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_omp_profile_parcel/data-source.tf
deleted file mode 100644
index 201b9ce19..000000000
--- a/examples/data-sources/sdwan_system_omp_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_omp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_performance_monitoring_feature/data-source.tf b/examples/data-sources/sdwan_system_performance_monitoring_feature/data-source.tf
new file mode 100644
index 000000000..bb401d2a9
--- /dev/null
+++ b/examples/data-sources/sdwan_system_performance_monitoring_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_performance_monitoring_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_performance_monitoring_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_performance_monitoring_profile_parcel/data-source.tf
deleted file mode 100644
index 2527246b5..000000000
--- a/examples/data-sources/sdwan_system_performance_monitoring_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_performance_monitoring_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_remote_access_feature/data-source.tf b/examples/data-sources/sdwan_system_remote_access_feature/data-source.tf
new file mode 100644
index 000000000..488c20bd2
--- /dev/null
+++ b/examples/data-sources/sdwan_system_remote_access_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_remote_access_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_remote_access_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_remote_access_profile_parcel/data-source.tf
deleted file mode 100644
index 51a5e558b..000000000
--- a/examples/data-sources/sdwan_system_remote_access_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_remote_access_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_security_feature/data-source.tf b/examples/data-sources/sdwan_system_security_feature/data-source.tf
new file mode 100644
index 000000000..7b05e0304
--- /dev/null
+++ b/examples/data-sources/sdwan_system_security_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_security_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_security_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_security_profile_parcel/data-source.tf
deleted file mode 100644
index 96d55a6d8..000000000
--- a/examples/data-sources/sdwan_system_security_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_security_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_system_snmp_feature/data-source.tf b/examples/data-sources/sdwan_system_snmp_feature/data-source.tf
new file mode 100644
index 000000000..814be2b62
--- /dev/null
+++ b/examples/data-sources/sdwan_system_snmp_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_system_snmp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_system_snmp_profile_parcel/data-source.tf b/examples/data-sources/sdwan_system_snmp_profile_parcel/data-source.tf
deleted file mode 100644
index 7fe859b50..000000000
--- a/examples/data-sources/sdwan_system_snmp_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_system_snmp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_transport_gps_feature/data-source.tf b/examples/data-sources/sdwan_transport_gps_feature/data-source.tf
new file mode 100644
index 000000000..17187b452
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_gps_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_gps_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_ipv6_tracker_feature/data-source.tf b/examples/data-sources/sdwan_transport_ipv6_tracker_feature/data-source.tf
new file mode 100644
index 000000000..ae9cb22a9
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_ipv6_tracker_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_ipv6_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_ipv6_tracker_group_feature/data-source.tf b/examples/data-sources/sdwan_transport_ipv6_tracker_group_feature/data-source.tf
new file mode 100644
index 000000000..8989308f6
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_ipv6_tracker_group_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_ipv6_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_ipv6_tracker_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_ipv6_tracker_profile_parcel/data-source.tf
deleted file mode 100644
index 5b273844c..000000000
--- a/examples/data-sources/sdwan_transport_ipv6_tracker_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_transport_ipv6_tracker_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_transport_management_vpn_feature/data-source.tf b/examples/data-sources/sdwan_transport_management_vpn_feature/data-source.tf
new file mode 100644
index 000000000..55ae27940
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_management_vpn_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_management_vpn_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_management_vpn_interface_ethernet_feature/data-source.tf b/examples/data-sources/sdwan_transport_management_vpn_interface_ethernet_feature/data-source.tf
new file mode 100644
index 000000000..47a76bb74
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_management_vpn_interface_ethernet_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_transport_management_vpn_interface_ethernet_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_management_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/data-source.tf
deleted file mode 100644
index 9f1365c31..000000000
--- a/examples/data-sources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_management_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_transport_management_vpn_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_management_vpn_profile_parcel/data-source.tf
deleted file mode 100644
index 34069fbf6..000000000
--- a/examples/data-sources/sdwan_transport_management_vpn_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_transport_management_vpn_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_transport_route_policy_feature/data-source.tf b/examples/data-sources/sdwan_transport_route_policy_feature/data-source.tf
new file mode 100644
index 000000000..8e5309b12
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_route_policy_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_route_policy_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_routing_bgp_feature/data-source.tf b/examples/data-sources/sdwan_transport_routing_bgp_feature/data-source.tf
new file mode 100644
index 000000000..d861c760b
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_routing_bgp_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_routing_bgp_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_routing_bgp_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_routing_bgp_profile_parcel/data-source.tf
deleted file mode 100644
index 6e83aecaf..000000000
--- a/examples/data-sources/sdwan_transport_routing_bgp_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_transport_routing_bgp_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/data-sources/sdwan_transport_routing_ospf_feature/data-source.tf b/examples/data-sources/sdwan_transport_routing_ospf_feature/data-source.tf
new file mode 100644
index 000000000..fbab22d3e
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_routing_ospf_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_routing_ospf_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_routing_ospfv3_ipv4_feature/data-source.tf b/examples/data-sources/sdwan_transport_routing_ospfv3_ipv4_feature/data-source.tf
new file mode 100644
index 000000000..56f822627
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_routing_ospfv3_ipv4_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_routing_ospfv3_ipv4_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_routing_ospfv3_ipv6_feature/data-source.tf b/examples/data-sources/sdwan_transport_routing_ospfv3_ipv6_feature/data-source.tf
new file mode 100644
index 000000000..255605a4a
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_routing_ospfv3_ipv6_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_routing_ospfv3_ipv6_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_tracker_feature/data-source.tf b/examples/data-sources/sdwan_transport_tracker_feature/data-source.tf
new file mode 100644
index 000000000..3d3c4cfed
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_tracker_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_tracker_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_tracker_group_feature/data-source.tf b/examples/data-sources/sdwan_transport_tracker_group_feature/data-source.tf
new file mode 100644
index 000000000..ffbe801aa
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_tracker_group_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_tracker_group_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_feature/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_feature/data-source.tf
new file mode 100644
index 000000000..6641ad745
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_wan_vpn_feature/data-source.tf
@@ -0,0 +1,4 @@
+data "sdwan_transport_wan_vpn_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_cellular_feature/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_cellular_feature/data-source.tf
new file mode 100644
index 000000000..75cdd73da
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_wan_vpn_interface_cellular_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_transport_wan_vpn_interface_cellular_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/data-source.tf
deleted file mode 100644
index ff5b45e40..000000000
--- a/examples/data-sources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_ethernet_feature/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_ethernet_feature/data-source.tf
new file mode 100644
index 000000000..d00d8f120
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_wan_vpn_interface_ethernet_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/data-source.tf
deleted file mode 100644
index 5f75eb7cd..000000000
--- a/examples/data-sources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_gre_feature/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_gre_feature/data-source.tf
new file mode 100644
index 000000000..d7cae9940
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_wan_vpn_interface_gre_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_transport_wan_vpn_interface_gre_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/data-source.tf
deleted file mode 100644
index d5f288c41..000000000
--- a/examples/data-sources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_ipsec_feature/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_ipsec_feature/data-source.tf
new file mode 100644
index 000000000..dd67dcd96
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_wan_vpn_interface_ipsec_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_transport_wan_vpn_interface_ipsec_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/data-source.tf
deleted file mode 100644
index 435f32758..000000000
--- a/examples/data-sources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/data-source.tf
new file mode 100644
index 000000000..4f9972781
--- /dev/null
+++ b/examples/data-sources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/data-source.tf
@@ -0,0 +1,5 @@
+data "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "example" {
+ id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/data-source.tf
deleted file mode 100644
index 19f2d0f4f..000000000
--- a/examples/data-sources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-data "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
-}
diff --git a/examples/data-sources/sdwan_transport_wan_vpn_profile_parcel/data-source.tf b/examples/data-sources/sdwan_transport_wan_vpn_profile_parcel/data-source.tf
deleted file mode 100644
index 5e8a3c47b..000000000
--- a/examples/data-sources/sdwan_transport_wan_vpn_profile_parcel/data-source.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-data "sdwan_transport_wan_vpn_profile_parcel" "example" {
- id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
-}
diff --git a/examples/resources/sdwan_application_priority_qos_policy/import.sh b/examples/resources/sdwan_application_priority_qos_policy/import.sh
new file mode 100644
index 000000000..cae2caead
--- /dev/null
+++ b/examples/resources/sdwan_application_priority_qos_policy/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_application_priority_qos_policy.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_application_priority_qos_policy/resource.tf b/examples/resources/sdwan_application_priority_qos_policy/resource.tf
new file mode 100644
index 000000000..aef8b1ed7
--- /dev/null
+++ b/examples/resources/sdwan_application_priority_qos_policy/resource.tf
@@ -0,0 +1,14 @@
+resource "sdwan_application_priority_qos_policy" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ target_interface = ["{{interface_var_1}}"]
+ qos_schedulers = [
+ {
+ drops = "tail-drop"
+ queue = "0"
+ bandwidth = "10"
+ scheduling_type = "llq"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_application_priority_qos_policy_profile_parcel/import.sh b/examples/resources/sdwan_application_priority_qos_policy_profile_parcel/import.sh
deleted file mode 100644
index 6a82e11c4..000000000
--- a/examples/resources/sdwan_application_priority_qos_policy_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_application_priority_qos_policy_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_application_priority_qos_policy_profile_parcel/resource.tf b/examples/resources/sdwan_application_priority_qos_policy_profile_parcel/resource.tf
deleted file mode 100644
index 5b038ab9f..000000000
--- a/examples/resources/sdwan_application_priority_qos_policy_profile_parcel/resource.tf
+++ /dev/null
@@ -1,14 +0,0 @@
-resource "sdwan_application_priority_qos_policy_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- target_interface = ["{{interface_var_1}}"]
- qos_schedulers = [
- {
- drops = "tail-drop"
- queue = "0"
- bandwidth = "10"
- scheduling_type = "llq"
- }
- ]
-}
diff --git a/examples/resources/sdwan_cli_config_feature/import.sh b/examples/resources/sdwan_cli_config_feature/import.sh
new file mode 100644
index 000000000..154ad7d5e
--- /dev/null
+++ b/examples/resources/sdwan_cli_config_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_cli_config_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_cli_config_feature/resource.tf b/examples/resources/sdwan_cli_config_feature/resource.tf
new file mode 100644
index 000000000..43d5780d3
--- /dev/null
+++ b/examples/resources/sdwan_cli_config_feature/resource.tf
@@ -0,0 +1,6 @@
+resource "sdwan_cli_config_feature" "example" {
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ name = "Example"
+ description = "My Example"
+ cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"
+}
diff --git a/examples/resources/sdwan_cli_config_profile_parcel/import.sh b/examples/resources/sdwan_cli_config_profile_parcel/import.sh
deleted file mode 100644
index 503004bce..000000000
--- a/examples/resources/sdwan_cli_config_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_cli_config_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_cli_config_profile_parcel/resource.tf b/examples/resources/sdwan_cli_config_profile_parcel/resource.tf
deleted file mode 100644
index f40d61663..000000000
--- a/examples/resources/sdwan_cli_config_profile_parcel/resource.tf
+++ /dev/null
@@ -1,6 +0,0 @@
-resource "sdwan_cli_config_profile_parcel" "example" {
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- name = "Example"
- description = "My Example"
- cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"
-}
diff --git a/examples/resources/sdwan_dns_security_feature_profile/import.sh b/examples/resources/sdwan_dns_security_feature_profile/import.sh
new file mode 100644
index 000000000..dc4c751ff
--- /dev/null
+++ b/examples/resources/sdwan_dns_security_feature_profile/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_dns_security_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_dns_security_feature_profile/resource.tf b/examples/resources/sdwan_dns_security_feature_profile/resource.tf
new file mode 100644
index 000000000..4fcccbef8
--- /dev/null
+++ b/examples/resources/sdwan_dns_security_feature_profile/resource.tf
@@ -0,0 +1,4 @@
+resource "sdwan_dns_security_feature_profile" "example" {
+ name = "DNS_SECURITY_FP_1"
+ description = "My dns security feature profile 1"
+}
diff --git a/examples/resources/sdwan_embedded_security_feature_profile/import.sh b/examples/resources/sdwan_embedded_security_feature_profile/import.sh
new file mode 100644
index 000000000..acf275678
--- /dev/null
+++ b/examples/resources/sdwan_embedded_security_feature_profile/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_embedded_security_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_embedded_security_feature_profile/resource.tf b/examples/resources/sdwan_embedded_security_feature_profile/resource.tf
new file mode 100644
index 000000000..58b011001
--- /dev/null
+++ b/examples/resources/sdwan_embedded_security_feature_profile/resource.tf
@@ -0,0 +1,4 @@
+resource "sdwan_embedded_security_feature_profile" "example" {
+ name = "EMBEDDED_SECURITY_FP_1"
+ description = "My embedded security feature profile 1"
+}
diff --git a/examples/resources/sdwan_other_feature_profile/import.sh b/examples/resources/sdwan_other_feature_profile/import.sh
new file mode 100644
index 000000000..7728695b9
--- /dev/null
+++ b/examples/resources/sdwan_other_feature_profile/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_other_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_other_feature_profile/resource.tf b/examples/resources/sdwan_other_feature_profile/resource.tf
new file mode 100644
index 000000000..c9015dc7a
--- /dev/null
+++ b/examples/resources/sdwan_other_feature_profile/resource.tf
@@ -0,0 +1,4 @@
+resource "sdwan_other_feature_profile" "example" {
+ name = "OTHER_FP_1"
+ description = "My Other feature profile 1"
+}
diff --git a/examples/resources/sdwan_other_thousandeyes_feature/import.sh b/examples/resources/sdwan_other_thousandeyes_feature/import.sh
new file mode 100644
index 000000000..92cb37c4f
--- /dev/null
+++ b/examples/resources/sdwan_other_thousandeyes_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_other_thousandeyes_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_other_thousandeyes_feature/resource.tf b/examples/resources/sdwan_other_thousandeyes_feature/resource.tf
new file mode 100644
index 000000000..d599e7eb1
--- /dev/null
+++ b/examples/resources/sdwan_other_thousandeyes_feature/resource.tf
@@ -0,0 +1,19 @@
+resource "sdwan_other_thousandeyes_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ virtual_application = [
+ {
+ account_group_token = "qwer"
+ vpn = 1
+ management_ip = "10.0.0.2"
+ management_subnet_mask = "255.255.255.0"
+ agent_default_gateway = "10.0.0.1"
+ name_server_ip = "77.77.77.71"
+ hostname = "thousandeyesHost"
+ proxy_type = "static"
+ proxy_host = "proxy.thousandeyes.com"
+ proxy_port = 3128
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_other_ucse_feature/import.sh b/examples/resources/sdwan_other_ucse_feature/import.sh
new file mode 100644
index 000000000..5299c39b8
--- /dev/null
+++ b/examples/resources/sdwan_other_ucse_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_other_ucse_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_other_ucse_feature/resource.tf b/examples/resources/sdwan_other_ucse_feature/resource.tf
new file mode 100644
index 000000000..d3bc4a405
--- /dev/null
+++ b/examples/resources/sdwan_other_ucse_feature/resource.tf
@@ -0,0 +1,21 @@
+resource "sdwan_other_ucse_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ bay = 2
+ slot = 0
+ access_port_dedicated = false
+ access_port_shared_type = "ge1"
+ access_port_shared_failover_type = "ge2"
+ ipv4_address = "2.2.2.2/24"
+ default_gateway = "2.2.2.2"
+ vlan_id = 3
+ assign_priority = 3
+ interfaces = [
+ {
+ interface_name = "ucse2/0"
+ ucse_interface_vpn = 2
+ ipv4_address = "10.1.15.15/24"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_app_probe_class/import.sh b/examples/resources/sdwan_policy_object_app_probe_class/import.sh
new file mode 100644
index 000000000..bdffae31e
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_app_probe_class/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_app_probe_class.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_app_probe_class/resource.tf b/examples/resources/sdwan_policy_object_app_probe_class/resource.tf
new file mode 100644
index 000000000..fcf1aa030
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_app_probe_class/resource.tf
@@ -0,0 +1,16 @@
+resource "sdwan_policy_object_app_probe_class" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ map = [
+ {
+ color = "3g"
+ dscp = 45
+ }
+ ]
+ forwarding_class = "classlist1"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_application_list/import.sh b/examples/resources/sdwan_policy_object_application_list/import.sh
new file mode 100644
index 000000000..5dfa9281e
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_application_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_application_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_application_list/resource.tf b/examples/resources/sdwan_policy_object_application_list/resource.tf
new file mode 100644
index 000000000..07420f639
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_application_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_application_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ application = "3com-amp3"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_as_path_list/import.sh b/examples/resources/sdwan_policy_object_as_path_list/import.sh
new file mode 100644
index 000000000..644d52273
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_as_path_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_as_path_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_as_path_list/resource.tf b/examples/resources/sdwan_policy_object_as_path_list/resource.tf
new file mode 100644
index 000000000..2bba15ef9
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_as_path_list/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_policy_object_as_path_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ as_path_list_id = 1
+ entries = [
+ {
+ as_path_list = "110"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_class_map/import.sh b/examples/resources/sdwan_policy_object_class_map/import.sh
new file mode 100644
index 000000000..b66a2bdbb
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_class_map/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_class_map.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_class_map/resource.tf b/examples/resources/sdwan_policy_object_class_map/resource.tf
new file mode 100644
index 000000000..b20416f6e
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_class_map/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_class_map" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ queue = "0"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_color_list/import.sh b/examples/resources/sdwan_policy_object_color_list/import.sh
new file mode 100644
index 000000000..be94fb700
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_color_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_color_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_color_list/resource.tf b/examples/resources/sdwan_policy_object_color_list/resource.tf
new file mode 100644
index 000000000..de162fba1
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_color_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_color_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ color = "blue"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_data_ipv4_prefix_list/import.sh b/examples/resources/sdwan_policy_object_data_ipv4_prefix_list/import.sh
new file mode 100644
index 000000000..c492a0e48
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_data_ipv4_prefix_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_data_ipv4_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_data_ipv4_prefix_list/resource.tf b/examples/resources/sdwan_policy_object_data_ipv4_prefix_list/resource.tf
new file mode 100644
index 000000000..059405979
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_data_ipv4_prefix_list/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_policy_object_data_ipv4_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv4_address = "10.0.0.0"
+ ipv4_prefix_length = 8
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_data_ipv6_prefix_list/import.sh b/examples/resources/sdwan_policy_object_data_ipv6_prefix_list/import.sh
new file mode 100644
index 000000000..d6e5ab15f
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_data_ipv6_prefix_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_data_ipv6_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_data_ipv6_prefix_list/resource.tf b/examples/resources/sdwan_policy_object_data_ipv6_prefix_list/resource.tf
new file mode 100644
index 000000000..d3a8e0f67
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_data_ipv6_prefix_list/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_policy_object_data_ipv6_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv6_address = "2001:db8:85a3::8a2e:370:7334"
+ ipv6_prefix_length = 64
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_expanded_community_list/import.sh b/examples/resources/sdwan_policy_object_expanded_community_list/import.sh
new file mode 100644
index 000000000..e7186c5a9
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_expanded_community_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_expanded_community_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_expanded_community_list/resource.tf b/examples/resources/sdwan_policy_object_expanded_community_list/resource.tf
new file mode 100644
index 000000000..0363ba2bf
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_expanded_community_list/resource.tf
@@ -0,0 +1,6 @@
+resource "sdwan_policy_object_expanded_community_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ expanded_community_lists = ["abcd"]
+}
diff --git a/examples/resources/sdwan_policy_object_extended_community_list/import.sh b/examples/resources/sdwan_policy_object_extended_community_list/import.sh
new file mode 100644
index 000000000..7369c3d61
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_extended_community_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_extended_community_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_extended_community_list/resource.tf b/examples/resources/sdwan_policy_object_extended_community_list/resource.tf
new file mode 100644
index 000000000..c4cb77000
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_extended_community_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_extended_community_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ extended_community = "soo 10.0.0.1:30"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_feature_profile/import.sh b/examples/resources/sdwan_policy_object_feature_profile/import.sh
new file mode 100644
index 000000000..ee4f54227
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_feature_profile/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_feature_profile/resource.tf b/examples/resources/sdwan_policy_object_feature_profile/resource.tf
new file mode 100644
index 000000000..531f4201a
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_feature_profile/resource.tf
@@ -0,0 +1,4 @@
+resource "sdwan_policy_object_feature_profile" "example" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
diff --git a/examples/resources/sdwan_policy_object_ipv4_prefix_list/import.sh b/examples/resources/sdwan_policy_object_ipv4_prefix_list/import.sh
new file mode 100644
index 000000000..444e1f4f9
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_ipv4_prefix_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_ipv4_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_ipv4_prefix_list/resource.tf b/examples/resources/sdwan_policy_object_ipv4_prefix_list/resource.tf
new file mode 100644
index 000000000..ad0c6040f
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_ipv4_prefix_list/resource.tf
@@ -0,0 +1,13 @@
+resource "sdwan_policy_object_ipv4_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv4_address = "10.0.0.0"
+ ipv4_prefix_length = 8
+ le = 24
+ ge = 16
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_ipv6_prefix_list/import.sh b/examples/resources/sdwan_policy_object_ipv6_prefix_list/import.sh
new file mode 100644
index 000000000..8c04634c7
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_ipv6_prefix_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_ipv6_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_ipv6_prefix_list/resource.tf b/examples/resources/sdwan_policy_object_ipv6_prefix_list/resource.tf
new file mode 100644
index 000000000..f411ccbee
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_ipv6_prefix_list/resource.tf
@@ -0,0 +1,13 @@
+resource "sdwan_policy_object_ipv6_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ipv6_address = "2001:db8:85a3::8a2e:370:7334"
+ ipv6_prefix_length = 64
+ le = 100
+ ge = 70
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_mirror/import.sh b/examples/resources/sdwan_policy_object_mirror/import.sh
new file mode 100644
index 000000000..ce3b14d10
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_mirror/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_mirror.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_mirror/resource.tf b/examples/resources/sdwan_policy_object_mirror/resource.tf
new file mode 100644
index 000000000..c98690fb1
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_mirror/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_policy_object_mirror" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ remote_destination_ip = "10.0.0.1"
+ source_ip = "10.0.0.2"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_policer/import.sh b/examples/resources/sdwan_policy_object_policer/import.sh
new file mode 100644
index 000000000..d45e923b9
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_policer/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_policer.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_policer/resource.tf b/examples/resources/sdwan_policy_object_policer/resource.tf
new file mode 100644
index 000000000..73b669567
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_policer/resource.tf
@@ -0,0 +1,12 @@
+resource "sdwan_policy_object_policer" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ burst_bytes = 56500
+ exceed_action = "remark"
+ rate_bps = 60000
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_preferred_color_group/import.sh b/examples/resources/sdwan_policy_object_preferred_color_group/import.sh
new file mode 100644
index 000000000..1f8914fd8
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_preferred_color_group/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_preferred_color_group.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_preferred_color_group/resource.tf b/examples/resources/sdwan_policy_object_preferred_color_group/resource.tf
new file mode 100644
index 000000000..407c71c45
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_preferred_color_group/resource.tf
@@ -0,0 +1,15 @@
+resource "sdwan_policy_object_preferred_color_group" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ primary_color_preference = ["default"]
+ primary_path_preference = "direct-path"
+ secondary_color_preference = ["bronze"]
+ secondary_path_preference = "all-paths"
+ tertiary_color_preference = ["blue"]
+ tertiary_path_preference = "all-paths"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list/import.sh b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list/import.sh
new file mode 100644
index 000000000..28998eea0
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_data_ipv4_prefix_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list/resource.tf b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list/resource.tf
new file mode 100644
index 000000000..6cfd38d43
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_data_ipv4_prefix_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ ip_prefix = "10.0.0.0/12"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_fqdn_list/import.sh b/examples/resources/sdwan_policy_object_security_fqdn_list/import.sh
new file mode 100644
index 000000000..2996ad5c5
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_fqdn_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_fqdn_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_fqdn_list/resource.tf b/examples/resources/sdwan_policy_object_security_fqdn_list/resource.tf
new file mode 100644
index 000000000..19d6576ef
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_fqdn_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_fqdn_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ pattern = "cisco.com"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_geolocation_list/import.sh b/examples/resources/sdwan_policy_object_security_geolocation_list/import.sh
new file mode 100644
index 000000000..6fbf478dc
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_geolocation_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_geolocation_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_geolocation_list/resource.tf b/examples/resources/sdwan_policy_object_security_geolocation_list/resource.tf
new file mode 100644
index 000000000..3a4a050f5
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_geolocation_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_geolocation_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ country = "DZA"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_identity_list/import.sh b/examples/resources/sdwan_policy_object_security_identity_list/import.sh
new file mode 100644
index 000000000..69b628a91
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_identity_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_identity_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_identity_list/resource.tf b/examples/resources/sdwan_policy_object_security_identity_list/resource.tf
new file mode 100644
index 000000000..93e68f035
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_identity_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_identity_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ user = "administrator"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_ips_signature/import.sh b/examples/resources/sdwan_policy_object_security_ips_signature/import.sh
new file mode 100644
index 000000000..9aa08eb5c
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_ips_signature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_ips_signature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_ips_signature/resource.tf b/examples/resources/sdwan_policy_object_security_ips_signature/resource.tf
new file mode 100644
index 000000000..d6a18fb88
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_ips_signature/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_policy_object_security_ips_signature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ generator_id = "1234"
+ signature_id = "5678"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_local_application_list/import.sh b/examples/resources/sdwan_policy_object_security_local_application_list/import.sh
new file mode 100644
index 000000000..6b50af297
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_local_application_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_local_application_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_local_application_list/resource.tf b/examples/resources/sdwan_policy_object_security_local_application_list/resource.tf
new file mode 100644
index 000000000..ba4373eab
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_local_application_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_local_application_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ app = "audible-com"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_local_domain_list/import.sh b/examples/resources/sdwan_policy_object_security_local_domain_list/import.sh
new file mode 100644
index 000000000..3b07d7d4a
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_local_domain_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_local_domain_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_local_domain_list/resource.tf b/examples/resources/sdwan_policy_object_security_local_domain_list/resource.tf
new file mode 100644
index 000000000..744e33ed3
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_local_domain_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_local_domain_list" "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_port_list/import.sh b/examples/resources/sdwan_policy_object_security_port_list/import.sh
new file mode 100644
index 000000000..8360c0763
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_port_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_port_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_port_list/resource.tf b/examples/resources/sdwan_policy_object_security_port_list/resource.tf
new file mode 100644
index 000000000..c020e1649
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_port_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_port_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ port = "100"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_scalable_group_tag_list/import.sh b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list/import.sh
new file mode 100644
index 000000000..6f5af2caf
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_scalable_group_tag_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_scalable_group_tag_list/resource.tf b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list/resource.tf
new file mode 100644
index 000000000..b7bc19d67
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_policy_object_security_scalable_group_tag_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = ""
+ entries = [
+ {
+ sgt_name = "ANY"
+ tag = "65535"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_security_url_list/import.sh b/examples/resources/sdwan_policy_object_security_url_list/import.sh
new file mode 100644
index 000000000..d3c7e0c61
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_url_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_security_url_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_security_url_list/resource.tf b/examples/resources/sdwan_policy_object_security_url_list/resource.tf
new file mode 100644
index 000000000..7dafae6ed
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_security_url_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_security_url_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ pattern = "www.cisco.com"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_sla_class_list/import.sh b/examples/resources/sdwan_policy_object_sla_class_list/import.sh
new file mode 100644
index 000000000..7a56a3d08
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_sla_class_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_sla_class_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_sla_class_list/resource.tf b/examples/resources/sdwan_policy_object_sla_class_list/resource.tf
new file mode 100644
index 000000000..55fd26cac
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_sla_class_list/resource.tf
@@ -0,0 +1,14 @@
+resource "sdwan_policy_object_sla_class_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ latency = 2
+ loss = 1
+ jitter = 1
+ fallback_best_tunnel_criteria = "loss"
+ fallback_best_tunnel_loss_variance = 5
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_standard_community_list/import.sh b/examples/resources/sdwan_policy_object_standard_community_list/import.sh
new file mode 100644
index 000000000..72e834627
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_standard_community_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_standard_community_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_standard_community_list/resource.tf b/examples/resources/sdwan_policy_object_standard_community_list/resource.tf
new file mode 100644
index 000000000..c17c61c1a
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_standard_community_list/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_standard_community_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ standard_community = "1000:10000"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_tloc_list/import.sh b/examples/resources/sdwan_policy_object_tloc_list/import.sh
new file mode 100644
index 000000000..22ebaebc6
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_tloc_list/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_tloc_list.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_tloc_list/resource.tf b/examples/resources/sdwan_policy_object_tloc_list/resource.tf
new file mode 100644
index 000000000..9b767a9c3
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_tloc_list/resource.tf
@@ -0,0 +1,13 @@
+resource "sdwan_policy_object_tloc_list" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ tloc_ip = "10.0.0.0"
+ color = "3g"
+ encapsulation = "gre"
+ preference = "33"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_policy_object_vpn_group/import.sh b/examples/resources/sdwan_policy_object_vpn_group/import.sh
new file mode 100644
index 000000000..3e0d3b280
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_vpn_group/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_policy_object_vpn_group.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_policy_object_vpn_group/resource.tf b/examples/resources/sdwan_policy_object_vpn_group/resource.tf
new file mode 100644
index 000000000..2ca0377ad
--- /dev/null
+++ b/examples/resources/sdwan_policy_object_vpn_group/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_policy_object_vpn_group" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ entries = [
+ {
+ vpn = 100
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_service_lan_vpn_feature/import.sh b/examples/resources/sdwan_service_lan_vpn_feature/import.sh
new file mode 100644
index 000000000..250392290
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_lan_vpn_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_feature/resource.tf b/examples/resources/sdwan_service_lan_vpn_feature/resource.tf
new file mode 100644
index 000000000..fe314d2f6
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_feature/resource.tf
@@ -0,0 +1,129 @@
+resource "sdwan_service_lan_vpn_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ vpn = 1
+ config_description = "VPN1"
+ omp_admin_distance_ipv4 = 1
+ omp_admin_distance_ipv6 = 1
+ enable_sdwan_remote_access = false
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ host_mappings = [
+ {
+ host_name = "HOSTMAPPING1"
+ list_of_ips = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2001:0:0:1::0/12"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "FW"
+ ipv4_addresses = ["1.2.3.4"]
+ tracking = true
+ }
+ ]
+ service_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ service = "SIG"
+ vpn = 0
+ }
+ ]
+ gre_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ interface = ["gre01"]
+ vpn = 0
+ }
+ ]
+ ipsec_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ interface = ["ipsec01"]
+ }
+ ]
+ nat_pools = [
+ {
+ nat_pool_name = 1
+ prefix_length = 3
+ range_start = "1.2.3.4"
+ range_end = "2.3.4.5"
+ overload = true
+ direction = "inside"
+ }
+ ]
+ nat_port_forwards = [
+ {
+ nat_pool_name = 2
+ source_port = 122
+ translate_port = 330
+ source_ip = "1.2.3.4"
+ translated_source_ip = "2.3.4.5"
+ protocol = "TCP"
+ }
+ ]
+ static_nats = [
+ {
+ nat_pool_name = 3
+ source_ip = "1.2.3.4"
+ translated_source_ip = "2.3.4.5"
+ static_nat_direction = "inside"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ name = "NATPOOL1"
+ range_start = "1.2.3.4"
+ range_end = "2.3.4.5"
+ overload = false
+ }
+ ]
+ ipv4_import_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+ ipv4_export_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+ ipv6_import_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+ ipv6_export_route_targets = [
+ {
+ route_target = "1.1.1.3:200"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ethernet_feature/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_ethernet_feature/import.sh
new file mode 100644
index 000000000..4e2cb9af5
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_ethernet_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_lan_vpn_interface_ethernet_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ethernet_feature/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_ethernet_feature/resource.tf
new file mode 100644
index 000000000..68e339a94
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_ethernet_feature/resource.tf
@@ -0,0 +1,100 @@
+resource "sdwan_service_lan_vpn_interface_ethernet_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = false
+ interface_name = "GigabitEthernet3"
+ interface_description = "LAN"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "1.2.3.5"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ ipv6_dhcp_helpers = [
+ {
+ address = "2001:0:0:1::0"
+ dhcpv6_helper_vpn = 1
+ }
+ ]
+ ipv4_nat = false
+ ipv4_nat_type = "pool"
+ ipv4_nat_range_start = "1.2.3.4"
+ ipv4_nat_range_end = "4.5.6.7"
+ ipv4_nat_prefix_length = 1
+ ipv4_nat_overload = true
+ ipv4_nat_loopback = "123"
+ ipv4_nat_udp_timeout = 123
+ ipv4_nat_tcp_timeout = 123
+ static_nats = [
+ {
+ source_ip = "1.2.3.4"
+ translate_ip = "2.3.4.5"
+ direction = "inside"
+ source_vpn = 0
+ }
+ ]
+ ipv6_nat = true
+ nat64 = false
+ acl_shaping_rate = 12
+ ipv6_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ ipv6_addresses = [
+ {
+ link_local_address = "1::1"
+ global_address = "1::1/24"
+ }
+ ]
+ }
+ ]
+ ipv4_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ address = "1.2.3.4"
+ secondary_addresses = [
+ {
+ address = "2.3.4.5"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ tloc_prefix_change = true
+ tloc_pref_change_value = 100
+ }
+ ]
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ trustsec_enable_sgt_propogation = false
+ trustsec_propogate = true
+ trustsec_security_group_tag = 123
+ trustsec_enable_enforced_propogation = false
+ trustsec_enforced_security_group_tag = 1234
+ duplex = "full"
+ mac_address = "00-B0-D0-63-C2-26"
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 500
+ speed = "1000"
+ arp_timeout = 1200
+ autonegotiate = false
+ media_type = "auto-select"
+ load_interval = 30
+ tracker = "TRACKER1"
+ icmp_redirect_disable = true
+ xconnect = "1"
+ ip_directed_broadcast = false
+}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/import.sh
deleted file mode 100644
index 298fd3aba..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_service_lan_vpn_interface_ethernet_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/resource.tf
deleted file mode 100644
index a8fe86b68..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_ethernet_profile_parcel/resource.tf
+++ /dev/null
@@ -1,100 +0,0 @@
-resource "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = false
- interface_name = "GigabitEthernet3"
- interface_description = "LAN"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "1.2.3.5"
- subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helper = ["1.2.3.4"]
- ipv6_dhcp_helpers = [
- {
- address = "2001:0:0:1::0"
- dhcpv6_helper_vpn = 1
- }
- ]
- ipv4_nat = false
- ipv4_nat_type = "pool"
- ipv4_nat_range_start = "1.2.3.4"
- ipv4_nat_range_end = "4.5.6.7"
- ipv4_nat_prefix_length = 1
- ipv4_nat_overload = true
- ipv4_nat_loopback = "123"
- ipv4_nat_udp_timeout = 123
- ipv4_nat_tcp_timeout = 123
- static_nats = [
- {
- source_ip = "1.2.3.4"
- translate_ip = "2.3.4.5"
- direction = "inside"
- source_vpn = 0
- }
- ]
- ipv6_nat = true
- nat64 = false
- acl_shaping_rate = 12
- ipv6_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- ipv6_addresses = [
- {
- link_local_address = "1::1"
- global_address = "1::1/24"
- }
- ]
- }
- ]
- ipv4_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- address = "1.2.3.4"
- secondary_addresses = [
- {
- address = "2.3.4.5"
- subnet_mask = "0.0.0.0"
- }
- ]
- tloc_prefix_change = true
- tloc_pref_change_value = 100
- }
- ]
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- trustsec_enable_sgt_propogation = false
- trustsec_propogate = true
- trustsec_security_group_tag = 123
- trustsec_enable_enforced_propogation = false
- trustsec_enforced_security_group_tag = 1234
- duplex = "full"
- mac_address = "00-B0-D0-63-C2-26"
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 500
- speed = "1000"
- arp_timeout = 1200
- autonegotiate = false
- media_type = "auto-select"
- load_interval = 30
- tracker = "TRACKER1"
- icmp_redirect_disable = true
- xconnect = "1"
- ip_directed_broadcast = false
-}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_gre_feature/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_gre_feature/import.sh
new file mode 100644
index 000000000..02e73e8ab
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_gre_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_lan_vpn_interface_gre_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_gre_feature/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_gre_feature/resource.tf
new file mode 100644
index 000000000..012cf5f20
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_gre_feature/resource.tf
@@ -0,0 +1,17 @@
+resource "sdwan_service_lan_vpn_interface_gre_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "gre1"
+ interface_description = "gre1"
+ ipv4_address = "70.1.1.1"
+ ipv4_subnet_mask = "255.255.255.0"
+ shutdown = true
+ tunnel_source_ipv4_address = "78.1.1.1"
+ tunnel_destination_ipv4_address = "79.1.1.1"
+ ip_mtu = 1500
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ application_tunnel_type = "none"
+}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_gre_profile_parcel/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_gre_profile_parcel/import.sh
deleted file mode 100644
index 023df9a1f..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_gre_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_service_lan_vpn_interface_gre_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_gre_profile_parcel/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_gre_profile_parcel/resource.tf
deleted file mode 100644
index eaedfae00..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_gre_profile_parcel/resource.tf
+++ /dev/null
@@ -1,17 +0,0 @@
-resource "sdwan_service_lan_vpn_interface_gre_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "gre1"
- interface_description = "gre1"
- ipv4_address = "70.1.1.1"
- ipv4_subnet_mask = "255.255.255.0"
- shutdown = true
- tunnel_source_ipv4_address = "78.1.1.1"
- tunnel_destination_ipv4_address = "79.1.1.1"
- ip_mtu = 1500
- tcp_mss = 1460
- clear_dont_fragment = false
- application_tunnel_type = "none"
-}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ipsec_feature/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_ipsec_feature/import.sh
new file mode 100644
index 000000000..66e19b94d
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_ipsec_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_lan_vpn_interface_ipsec_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ipsec_feature/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_ipsec_feature/resource.tf
new file mode 100644
index 000000000..4ddcf8a9b
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_ipsec_feature/resource.tf
@@ -0,0 +1,35 @@
+resource "sdwan_service_lan_vpn_interface_ipsec_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "ipsec987"
+ shutdown = true
+ interface_description = "ipsec987"
+ ipv4_address = "9.7.5.4"
+ ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_ipv4_address = "1.3.5.88"
+ tunnel_source_ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_interface = "GigabitEthernet8"
+ tunnel_destination_ipv4_address = "2.55.67.99"
+ tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
+ application_tunnel_type = "none"
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ ip_mtu = 1500
+ dpd_interval = 10
+ dpd_retries = 3
+ ike_preshared_key = "123"
+ ike_version = 1
+ ike_integrity_protocol = "main"
+ ike_rekey_interval = 14400
+ ike_ciphersuite = "aes256-cbc-sha1"
+ ike_diffie_hellman_group = "16"
+ ike_id_local_end_point = "xxx"
+ ike_id_remote_end_point = "xxx"
+ ipsec_rekey_interval = 3600
+ ipsec_replay_window = 512
+ ipsec_ciphersuite = "aes256-gcm"
+ perfect_forward_secrecy = "group-16"
+ tunnel_route_via = "2222"
+}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/import.sh
deleted file mode 100644
index 0b57a744f..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_service_lan_vpn_interface_ipsec_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/resource.tf
deleted file mode 100644
index b3730d06d..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_ipsec_profile_parcel/resource.tf
+++ /dev/null
@@ -1,35 +0,0 @@
-resource "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "ipsec987"
- shutdown = true
- interface_description = "ipsec987"
- ipv4_address = "9.7.5.4"
- ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_ipv4_address = "1.3.5.88"
- tunnel_source_ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_interface = "GigabitEthernet8"
- tunnel_destination_ipv4_address = "2.55.67.99"
- tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
- application_tunnel_type = "none"
- tcp_mss = 1460
- clear_dont_fragment = false
- ip_mtu = 1500
- dpd_interval = 10
- dpd_retries = 3
- ike_preshared_key = "123"
- ike_version = 1
- ike_integrity_protocol = "main"
- ike_rekey_interval = 14400
- ike_ciphersuite = "aes256-cbc-sha1"
- ike_diffie_hellman_group = "16"
- ike_id_local_end_point = "xxx"
- ike_id_remote_end_point = "xxx"
- ipsec_rekey_interval = 3600
- ipsec_replay_window = 512
- ipsec_ciphersuite = "aes256-gcm"
- perfect_forward_secrecy = "group-16"
- tunnel_route_via = "2222"
-}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_svi_feature/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_svi_feature/import.sh
new file mode 100644
index 000000000..12ba6df68
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_svi_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_lan_vpn_interface_svi_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_svi_feature/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_svi_feature/resource.tf
new file mode 100644
index 000000000..d95a0b1df
--- /dev/null
+++ b/examples/resources/sdwan_service_lan_vpn_interface_svi_feature/resource.tf
@@ -0,0 +1,80 @@
+resource "sdwan_service_lan_vpn_interface_svi_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ service_lan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = false
+ interface_name = "Vlan1"
+ interface_description = "SVI"
+ interface_mtu = 1500
+ ip_mtu = 1500
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "2.3.4.5"
+ ipv4_subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helpers = ["4.5.6.7"]
+ ipv6_address = "2001:0:0:1::0/32"
+ ipv6_secondary_addresses = [
+ {
+ address = "::2/32"
+ }
+ ]
+ ipv6_dhcp_helpers = [
+ {
+ address = "2001:0:0:1::0"
+ vpn = 1
+ }
+ ]
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ ipv4_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ prefix_list = "prefix"
+ address = "1.2.3.4"
+ secondary_addresses = [
+ {
+ address = "2.3.4.5"
+ }
+ ]
+ tloc_prefix_change = true
+ tloc_prefix_change_value = 100
+ }
+ ]
+ ipv6_vrrps = [
+ {
+ group_id = 1
+ priority = 100
+ timer = 1000
+ track_omp = false
+ track_prefix_list = "1"
+ addresses = [
+ {
+ link_local_address = "1::1"
+ global_address = "1::1/24"
+ }
+ ]
+ secondary_addresses = [
+ {
+ prefix = "::20/32"
+ }
+ ]
+ }
+ ]
+ enable_dhcpv6 = false
+ tcp_mss = 1024
+ arp_timeout = 1200
+ ip_directed_broadcast = false
+ icmp_redirect_disable = true
+}
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_svi_profile_parcel/import.sh b/examples/resources/sdwan_service_lan_vpn_interface_svi_profile_parcel/import.sh
deleted file mode 100644
index 89982d911..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_svi_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_service_lan_vpn_interface_svi_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_interface_svi_profile_parcel/resource.tf b/examples/resources/sdwan_service_lan_vpn_interface_svi_profile_parcel/resource.tf
deleted file mode 100644
index 39a2f3c96..000000000
--- a/examples/resources/sdwan_service_lan_vpn_interface_svi_profile_parcel/resource.tf
+++ /dev/null
@@ -1,80 +0,0 @@
-resource "sdwan_service_lan_vpn_interface_svi_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- service_lan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = false
- interface_name = "Vlan1"
- interface_description = "SVI"
- interface_mtu = 1500
- ip_mtu = 1500
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "2.3.4.5"
- ipv4_subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helpers = ["4.5.6.7"]
- ipv6_address = "2001:0:0:1::0/32"
- ipv6_secondary_addresses = [
- {
- address = "::2/32"
- }
- ]
- ipv6_dhcp_helpers = [
- {
- address = "2001:0:0:1::0"
- vpn = 1
- }
- ]
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- ipv4_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- prefix_list = "prefix"
- address = "1.2.3.4"
- secondary_addresses = [
- {
- address = "2.3.4.5"
- }
- ]
- tloc_prefix_change = true
- tloc_prefix_change_value = 100
- }
- ]
- ipv6_vrrps = [
- {
- group_id = 1
- priority = 100
- timer = 1000
- track_omp = false
- track_prefix_list = "1"
- addresses = [
- {
- link_local_address = "1::1"
- global_address = "1::1/24"
- }
- ]
- secondary_addresses = [
- {
- prefix = "::20/32"
- }
- ]
- }
- ]
- enable_dhcpv6 = false
- tcp_mss = 1024
- arp_timeout = 1200
- ip_directed_broadcast = false
- icmp_redirect_disable = true
-}
diff --git a/examples/resources/sdwan_service_lan_vpn_profile_parcel/import.sh b/examples/resources/sdwan_service_lan_vpn_profile_parcel/import.sh
deleted file mode 100644
index 44f2ff995..000000000
--- a/examples/resources/sdwan_service_lan_vpn_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_service_lan_vpn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_lan_vpn_profile_parcel/resource.tf b/examples/resources/sdwan_service_lan_vpn_profile_parcel/resource.tf
deleted file mode 100644
index a739b3ed2..000000000
--- a/examples/resources/sdwan_service_lan_vpn_profile_parcel/resource.tf
+++ /dev/null
@@ -1,129 +0,0 @@
-resource "sdwan_service_lan_vpn_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- vpn = 1
- config_description = "VPN1"
- omp_admin_distance_ipv4 = 1
- omp_admin_distance_ipv6 = 1
- enable_sdwan_remote_access = false
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- host_mappings = [
- {
- host_name = "HOSTMAPPING1"
- list_of_ips = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2001:0:0:1::0/12"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "FW"
- ipv4_addresses = ["1.2.3.4"]
- tracking = true
- }
- ]
- service_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- service = "SIG"
- vpn = 0
- }
- ]
- gre_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- interface = ["gre01"]
- vpn = 0
- }
- ]
- ipsec_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- interface = ["ipsec01"]
- }
- ]
- nat_pools = [
- {
- nat_pool_name = 1
- prefix_length = 3
- range_start = "1.2.3.4"
- range_end = "2.3.4.5"
- overload = true
- direction = "inside"
- }
- ]
- nat_port_forwards = [
- {
- nat_pool_name = 2
- source_port = 122
- translate_port = 330
- source_ip = "1.2.3.4"
- translated_source_ip = "2.3.4.5"
- protocol = "TCP"
- }
- ]
- static_nats = [
- {
- nat_pool_name = 3
- source_ip = "1.2.3.4"
- translated_source_ip = "2.3.4.5"
- static_nat_direction = "inside"
- }
- ]
- nat_64_v4_pools = [
- {
- name = "NATPOOL1"
- range_start = "1.2.3.4"
- range_end = "2.3.4.5"
- overload = false
- }
- ]
- ipv4_import_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
- ipv4_export_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
- ipv6_import_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
- ipv6_export_route_targets = [
- {
- route_target = "1.1.1.3:200"
- }
- ]
-}
diff --git a/examples/resources/sdwan_service_object_tracker_feature/import.sh b/examples/resources/sdwan_service_object_tracker_feature/import.sh
new file mode 100644
index 000000000..ffec980ee
--- /dev/null
+++ b/examples/resources/sdwan_service_object_tracker_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_object_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_object_tracker_feature/resource.tf b/examples/resources/sdwan_service_object_tracker_feature/resource.tf
new file mode 100644
index 000000000..c25c3765f
--- /dev/null
+++ b/examples/resources/sdwan_service_object_tracker_feature/resource.tf
@@ -0,0 +1,8 @@
+resource "sdwan_service_object_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ object_tracker_id = 10
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+}
diff --git a/examples/resources/sdwan_service_object_tracker_group_feature/import.sh b/examples/resources/sdwan_service_object_tracker_group_feature/import.sh
new file mode 100644
index 000000000..7d1d5bab5
--- /dev/null
+++ b/examples/resources/sdwan_service_object_tracker_group_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_object_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_object_tracker_group_feature/resource.tf b/examples/resources/sdwan_service_object_tracker_group_feature/resource.tf
new file mode 100644
index 000000000..65329b6e9
--- /dev/null
+++ b/examples/resources/sdwan_service_object_tracker_group_feature/resource.tf
@@ -0,0 +1,12 @@
+resource "sdwan_service_object_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ object_tracker_id = 10
+ tracker_elements = [
+ {
+ object_tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ reachable = "or"
+}
diff --git a/examples/resources/sdwan_service_route_policy_feature/import.sh b/examples/resources/sdwan_service_route_policy_feature/import.sh
new file mode 100644
index 000000000..9c4139045
--- /dev/null
+++ b/examples/resources/sdwan_service_route_policy_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_route_policy_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_route_policy_feature/resource.tf b/examples/resources/sdwan_service_route_policy_feature/resource.tf
new file mode 100644
index 000000000..2b81031a0
--- /dev/null
+++ b/examples/resources/sdwan_service_route_policy_feature/resource.tf
@@ -0,0 +1,29 @@
+resource "sdwan_service_route_policy_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "accept"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "reject"
+ protocol = "IPV4"
+ actions = [
+ {
+ as_path_prepend = [65521]
+ community_additive = false
+ community = ["internet"]
+ local_preference = 100
+ metric = 20
+ metric_type = "type1"
+ omp_tag = 200
+ origin = "EGP"
+ ospf_tag = 1200
+ weight = 2200
+ ipv4_next_hop = "10.0.0.1"
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_service_routing_bgp_feature/import.sh b/examples/resources/sdwan_service_routing_bgp_feature/import.sh
new file mode 100644
index 000000000..815d9df52
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_bgp_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_routing_bgp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_routing_bgp_feature/resource.tf b/examples/resources/sdwan_service_routing_bgp_feature/resource.tf
new file mode 100644
index 000000000..2fc836377
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_bgp_feature/resource.tf
@@ -0,0 +1,108 @@
+resource "sdwan_service_routing_bgp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ as_number = 429
+ router_id = "1.2.3.4"
+ propagate_as_path = false
+ propagate_community = false
+ external_routes_distance = 20
+ internal_routes_distance = 200
+ local_routes_distance = 20
+ keepalive_time = 60
+ hold_time = 180
+ always_compare_med = false
+ deterministic_med = false
+ missing_med_as_worst = false
+ compare_router_id = false
+ multipath_relax = false
+ ipv4_neighbors = [
+ {
+ address = "1.2.3.4"
+ description = "neighbor1"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 40
+ hold_time = 200
+ update_source_interface = "GigabitEthernet0"
+ next_hop_self = false
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 1
+ password = "myPassword"
+ send_label = true
+ as_override = false
+ allowas_in_number = 1
+ address_families = [
+ {
+ family_type = "ipv4-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv6_neighbors = [
+ {
+ address = "2001::1"
+ description = "neighbor2"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 180
+ hold_time = 60
+ update_source_interface = "Loopback1"
+ next_hop_self = true
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 3
+ password = "myPassword"
+ as_override = true
+ allowas_in_number = 3
+ address_families = [
+ {
+ family_type = "ipv6-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv4_aggregate_addresses = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv4_networks = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ }
+ ]
+ ipv4_eibgp_maximum_paths = 1
+ ipv4_originate = false
+ ipv4_table_map_filter = false
+ ipv6_aggregate_addresses = [
+ {
+ aggregate_prefix = "3001::1/128"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv6_networks = [
+ {
+ network_prefix = "2001:0DB8:0000:000b::/64"
+ }
+ ]
+ ipv6_eibgp_maximum_paths = 2
+ ipv6_originate = true
+ ipv6_table_map_filter = false
+}
diff --git a/examples/resources/sdwan_service_routing_ospf_feature/import.sh b/examples/resources/sdwan_service_routing_ospf_feature/import.sh
new file mode 100644
index 000000000..100c6cbce
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_ospf_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_routing_ospf_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_routing_ospf_feature/resource.tf b/examples/resources/sdwan_service_routing_ospf_feature/resource.tf
new file mode 100644
index 000000000..1f36e4b60
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_ospf_feature/resource.tf
@@ -0,0 +1,60 @@
+resource "sdwan_service_routing_ospf_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ redistributes = [
+ {
+ protocol = "static"
+ nat_dia = true
+ }
+ ]
+ router_lsas = [
+ {
+ type = "on-startup"
+ time = 5
+ }
+ ]
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ no_summary = false
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ designated_router_priority = 1
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "message-digest"
+ message_digest_key_id = 7
+ message_digest_key = "sdjfhsghbjdjr"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_service_routing_ospfv3_ipv4_feature/import.sh b/examples/resources/sdwan_service_routing_ospfv3_ipv4_feature/import.sh
new file mode 100644
index 000000000..040dd314f
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_ospfv3_ipv4_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_routing_ospfv3_ipv4_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_routing_ospfv3_ipv4_feature/resource.tf b/examples/resources/sdwan_service_routing_ospfv3_ipv4_feature/resource.tf
new file mode 100644
index 000000000..67d5b0dea
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_ospfv3_ipv4_feature/resource.tf
@@ -0,0 +1,54 @@
+resource "sdwan_service_routing_ospfv3_ipv4_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "nat-route"
+ nat_dia = true
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_service_routing_ospfv3_ipv6_feature/import.sh b/examples/resources/sdwan_service_routing_ospfv3_ipv6_feature/import.sh
new file mode 100644
index 000000000..22225e3a0
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_ospfv3_ipv6_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_routing_ospfv3_ipv6_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_routing_ospfv3_ipv6_feature/resource.tf b/examples/resources/sdwan_service_routing_ospfv3_ipv6_feature/resource.tf
new file mode 100644
index 000000000..2e10666c0
--- /dev/null
+++ b/examples/resources/sdwan_service_routing_ospfv3_ipv6_feature/resource.tf
@@ -0,0 +1,52 @@
+resource "sdwan_service_routing_ospfv3_ipv6_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "static"
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ prefix = "3002::/96"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_service_switchport_feature/import.sh b/examples/resources/sdwan_service_switchport_feature/import.sh
new file mode 100644
index 000000000..f5708b9ca
--- /dev/null
+++ b/examples/resources/sdwan_service_switchport_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_switchport_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_switchport_feature/resource.tf b/examples/resources/sdwan_service_switchport_feature/resource.tf
new file mode 100644
index 000000000..3782befa4
--- /dev/null
+++ b/examples/resources/sdwan_service_switchport_feature/resource.tf
@@ -0,0 +1,38 @@
+resource "sdwan_service_switchport_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ interfaces = [
+ {
+ interface_name = "GigabitEthernet"
+ mode = "access"
+ shutdown = true
+ speed = "10"
+ duplex = "full"
+ switchport_access_vlan = 1
+ switchport_trunk_allowed_vlans = "1"
+ switchport_trunk_native_vlan = 1
+ port_control = "auto"
+ voice_vlan = 1
+ pae_enable = true
+ mac_authentication_bypass = false
+ host_mode = "single-host"
+ enable_periodic_reauth = false
+ inactivity = 60
+ reauthentication = 1
+ control_direction = "both"
+ restricted_vlan = 1
+ guest_vlan = 1
+ critical_vlan = 1
+ enable_voice = false
+ }
+ ]
+ age_out_time = 300
+ static_mac_addresses = [
+ {
+ mac_address = "01:02:03:04:05:06"
+ vlan_id = 1
+ interface_name = "GigabitEthernet0/0/0"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_service_tracker_feature/import.sh b/examples/resources/sdwan_service_tracker_feature/import.sh
new file mode 100644
index 000000000..70f2c945c
--- /dev/null
+++ b/examples/resources/sdwan_service_tracker_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_tracker_feature/resource.tf b/examples/resources/sdwan_service_tracker_feature/resource.tf
new file mode 100644
index 000000000..ee8f4670a
--- /dev/null
+++ b/examples/resources/sdwan_service_tracker_feature/resource.tf
@@ -0,0 +1,16 @@
+resource "sdwan_service_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_2"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ protocol = "tcp"
+ port = 123
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "static-route"
+ tracker_type = "endpoint"
+}
diff --git a/examples/resources/sdwan_service_tracker_group_feature/import.sh b/examples/resources/sdwan_service_tracker_group_feature/import.sh
new file mode 100644
index 000000000..d6e7fd98d
--- /dev/null
+++ b/examples/resources/sdwan_service_tracker_group_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_service_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_tracker_group_feature/resource.tf b/examples/resources/sdwan_service_tracker_group_feature/resource.tf
new file mode 100644
index 000000000..24e5fd94e
--- /dev/null
+++ b/examples/resources/sdwan_service_tracker_group_feature/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_service_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_elements = [
+ {
+ tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ tracker_boolean = "or"
+}
diff --git a/examples/resources/sdwan_service_tracker_profile_parcel/import.sh b/examples/resources/sdwan_service_tracker_profile_parcel/import.sh
deleted file mode 100644
index 23c1e6199..000000000
--- a/examples/resources/sdwan_service_tracker_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_service_tracker_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_service_tracker_profile_parcel/resource.tf b/examples/resources/sdwan_service_tracker_profile_parcel/resource.tf
deleted file mode 100644
index 6119bf63c..000000000
--- a/examples/resources/sdwan_service_tracker_profile_parcel/resource.tf
+++ /dev/null
@@ -1,16 +0,0 @@
-resource "sdwan_service_tracker_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- tracker_name = "TRACKER_2"
- endpoint_api_url = "google.com"
- endpoint_dns_name = "google.com"
- endpoint_ip = "1.2.3.4"
- protocol = "tcp"
- port = 123
- interval = 30
- multiplier = 3
- threshold = 300
- endpoint_tracker_type = "static-route"
- tracker_type = "endpoint"
-}
diff --git a/examples/resources/sdwan_sig_security_feature_profile/import.sh b/examples/resources/sdwan_sig_security_feature_profile/import.sh
new file mode 100644
index 000000000..d8bc6a0bd
--- /dev/null
+++ b/examples/resources/sdwan_sig_security_feature_profile/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_sig_security_feature_profile.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_sig_security_feature_profile/resource.tf b/examples/resources/sdwan_sig_security_feature_profile/resource.tf
new file mode 100644
index 000000000..a0db33612
--- /dev/null
+++ b/examples/resources/sdwan_sig_security_feature_profile/resource.tf
@@ -0,0 +1,4 @@
+resource "sdwan_sig_security_feature_profile" "example" {
+ name = "SIG_SECURITY_FP_1"
+ description = "My sig security feature profile 1"
+}
diff --git a/examples/resources/sdwan_system_aaa_feature/import.sh b/examples/resources/sdwan_system_aaa_feature/import.sh
new file mode 100644
index 000000000..38a71dbdd
--- /dev/null
+++ b/examples/resources/sdwan_system_aaa_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_aaa_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_aaa_feature/resource.tf b/examples/resources/sdwan_system_aaa_feature/resource.tf
new file mode 100644
index 000000000..1850a6d2f
--- /dev/null
+++ b/examples/resources/sdwan_system_aaa_feature/resource.tf
@@ -0,0 +1,78 @@
+resource "sdwan_system_aaa_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ authentication_group = true
+ accounting_group = true
+ server_auth_order = ["local"]
+ users = [
+ {
+ name = "User1"
+ password = "cisco123"
+ privilege = "15"
+ public_keys = [
+ {
+ key_string = "AAAAB3NzaC1yc2"
+ key_type = "ssh-rsa"
+ }
+ ]
+ }
+ ]
+ radius_groups = [
+ {
+ group_name = "RGROUP1"
+ vpn = 10
+ source_interface = "GigabitEthernet0"
+ servers = [
+ {
+ address = "1.2.3.4"
+ auth_port = 1812
+ acct_port = 1813
+ timeout = 5
+ retransmit = 3
+ key = "cisco123"
+ secret_key = "cisco123"
+ key_enum = "7"
+ key_type = "key"
+ }
+ ]
+ }
+ ]
+ tacacs_groups = [
+ {
+ group_name = "TGROUP1"
+ vpn = 10
+ source_interface = "GigabitEthernet0"
+ servers = [
+ {
+ address = "1.2.3.4"
+ port = 49
+ timeout = 5
+ key = "cisco123"
+ secret_key = "cisco123"
+ key_enum = "7"
+ }
+ ]
+ }
+ ]
+ accounting_rules = [
+ {
+ rule_id = "1"
+ method = "commands"
+ level = "15"
+ start_stop = true
+ group = ["RGROUP1"]
+ }
+ ]
+ authorization_console = true
+ authorization_config_commands = true
+ authorization_rules = [
+ {
+ rule_id = "1"
+ method = "commands"
+ level = "15"
+ group = ["RGROUP1"]
+ if_authenticated = true
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_aaa_profile_parcel/import.sh b/examples/resources/sdwan_system_aaa_profile_parcel/import.sh
deleted file mode 100644
index 61809da27..000000000
--- a/examples/resources/sdwan_system_aaa_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_aaa_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_aaa_profile_parcel/resource.tf b/examples/resources/sdwan_system_aaa_profile_parcel/resource.tf
deleted file mode 100644
index b611eb3c5..000000000
--- a/examples/resources/sdwan_system_aaa_profile_parcel/resource.tf
+++ /dev/null
@@ -1,78 +0,0 @@
-resource "sdwan_system_aaa_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- authentication_group = true
- accounting_group = true
- server_auth_order = ["local"]
- users = [
- {
- name = "User1"
- password = "cisco123"
- privilege = "15"
- public_keys = [
- {
- key_string = "AAAAB3NzaC1yc2"
- key_type = "ssh-rsa"
- }
- ]
- }
- ]
- radius_groups = [
- {
- group_name = "RGROUP1"
- vpn = 10
- source_interface = "GigabitEthernet0"
- servers = [
- {
- address = "1.2.3.4"
- auth_port = 1812
- acct_port = 1813
- timeout = 5
- retransmit = 3
- key = "cisco123"
- secret_key = "cisco123"
- key_enum = "7"
- key_type = "key"
- }
- ]
- }
- ]
- tacacs_groups = [
- {
- group_name = "TGROUP1"
- vpn = 10
- source_interface = "GigabitEthernet0"
- servers = [
- {
- address = "1.2.3.4"
- port = 49
- timeout = 5
- key = "cisco123"
- secret_key = "cisco123"
- key_enum = "7"
- }
- ]
- }
- ]
- accounting_rules = [
- {
- rule_id = "1"
- method = "commands"
- level = "15"
- start_stop = true
- group = ["RGROUP1"]
- }
- ]
- authorization_console = true
- authorization_config_commands = true
- authorization_rules = [
- {
- rule_id = "1"
- method = "commands"
- level = "15"
- group = ["RGROUP1"]
- if_authenticated = true
- }
- ]
-}
diff --git a/examples/resources/sdwan_system_banner_feature/import.sh b/examples/resources/sdwan_system_banner_feature/import.sh
new file mode 100644
index 000000000..5203f9290
--- /dev/null
+++ b/examples/resources/sdwan_system_banner_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_banner_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_banner_feature/resource.tf b/examples/resources/sdwan_system_banner_feature/resource.tf
new file mode 100644
index 000000000..1a8292d66
--- /dev/null
+++ b/examples/resources/sdwan_system_banner_feature/resource.tf
@@ -0,0 +1,7 @@
+resource "sdwan_system_banner_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ login = "My login banner"
+ motd = "My motd banner"
+}
diff --git a/examples/resources/sdwan_system_banner_profile_parcel/import.sh b/examples/resources/sdwan_system_banner_profile_parcel/import.sh
deleted file mode 100644
index 3052c58fd..000000000
--- a/examples/resources/sdwan_system_banner_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_banner_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_banner_profile_parcel/resource.tf b/examples/resources/sdwan_system_banner_profile_parcel/resource.tf
deleted file mode 100644
index 1c3c3914d..000000000
--- a/examples/resources/sdwan_system_banner_profile_parcel/resource.tf
+++ /dev/null
@@ -1,7 +0,0 @@
-resource "sdwan_system_banner_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- login = "My login banner"
- motd = "My motd banner"
-}
diff --git a/examples/resources/sdwan_system_basic_feature/import.sh b/examples/resources/sdwan_system_basic_feature/import.sh
new file mode 100644
index 000000000..b4b0eb574
--- /dev/null
+++ b/examples/resources/sdwan_system_basic_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_basic_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_basic_feature/resource.tf b/examples/resources/sdwan_system_basic_feature/resource.tf
new file mode 100644
index 000000000..b8bba3d09
--- /dev/null
+++ b/examples/resources/sdwan_system_basic_feature/resource.tf
@@ -0,0 +1,46 @@
+resource "sdwan_system_basic_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ timezone = "UTC"
+ config_description = "example"
+ location = "example"
+ gps_longitude = -77
+ gps_latitude = 38
+ gps_geo_fencing_enable = true
+ gps_geo_fencing_range = 100
+ gps_sms_enable = true
+ gps_sms_mobile_numbers = [
+ {
+ number = "+11111233"
+ }
+ ]
+ device_groups = ["example"]
+ controller_groups = [1]
+ overlay_id = 1
+ port_offset = 19
+ port_hopping = true
+ control_session_pps = 300
+ track_transport = true
+ track_interface_tag = 2
+ console_baud_rate = "9600"
+ max_omp_sessions = 24
+ multi_tenant = false
+ track_default_gateway = true
+ admin_tech_on_failure = true
+ idle_timeout = 10
+ on_demand_enable = true
+ on_demand_idle_timeout = 10
+ transport_gateway = false
+ enhanced_app_aware_routing = "aggressive"
+ site_types = ["type-1"]
+ affinity_group_number = 1
+ affinity_group_preferences = [1]
+ affinity_preference_auto = false
+ affinity_per_vrfs = [
+ {
+ affinity_group_number = 1
+ vrf_range = "123-456"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_basic_profile_parcel/import.sh b/examples/resources/sdwan_system_basic_profile_parcel/import.sh
deleted file mode 100644
index dce0f8ac2..000000000
--- a/examples/resources/sdwan_system_basic_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_basic_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_basic_profile_parcel/resource.tf b/examples/resources/sdwan_system_basic_profile_parcel/resource.tf
deleted file mode 100644
index 43bf66c68..000000000
--- a/examples/resources/sdwan_system_basic_profile_parcel/resource.tf
+++ /dev/null
@@ -1,46 +0,0 @@
-resource "sdwan_system_basic_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- timezone = "UTC"
- config_description = "example"
- location = "example"
- gps_longitude = -77
- gps_latitude = 38
- gps_geo_fencing_enable = true
- gps_geo_fencing_range = 100
- gps_sms_enable = true
- gps_sms_mobile_numbers = [
- {
- number = "+11111233"
- }
- ]
- device_groups = ["example"]
- controller_groups = [1]
- overlay_id = 1
- port_offset = 19
- port_hopping = true
- control_session_pps = 300
- track_transport = true
- track_interface_tag = 2
- console_baud_rate = "9600"
- max_omp_sessions = 24
- multi_tenant = false
- track_default_gateway = true
- admin_tech_on_failure = true
- idle_timeout = 10
- on_demand_enable = true
- on_demand_idle_timeout = 10
- transport_gateway = false
- enhanced_app_aware_routing = "aggressive"
- site_types = ["type-1"]
- affinity_group_number = 1
- affinity_group_preferences = [1]
- affinity_preference_auto = false
- affinity_per_vrfs = [
- {
- affinity_group_number = 1
- vrf_range = "123-456"
- }
- ]
-}
diff --git a/examples/resources/sdwan_system_bfd_feature/import.sh b/examples/resources/sdwan_system_bfd_feature/import.sh
new file mode 100644
index 000000000..d01c1b721
--- /dev/null
+++ b/examples/resources/sdwan_system_bfd_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_bfd_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_bfd_feature/resource.tf b/examples/resources/sdwan_system_bfd_feature/resource.tf
new file mode 100644
index 000000000..254f37ede
--- /dev/null
+++ b/examples/resources/sdwan_system_bfd_feature/resource.tf
@@ -0,0 +1,17 @@
+resource "sdwan_system_bfd_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ multiplier = 3
+ poll_interval = 100
+ default_dscp = 8
+ colors = [
+ {
+ color = "3g"
+ hello_interval = 200
+ multiplier = 3
+ pmtu_discovery = true
+ dscp = 16
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_bfd_profile_parcel/import.sh b/examples/resources/sdwan_system_bfd_profile_parcel/import.sh
deleted file mode 100644
index 80ff8ab0f..000000000
--- a/examples/resources/sdwan_system_bfd_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_bfd_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_bfd_profile_parcel/resource.tf b/examples/resources/sdwan_system_bfd_profile_parcel/resource.tf
deleted file mode 100644
index f655ebf55..000000000
--- a/examples/resources/sdwan_system_bfd_profile_parcel/resource.tf
+++ /dev/null
@@ -1,17 +0,0 @@
-resource "sdwan_system_bfd_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- multiplier = 3
- poll_interval = 100
- default_dscp = 8
- colors = [
- {
- color = "3g"
- hello_interval = 200
- multiplier = 3
- pmtu_discovery = true
- dscp = 16
- }
- ]
-}
diff --git a/examples/resources/sdwan_system_flexible_port_speed_feature/import.sh b/examples/resources/sdwan_system_flexible_port_speed_feature/import.sh
new file mode 100644
index 000000000..e83a1d9ca
--- /dev/null
+++ b/examples/resources/sdwan_system_flexible_port_speed_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_flexible_port_speed_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_flexible_port_speed_feature/resource.tf b/examples/resources/sdwan_system_flexible_port_speed_feature/resource.tf
new file mode 100644
index 000000000..74d1cbbe3
--- /dev/null
+++ b/examples/resources/sdwan_system_flexible_port_speed_feature/resource.tf
@@ -0,0 +1,6 @@
+resource "sdwan_system_flexible_port_speed_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ port_type = "12 ports of 1/10GE + 3 ports 40GE"
+}
diff --git a/examples/resources/sdwan_system_flexible_port_speed_profile_parcel/import.sh b/examples/resources/sdwan_system_flexible_port_speed_profile_parcel/import.sh
deleted file mode 100644
index 0c38b4290..000000000
--- a/examples/resources/sdwan_system_flexible_port_speed_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_flexible_port_speed_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_flexible_port_speed_profile_parcel/resource.tf b/examples/resources/sdwan_system_flexible_port_speed_profile_parcel/resource.tf
deleted file mode 100644
index 542a4340e..000000000
--- a/examples/resources/sdwan_system_flexible_port_speed_profile_parcel/resource.tf
+++ /dev/null
@@ -1,6 +0,0 @@
-resource "sdwan_system_flexible_port_speed_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- port_type = "12 ports of 1/10GE + 3 ports 40GE"
-}
diff --git a/examples/resources/sdwan_system_global_feature/import.sh b/examples/resources/sdwan_system_global_feature/import.sh
new file mode 100644
index 000000000..6d8dd99d1
--- /dev/null
+++ b/examples/resources/sdwan_system_global_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_global_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_global_feature/resource.tf b/examples/resources/sdwan_system_global_feature/resource.tf
new file mode 100644
index 000000000..7f5ad80b2
--- /dev/null
+++ b/examples/resources/sdwan_system_global_feature/resource.tf
@@ -0,0 +1,28 @@
+resource "sdwan_system_global_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ http_server = false
+ https_server = false
+ ftp_passive = false
+ domain_lookup = false
+ arp_proxy = false
+ rsh_rcp = false
+ line_vty = false
+ cdp = true
+ lldp = true
+ source_interface = "GigabitEthernet0/0/1"
+ tcp_keepalives_in = true
+ tcp_keepalives_out = true
+ tcp_small_servers = false
+ udp_small_servers = false
+ console_logging = true
+ ip_source_routing = false
+ vty_line_logging = false
+ snmp_ifindex_persist = true
+ ignore_bootp = true
+ nat64_udp_timeout = 300
+ nat64_tcp_timeout = 3600
+ http_authentication = "aaa"
+ ssh_version = "2"
+}
diff --git a/examples/resources/sdwan_system_global_profile_parcel/import.sh b/examples/resources/sdwan_system_global_profile_parcel/import.sh
deleted file mode 100644
index 8a5a3c860..000000000
--- a/examples/resources/sdwan_system_global_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_global_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_global_profile_parcel/resource.tf b/examples/resources/sdwan_system_global_profile_parcel/resource.tf
deleted file mode 100644
index 6b2ad6891..000000000
--- a/examples/resources/sdwan_system_global_profile_parcel/resource.tf
+++ /dev/null
@@ -1,28 +0,0 @@
-resource "sdwan_system_global_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- http_server = false
- https_server = false
- ftp_passive = false
- domain_lookup = false
- arp_proxy = false
- rsh_rcp = false
- line_vty = false
- cdp = true
- lldp = true
- source_interface = "GigabitEthernet0/0/1"
- tcp_keepalives_in = true
- tcp_keepalives_out = true
- tcp_small_servers = false
- udp_small_servers = false
- console_logging = true
- ip_source_routing = false
- vty_line_logging = false
- snmp_ifindex_persist = true
- ignore_bootp = true
- nat64_udp_timeout = 300
- nat64_tcp_timeout = 3600
- http_authentication = "aaa"
- ssh_version = "2"
-}
diff --git a/examples/resources/sdwan_system_ipv4_device_access_feature/import.sh b/examples/resources/sdwan_system_ipv4_device_access_feature/import.sh
new file mode 100644
index 000000000..662288faa
--- /dev/null
+++ b/examples/resources/sdwan_system_ipv4_device_access_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_ipv4_device_access_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_ipv4_device_access_feature/resource.tf b/examples/resources/sdwan_system_ipv4_device_access_feature/resource.tf
new file mode 100644
index 000000000..66b73def8
--- /dev/null
+++ b/examples/resources/sdwan_system_ipv4_device_access_feature/resource.tf
@@ -0,0 +1,14 @@
+resource "sdwan_system_ipv4_device_access_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "drop"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "accept"
+ device_access_port = 161
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_ipv4_device_access_profile_parcel/import.sh b/examples/resources/sdwan_system_ipv4_device_access_profile_parcel/import.sh
deleted file mode 100644
index bdd864336..000000000
--- a/examples/resources/sdwan_system_ipv4_device_access_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_ipv4_device_access_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_ipv4_device_access_profile_parcel/resource.tf b/examples/resources/sdwan_system_ipv4_device_access_profile_parcel/resource.tf
deleted file mode 100644
index 1c3da661b..000000000
--- a/examples/resources/sdwan_system_ipv4_device_access_profile_parcel/resource.tf
+++ /dev/null
@@ -1,14 +0,0 @@
-resource "sdwan_system_ipv4_device_access_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- default_action = "drop"
- sequences = [
- {
- id = 1
- name = "SEQ_1"
- base_action = "accept"
- device_access_port = 161
- }
- ]
-}
diff --git a/examples/resources/sdwan_system_ipv6_device_access_feature/import.sh b/examples/resources/sdwan_system_ipv6_device_access_feature/import.sh
new file mode 100644
index 000000000..364de8e60
--- /dev/null
+++ b/examples/resources/sdwan_system_ipv6_device_access_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_ipv6_device_access_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_ipv6_device_access_feature/resource.tf b/examples/resources/sdwan_system_ipv6_device_access_feature/resource.tf
new file mode 100644
index 000000000..d4026b614
--- /dev/null
+++ b/examples/resources/sdwan_system_ipv6_device_access_feature/resource.tf
@@ -0,0 +1,14 @@
+resource "sdwan_system_ipv6_device_access_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "drop"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "accept"
+ device_access_port = 22
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_ipv6_device_access_profile_parcel/import.sh b/examples/resources/sdwan_system_ipv6_device_access_profile_parcel/import.sh
deleted file mode 100644
index 530d1c520..000000000
--- a/examples/resources/sdwan_system_ipv6_device_access_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_ipv6_device_access_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_ipv6_device_access_profile_parcel/resource.tf b/examples/resources/sdwan_system_ipv6_device_access_profile_parcel/resource.tf
deleted file mode 100644
index 87ec4700b..000000000
--- a/examples/resources/sdwan_system_ipv6_device_access_profile_parcel/resource.tf
+++ /dev/null
@@ -1,14 +0,0 @@
-resource "sdwan_system_ipv6_device_access_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- default_action = "drop"
- sequences = [
- {
- id = 1
- name = "SEQ_1"
- base_action = "accept"
- device_access_port = 22
- }
- ]
-}
diff --git a/examples/resources/sdwan_system_logging_feature/import.sh b/examples/resources/sdwan_system_logging_feature/import.sh
new file mode 100644
index 000000000..e4bfc462a
--- /dev/null
+++ b/examples/resources/sdwan_system_logging_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_logging_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_logging_feature/resource.tf b/examples/resources/sdwan_system_logging_feature/resource.tf
new file mode 100644
index 000000000..85f240ae5
--- /dev/null
+++ b/examples/resources/sdwan_system_logging_feature/resource.tf
@@ -0,0 +1,37 @@
+resource "sdwan_system_logging_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ disk_enable = true
+ disk_file_size = 9
+ disk_file_rotate = 10
+ tls_profiles = [
+ {
+ profile = "test"
+ tls_version = "TLSv1.1"
+ cipher_suites = ["aes-128-cbc-sha"]
+ }
+ ]
+ ipv4_servers = [
+ {
+ hostname_ip = "1.1.1.1"
+ vpn = 512
+ source_interface = "GigabitEthernet1"
+ priority = "informational"
+ tls_enable = true
+ tls_properties_custom_profile = true
+ tls_properties_profile = "test"
+ }
+ ]
+ ipv6_servers = [
+ {
+ hostname_ip = "1.1.1.1"
+ vpn = 512
+ source_interface = "GigabitEthernet1"
+ priority = "informational"
+ tls_enable = true
+ tls_properties_custom_profile = true
+ tls_properties_profile = "test"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_logging_profile_parcel/import.sh b/examples/resources/sdwan_system_logging_profile_parcel/import.sh
deleted file mode 100644
index 2a9d20bad..000000000
--- a/examples/resources/sdwan_system_logging_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_logging_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_logging_profile_parcel/resource.tf b/examples/resources/sdwan_system_logging_profile_parcel/resource.tf
deleted file mode 100644
index 52894d50c..000000000
--- a/examples/resources/sdwan_system_logging_profile_parcel/resource.tf
+++ /dev/null
@@ -1,37 +0,0 @@
-resource "sdwan_system_logging_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- disk_enable = true
- disk_file_size = 9
- disk_file_rotate = 10
- tls_profiles = [
- {
- profile = "test"
- tls_version = "TLSv1.1"
- cipher_suites = ["aes-128-cbc-sha"]
- }
- ]
- ipv4_servers = [
- {
- hostname_ip = "1.1.1.1"
- vpn = 512
- source_interface = "GigabitEthernet1"
- priority = "informational"
- tls_enable = true
- tls_properties_custom_profile = true
- tls_properties_profile = "test"
- }
- ]
- ipv6_servers = [
- {
- hostname_ip = "1.1.1.1"
- vpn = 512
- source_interface = "GigabitEthernet1"
- priority = "informational"
- tls_enable = true
- tls_properties_custom_profile = true
- tls_properties_profile = "test"
- }
- ]
-}
diff --git a/examples/resources/sdwan_system_mrf_feature/import.sh b/examples/resources/sdwan_system_mrf_feature/import.sh
new file mode 100644
index 000000000..0e2449ac0
--- /dev/null
+++ b/examples/resources/sdwan_system_mrf_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_mrf_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_mrf_feature/resource.tf b/examples/resources/sdwan_system_mrf_feature/resource.tf
new file mode 100644
index 000000000..08fde11fd
--- /dev/null
+++ b/examples/resources/sdwan_system_mrf_feature/resource.tf
@@ -0,0 +1,10 @@
+resource "sdwan_system_mrf_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ region_id = 1
+ secondary_region_id = 2
+ role = "edge-router"
+ enable_migration_to_mrf = "enabled"
+ migration_bgp_community = 100
+}
diff --git a/examples/resources/sdwan_system_mrf_profile_parcel/import.sh b/examples/resources/sdwan_system_mrf_profile_parcel/import.sh
deleted file mode 100644
index 1e5571278..000000000
--- a/examples/resources/sdwan_system_mrf_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_mrf_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_mrf_profile_parcel/resource.tf b/examples/resources/sdwan_system_mrf_profile_parcel/resource.tf
deleted file mode 100644
index 0f10bcf69..000000000
--- a/examples/resources/sdwan_system_mrf_profile_parcel/resource.tf
+++ /dev/null
@@ -1,10 +0,0 @@
-resource "sdwan_system_mrf_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- region_id = 1
- secondary_region_id = 2
- role = "edge-router"
- enable_migration_to_mrf = "enabled"
- migration_bgp_community = 100
-}
diff --git a/examples/resources/sdwan_system_ntp_feature/import.sh b/examples/resources/sdwan_system_ntp_feature/import.sh
new file mode 100644
index 000000000..1d874fa3d
--- /dev/null
+++ b/examples/resources/sdwan_system_ntp_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_ntp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_ntp_feature/resource.tf b/examples/resources/sdwan_system_ntp_feature/resource.tf
new file mode 100644
index 000000000..fbb47f2a2
--- /dev/null
+++ b/examples/resources/sdwan_system_ntp_feature/resource.tf
@@ -0,0 +1,25 @@
+resource "sdwan_system_ntp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ servers = [
+ {
+ hostname_ip_address = "1.1.1.1"
+ authentication_key = 41673
+ vpn = 1
+ ntp_version = 4
+ source_interface = "Ethernet"
+ prefer_this_ntp_server = false
+ }
+ ]
+ authentication_keys = [
+ {
+ key_id = 49737
+ md5_value = "$CRYPT_CLUSTER"
+ }
+ ]
+ trusted_keys = [49737]
+ authoritative_ntp_server = false
+ stratum = 1
+ source_interface = "ATM"
+}
diff --git a/examples/resources/sdwan_system_ntp_profile_parcel/import.sh b/examples/resources/sdwan_system_ntp_profile_parcel/import.sh
deleted file mode 100644
index 42218fb2f..000000000
--- a/examples/resources/sdwan_system_ntp_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_ntp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_ntp_profile_parcel/resource.tf b/examples/resources/sdwan_system_ntp_profile_parcel/resource.tf
deleted file mode 100644
index 5f6ef8627..000000000
--- a/examples/resources/sdwan_system_ntp_profile_parcel/resource.tf
+++ /dev/null
@@ -1,25 +0,0 @@
-resource "sdwan_system_ntp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- servers = [
- {
- hostname_ip_address = "1.1.1.1"
- authentication_key = 41673
- vpn = 1
- ntp_version = 4
- source_interface = "Ethernet"
- prefer_this_ntp_server = false
- }
- ]
- authentication_keys = [
- {
- key_id = 49737
- md5_value = "$CRYPT_CLUSTER"
- }
- ]
- trusted_keys = [49737]
- authoritative_ntp_server = false
- stratum = 1
- source_interface = "ATM"
-}
diff --git a/examples/resources/sdwan_system_omp_feature/import.sh b/examples/resources/sdwan_system_omp_feature/import.sh
new file mode 100644
index 000000000..b5c6c51c7
--- /dev/null
+++ b/examples/resources/sdwan_system_omp_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_omp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_omp_feature/resource.tf b/examples/resources/sdwan_system_omp_feature/resource.tf
new file mode 100644
index 000000000..9ed742776
--- /dev/null
+++ b/examples/resources/sdwan_system_omp_feature/resource.tf
@@ -0,0 +1,34 @@
+resource "sdwan_system_omp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ graceful_restart = true
+ overlay_as = 10
+ paths_advertised_per_prefix = 4
+ ecmp_limit = 4
+ shutdown = false
+ omp_admin_distance_ipv4 = 10
+ omp_admin_distance_ipv6 = 20
+ advertisement_interval = 1
+ graceful_restart_timer = 43200
+ eor_timer = 300
+ holdtime = 60
+ advertise_ipv4_bgp = false
+ advertise_ipv4_ospf = false
+ advertise_ipv4_ospf_v3 = false
+ advertise_ipv4_connected = false
+ advertise_ipv4_static = false
+ advertise_ipv4_eigrp = false
+ advertise_ipv4_lisp = false
+ advertise_ipv4_isis = false
+ advertise_ipv6_bgp = true
+ advertise_ipv6_ospf = true
+ advertise_ipv6_connected = true
+ advertise_ipv6_static = true
+ advertise_ipv6_eigrp = true
+ advertise_ipv6_lisp = true
+ advertise_ipv6_isis = true
+ ignore_region_path_length = false
+ transport_gateway = "prefer"
+ site_types = ["type-1"]
+}
diff --git a/examples/resources/sdwan_system_omp_profile_parcel/import.sh b/examples/resources/sdwan_system_omp_profile_parcel/import.sh
deleted file mode 100644
index e8a1f7dbe..000000000
--- a/examples/resources/sdwan_system_omp_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_omp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_omp_profile_parcel/resource.tf b/examples/resources/sdwan_system_omp_profile_parcel/resource.tf
deleted file mode 100644
index cca492ac5..000000000
--- a/examples/resources/sdwan_system_omp_profile_parcel/resource.tf
+++ /dev/null
@@ -1,34 +0,0 @@
-resource "sdwan_system_omp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- graceful_restart = true
- overlay_as = 10
- paths_advertised_per_prefix = 4
- ecmp_limit = 4
- shutdown = false
- omp_admin_distance_ipv4 = 10
- omp_admin_distance_ipv6 = 20
- advertisement_interval = 1
- graceful_restart_timer = 43200
- eor_timer = 300
- holdtime = 60
- advertise_ipv4_bgp = false
- advertise_ipv4_ospf = false
- advertise_ipv4_ospf_v3 = false
- advertise_ipv4_connected = false
- advertise_ipv4_static = false
- advertise_ipv4_eigrp = false
- advertise_ipv4_lisp = false
- advertise_ipv4_isis = false
- advertise_ipv6_bgp = true
- advertise_ipv6_ospf = true
- advertise_ipv6_connected = true
- advertise_ipv6_static = true
- advertise_ipv6_eigrp = true
- advertise_ipv6_lisp = true
- advertise_ipv6_isis = true
- ignore_region_path_length = false
- transport_gateway = "prefer"
- site_types = ["type-1"]
-}
diff --git a/examples/resources/sdwan_system_performance_monitoring_feature/import.sh b/examples/resources/sdwan_system_performance_monitoring_feature/import.sh
new file mode 100644
index 000000000..36ba04079
--- /dev/null
+++ b/examples/resources/sdwan_system_performance_monitoring_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_performance_monitoring_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_performance_monitoring_feature/resource.tf b/examples/resources/sdwan_system_performance_monitoring_feature/resource.tf
new file mode 100644
index 000000000..910e56f60
--- /dev/null
+++ b/examples/resources/sdwan_system_performance_monitoring_feature/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_system_performance_monitoring_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ app_perf_monitor_enabled = true
+ app_perf_monitor_app_group = ["amazon-group"]
+ monitoring_config_enabled = true
+ monitoring_config_interval = "30"
+ event_driven_config_enabled = true
+ event_driven_events = ["SLA_CHANGE"]
+}
diff --git a/examples/resources/sdwan_system_performance_monitoring_profile_parcel/import.sh b/examples/resources/sdwan_system_performance_monitoring_profile_parcel/import.sh
deleted file mode 100644
index f7df2d62f..000000000
--- a/examples/resources/sdwan_system_performance_monitoring_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_performance_monitoring_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_performance_monitoring_profile_parcel/resource.tf b/examples/resources/sdwan_system_performance_monitoring_profile_parcel/resource.tf
deleted file mode 100644
index 04e646cdb..000000000
--- a/examples/resources/sdwan_system_performance_monitoring_profile_parcel/resource.tf
+++ /dev/null
@@ -1,11 +0,0 @@
-resource "sdwan_system_performance_monitoring_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- app_perf_monitor_enabled = true
- app_perf_monitor_app_group = ["amazon-group"]
- monitoring_config_enabled = true
- monitoring_config_interval = "30"
- event_driven_config_enabled = true
- event_driven_events = ["SLA_CHANGE"]
-}
diff --git a/examples/resources/sdwan_system_remote_access_feature/import.sh b/examples/resources/sdwan_system_remote_access_feature/import.sh
new file mode 100644
index 000000000..5731bbddf
--- /dev/null
+++ b/examples/resources/sdwan_system_remote_access_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_remote_access_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_remote_access_feature/resource.tf b/examples/resources/sdwan_system_remote_access_feature/resource.tf
new file mode 100644
index 000000000..064f128cc
--- /dev/null
+++ b/examples/resources/sdwan_system_remote_access_feature/resource.tf
@@ -0,0 +1,21 @@
+resource "sdwan_system_remote_access_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ connection_type_ssl = false
+ any_connect_eap_authentication_type = "user"
+ ipv4_pool_size = 50
+ ipv6_pool_size = 1024
+ enable_certificate_list_check = false
+ psk_authentication_type = "aaa"
+ radius_group_name = "radius-1"
+ aaa_derive_name_from_peer_identity = "MyPassword"
+ aaa_enable_accounting = false
+ ikev2_local_ike_identity_type = "EMAIL"
+ ikev2_local_ike_identity_value = "abc@xyz.com"
+ ikev2_security_association_lifetime = 86400
+ ikev2_anti_dos_threshold = 99
+ ipsec_enable_anti_replay = false
+ ipsec_security_association_lifetime = 3600
+ ipsec_enable_perfect_foward_secrecy = false
+}
diff --git a/examples/resources/sdwan_system_remote_access_profile_parcel/import.sh b/examples/resources/sdwan_system_remote_access_profile_parcel/import.sh
deleted file mode 100644
index ab70e59cd..000000000
--- a/examples/resources/sdwan_system_remote_access_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_remote_access_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_remote_access_profile_parcel/resource.tf b/examples/resources/sdwan_system_remote_access_profile_parcel/resource.tf
deleted file mode 100644
index 56e679c45..000000000
--- a/examples/resources/sdwan_system_remote_access_profile_parcel/resource.tf
+++ /dev/null
@@ -1,23 +0,0 @@
-resource "sdwan_system_remote_access_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- connection_type_ssl = false
- any_connect_eap_authentication_type = "user"
- ipv4_pool_size = 50
- ipv6_pool_size = 1024
- enable_certificate_list_check = false
- psk_authentication_type = "aaa"
- psk_authentication_pre_shared_key = "Cisco123"
- radius_group_name = "radius-1"
- aaa_derive_name_from_peer_identity = "MyPassword"
- aaa_enable_accounting = false
- ikev2_local_ike_identity_type = "EMAIL"
- ikev2_local_ike_identity_value = "abc@xyz.com"
- ikev2_security_association_lifetime = 86400
- ikev2_anti_dos_threshold = 99
- ipsec_enable_anti_replay = false
- ipsec_anti_replay_window_size = 64
- ipsec_security_association_lifetime = 3600
- ipsec_enable_perfect_foward_secrecy = false
-}
diff --git a/examples/resources/sdwan_system_security_feature/import.sh b/examples/resources/sdwan_system_security_feature/import.sh
new file mode 100644
index 000000000..453db15af
--- /dev/null
+++ b/examples/resources/sdwan_system_security_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_security_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_security_feature/resource.tf b/examples/resources/sdwan_system_security_feature/resource.tf
new file mode 100644
index 000000000..c7c01d532
--- /dev/null
+++ b/examples/resources/sdwan_system_security_feature/resource.tf
@@ -0,0 +1,34 @@
+resource "sdwan_system_security_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ rekey = 86400
+ anti_replay_window = "512"
+ extended_anti_replay_window = 256
+ ipsec_pairwise_keying = false
+ integrity_type = ["esp"]
+ keychains = [
+ {
+ key_chain_name = "aaa"
+ key_id = 1
+ }
+ ]
+ keys = [
+ {
+ id = 0
+ name = "aaa"
+ send_id = 1
+ receiver_id = 2
+ include_tcp_options = false
+ accept_ao_mismatch = false
+ crypto_algorithm = "aes-128-cmac"
+ key_string = "abcabc"
+ send_life_time_local = true
+ send_life_time_start_epoch = 1659284400
+ send_life_time_infinite = true
+ accept_life_time_local = true
+ accept_life_time_start_epoch = 1659284400
+ accept_life_time_infinite = true
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_security_profile_parcel/import.sh b/examples/resources/sdwan_system_security_profile_parcel/import.sh
deleted file mode 100644
index 623a6ac5f..000000000
--- a/examples/resources/sdwan_system_security_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_security_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_security_profile_parcel/resource.tf b/examples/resources/sdwan_system_security_profile_parcel/resource.tf
deleted file mode 100644
index d8009f13a..000000000
--- a/examples/resources/sdwan_system_security_profile_parcel/resource.tf
+++ /dev/null
@@ -1,34 +0,0 @@
-resource "sdwan_system_security_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- rekey = 86400
- anti_replay_window = "512"
- extended_anti_replay_window = 256
- ipsec_pairwise_keying = false
- integrity_type = ["esp"]
- keychains = [
- {
- key_chain_name = "aaa"
- key_id = 1
- }
- ]
- keys = [
- {
- id = 0
- name = "aaa"
- send_id = 1
- receiver_id = 2
- include_tcp_options = false
- accept_ao_mismatch = false
- crypto_algorithm = "aes-128-cmac"
- key_string = "abcabc"
- send_life_time_local = true
- send_life_time_start_epoch = 1659284400
- send_life_time_infinite = true
- accept_life_time_local = true
- accept_life_time_start_epoch = 1659284400
- accept_life_time_infinite = true
- }
- ]
-}
diff --git a/examples/resources/sdwan_system_snmp_feature/import.sh b/examples/resources/sdwan_system_snmp_feature/import.sh
new file mode 100644
index 000000000..de9c959f7
--- /dev/null
+++ b/examples/resources/sdwan_system_snmp_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_system_snmp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_snmp_feature/resource.tf b/examples/resources/sdwan_system_snmp_feature/resource.tf
new file mode 100644
index 000000000..28a38dee1
--- /dev/null
+++ b/examples/resources/sdwan_system_snmp_feature/resource.tf
@@ -0,0 +1,54 @@
+resource "sdwan_system_snmp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ shutdown = false
+ contact_person = "wixie.cisco"
+ location_of_device = "SHANGHAI"
+ views = [
+ {
+ name = "VIEW1"
+ oids = [
+ {
+ id = "1.3.6.1.4.1.9.9.394"
+ exclude = false
+ }
+ ]
+ }
+ ]
+ communities = [
+ {
+ name = "example"
+ user_label = "COMMUNITY1"
+ view = "VIEW1"
+ authorization = "read-only"
+ }
+ ]
+ groups = [
+ {
+ name = "GROUP1"
+ security_level = "auth-priv"
+ view = "VIEW1"
+ }
+ ]
+ users = [
+ {
+ name = "USER1"
+ authentication_protocol = "sha"
+ authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
+ privacy_protocol = "aes-256-cfb-128"
+ privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
+ group = "GROUP1"
+ }
+ ]
+ trap_target_servers = [
+ {
+ vpn_id = 1
+ ip = "10.75.221.156"
+ port = 161
+ user_label = "TARGET1"
+ user = "USER1"
+ source_interface = "GigabitEthernet1"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_system_snmp_profile_parcel/import.sh b/examples/resources/sdwan_system_snmp_profile_parcel/import.sh
deleted file mode 100644
index 5bf73f9ea..000000000
--- a/examples/resources/sdwan_system_snmp_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_system_snmp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_system_snmp_profile_parcel/resource.tf b/examples/resources/sdwan_system_snmp_profile_parcel/resource.tf
deleted file mode 100644
index 92b6dc7f2..000000000
--- a/examples/resources/sdwan_system_snmp_profile_parcel/resource.tf
+++ /dev/null
@@ -1,54 +0,0 @@
-resource "sdwan_system_snmp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- shutdown = false
- contact_person = "wixie.cisco"
- location_of_device = "SHANGHAI"
- views = [
- {
- name = "VIEW1"
- oids = [
- {
- id = "1.3.6.1.4.1.9.9.394"
- exclude = false
- }
- ]
- }
- ]
- communities = [
- {
- name = "example"
- user_label = "COMMUNITY1"
- view = "VIEW1"
- authorization = "read-only"
- }
- ]
- groups = [
- {
- name = "GROUP1"
- security_level = "auth-priv"
- view = "VIEW1"
- }
- ]
- users = [
- {
- name = "USER1"
- authentication_protocol = "sha"
- authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
- privacy_protocol = "aes-256-cfb-128"
- privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="
- group = "GROUP1"
- }
- ]
- trap_target_servers = [
- {
- vpn_id = 1
- ip = "10.75.221.156"
- port = 161
- user_label = "TARGET1"
- user = "USER1"
- source_interface = "GigabitEthernet1"
- }
- ]
-}
diff --git a/examples/resources/sdwan_transport_gps_feature/import.sh b/examples/resources/sdwan_transport_gps_feature/import.sh
new file mode 100644
index 000000000..713ee7bd0
--- /dev/null
+++ b/examples/resources/sdwan_transport_gps_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_gps_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_gps_feature/resource.tf b/examples/resources/sdwan_transport_gps_feature/resource.tf
new file mode 100644
index 000000000..9582a5dcc
--- /dev/null
+++ b/examples/resources/sdwan_transport_gps_feature/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_transport_gps_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ gps_enable = false
+ gps_mode = "ms-based"
+ nmea_enable = false
+ nmea_source_address = "1.2.3.4"
+ nmea_destination_address = "2.3.4.5"
+ nmea_destination_port = 22
+}
diff --git a/examples/resources/sdwan_transport_ipv6_tracker_feature/import.sh b/examples/resources/sdwan_transport_ipv6_tracker_feature/import.sh
new file mode 100644
index 000000000..2bd373f39
--- /dev/null
+++ b/examples/resources/sdwan_transport_ipv6_tracker_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_ipv6_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_ipv6_tracker_feature/resource.tf b/examples/resources/sdwan_transport_ipv6_tracker_feature/resource.tf
new file mode 100644
index 000000000..8311baa6a
--- /dev/null
+++ b/examples/resources/sdwan_transport_ipv6_tracker_feature/resource.tf
@@ -0,0 +1,14 @@
+resource "sdwan_transport_ipv6_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+}
diff --git a/examples/resources/sdwan_transport_ipv6_tracker_group_feature/import.sh b/examples/resources/sdwan_transport_ipv6_tracker_group_feature/import.sh
new file mode 100644
index 000000000..7047d1ad7
--- /dev/null
+++ b/examples/resources/sdwan_transport_ipv6_tracker_group_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_ipv6_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_ipv6_tracker_group_feature/resource.tf b/examples/resources/sdwan_transport_ipv6_tracker_group_feature/resource.tf
new file mode 100644
index 000000000..4fbd23d58
--- /dev/null
+++ b/examples/resources/sdwan_transport_ipv6_tracker_group_feature/resource.tf
@@ -0,0 +1,12 @@
+resource "sdwan_transport_ipv6_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_GROUP_1"
+ tracker_elements = [
+ {
+ tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ tracker_boolean = "or"
+}
diff --git a/examples/resources/sdwan_transport_ipv6_tracker_profile_parcel/import.sh b/examples/resources/sdwan_transport_ipv6_tracker_profile_parcel/import.sh
deleted file mode 100644
index f133daffd..000000000
--- a/examples/resources/sdwan_transport_ipv6_tracker_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_ipv6_tracker_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_ipv6_tracker_profile_parcel/resource.tf b/examples/resources/sdwan_transport_ipv6_tracker_profile_parcel/resource.tf
deleted file mode 100644
index a7a2ee7fd..000000000
--- a/examples/resources/sdwan_transport_ipv6_tracker_profile_parcel/resource.tf
+++ /dev/null
@@ -1,14 +0,0 @@
-resource "sdwan_transport_ipv6_tracker_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- tracker_name = "TRACKER_1"
- endpoint_api_url = "google.com"
- endpoint_dns_name = "google.com"
- endpoint_ip = "2001:0:0:1::0"
- interval = 30
- multiplier = 3
- threshold = 300
- endpoint_tracker_type = "ipv6-interface"
- tracker_type = "endpoint"
-}
diff --git a/examples/resources/sdwan_transport_management_vpn_feature/import.sh b/examples/resources/sdwan_transport_management_vpn_feature/import.sh
new file mode 100644
index 000000000..c4bd8c793
--- /dev/null
+++ b/examples/resources/sdwan_transport_management_vpn_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_management_vpn_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_management_vpn_feature/resource.tf b/examples/resources/sdwan_transport_management_vpn_feature/resource.tf
new file mode 100644
index 000000000..4cc3a0cca
--- /dev/null
+++ b/examples/resources/sdwan_transport_management_vpn_feature/resource.tf
@@ -0,0 +1,41 @@
+resource "sdwan_transport_management_vpn_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ vpn_description = "example"
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ gateway = "next_hop"
+ next_hops = [
+ {
+ address = "2001:0:0:1::1"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/import.sh b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/import.sh
new file mode 100644
index 000000000..a4aefc910
--- /dev/null
+++ b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_management_vpn_interface_ethernet_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/resource.tf b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/resource.tf
new file mode 100644
index 000000000..461a8413a
--- /dev/null
+++ b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_feature/resource.tf
@@ -0,0 +1,41 @@
+resource "sdwan_transport_management_vpn_interface_ethernet_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_management_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "GigabitEthernet1"
+ interface_description = "Transport Management VPN Interface Ethernet"
+ ipv4_configuration_type = "static"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ ipv4_iperf_server = "example"
+ ipv4_auto_detect_bandwidth = false
+ ipv6_configuration_type = "static"
+ ipv6_address = "2001:0:0:1::/64"
+ arp_entries = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ duplex = "full"
+ mac_address = "00-B0-D0-63-C2-26"
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 505
+ speed = "2500"
+ arp_timeout = 1200
+ autonegotiate = false
+ media_type = "rj45"
+ load_interval = 30
+ icmp_redirect_disable = true
+ ip_directed_broadcast = false
+}
diff --git a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/import.sh b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/import.sh
deleted file mode 100644
index 6b9340c0d..000000000
--- a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_management_vpn_interface_ethernet_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/resource.tf b/examples/resources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/resource.tf
deleted file mode 100644
index 9e04846da..000000000
--- a/examples/resources/sdwan_transport_management_vpn_interface_ethernet_profile_parcel/resource.tf
+++ /dev/null
@@ -1,41 +0,0 @@
-resource "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_management_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "GigabitEthernet1"
- interface_description = "Transport Management VPN Interface Ethernet"
- ipv4_configuration_type = "static"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helper = ["1.2.3.4"]
- ipv4_iperf_server = "example"
- ipv4_auto_detect_bandwidth = false
- ipv6_configuration_type = "static"
- ipv6_address = "2001:0:0:1::/64"
- arp_entries = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- duplex = "full"
- mac_address = "00-B0-D0-63-C2-26"
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 505
- speed = "2500"
- arp_timeout = 1200
- autonegotiate = false
- media_type = "rj45"
- load_interval = 30
- icmp_redirect_disable = true
- ip_directed_broadcast = false
-}
diff --git a/examples/resources/sdwan_transport_management_vpn_profile_parcel/import.sh b/examples/resources/sdwan_transport_management_vpn_profile_parcel/import.sh
deleted file mode 100644
index 8b69afd51..000000000
--- a/examples/resources/sdwan_transport_management_vpn_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_management_vpn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_management_vpn_profile_parcel/resource.tf b/examples/resources/sdwan_transport_management_vpn_profile_parcel/resource.tf
deleted file mode 100644
index b740ee088..000000000
--- a/examples/resources/sdwan_transport_management_vpn_profile_parcel/resource.tf
+++ /dev/null
@@ -1,42 +0,0 @@
-resource "sdwan_transport_management_vpn_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- vpn_description = "example"
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- gateway = "next_hop"
- next_hops = [
- {
- address = "2001:0:0:1::1"
- administrative_distance = 1
- }
- ]
- }
- ]
-}
diff --git a/examples/resources/sdwan_transport_route_policy_feature/import.sh b/examples/resources/sdwan_transport_route_policy_feature/import.sh
new file mode 100644
index 000000000..5378dbeec
--- /dev/null
+++ b/examples/resources/sdwan_transport_route_policy_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_route_policy_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_route_policy_feature/resource.tf b/examples/resources/sdwan_transport_route_policy_feature/resource.tf
new file mode 100644
index 000000000..d8ed13483
--- /dev/null
+++ b/examples/resources/sdwan_transport_route_policy_feature/resource.tf
@@ -0,0 +1,29 @@
+resource "sdwan_transport_route_policy_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ default_action = "accept"
+ sequences = [
+ {
+ id = 1
+ name = "SEQ_1"
+ base_action = "reject"
+ protocol = "IPV4"
+ actions = [
+ {
+ as_path_prepend = [65521]
+ community_additive = false
+ community = ["internet"]
+ local_preference = 100
+ metric = 20
+ metric_type = "type1"
+ omp_tag = 200
+ origin = "EGP"
+ ospf_tag = 1200
+ weight = 2200
+ ipv4_next_hop = "10.0.0.1"
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_transport_routing_bgp_feature/import.sh b/examples/resources/sdwan_transport_routing_bgp_feature/import.sh
new file mode 100644
index 000000000..fdfacd916
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_bgp_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_routing_bgp_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_routing_bgp_feature/resource.tf b/examples/resources/sdwan_transport_routing_bgp_feature/resource.tf
new file mode 100644
index 000000000..f83d43f21
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_bgp_feature/resource.tf
@@ -0,0 +1,114 @@
+resource "sdwan_transport_routing_bgp_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ as_number = 429
+ router_id = "1.2.3.4"
+ propagate_as_path = false
+ propagate_community = false
+ external_routes_distance = 20
+ internal_routes_distance = 200
+ local_routes_distance = 20
+ keepalive_time = 60
+ hold_time = 180
+ always_compare_med = false
+ deterministic_med = false
+ missing_med_as_worst = false
+ compare_router_id = false
+ multipath_relax = false
+ ipv4_neighbors = [
+ {
+ address = "1.2.3.4"
+ description = "neighbor1"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 40
+ hold_time = 200
+ update_source_interface = "GigabitEthernet0"
+ next_hop_self = false
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 1
+ password = "myPassword"
+ send_label = true
+ explicit_null = false
+ as_override = false
+ allowas_in_number = 1
+ address_families = [
+ {
+ family_type = "ipv4-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv6_neighbors = [
+ {
+ address = "2001::1"
+ description = "neighbor2"
+ shutdown = false
+ remote_as = 200
+ local_as = 200
+ keepalive_time = 180
+ hold_time = 60
+ update_source_interface = "Loopback1"
+ next_hop_self = true
+ send_community = true
+ send_extended_community = true
+ ebgp_multihop = 3
+ password = "myPassword"
+ as_override = true
+ allowas_in_number = 3
+ address_families = [
+ {
+ family_type = "ipv6-unicast"
+ max_number_of_prefixes = 2000
+ threshold = 75
+ policy_type = "restart"
+ restart_interval = 30
+ }
+ ]
+ }
+ ]
+ ipv4_aggregate_addresses = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv4_networks = [
+ {
+ network_address = "10.10.0.0"
+ subnet_mask = "255.255.0.0"
+ }
+ ]
+ ipv4_eibgp_maximum_paths = 1
+ ipv4_originate = false
+ ipv4_table_map_filter = false
+ ipv6_aggregate_addresses = [
+ {
+ aggregate_prefix = "3001::1/128"
+ as_set_path = false
+ summary_only = false
+ }
+ ]
+ ipv6_networks = [
+ {
+ network_prefix = "2001:0DB8:0000:000b::/64"
+ }
+ ]
+ ipv6_eibgp_maximum_paths = 2
+ ipv6_originate = true
+ ipv6_table_map_filter = false
+ mpls_interfaces = [
+ {
+ interface_name = "GigabitEthernet1"
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_transport_routing_bgp_profile_parcel/import.sh b/examples/resources/sdwan_transport_routing_bgp_profile_parcel/import.sh
deleted file mode 100644
index 8f34d474f..000000000
--- a/examples/resources/sdwan_transport_routing_bgp_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_routing_bgp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_routing_bgp_profile_parcel/resource.tf b/examples/resources/sdwan_transport_routing_bgp_profile_parcel/resource.tf
deleted file mode 100644
index 98c71fe7e..000000000
--- a/examples/resources/sdwan_transport_routing_bgp_profile_parcel/resource.tf
+++ /dev/null
@@ -1,114 +0,0 @@
-resource "sdwan_transport_routing_bgp_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- as_number = 429
- router_id = "1.2.3.4"
- propagate_as_path = false
- propagate_community = false
- external_routes_distance = 20
- internal_routes_distance = 200
- local_routes_distance = 20
- keepalive_time = 60
- hold_time = 180
- always_compare_med = false
- deterministic_med = false
- missing_med_as_worst = false
- compare_router_id = false
- multipath_relax = false
- ipv4_neighbors = [
- {
- address = "1.2.3.4"
- description = "neighbor1"
- shutdown = false
- remote_as = 200
- local_as = 200
- keepalive_time = 40
- hold_time = 200
- update_source_interface = "GigabitEthernet0"
- next_hop_self = false
- send_community = true
- send_extended_community = true
- ebgp_multihop = 1
- password = "myPassword"
- send_label = true
- explicit_null = false
- as_override = false
- allowas_in_number = 1
- address_families = [
- {
- family_type = "ipv4-unicast"
- max_number_of_prefixes = 2000
- threshold = 75
- policy_type = "restart"
- restart_interval = 30
- }
- ]
- }
- ]
- ipv6_neighbors = [
- {
- address = "2001::1"
- description = "neighbor2"
- shutdown = false
- remote_as = 200
- local_as = 200
- keepalive_time = 180
- hold_time = 60
- update_source_interface = "Loopback1"
- next_hop_self = true
- send_community = true
- send_extended_community = true
- ebgp_multihop = 3
- password = "myPassword"
- as_override = true
- allowas_in_number = 3
- address_families = [
- {
- family_type = "ipv6-unicast"
- max_number_of_prefixes = 2000
- threshold = 75
- policy_type = "restart"
- restart_interval = 30
- }
- ]
- }
- ]
- ipv4_aggregate_addresses = [
- {
- network_address = "10.10.0.0"
- subnet_mask = "255.255.0.0"
- as_set_path = false
- summary_only = false
- }
- ]
- ipv4_networks = [
- {
- network_address = "10.10.0.0"
- subnet_mask = "255.255.0.0"
- }
- ]
- ipv4_eibgp_maximum_paths = 1
- ipv4_originate = false
- ipv4_table_map_filter = false
- ipv6_aggregate_addresses = [
- {
- aggregate_prefix = "3001::1/128"
- as_set_path = false
- summary_only = false
- }
- ]
- ipv6_networks = [
- {
- network_prefix = "2001:0DB8:0000:000b::/64"
- }
- ]
- ipv6_eibgp_maximum_paths = 2
- ipv6_originate = true
- ipv6_table_map_filter = false
- mpls_interfaces = [
- {
- interface_name = "GigabitEthernet1"
- }
- ]
-}
diff --git a/examples/resources/sdwan_transport_routing_ospf_feature/import.sh b/examples/resources/sdwan_transport_routing_ospf_feature/import.sh
new file mode 100644
index 000000000..4201dc81e
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_ospf_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_routing_ospf_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_routing_ospf_feature/resource.tf b/examples/resources/sdwan_transport_routing_ospf_feature/resource.tf
new file mode 100644
index 000000000..8ea305d00
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_ospf_feature/resource.tf
@@ -0,0 +1,60 @@
+resource "sdwan_transport_routing_ospf_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ redistributes = [
+ {
+ protocol = "static"
+ nat_dia = true
+ }
+ ]
+ router_lsas = [
+ {
+ type = "on-startup"
+ time = 5
+ }
+ ]
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ no_summary = false
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ designated_router_priority = 1
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "message-digest"
+ message_digest_key_id = 7
+ message_digest_key = "sdjfhsghbjdjr"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_transport_routing_ospfv3_ipv4_feature/import.sh b/examples/resources/sdwan_transport_routing_ospfv3_ipv4_feature/import.sh
new file mode 100644
index 000000000..522949b78
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_ospfv3_ipv4_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_routing_ospfv3_ipv4_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_routing_ospfv3_ipv4_feature/resource.tf b/examples/resources/sdwan_transport_routing_ospfv3_ipv4_feature/resource.tf
new file mode 100644
index 000000000..672111f01
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_ospfv3_ipv4_feature/resource.tf
@@ -0,0 +1,54 @@
+resource "sdwan_transport_routing_ospfv3_ipv4_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "nat-route"
+ nat_dia = true
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ ip_address = "10.1.1.0"
+ subnet_mask = "255.255.255.0"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_transport_routing_ospfv3_ipv6_feature/import.sh b/examples/resources/sdwan_transport_routing_ospfv3_ipv6_feature/import.sh
new file mode 100644
index 000000000..eb47906ce
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_ospfv3_ipv6_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_routing_ospfv3_ipv6_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_routing_ospfv3_ipv6_feature/resource.tf b/examples/resources/sdwan_transport_routing_ospfv3_ipv6_feature/resource.tf
new file mode 100644
index 000000000..40cbf3e0f
--- /dev/null
+++ b/examples/resources/sdwan_transport_routing_ospfv3_ipv6_feature/resource.tf
@@ -0,0 +1,52 @@
+resource "sdwan_transport_routing_ospfv3_ipv6_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ router_id = "1.2.3.4"
+ distance = 110
+ distance_external = 110
+ distance_inter_area = 110
+ distance_intra_area = 110
+ reference_bandwidth = 101
+ rfc_1583_compatible = true
+ default_information_originate = false
+ default_information_originate_always = false
+ default_information_originate_metric = 1
+ default_information_originate_metric_type = "type1"
+ spf_calculation_delay = 200
+ spf_initial_hold_time = 1000
+ spf_maximum_hold_time = 10000
+ filter = false
+ redistributes = [
+ {
+ protocol = "static"
+ }
+ ]
+ router_lsa_action = "on-startup"
+ router_lsa_on_startup_time = 30
+ areas = [
+ {
+ area_number = 1
+ area_type = "stub"
+ interfaces = [
+ {
+ name = "GigabitEthernet2"
+ hello_interval = 10
+ dead_interval = 40
+ lsa_retransmit_interval = 5
+ cost = 10
+ network_type = "broadcast"
+ passive_interface = false
+ authentication_type = "no-auth"
+ }
+ ]
+ ranges = [
+ {
+ prefix = "3002::/96"
+ cost = 1
+ no_advertise = false
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_transport_tracker_feature/import.sh b/examples/resources/sdwan_transport_tracker_feature/import.sh
new file mode 100644
index 000000000..97d0122f8
--- /dev/null
+++ b/examples/resources/sdwan_transport_tracker_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_tracker_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_tracker_feature/resource.tf b/examples/resources/sdwan_transport_tracker_feature/resource.tf
new file mode 100644
index 000000000..b46a3c9ac
--- /dev/null
+++ b/examples/resources/sdwan_transport_tracker_feature/resource.tf
@@ -0,0 +1,14 @@
+resource "sdwan_transport_tracker_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "interface"
+ tracker_type = "endpoint"
+}
diff --git a/examples/resources/sdwan_transport_tracker_group_feature/import.sh b/examples/resources/sdwan_transport_tracker_group_feature/import.sh
new file mode 100644
index 000000000..58b96b436
--- /dev/null
+++ b/examples/resources/sdwan_transport_tracker_group_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_tracker_group_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_tracker_group_feature/resource.tf b/examples/resources/sdwan_transport_tracker_group_feature/resource.tf
new file mode 100644
index 000000000..f98ca4632
--- /dev/null
+++ b/examples/resources/sdwan_transport_tracker_group_feature/resource.tf
@@ -0,0 +1,11 @@
+resource "sdwan_transport_tracker_group_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ tracker_elements = [
+ {
+ tracker_id = "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ ]
+ tracker_boolean = "or"
+}
diff --git a/examples/resources/sdwan_transport_wan_vpn_feature/import.sh b/examples/resources/sdwan_transport_wan_vpn_feature/import.sh
new file mode 100644
index 000000000..d10e0d5db
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_wan_vpn_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_feature/resource.tf b/examples/resources/sdwan_transport_wan_vpn_feature/resource.tf
new file mode 100644
index 000000000..72564f34c
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_feature/resource.tf
@@ -0,0 +1,54 @@
+resource "sdwan_transport_wan_vpn_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_cellular_feature/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_cellular_feature/import.sh
new file mode 100644
index 000000000..37756b4e4
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_cellular_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_wan_vpn_interface_cellular_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_cellular_feature/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_cellular_feature/resource.tf
new file mode 100644
index 000000000..ea2ece7e2
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_cellular_feature/resource.tf
@@ -0,0 +1,71 @@
+resource "sdwan_transport_wan_vpn_interface_cellular_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "GigabitEthernet1"
+ interface_description = "WAN"
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ service_provider = "example"
+ bandwidth_upstream = 21474836
+ bandwidth_downstream = 21474836
+ tunnel_interface = true
+ per_tunnel_qos = true
+ tunnel_qos_mode = "hub"
+ tunnel_bandwidth_percent = 82
+ tunnel_interface_bind_loopback_tunnel = "example"
+ tunnel_interface_carrier = "default"
+ tunnel_interface_color = "default"
+ tunnel_interface_hello_interval = 1000
+ tunnel_interface_hello_tolerance = 12
+ tunnel_interface_last_resort_circuit = false
+ tunnel_interface_color_restrict = true
+ tunnel_interface_groups = 42949672
+ tunnel_interface_border = false
+ tunnel_interface_max_control_connections = 62
+ tunnel_interface_nat_refresh_interval = 5
+ tunnel_interface_vbond_as_stun_server = false
+ tunnel_interface_exclude_controller_group_list = [2]
+ tunnel_interface_vmanage_connection_preference = 8
+ tunnel_interface_port_hop = true
+ tunnel_interface_low_bandwidth_link = false
+ tunnel_interface_tunnel_tcp_mss = 1460
+ tunnel_interface_clear_dont_fragment = false
+ tunnel_interface_network_broadcast = false
+ tunnel_interface_allow_all = false
+ tunnel_interface_allow_bgp = false
+ tunnel_interface_allow_dhcp = true
+ tunnel_interface_allow_ntp = false
+ tunnel_interface_allow_ssh = false
+ tunnel_interface_allow_dns = true
+ tunnel_interface_allow_icmp = true
+ tunnel_interface_allow_https = true
+ tunnel_interface_allow_ospf = false
+ tunnel_interface_allow_stun = false
+ tunnel_interface_allow_snmp = false
+ tunnel_interface_allow_netconf = false
+ tunnel_interface_allow_bfd = false
+ tunnel_interface_encapsulations = [
+ {
+ encapsulation = "gre"
+ preference = 4294967
+ weight = 250
+ }
+ ]
+ nat_ipv4 = true
+ nat_udp_timeout = 1
+ nat_tcp_timeout = 60
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 505
+ tloc_extension = "tloc"
+ tracker = "example"
+ ip_directed_broadcast = false
+}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/import.sh
deleted file mode 100644
index 947c1ce11..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_wan_vpn_interface_cellular_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/resource.tf
deleted file mode 100644
index 378486e8d..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_cellular_profile_parcel/resource.tf
+++ /dev/null
@@ -1,71 +0,0 @@
-resource "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "GigabitEthernet1"
- interface_description = "WAN"
- ipv4_dhcp_helper = ["1.2.3.4"]
- service_provider = "example"
- bandwidth_upstream = 21474836
- bandwidth_downstream = 21474836
- tunnel_interface = true
- per_tunnel_qos = true
- tunnel_qos_mode = "hub"
- tunnel_bandwidth_percent = 82
- tunnel_interface_bind_loopback_tunnel = "example"
- tunnel_interface_carrier = "default"
- tunnel_interface_color = "default"
- tunnel_interface_hello_interval = 1000
- tunnel_interface_hello_tolerance = 12
- tunnel_interface_last_resort_circuit = false
- tunnel_interface_color_restrict = true
- tunnel_interface_groups = 42949672
- tunnel_interface_border = false
- tunnel_interface_max_control_connections = 62
- tunnel_interface_nat_refresh_interval = 5
- tunnel_interface_vbond_as_stun_server = false
- tunnel_interface_exclude_controller_group_list = [2]
- tunnel_interface_vmanage_connection_preference = 8
- tunnel_interface_port_hop = true
- tunnel_interface_low_bandwidth_link = false
- tunnel_interface_tunnel_tcp_mss = 1460
- tunnel_interface_clear_dont_fragment = false
- tunnel_interface_network_broadcast = false
- tunnel_interface_allow_all = false
- tunnel_interface_allow_bgp = false
- tunnel_interface_allow_dhcp = true
- tunnel_interface_allow_ntp = false
- tunnel_interface_allow_ssh = false
- tunnel_interface_allow_dns = true
- tunnel_interface_allow_icmp = true
- tunnel_interface_allow_https = true
- tunnel_interface_allow_ospf = false
- tunnel_interface_allow_stun = false
- tunnel_interface_allow_snmp = false
- tunnel_interface_allow_netconf = false
- tunnel_interface_allow_bfd = false
- tunnel_interface_encapsulations = [
- {
- encapsulation = "gre"
- preference = 4294967
- weight = 250
- }
- ]
- nat_ipv4 = true
- nat_udp_timeout = 1
- nat_tcp_timeout = 60
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 505
- tloc_extension = "tloc"
- tracker = "example"
- ip_directed_broadcast = false
-}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/import.sh
new file mode 100644
index 000000000..9f6c5252e
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_wan_vpn_interface_ethernet_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/resource.tf
new file mode 100644
index 000000000..60d35b050
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_feature/resource.tf
@@ -0,0 +1,115 @@
+resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "GigabitEthernet1"
+ interface_description = "WAN"
+ ipv4_configuration_type = "static"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv4_secondary_addresses = [
+ {
+ address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ }
+ ]
+ ipv4_dhcp_helper = ["1.2.3.4"]
+ ipv6_configuration_type = "static"
+ iperf_server = "example"
+ block_non_source_ip = false
+ service_provider = "example"
+ bandwidth_upstream = 21474836
+ bandwidth_downstream = 21474836
+ auto_detect_bandwidth = false
+ tunnel_interface = true
+ per_tunnel_qos = true
+ tunnel_qos_mode = "hub"
+ tunnel_bandwidth_percent = 82
+ tunnel_interface_bind_loopback_tunnel = "example"
+ tunnel_interface_carrier = "default"
+ tunnel_interface_color = "default"
+ tunnel_interface_hello_interval = 1000
+ tunnel_interface_hello_tolerance = 12
+ tunnel_interface_last_resort_circuit = false
+ tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"
+ tunnel_interface_color_restrict = true
+ tunnel_interface_groups = 42949672
+ tunnel_interface_border = false
+ tunnel_interface_max_control_connections = 62
+ tunnel_interface_nat_refresh_interval = 5
+ tunnel_interface_vbond_as_stun_server = false
+ tunnel_interface_exclude_controller_group_list = [2]
+ tunnel_interface_vmanage_connection_preference = 8
+ tunnel_interface_port_hop = true
+ tunnel_interface_low_bandwidth_link = false
+ tunnel_interface_tunnel_tcp_mss = 1460
+ tunnel_interface_clear_dont_fragment = false
+ tunnel_interface_cts_sgt_propagation = false
+ tunnel_interface_network_broadcast = false
+ tunnel_interface_allow_all = false
+ tunnel_interface_allow_bgp = false
+ tunnel_interface_allow_dhcp = true
+ tunnel_interface_allow_ntp = false
+ tunnel_interface_allow_ssh = false
+ tunnel_interface_allow_dns = true
+ tunnel_interface_allow_icmp = true
+ tunnel_interface_allow_https = true
+ tunnel_interface_allow_ospf = false
+ tunnel_interface_allow_stun = false
+ tunnel_interface_allow_snmp = false
+ tunnel_interface_allow_netconf = false
+ tunnel_interface_allow_bfd = false
+ tunnel_interface_encapsulations = [
+ {
+ encapsulation = "gre"
+ preference = 4294967
+ weight = 250
+ }
+ ]
+ nat_ipv4 = true
+ nat_type = "interface"
+ nat_udp_timeout = 1
+ nat_tcp_timeout = 60
+ new_static_nats = [
+ {
+ source_ip = "1.2.3.4"
+ translated_ip = "2.3.4.5"
+ direction = "inside"
+ source_vpn = 3
+ }
+ ]
+ nat_ipv6 = true
+ nat64 = false
+ nat66 = true
+ static_nat66 = [
+ {
+ source_prefix = "2001:0db8:85a3::/48"
+ translated_source_prefix = "abcd:1234:5678::/48"
+ source_vpn_id = 4
+ }
+ ]
+ arps = [
+ {
+ ip_address = "1.2.3.4"
+ mac_address = "00-B0-D0-63-C2-26"
+ }
+ ]
+ icmp_redirect_disable = true
+ duplex = "full"
+ mac_address = "00-B0-D0-63-C2-26"
+ ip_mtu = 1500
+ interface_mtu = 1500
+ tcp_mss = 505
+ speed = "2500"
+ arp_timeout = 1200
+ autonegotiate = false
+ media_type = "rj45"
+ tloc_extension = "tloc"
+ gre_tunnel_source_ip = "1.2.3.4"
+ xconnect = "example"
+ load_interval = 30
+ tracker = "example"
+ ip_directed_broadcast = false
+}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/import.sh
deleted file mode 100644
index fa41f5fe5..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/resource.tf
deleted file mode 100644
index fa4c0865a..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_ethernet_profile_parcel/resource.tf
+++ /dev/null
@@ -1,115 +0,0 @@
-resource "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "GigabitEthernet1"
- interface_description = "WAN"
- ipv4_configuration_type = "static"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv4_secondary_addresses = [
- {
- address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- }
- ]
- ipv4_dhcp_helper = ["1.2.3.4"]
- ipv6_configuration_type = "static"
- iperf_server = "example"
- block_non_source_ip = false
- service_provider = "example"
- bandwidth_upstream = 21474836
- bandwidth_downstream = 21474836
- auto_detect_bandwidth = false
- tunnel_interface = true
- per_tunnel_qos = true
- tunnel_qos_mode = "hub"
- tunnel_bandwidth_percent = 82
- tunnel_interface_bind_loopback_tunnel = "example"
- tunnel_interface_carrier = "default"
- tunnel_interface_color = "default"
- tunnel_interface_hello_interval = 1000
- tunnel_interface_hello_tolerance = 12
- tunnel_interface_last_resort_circuit = false
- tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"
- tunnel_interface_color_restrict = true
- tunnel_interface_groups = 42949672
- tunnel_interface_border = false
- tunnel_interface_max_control_connections = 62
- tunnel_interface_nat_refresh_interval = 5
- tunnel_interface_vbond_as_stun_server = false
- tunnel_interface_exclude_controller_group_list = [2]
- tunnel_interface_vmanage_connection_preference = 8
- tunnel_interface_port_hop = true
- tunnel_interface_low_bandwidth_link = false
- tunnel_interface_tunnel_tcp_mss = 1460
- tunnel_interface_clear_dont_fragment = false
- tunnel_interface_cts_sgt_propagation = false
- tunnel_interface_network_broadcast = false
- tunnel_interface_allow_all = false
- tunnel_interface_allow_bgp = false
- tunnel_interface_allow_dhcp = true
- tunnel_interface_allow_ntp = false
- tunnel_interface_allow_ssh = false
- tunnel_interface_allow_dns = true
- tunnel_interface_allow_icmp = true
- tunnel_interface_allow_https = true
- tunnel_interface_allow_ospf = false
- tunnel_interface_allow_stun = false
- tunnel_interface_allow_snmp = false
- tunnel_interface_allow_netconf = false
- tunnel_interface_allow_bfd = false
- tunnel_interface_encapsulations = [
- {
- encapsulation = "gre"
- preference = 4294967
- weight = 250
- }
- ]
- nat_ipv4 = true
- nat_type = "interface"
- nat_udp_timeout = 1
- nat_tcp_timeout = 60
- new_static_nats = [
- {
- source_ip = "1.2.3.4"
- translated_ip = "2.3.4.5"
- direction = "inside"
- source_vpn = 3
- }
- ]
- nat_ipv6 = true
- nat64 = false
- nat66 = true
- static_nat66 = [
- {
- source_prefix = "2001:0db8:85a3::/48"
- translated_source_prefix = "abcd:1234:5678::/48"
- source_vpn_id = 4
- }
- ]
- arps = [
- {
- ip_address = "1.2.3.4"
- mac_address = "00-B0-D0-63-C2-26"
- }
- ]
- icmp_redirect_disable = true
- duplex = "full"
- mac_address = "00-B0-D0-63-C2-26"
- ip_mtu = 1500
- interface_mtu = 1500
- tcp_mss = 505
- speed = "2500"
- arp_timeout = 1200
- autonegotiate = false
- media_type = "rj45"
- tloc_extension = "tloc"
- gre_tunnel_source_ip = "1.2.3.4"
- xconnect = "example"
- load_interval = 30
- tracker = "example"
- ip_directed_broadcast = false
-}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_gre_feature/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_gre_feature/import.sh
new file mode 100644
index 000000000..131d5b458
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_gre_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_wan_vpn_interface_gre_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_gre_feature/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_gre_feature/resource.tf
new file mode 100644
index 000000000..2a71a5310
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_gre_feature/resource.tf
@@ -0,0 +1,17 @@
+resource "sdwan_transport_wan_vpn_interface_gre_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "gre1"
+ interface_description = "gre1"
+ ipv4_address = "70.1.1.1"
+ ipv4_subnet_mask = "255.255.255.0"
+ shutdown = true
+ tunnel_source_ipv4_address = "78.1.1.1"
+ tunnel_destination_ipv4_address = "79.1.1.1"
+ ip_mtu = 1500
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ application_tunnel_type = "none"
+}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/import.sh
deleted file mode 100644
index 15361c2f0..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_wan_vpn_interface_gre_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/resource.tf
deleted file mode 100644
index 37a1ea48e..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_gre_profile_parcel/resource.tf
+++ /dev/null
@@ -1,17 +0,0 @@
-resource "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "gre1"
- interface_description = "gre1"
- ipv4_address = "70.1.1.1"
- ipv4_subnet_mask = "255.255.255.0"
- shutdown = true
- tunnel_source_ipv4_address = "78.1.1.1"
- tunnel_destination_ipv4_address = "79.1.1.1"
- ip_mtu = 1500
- tcp_mss = 1460
- clear_dont_fragment = false
- application_tunnel_type = "none"
-}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_feature/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_feature/import.sh
new file mode 100644
index 000000000..d0a481be0
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_wan_vpn_interface_ipsec_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_feature/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_feature/resource.tf
new file mode 100644
index 000000000..fd21717e6
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_feature/resource.tf
@@ -0,0 +1,35 @@
+resource "sdwan_transport_wan_vpn_interface_ipsec_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ interface_name = "ipsec987"
+ shutdown = true
+ interface_description = "ipsec987"
+ ipv4_address = "9.7.5.4"
+ ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_ipv4_address = "1.3.5.88"
+ tunnel_source_ipv4_subnet_mask = "255.255.255.0"
+ tunnel_source_interface = "GigabitEthernet8"
+ tunnel_destination_ipv4_address = "2.55.67.99"
+ tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
+ application_tunnel_type = "none"
+ tcp_mss = 1460
+ clear_dont_fragment = false
+ ip_mtu = 1500
+ dpd_interval = 10
+ dpd_retries = 3
+ ike_preshared_key = "123"
+ ike_version = 1
+ ike_integrity_protocol = "main"
+ ike_rekey_interval = 14400
+ ike_ciphersuite = "aes256-cbc-sha1"
+ ike_diffie_hellman_group = "16"
+ ike_id_local_end_point = "xxx"
+ ike_id_remote_end_point = "xxx"
+ ipsec_rekey_interval = 3600
+ ipsec_replay_window = 512
+ ipsec_ciphersuite = "aes256-gcm"
+ perfect_forward_secrecy = "group-16"
+ tunnel_route_via = "2222"
+}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/import.sh
deleted file mode 100644
index 2f55abf6d..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/resource.tf
deleted file mode 100644
index 0a68865f9..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_ipsec_profile_parcel/resource.tf
+++ /dev/null
@@ -1,35 +0,0 @@
-resource "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- interface_name = "ipsec987"
- shutdown = true
- interface_description = "ipsec987"
- ipv4_address = "9.7.5.4"
- ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_ipv4_address = "1.3.5.88"
- tunnel_source_ipv4_subnet_mask = "255.255.255.0"
- tunnel_source_interface = "GigabitEthernet8"
- tunnel_destination_ipv4_address = "2.55.67.99"
- tunnel_destination_ipv4_subnet_mask = "255.255.255.0"
- application_tunnel_type = "none"
- tcp_mss = 1460
- clear_dont_fragment = false
- ip_mtu = 1500
- dpd_interval = 10
- dpd_retries = 3
- ike_preshared_key = "123"
- ike_version = 1
- ike_integrity_protocol = "main"
- ike_rekey_interval = 14400
- ike_ciphersuite = "aes256-cbc-sha1"
- ike_diffie_hellman_group = "16"
- ike_id_local_end_point = "xxx"
- ike_id_remote_end_point = "xxx"
- ipsec_rekey_interval = 3600
- ipsec_replay_window = 512
- ipsec_ciphersuite = "aes256-gcm"
- perfect_forward_secrecy = "group-16"
- tunnel_route_via = "2222"
-}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/import.sh
new file mode 100644
index 000000000..24045e2d1
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/import.sh
@@ -0,0 +1 @@
+terraform import sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/resource.tf
new file mode 100644
index 000000000..62aa6a3b1
--- /dev/null
+++ b/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_feature/resource.tf
@@ -0,0 +1,62 @@
+resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "example" {
+ name = "Example"
+ description = "My Example"
+ feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
+ transport_wan_vpn_feature_id = "140331f6-5418-4755-a059-13c77eb96037"
+ shutdown = true
+ interface_name = "Serial0"
+ ipv4_address = "1.2.3.4"
+ ipv4_subnet_mask = "0.0.0.0"
+ ipv6_address = "2001:0:0:1::/64"
+ bandwidth = 123456
+ bandwidth_downstream = 123456
+ clock_rate = "1200"
+ encapsulation = "ppp"
+ tunnel_interface = true
+ per_tunnel_qos = true
+ per_tunnel_qos_aggregator = false
+ tunnel_qos_mode = "hub"
+ tunnel_interface_color = "mpls"
+ tunnel_interface_restrict = true
+ tunnel_interface_groups = 42949672
+ tunnel_interface_border = false
+ tunnel_interface_max_control_connections = 62
+ tunnel_interface_vbond_as_stun_server = false
+ tunnel_interface_exclude_controller_group_list = [2]
+ tunnel_interface_vmanage_connection_preference = 8
+ tunnel_interface_port_hop = true
+ tunnel_interface_low_bandwidth_link = false
+ tunnel_interface_tunnel_tcp_mss = 1460
+ tunnel_interface_clear_dont_fragment = false
+ tunnel_interface_clear_network_broadcast = false
+ tunnel_interface_carrier = "default"
+ tunnel_interface_bind_loopback_tunnel = "example"
+ tunnel_interface_last_resort_circuit = false
+ tunnel_interface_nat_refresh_interval = 5
+ tunnel_interface_hello_interval = 1000
+ tunnel_interface_hello_tolerance = 12
+ tunnel_interface_allow_all = false
+ tunnel_interface_allow_bgp = false
+ tunnel_interface_allow_dhcp = true
+ tunnel_interface_allow_dns = true
+ tunnel_interface_allow_icmp = true
+ tunnel_interface_allow_netconf = false
+ tunnel_interface_allow_ntp = false
+ tunnel_interface_allow_ospf = false
+ tunnel_interface_allow_ssh = false
+ tunnel_interface_allow_stun = false
+ tunnel_interface_allow_https = true
+ tunnel_interface_allow_snmp = false
+ tunnel_interface_allow_bfd = false
+ tunnel_interface_encapsulations = [
+ {
+ encapsulation = "gre"
+ preference = 4294967
+ weight = 250
+ }
+ ]
+ tcp_mss = 1460
+ mtu = 1500
+ ip_mtu = 1500
+ tloc_extension = "tloc"
+}
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/import.sh b/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/import.sh
deleted file mode 100644
index bdbef8f2a..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/resource.tf b/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/resource.tf
deleted file mode 100644
index a6aab7e53..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel/resource.tf
+++ /dev/null
@@ -1,62 +0,0 @@
-resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- transport_wan_vpn_profile_parcel_id = "140331f6-5418-4755-a059-13c77eb96037"
- shutdown = true
- interface_name = "Serial0"
- ipv4_address = "1.2.3.4"
- ipv4_subnet_mask = "0.0.0.0"
- ipv6_address = "2001:0:0:1::/64"
- bandwidth = 123456
- bandwidth_downstream = 123456
- clock_rate = "1200"
- encapsulation = "ppp"
- tunnel_interface = true
- per_tunnel_qos = true
- per_tunnel_qos_aggregator = false
- tunnel_qos_mode = "hub"
- tunnel_interface_color = "mpls"
- tunnel_interface_restrict = true
- tunnel_interface_groups = 42949672
- tunnel_interface_border = false
- tunnel_interface_max_control_connections = 62
- tunnel_interface_vbond_as_stun_server = false
- tunnel_interface_exclude_controller_group_list = [2]
- tunnel_interface_vmanage_connection_preference = 8
- tunnel_interface_port_hop = true
- tunnel_interface_low_bandwidth_link = false
- tunnel_interface_tunnel_tcp_mss = 1460
- tunnel_interface_clear_dont_fragment = false
- tunnel_interface_clear_network_broadcast = false
- tunnel_interface_carrier = "default"
- tunnel_interface_bind_loopback_tunnel = "example"
- tunnel_interface_last_resort_circuit = false
- tunnel_interface_nat_refresh_interval = 5
- tunnel_interface_hello_interval = 1000
- tunnel_interface_hello_tolerance = 12
- tunnel_interface_allow_all = false
- tunnel_interface_allow_bgp = false
- tunnel_interface_allow_dhcp = true
- tunnel_interface_allow_dns = true
- tunnel_interface_allow_icmp = true
- tunnel_interface_allow_netconf = false
- tunnel_interface_allow_ntp = false
- tunnel_interface_allow_ospf = false
- tunnel_interface_allow_ssh = false
- tunnel_interface_allow_stun = false
- tunnel_interface_allow_https = true
- tunnel_interface_allow_snmp = false
- tunnel_interface_allow_bfd = false
- tunnel_interface_encapsulations = [
- {
- encapsulation = "gre"
- preference = 4294967
- weight = 250
- }
- ]
- tcp_mss = 1460
- mtu = 1500
- ip_mtu = 1500
- tloc_extension = "tloc"
-}
diff --git a/examples/resources/sdwan_transport_wan_vpn_profile_parcel/import.sh b/examples/resources/sdwan_transport_wan_vpn_profile_parcel/import.sh
deleted file mode 100644
index 074d5f6f7..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_profile_parcel/import.sh
+++ /dev/null
@@ -1 +0,0 @@
-terraform import sdwan_transport_wan_vpn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/examples/resources/sdwan_transport_wan_vpn_profile_parcel/resource.tf b/examples/resources/sdwan_transport_wan_vpn_profile_parcel/resource.tf
deleted file mode 100644
index f6702883b..000000000
--- a/examples/resources/sdwan_transport_wan_vpn_profile_parcel/resource.tf
+++ /dev/null
@@ -1,55 +0,0 @@
-resource "sdwan_transport_wan_vpn_profile_parcel" "example" {
- name = "Example"
- description = "My Example"
- feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
diff --git a/gen/definitions/generic/advanced_inspection_profile_policy_definition.yaml b/gen/definitions/generic/advanced_inspection_profile_policy_definition.yaml
index f234d2472..379bd81ef 100644
--- a/gen/definitions/generic/advanced_inspection_profile_policy_definition.yaml
+++ b/gen/definitions/generic/advanced_inspection_profile_policy_definition.yaml
@@ -2,7 +2,7 @@ name: Advanced Inspection Profile Policy Definition
rest_endpoint: /template/policy/definition/advancedinspectionprofile/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
@@ -49,7 +49,7 @@ attributes:
tf_only: true
type: Version
description: URL filtering version
- exclude_test: true
+ exclude_test: true
- model_name: ref
data_path: [definition, advancedMalwareProtection]
tf_name: advanced_malware_protection_id
@@ -61,7 +61,7 @@ attributes:
tf_only: true
type: Version
description: Advanced malware protection version
- exclude_test: true
+ exclude_test: true
- model_name: ref
data_path: [definition, sslDecryption]
tf_name: tls_ssl_decryption_id
@@ -73,7 +73,7 @@ attributes:
tf_only: true
type: Version
description: TLS/SSL decryption version
- exclude_test: true
+ exclude_test: true
test_prerequisites: |
resource "sdwan_url_filtering_policy_definition" "test" {
diff --git a/gen/definitions/generic/advanced_malware_protection_policy_definition.yaml b/gen/definitions/generic/advanced_malware_protection_policy_definition.yaml
index b2892d1c3..111f668cc 100644
--- a/gen/definitions/generic/advanced_malware_protection_policy_definition.yaml
+++ b/gen/definitions/generic/advanced_malware_protection_policy_definition.yaml
@@ -3,7 +3,7 @@ name: Advanced Malware Protection Policy Definition
rest_endpoint: /template/policy/definition/advancedMalwareProtection/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/allow_url_list_policy_object.yaml b/gen/definitions/generic/allow_url_list_policy_object.yaml
index 0078b56d9..8eceeda7d 100644
--- a/gen/definitions/generic/allow_url_list_policy_object.yaml
+++ b/gen/definitions/generic/allow_url_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Allow URL List Policy Object
rest_endpoint: /template/policy/list/urlwhitelist/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/app_probe_class_policy_object.yaml b/gen/definitions/generic/app_probe_class_policy_object.yaml
index 708aee8ca..d522ab02a 100644
--- a/gen/definitions/generic/app_probe_class_policy_object.yaml
+++ b/gen/definitions/generic/app_probe_class_policy_object.yaml
@@ -3,7 +3,7 @@ name: App Probe Class Policy Object
rest_endpoint: /template/policy/list/appprobe/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/application_aware_routing_policy_definition.yaml b/gen/definitions/generic/application_aware_routing_policy_definition.yaml
index 85c695a71..a98e5c697 100644
--- a/gen/definitions/generic/application_aware_routing_policy_definition.yaml
+++ b/gen/definitions/generic/application_aware_routing_policy_definition.yaml
@@ -4,7 +4,7 @@ rest_endpoint: /template/policy/definition/approute/
has_version: true
id_attribute: definitionId
type_value: appRoute
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: type
type: String
@@ -77,6 +77,7 @@ attributes:
destinationRegion,
destinationPort,
trafficTo,
+ icmpMessage,
]
description: Type of match entry
example: appList
@@ -108,6 +109,15 @@ attributes:
type: Version
description: DNS Application list version
exclude_test: true
+ - model_name: value
+ tf_name: icmp_message
+ conditional_attribute:
+ name: type
+ value: icmpMessage
+ type: String
+ description: ICMP Message
+ exclude_test: true
+ example: "echo echo-reply"
- model_name: value
tf_name: dns
conditional_attribute:
@@ -298,7 +308,14 @@ attributes:
type: String
id: true
mandatory: true
- enum_values: [name, preferredColor, preferredColorGroup, strict, fallbackToBestPath]
+ enum_values:
+ [
+ name,
+ preferredColor,
+ preferredColorGroup,
+ strict,
+ fallbackToBestPath,
+ ]
description: Type of SLA class parameter
example: name
- model_name: ref
@@ -346,4 +363,4 @@ test_prerequisites: |
application = "netflix"
}
]
- }
\ No newline at end of file
+ }
diff --git a/gen/definitions/generic/application_list_policy_object.yaml b/gen/definitions/generic/application_list_policy_object.yaml
index 796e59225..a33865e24 100644
--- a/gen/definitions/generic/application_list_policy_object.yaml
+++ b/gen/definitions/generic/application_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Application List Policy Object
rest_endpoint: /template/policy/list/app/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/application_priority_feature_profile.yaml b/gen/definitions/generic/application_priority_feature_profile.yaml
index 5c5fcd896..375301bee 100644
--- a/gen/definitions/generic/application_priority_feature_profile.yaml
+++ b/gen/definitions/generic/application_priority_feature_profile.yaml
@@ -1,6 +1,7 @@
---
name: Application Priority Feature Profile
rest_endpoint: /v1/feature-profile/sdwan/application-priority/
+minimum_version: 20.12.0
id_attribute: id
doc_category: Feature Profiles
test_tags: [SDWAN_2012]
diff --git a/gen/definitions/generic/as_path_list_policy_object.yaml b/gen/definitions/generic/as_path_list_policy_object.yaml
index 8251d8d1f..3d801f88d 100644
--- a/gen/definitions/generic/as_path_list_policy_object.yaml
+++ b/gen/definitions/generic/as_path_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: AS Path List Policy Object
rest_endpoint: /template/policy/list/aspath/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/block_url_list_policy_object.yaml b/gen/definitions/generic/block_url_list_policy_object.yaml
index 7dbf5d416..f2637d9c3 100644
--- a/gen/definitions/generic/block_url_list_policy_object.yaml
+++ b/gen/definitions/generic/block_url_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Block URL List Policy Object
rest_endpoint: /template/policy/list/urlblacklist/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/centralized_policy.yaml b/gen/definitions/generic/centralized_policy.yaml
index 4fb7650a2..5d06bd19a 100644
--- a/gen/definitions/generic/centralized_policy.yaml
+++ b/gen/definitions/generic/centralized_policy.yaml
@@ -4,7 +4,7 @@ rest_endpoint: /template/policy/vsmart/
get_rest_endpoint: /template/policy/vsmart/definition/
has_version: true
id_attribute: policyId
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: policyType
type: String
diff --git a/gen/definitions/generic/cflowd_policy_definition.yaml b/gen/definitions/generic/cflowd_policy_definition.yaml
index 89dfb6021..b4fa482c7 100644
--- a/gen/definitions/generic/cflowd_policy_definition.yaml
+++ b/gen/definitions/generic/cflowd_policy_definition.yaml
@@ -4,7 +4,7 @@ rest_endpoint: /template/policy/definition/cflowd/
has_version: true
id_attribute: definitionId
type_value: cflowd
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/class_map_policy_object.yaml b/gen/definitions/generic/class_map_policy_object.yaml
index af7d3394c..6be36a835 100644
--- a/gen/definitions/generic/class_map_policy_object.yaml
+++ b/gen/definitions/generic/class_map_policy_object.yaml
@@ -3,7 +3,7 @@ name: Class Map Policy Object
rest_endpoint: /template/policy/list/class/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/cli_config_feature.yaml b/gen/definitions/generic/cli_config_feature.yaml
new file mode 100644
index 000000000..e9c36f5a3
--- /dev/null
+++ b/gen/definitions/generic/cli_config_feature.yaml
@@ -0,0 +1,44 @@
+---
+name: CLI Config Feature
+rest_endpoint: /v1/feature-profile/sdwan/cli/%v/config/
+minimum_version: 20.12.0
+has_version: true
+id_attribute: parcelId
+test_tags: [SDWAN_2012]
+doc_category: Features
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_cli_feature_profile.test.id
+ - model_name: name
+ response_data_path: [payload]
+ type: String
+ mandatory: true
+ description: The name of the Feature
+ string_min_length: 1
+ string_max_length: 128
+ example: Example
+ - model_name: description
+ response_data_path: [payload]
+ type: String
+ mandatory: true
+ description: The description of the Feature
+ example: My Example
+ - model_name: config
+ tf_name: cli_configuration
+ data_path: [data]
+ response_data_path: [payload, data]
+ type: String
+ mandatory: true
+ description: CLI configuration
+ example: 'bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000'
+
+test_prerequisites: |
+ resource "sdwan_cli_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/generic/cli_config_profile_parcel.yaml b/gen/definitions/generic/cli_config_profile_parcel.yaml
deleted file mode 100644
index 3b97e76c9..000000000
--- a/gen/definitions/generic/cli_config_profile_parcel.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
----
-name: CLI Config Profile Parcel
-rest_endpoint: /v1/feature-profile/sdwan/cli/%v/config/
-minimum_version: 20.12.0
-has_version: true
-id_attribute: parcelId
-test_tags: [SDWAN_2012]
-doc_category: Profile Parcels
-attributes:
- - tf_name: feature_profile_id
- reference: true
- type: String
- mandatory: true
- description: Feature Profile ID
- example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
- test_value: sdwan_cli_feature_profile.test.id
- - model_name: name
- response_data_path: [payload]
- type: String
- mandatory: true
- description: The name of the profile parcel
- string_min_length: 1
- string_max_length: 128
- example: Example
- - model_name: description
- response_data_path: [payload]
- type: String
- mandatory: true
- description: The description of the profile parcel
- example: My Example
- - model_name: config
- tf_name: cli_configuration
- data_path: [data]
- response_data_path: [payload, data]
- type: String
- mandatory: true
- description: CLI configuration
- example: 'bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000'
-
-test_prerequisites: |
- resource "sdwan_cli_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
- }
\ No newline at end of file
diff --git a/gen/definitions/generic/cli_device_template.yaml b/gen/definitions/generic/cli_device_template.yaml
index 3f61fd37c..cf6d0de93 100644
--- a/gen/definitions/generic/cli_device_template.yaml
+++ b/gen/definitions/generic/cli_device_template.yaml
@@ -5,7 +5,7 @@ get_rest_endpoint: /template/device/object/
post_rest_endpoint: /template/device/cli/
has_version: true
id_attribute: templateId
-doc_category: Device Templates
+doc_category: (Classic) Device Templates
attributes:
- model_name: configType
type: String
diff --git a/gen/definitions/generic/cli_feature_profile.yaml b/gen/definitions/generic/cli_feature_profile.yaml
index 01d7d4211..29696a409 100644
--- a/gen/definitions/generic/cli_feature_profile.yaml
+++ b/gen/definitions/generic/cli_feature_profile.yaml
@@ -1,6 +1,7 @@
---
name: CLI Feature Profile
rest_endpoint: /v1/feature-profile/sdwan/cli/
+minimum_version: 20.12.0
id_attribute: id
doc_category: Feature Profiles
test_tags: [SDWAN_2012]
diff --git a/gen/definitions/generic/color_list_policy_object.yaml b/gen/definitions/generic/color_list_policy_object.yaml
index a21dbe396..6869247b7 100644
--- a/gen/definitions/generic/color_list_policy_object.yaml
+++ b/gen/definitions/generic/color_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Color List Policy Object
rest_endpoint: /template/policy/list/color/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/custom_control_topology_policy_definition.yaml b/gen/definitions/generic/custom_control_topology_policy_definition.yaml
index a6088178f..c8a1ba66d 100644
--- a/gen/definitions/generic/custom_control_topology_policy_definition.yaml
+++ b/gen/definitions/generic/custom_control_topology_policy_definition.yaml
@@ -4,7 +4,7 @@ rest_endpoint: /template/policy/definition/control/
has_version: true
id_attribute: definitionId
type_value: control
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: type
type: String
@@ -31,7 +31,6 @@ attributes:
- model_name: sequences
tf_name: sequences
type: List
- mandatory: true
description: List of sequences
attributes:
- model_name: sequenceId
diff --git a/gen/definitions/generic/data_fqdn_prefix_list_policy_object.yaml b/gen/definitions/generic/data_fqdn_prefix_list_policy_object.yaml
index 47f439895..b226e56be 100644
--- a/gen/definitions/generic/data_fqdn_prefix_list_policy_object.yaml
+++ b/gen/definitions/generic/data_fqdn_prefix_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Data FQDN Prefix List Policy Object
rest_endpoint: /template/policy/list/fqdn/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/data_ipv4_prefix_list_policy_object.yaml b/gen/definitions/generic/data_ipv4_prefix_list_policy_object.yaml
index 9c167a659..a6590b43d 100644
--- a/gen/definitions/generic/data_ipv4_prefix_list_policy_object.yaml
+++ b/gen/definitions/generic/data_ipv4_prefix_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Data IPv4 Prefix List Policy Object
rest_endpoint: /template/policy/list/dataprefix/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/data_ipv6_prefix_list_policy_object.yaml b/gen/definitions/generic/data_ipv6_prefix_list_policy_object.yaml
index 15d6f8c94..6ae3d5217 100644
--- a/gen/definitions/generic/data_ipv6_prefix_list_policy_object.yaml
+++ b/gen/definitions/generic/data_ipv6_prefix_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Data IPv6 Prefix List Policy Object
rest_endpoint: /template/policy/list/dataipv6prefix/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/dns_security_feature_profile.yaml b/gen/definitions/generic/dns_security_feature_profile.yaml
new file mode 100644
index 000000000..c6d9cf000
--- /dev/null
+++ b/gen/definitions/generic/dns_security_feature_profile.yaml
@@ -0,0 +1,19 @@
+---
+name: DNS Security Feature Profile
+rest_endpoint: /v1/feature-profile/sdwan/dns-security/
+minimum_version: 20.12.0
+id_attribute: id
+doc_category: Feature Profiles
+test_tags: [SDWAN_2012]
+attributes:
+ - model_name: name
+ response_model_name: profileName
+ type: String
+ mandatory: true
+ description: The name of the dns security feature profile
+ example: DNS_SECURITY_FP_1
+ - model_name: description
+ type: String
+ mandatory: true
+ description: Description
+ example: My dns security feature profile 1
diff --git a/gen/definitions/generic/dns_security_policy_definition.yaml b/gen/definitions/generic/dns_security_policy_definition.yaml
index e3d9ea17e..19e1237a4 100644
--- a/gen/definitions/generic/dns_security_policy_definition.yaml
+++ b/gen/definitions/generic/dns_security_policy_definition.yaml
@@ -3,7 +3,7 @@ name: DNS Security Policy Definition
rest_endpoint: /template/policy/definition/dnssecurity/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
test_tags: [SDWAN_209]
attributes:
- model_name: type
@@ -33,7 +33,7 @@ attributes:
tf_only: true
type: Version
description: Local domain bypass list version
- exclude_test: true
+ exclude_test: true
- model_name: localDomainBypassEnabled
data_path: [definition]
tf_name: local_domain_bypass_enabled
@@ -51,7 +51,7 @@ attributes:
data_path: [definition]
tf_name: target_vpns
type: List
- description: Only relevant when `match_all_vpn` is `false`
+ description: Only relevant when `match_all_vpn` is `false`
example: 1
exclude_test: true
attributes:
@@ -59,7 +59,7 @@ attributes:
tf_name: vpn_ids
type: Set
element_type: String
- description: VPN ID's separated by Comma
+ description: VPN ID's separated by Comma
example: 1
- model_name: umbrellaDefault
tf_name: umbrella_dns_default
diff --git a/gen/definitions/generic/domain_list_policy_object.yaml b/gen/definitions/generic/domain_list_policy_object.yaml
index 921d556a0..3dcd5516c 100644
--- a/gen/definitions/generic/domain_list_policy_object.yaml
+++ b/gen/definitions/generic/domain_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Domain List Policy Object
rest_endpoint: /template/policy/list/localdomain/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/embedded_security_feature_profile.yaml b/gen/definitions/generic/embedded_security_feature_profile.yaml
new file mode 100644
index 000000000..fec023734
--- /dev/null
+++ b/gen/definitions/generic/embedded_security_feature_profile.yaml
@@ -0,0 +1,19 @@
+---
+name: Embedded Security Feature Profile
+rest_endpoint: /v1/feature-profile/sdwan/embedded-security/
+minimum_version: 20.12.0
+id_attribute: id
+doc_category: Feature Profiles
+test_tags: [SDWAN_2012]
+attributes:
+ - model_name: name
+ response_model_name: profileName
+ type: String
+ mandatory: true
+ description: The name of the embedded security feature profile
+ example: EMBEDDED_SECURITY_FP_1
+ - model_name: description
+ type: String
+ mandatory: true
+ description: Description
+ example: My embedded security feature profile 1
diff --git a/gen/definitions/generic/expanded_community_list_policy_object.yaml b/gen/definitions/generic/expanded_community_list_policy_object.yaml
index 4b355756c..abd93d0bd 100644
--- a/gen/definitions/generic/expanded_community_list_policy_object.yaml
+++ b/gen/definitions/generic/expanded_community_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Expanded Community List Policy Object
rest_endpoint: /template/policy/list/expandedcommunity/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/extended_community_list_policy_object.yaml b/gen/definitions/generic/extended_community_list_policy_object.yaml
index f09e3756c..099bf345a 100644
--- a/gen/definitions/generic/extended_community_list_policy_object.yaml
+++ b/gen/definitions/generic/extended_community_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Extended Community List Policy Object
rest_endpoint: /template/policy/list/extcommunity/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/feature_device_template.yaml b/gen/definitions/generic/feature_device_template.yaml
index 98225c617..170aac35c 100644
--- a/gen/definitions/generic/feature_device_template.yaml
+++ b/gen/definitions/generic/feature_device_template.yaml
@@ -5,7 +5,7 @@ post_rest_endpoint: /template/device/feature/
get_rest_endpoint: /template/device/object/
has_version: true
id_attribute: templateId
-doc_category: Device Templates
+doc_category: (Classic) Device Templates
attributes:
- model_name: configType
type: String
@@ -87,7 +87,24 @@ attributes:
tf_name: type
type: String
mandatory: true
- enum_values: [cisco_system, cisco_logging, cedge_aaa, cisco_bfd, cisco_omp, cisco_security, cisco_banner, cisco_snmp, cedge_global, cli-template, cisco_sig_credentials, switchport, cisco_thousandeyes, cisco_vpn]
+ enum_values:
+ [
+ cisco_system,
+ cisco_logging,
+ cedge_aaa,
+ cisco_bfd,
+ cisco_omp,
+ cisco_security,
+ cisco_banner,
+ cisco_snmp,
+ cedge_global,
+ cli-template,
+ cisco_sig_credentials,
+ switchport,
+ cisco_thousandeyes,
+ cisco_vpn,
+ virtual-application-utd,
+ ]
ignore_enum: true
description: Feature template type
example: cisco_system
@@ -113,7 +130,17 @@ attributes:
tf_name: type
type: String
mandatory: true
- enum_values: [cisco_logging, cisco_ntp, cisco_ospf, cisco_bgp, cisco_vpn_interface, cisco_vpn_interface_ipsec, vpn-interface-svi, cisco_secure_internet_gateway]
+ enum_values:
+ [
+ cisco_logging,
+ cisco_ntp,
+ cisco_ospf,
+ cisco_bgp,
+ cisco_vpn_interface,
+ cisco_vpn_interface_ipsec,
+ vpn-interface-svi,
+ cisco_secure_internet_gateway,
+ ]
ignore_enum: true
description: Feature template type
example: cisco_vpn_interface
diff --git a/gen/definitions/generic/geo_location_list_policy_object.yaml b/gen/definitions/generic/geo_location_list_policy_object.yaml
index cf31af4a4..c10f4d734 100644
--- a/gen/definitions/generic/geo_location_list_policy_object.yaml
+++ b/gen/definitions/generic/geo_location_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Geo Location List Policy Object
rest_endpoint: /template/policy/list/geolocation/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/hub_and_spoke_topology_policy_definition.yaml b/gen/definitions/generic/hub_and_spoke_topology_policy_definition.yaml
index 3b214220f..ad061549e 100644
--- a/gen/definitions/generic/hub_and_spoke_topology_policy_definition.yaml
+++ b/gen/definitions/generic/hub_and_spoke_topology_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
root_element: definition
type_value: hubAndSpoke
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: type
type: String
@@ -107,7 +107,7 @@ attributes:
description: Preference, multiple of 10 (for example 70, 80, 90, 100). The higher the value the higher the priority of the associated hub (required when `all_hubs_are_equal` is 'false')
example: 30
- model_name: prefixLists
- tf_name: ipv4_prefix_list_ids
+ tf_name: ipv4_prefix_list_ids
type: Set
element_type: String
description: List of IPv4 prefix list IDs
diff --git a/gen/definitions/generic/intrusion_prevention_policy_definition.yaml b/gen/definitions/generic/intrusion_prevention_policy_definition.yaml
index c2d069050..fe5211ef8 100644
--- a/gen/definitions/generic/intrusion_prevention_policy_definition.yaml
+++ b/gen/definitions/generic/intrusion_prevention_policy_definition.yaml
@@ -3,7 +3,7 @@ name: Intrusion Prevention Policy Definition
rest_endpoint: /template/policy/definition/intrusionprevention/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
@@ -24,7 +24,7 @@ attributes:
tf_name: mode
type: String
enum_values: [security, unified]
- default_value:
+ default_value:
description: The policy mode
example: security
- model_name: inspectionMode
@@ -38,7 +38,8 @@ attributes:
data_path: [definition]
tf_name: log_level
type: String
- enum_values: [emergency, alert, critical, error, warning, notice, info, debug]
+ enum_values:
+ [emergency, alert, critical, error, warning, notice, info, debug]
description: Log level
example: alert
- model_name: signatureSet
diff --git a/gen/definitions/generic/ips_signature_list_policy_object.yaml b/gen/definitions/generic/ips_signature_list_policy_object.yaml
index 1ffe4e866..e46b409f9 100644
--- a/gen/definitions/generic/ips_signature_list_policy_object.yaml
+++ b/gen/definitions/generic/ips_signature_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: IPS Signature List Policy Object
rest_endpoint: /template/policy/list/ipssignature/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/ipv4_acl_policy_definition.yaml b/gen/definitions/generic/ipv4_acl_policy_definition.yaml
index 5dea7004e..b1c204c84 100644
--- a/gen/definitions/generic/ipv4_acl_policy_definition.yaml
+++ b/gen/definitions/generic/ipv4_acl_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
get_before_delete: true
type_value: acl
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: type
type: String
@@ -84,6 +84,7 @@ attributes:
destinationDataPrefixList,
protocol,
tcp,
+ icmpMessage,
]
description: Type of match entry
example: dscp
@@ -107,6 +108,15 @@ attributes:
description: Source IP prefix
exclude_test: true
example: 10.0.0.0/8
+ - model_name: value
+ tf_name: icmp_message
+ conditional_attribute:
+ name: type
+ value: icmpMessage
+ type: String
+ description: ICMP Message
+ exclude_test: true
+ example: "echo echo-reply"
- model_name: value
tf_name: destination_ip
conditional_attribute:
diff --git a/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml b/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml
index dd71b5d69..133beeab2 100644
--- a/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml
+++ b/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
get_before_delete: true
type_value: deviceAccessPolicy
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/ipv4_prefix_list_policy_object.yaml b/gen/definitions/generic/ipv4_prefix_list_policy_object.yaml
index bab0d231c..64dd09481 100644
--- a/gen/definitions/generic/ipv4_prefix_list_policy_object.yaml
+++ b/gen/definitions/generic/ipv4_prefix_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: IPv4 Prefix List Policy Object
rest_endpoint: /template/policy/list/prefix/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/ipv6_acl_policy_definition.yaml b/gen/definitions/generic/ipv6_acl_policy_definition.yaml
index df0498545..437e014a2 100644
--- a/gen/definitions/generic/ipv6_acl_policy_definition.yaml
+++ b/gen/definitions/generic/ipv6_acl_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
get_before_delete: true
type_value: aclv6
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/ipv6_device_acl_policy_definition.yaml b/gen/definitions/generic/ipv6_device_acl_policy_definition.yaml
index 844d6b39a..ec80dde2c 100644
--- a/gen/definitions/generic/ipv6_device_acl_policy_definition.yaml
+++ b/gen/definitions/generic/ipv6_device_acl_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
get_before_delete: true
type_value: deviceAccessPolicyv6
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/ipv6_prefix_list_policy_object.yaml b/gen/definitions/generic/ipv6_prefix_list_policy_object.yaml
index 76acfe272..9529e922e 100644
--- a/gen/definitions/generic/ipv6_prefix_list_policy_object.yaml
+++ b/gen/definitions/generic/ipv6_prefix_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: IPv6 Prefix List Policy Object
rest_endpoint: /template/policy/list/ipv6prefix/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/local_application_list_policy_object.yaml b/gen/definitions/generic/local_application_list_policy_object.yaml
index 89291d485..ce26994f0 100644
--- a/gen/definitions/generic/local_application_list_policy_object.yaml
+++ b/gen/definitions/generic/local_application_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Local Application List Policy Object
rest_endpoint: /template/policy/list/localapp/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/localized_policy.yaml b/gen/definitions/generic/localized_policy.yaml
index b444570ab..d907dcacb 100644
--- a/gen/definitions/generic/localized_policy.yaml
+++ b/gen/definitions/generic/localized_policy.yaml
@@ -6,7 +6,7 @@ get_before_delete: true
has_version: true
id_attribute: policyId
delete_mutex: true
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: policyType
type: String
@@ -119,7 +119,16 @@ attributes:
tf_name: type
type: String
mandatory: true
- enum_values: [qosMap, rewriteRule, vedgeRoute, acl, aclv6, deviceAccessPolicy, deviceAccessPolicyv6]
+ enum_values:
+ [
+ qosMap,
+ rewriteRule,
+ vedgeRoute,
+ acl,
+ aclv6,
+ deviceAccessPolicy,
+ deviceAccessPolicyv6,
+ ]
description: Policy definition type
example: acl
diff --git a/gen/definitions/generic/mesh_topology_policy_definition.yaml b/gen/definitions/generic/mesh_topology_policy_definition.yaml
index 3d2406e18..fc534adbb 100644
--- a/gen/definitions/generic/mesh_topology_policy_definition.yaml
+++ b/gen/definitions/generic/mesh_topology_policy_definition.yaml
@@ -4,7 +4,7 @@ rest_endpoint: /template/policy/definition/mesh/
has_version: true
id_attribute: definitionId
type_value: mesh
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/mirror_policy_object.yaml b/gen/definitions/generic/mirror_policy_object.yaml
index 171ef94a2..3ce2d4bc8 100644
--- a/gen/definitions/generic/mirror_policy_object.yaml
+++ b/gen/definitions/generic/mirror_policy_object.yaml
@@ -3,7 +3,7 @@ name: Mirror Policy Object
rest_endpoint: /template/policy/list/mirror/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/object_group_policy_definition.yaml b/gen/definitions/generic/object_group_policy_definition.yaml
index 8024db086..2df75a09c 100644
--- a/gen/definitions/generic/object_group_policy_definition.yaml
+++ b/gen/definitions/generic/object_group_policy_definition.yaml
@@ -3,7 +3,7 @@ name: Object Group Policy Definition
rest_endpoint: /template/policy/definition/securitygroup/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/other_feature_profile.yaml b/gen/definitions/generic/other_feature_profile.yaml
new file mode 100644
index 000000000..8ccd84a98
--- /dev/null
+++ b/gen/definitions/generic/other_feature_profile.yaml
@@ -0,0 +1,19 @@
+---
+name: Other Feature Profile
+rest_endpoint: /v1/feature-profile/sdwan/other/
+minimum_version: 20.12.0
+id_attribute: id
+doc_category: Feature Profiles
+test_tags: [SDWAN_2012]
+attributes:
+ - model_name: name
+ response_model_name: profileName
+ type: String
+ mandatory: true
+ description: The name of the transport feature profile
+ example: OTHER_FP_1
+ - model_name: description
+ type: String
+ mandatory: true
+ description: Description
+ example: My Other feature profile 1
diff --git a/gen/definitions/generic/policer_policy_object.yaml b/gen/definitions/generic/policer_policy_object.yaml
index 01671e5bc..47bbfb227 100644
--- a/gen/definitions/generic/policer_policy_object.yaml
+++ b/gen/definitions/generic/policer_policy_object.yaml
@@ -3,7 +3,7 @@ name: Policer Policy Object
rest_endpoint: /template/policy/list/policer/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/policy_object_feature_profile.yaml b/gen/definitions/generic/policy_object_feature_profile.yaml
new file mode 100644
index 000000000..4b6881fab
--- /dev/null
+++ b/gen/definitions/generic/policy_object_feature_profile.yaml
@@ -0,0 +1,20 @@
+---
+name: Policy Object Feature Profile
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/
+minimum_version: 20.12.0
+id_attribute: id
+res_description: SD-WAN manager supports only a single policy object feature profile to be configured. This resource will therefore either create a new one if none exists or update the existing one.
+doc_category: Feature Profiles
+test_tags: [SDWAN_2012]
+attributes:
+ - model_name: name
+ response_model_name: profileName
+ type: String
+ mandatory: true
+ description: The name of the policy object feature profile
+ example: POLICY_OBJECT_FP_1
+ - model_name: description
+ type: String
+ mandatory: true
+ description: Description
+ example: My policy object feature profile 1
diff --git a/gen/definitions/generic/port_list_policy_object.yaml b/gen/definitions/generic/port_list_policy_object.yaml
index b8f4b1d8f..fc044850d 100644
--- a/gen/definitions/generic/port_list_policy_object.yaml
+++ b/gen/definitions/generic/port_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Port List Policy Object
rest_endpoint: /template/policy/list/port/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/preferred_color_group_policy_object.yaml b/gen/definitions/generic/preferred_color_group_policy_object.yaml
index 89990efc4..7b01d24ed 100644
--- a/gen/definitions/generic/preferred_color_group_policy_object.yaml
+++ b/gen/definitions/generic/preferred_color_group_policy_object.yaml
@@ -3,7 +3,7 @@ name: Preferred Color Group Policy Object
rest_endpoint: /template/policy/list/preferredcolorgroup/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/protocol_list_policy_object.yaml b/gen/definitions/generic/protocol_list_policy_object.yaml
index 3de27e7a1..83a42d102 100644
--- a/gen/definitions/generic/protocol_list_policy_object.yaml
+++ b/gen/definitions/generic/protocol_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Protocol List Policy Object
rest_endpoint: /template/policy/list/protocolname/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/qos_map_policy_definition.yaml b/gen/definitions/generic/qos_map_policy_definition.yaml
index 302211790..27e6ebfd5 100644
--- a/gen/definitions/generic/qos_map_policy_definition.yaml
+++ b/gen/definitions/generic/qos_map_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
get_before_delete: true
type_value: qosMap
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/region_list_policy_object.yaml b/gen/definitions/generic/region_list_policy_object.yaml
index 0afa4869a..71ff407aa 100644
--- a/gen/definitions/generic/region_list_policy_object.yaml
+++ b/gen/definitions/generic/region_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Region List Policy Object
rest_endpoint: /template/policy/list/region/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/rewrite_rule_policy_definition.yaml b/gen/definitions/generic/rewrite_rule_policy_definition.yaml
index f7a2ede46..b6318e33a 100644
--- a/gen/definitions/generic/rewrite_rule_policy_definition.yaml
+++ b/gen/definitions/generic/rewrite_rule_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
get_before_delete: true
type_value: rewriteRule
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/route_policy_definition.yaml b/gen/definitions/generic/route_policy_definition.yaml
index 9397f40b1..e3253907e 100644
--- a/gen/definitions/generic/route_policy_definition.yaml
+++ b/gen/definitions/generic/route_policy_definition.yaml
@@ -5,7 +5,7 @@ has_version: true
id_attribute: definitionId
get_before_delete: true
type_value: vedgeRoute
-doc_category: Localized Policies
+doc_category: (Classic) Localized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/rule_set_policy_definition.yaml b/gen/definitions/generic/rule_set_policy_definition.yaml
index 3aadf634e..7d2c63ec8 100644
--- a/gen/definitions/generic/rule_set_policy_definition.yaml
+++ b/gen/definitions/generic/rule_set_policy_definition.yaml
@@ -3,7 +3,7 @@ name: Rule Set Policy Definition
rest_endpoint: /template/policy/definition/ruleset/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/security_policy.yaml b/gen/definitions/generic/security_policy.yaml
index 19b1115ca..9f7684250 100644
--- a/gen/definitions/generic/security_policy.yaml
+++ b/gen/definitions/generic/security_policy.yaml
@@ -6,7 +6,7 @@ has_version: true
id_from_query_path: data
id_from_query_path_attribute: policyId
delete_mutex: true
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: policyType
type: String
@@ -35,11 +35,19 @@ attributes:
tf_name: use_case
type: String
default_value: custom
- enum_values: [custom, compliance, guestAccess, directCloudAccess, directInternetAccess, directCloudAccess]
+ enum_values:
+ [
+ custom,
+ compliance,
+ guestAccess,
+ directCloudAccess,
+ directInternetAccess,
+ directCloudAccess,
+ ]
description: The use case of the security policy
example: custom
- model_name: assembly
- data_path: [policyDefinition]
+ data_path: [policyDefinition]
tf_name: definitions
type: List
mandatory: true
@@ -58,7 +66,15 @@ attributes:
tf_name: type
type: String
mandatory: true
- enum_values: [urlFiltering, zoneBasedFW, intrusionPrevention, sslDecryption, advancedMalwareProtection, dnsSecurity]
+ enum_values:
+ [
+ urlFiltering,
+ zoneBasedFW,
+ intrusionPrevention,
+ sslDecryption,
+ advancedMalwareProtection,
+ dnsSecurity,
+ ]
description: Policy definition type
example: urlFiltering
- model_name: zoneToNozoneInternet
diff --git a/gen/definitions/generic/service_feature_profile.yaml b/gen/definitions/generic/service_feature_profile.yaml
index 9458c0c2d..5a281beba 100644
--- a/gen/definitions/generic/service_feature_profile.yaml
+++ b/gen/definitions/generic/service_feature_profile.yaml
@@ -1,6 +1,7 @@
---
name: Service Feature Profile
rest_endpoint: /v1/feature-profile/sdwan/service/
+minimum_version: 20.12.0
id_attribute: id
doc_category: Feature Profiles
test_tags: [SDWAN_2012]
diff --git a/gen/definitions/generic/sig_security_feature_profile.yaml b/gen/definitions/generic/sig_security_feature_profile.yaml
new file mode 100644
index 000000000..b20e51e4d
--- /dev/null
+++ b/gen/definitions/generic/sig_security_feature_profile.yaml
@@ -0,0 +1,19 @@
+---
+name: SIG Security Feature Profile
+rest_endpoint: /v1/feature-profile/sdwan/sig-security/
+minimum_version: 20.12.0
+id_attribute: id
+doc_category: Feature Profiles
+test_tags: [SDWAN_2012]
+attributes:
+ - model_name: name
+ response_model_name: profileName
+ type: String
+ mandatory: true
+ description: The name of the sig security feature profile
+ example: SIG_SECURITY_FP_1
+ - model_name: description
+ type: String
+ mandatory: true
+ description: Description
+ example: My sig security feature profile 1
diff --git a/gen/definitions/generic/site_list_policy_object.yaml b/gen/definitions/generic/site_list_policy_object.yaml
index d3ee8dbd0..905a82a5c 100644
--- a/gen/definitions/generic/site_list_policy_object.yaml
+++ b/gen/definitions/generic/site_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Site List Policy Object
rest_endpoint: /template/policy/list/site/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/sla_class_policy_object.yaml b/gen/definitions/generic/sla_class_policy_object.yaml
index 20c08b241..12e63e3db 100644
--- a/gen/definitions/generic/sla_class_policy_object.yaml
+++ b/gen/definitions/generic/sla_class_policy_object.yaml
@@ -3,7 +3,7 @@ name: SLA Class Policy Object
rest_endpoint: /template/policy/list/sla/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/standard_community_list_policy_object.yaml b/gen/definitions/generic/standard_community_list_policy_object.yaml
index 36f0e73df..118445ca9 100644
--- a/gen/definitions/generic/standard_community_list_policy_object.yaml
+++ b/gen/definitions/generic/standard_community_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Standard Community List Policy Object
rest_endpoint: /template/policy/list/community/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/system_feature_profile.yaml b/gen/definitions/generic/system_feature_profile.yaml
index 26cd75659..382407ce5 100644
--- a/gen/definitions/generic/system_feature_profile.yaml
+++ b/gen/definitions/generic/system_feature_profile.yaml
@@ -1,6 +1,7 @@
---
name: System Feature Profile
rest_endpoint: /v1/feature-profile/sdwan/system/
+minimum_version: 20.12.0
id_attribute: id
doc_category: Feature Profiles
test_tags: [SDWAN_2012]
diff --git a/gen/definitions/generic/tloc_list_policy_object.yaml b/gen/definitions/generic/tloc_list_policy_object.yaml
index 3e574af79..be1ba06a9 100644
--- a/gen/definitions/generic/tloc_list_policy_object.yaml
+++ b/gen/definitions/generic/tloc_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: TLOC List Policy Object
rest_endpoint: /template/policy/list/tloc/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml b/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml
index 4da5da919..d93cb5e7d 100644
--- a/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml
+++ b/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml
@@ -2,7 +2,7 @@ name: TLS SSL Decryption Policy Definition
rest_endpoint: /template/policy/definition/ssldecryption/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
@@ -33,7 +33,7 @@ attributes:
description: Default action (applies when `mode` set to `security`)
example: noIntent
- model_name: sequences
- data_path: [definition]
+ data_path: [definition]
type: List
tf_name: network_rules
description: List of network rules (applies when `mode` set to `security`)
@@ -69,7 +69,14 @@ attributes:
type: String
tf_name: option
description: source / destination option
- enum_values: [sourceIp, sourcePort, destinationVpn, destinationIp, destinationPort]
+ enum_values:
+ [
+ sourceIp,
+ sourcePort,
+ destinationVpn,
+ destinationIp,
+ destinationPort,
+ ]
example: destinationIp
- model_name: value
type: String
@@ -77,7 +84,7 @@ attributes:
description: source / destination option target
example: 10.0.0.0/12
- model_name: profiles
- data_path: [definition]
+ data_path: [definition]
tf_name: url_rules
type: List
description: List of url rules (applies when `mode` set to `security`)
@@ -190,4 +197,4 @@ attributes:
tf_name: use_default_ca_cert_bundle
type: Bool
description: Use default CA certificate bundle
- example: true
\ No newline at end of file
+ example: true
diff --git a/gen/definitions/generic/tls_ssl_profile_policy_definition.yaml b/gen/definitions/generic/tls_ssl_profile_policy_definition.yaml
index 3cb3f3ecf..23d9a1a34 100644
--- a/gen/definitions/generic/tls_ssl_profile_policy_definition.yaml
+++ b/gen/definitions/generic/tls_ssl_profile_policy_definition.yaml
@@ -3,7 +3,7 @@ name: TLS SSL Profile Policy Definition
rest_endpoint: /template/policy/definition/sslutdprofile/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
@@ -24,7 +24,7 @@ attributes:
tf_name: mode
type: String
enum_values: [security, unified]
- default_value:
+ default_value:
description: The policy mode
example: security
- model_name: decryptCategories
@@ -72,7 +72,7 @@ attributes:
tf_only: true
type: Version
description: Allow URL list version
- exclude_test: true
+ exclude_test: true
- model_name: ref
data_path: [definition, filteredUrlBlackList]
tf_name: block_url_list_id
@@ -84,7 +84,7 @@ attributes:
tf_only: true
type: Version
description: Block URL list version
- exclude_test: true
+ exclude_test: true
- model_name: failDecrypt
data_path: [definition]
tf_name: fail_decrypt
diff --git a/gen/definitions/generic/traffic_data_policy_definition.yaml b/gen/definitions/generic/traffic_data_policy_definition.yaml
index 7a5619d51..29e9c00db 100644
--- a/gen/definitions/generic/traffic_data_policy_definition.yaml
+++ b/gen/definitions/generic/traffic_data_policy_definition.yaml
@@ -4,7 +4,7 @@ rest_endpoint: /template/policy/definition/data/
has_version: true
id_attribute: definitionId
type_value: data
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: type
type: String
@@ -97,6 +97,7 @@ attributes:
destinationPort,
tcp,
trafficTo,
+ icmpMessage,
]
description: Type of match entry
example: appList
@@ -128,6 +129,15 @@ attributes:
type: Version
description: DNS Application list version
exclude_test: true
+ - model_name: value
+ tf_name: icmp_message
+ conditional_attribute:
+ name: type
+ value: icmpMessage
+ type: String
+ description: ICMP Message
+ exclude_test: true
+ example: "echo echo-reply"
- model_name: value
tf_name: dns
conditional_attribute:
@@ -387,10 +397,8 @@ attributes:
conditional_attribute:
name: type
value: lossProtectFec
- type: Int64
+ type: String
description: Loss correction FEC threshold
- min_int: 1
- max_int: 5
example: 2
exclude_test: true
- model_name: field
diff --git a/gen/definitions/generic/transport_feature_profile.yaml b/gen/definitions/generic/transport_feature_profile.yaml
index 62e220b07..b8aa5af56 100644
--- a/gen/definitions/generic/transport_feature_profile.yaml
+++ b/gen/definitions/generic/transport_feature_profile.yaml
@@ -1,6 +1,7 @@
---
name: Transport Feature Profile
rest_endpoint: /v1/feature-profile/sdwan/transport/
+minimum_version: 20.12.0
id_attribute: id
doc_category: Feature Profiles
test_tags: [SDWAN_2012]
diff --git a/gen/definitions/generic/url_filtering_definition.yaml b/gen/definitions/generic/url_filtering_definition.yaml
index d1c203ffb..29d751643 100644
--- a/gen/definitions/generic/url_filtering_definition.yaml
+++ b/gen/definitions/generic/url_filtering_definition.yaml
@@ -3,7 +3,7 @@ name: URL Filtering Policy Definition
rest_endpoint: /template/policy/definition/urlfiltering/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
@@ -24,7 +24,7 @@ attributes:
tf_name: mode
type: String
enum_values: [security, unified]
- default_value:
+ default_value:
description: The policy mode
example: security
- model_name: alerts
@@ -73,7 +73,7 @@ attributes:
tf_only: true
type: Version
description: Allow URL list version
- exclude_test: true
+ exclude_test: true
- model_name: ref
data_path: [definition, urlBlackList]
tf_name: block_url_list_id
@@ -85,7 +85,7 @@ attributes:
tf_only: true
type: Version
description: Block URL list version
- exclude_test: true
+ exclude_test: true
- model_name: blockPageAction
data_path: [definition]
tf_name: block_page_action
diff --git a/gen/definitions/generic/vpn_list_policy_object.yaml b/gen/definitions/generic/vpn_list_policy_object.yaml
index 8c7190b97..00e4fa21a 100644
--- a/gen/definitions/generic/vpn_list_policy_object.yaml
+++ b/gen/definitions/generic/vpn_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: VPN List Policy Object
rest_endpoint: /template/policy/list/vpn/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/vpn_membership_policy_definition.yaml b/gen/definitions/generic/vpn_membership_policy_definition.yaml
index d4ac74348..a6b1af9f4 100644
--- a/gen/definitions/generic/vpn_membership_policy_definition.yaml
+++ b/gen/definitions/generic/vpn_membership_policy_definition.yaml
@@ -4,7 +4,7 @@ rest_endpoint: /template/policy/definition/vpnmembershipgroup/
has_version: true
id_attribute: definitionId
type_value: vpnMembershipGroup
-doc_category: Centralized Policies
+doc_category: (Classic) Centralized Policies
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/generic/zone_based_firewall_policy_definition.yaml b/gen/definitions/generic/zone_based_firewall_policy_definition.yaml
index 5506bea88..4e395a78b 100644
--- a/gen/definitions/generic/zone_based_firewall_policy_definition.yaml
+++ b/gen/definitions/generic/zone_based_firewall_policy_definition.yaml
@@ -3,7 +3,7 @@ name: Zone Based Firewall Policy Definition
rest_endpoint: /template/policy/definition/zonebasedfw/
has_version: true
id_attribute: definitionId
-doc_category: Security Policies
+doc_category: (Classic) Security Policies
attributes:
- model_name: type
type: String
@@ -34,22 +34,22 @@ attributes:
min_list: 1
mandatory: true
attributes:
- - model_name: sourceZone
- type: String
- description: Source Zone
- example: self
- - model_name: destinationZone
- type: String
- description: Destination Zone
- example: 0d26a366-4a11-4942-a5ea-82af9502889f
- test_value: sdwan_zone_list_policy_object.test.id
+ - model_name: sourceZone
+ type: String
+ description: Source Zone
+ example: self
+ - model_name: destinationZone
+ type: String
+ description: Destination Zone
+ example: 0d26a366-4a11-4942-a5ea-82af9502889f
+ test_value: sdwan_zone_list_policy_object.test.id
- model_name: type
tf_name: default_action
data_path: [definition, defaultAction]
type: String
mandatory: true
description: Default Action
- enum_values: [pass, drop]
+ enum_values: [pass, drop]
example: pass
- model_name: sequences
tf_name: rules
@@ -58,81 +58,105 @@ attributes:
min_list: 1
mandatory: true
attributes:
- - model_name: sequenceId
- tf_name: rule_order
- type: Int64
- id: true
- mandatory: true
- description: Rule
- example: 1
- - model_name: sequenceName
- tf_name: rule_name
- type: String
- mandatory: true
- description: Rule name
- example: RULE_1
- - model_name: baseAction
- tf_name: base_action
- type: String
- mandatory: true
- description: Base action
- enum_values: [pass, drop, inspect]
- example: inspect
- - model_name: sequenceType
- type: String
- value: zoneBasedFW
- - model_name: entries
- tf_name: match_entries
- data_path: [match]
- type: List
- min_list: 1
- description: List of match entries
- attributes:
- - model_name: field
- tf_name: type
- type: String
+ - model_name: sequenceId
+ tf_name: rule_order
+ type: Int64
id: true
mandatory: true
- description: Type of match entry
- enum_values: [sourceFqdnList, sourceDataPrefixList, sourceGeoLocationList, sourcePortList, destinationFqdnList, destinationDataPrefixList, destinationGeoLocationList, destinationPortList, appList, protocolNameList, sourceIp, sourcePort, sourceFqdn, destinationIp, destinationFqdn, destinationPort, sourceGeoLocation, destinationGeoLocation, protocolName, protocol, app, ruleSetList]
- example: sourceGeoLocationList
- - model_name: ref
- tf_name: policy_id
+ description: Rule
+ example: 1
+ - model_name: sequenceName
+ tf_name: rule_name
type: String
- description: policy id for selected match entry
- example: 0d26a366-4a11-4942-a5ea-82af9502889f
- test_value: sdwan_geo_location_list_policy_object.test.id
- - model_name: value
- tf_name: value
- type: String
- description: value for selected match entry
- exclude_test: true
- example: 2
- - model_name: app
- tf_name: protocol_type
+ mandatory: true
+ description: Rule name
+ example: RULE_1
+ - model_name: baseAction
+ tf_name: base_action
type: String
- description: Should be included with additionally entries for `destinationPort` and `protocol` whenever the type `protocolName` is used.
- exclude_test: true
- example: dns
- - model_name: vipVariableName
- tf_name: value_variable
+ mandatory: true
+ description: Base action
+ enum_values: [pass, drop, inspect]
+ example: inspect
+ - model_name: sequenceType
type: String
- description: variable value for selected match entry if it has variable option (sourceIp & destinationIp)
- exclude_test: true
- example: 2
- - model_name: actions
- tf_name: action_entries
- type: List
- min_list: 1
- description: List of actions entries
- attributes:
- - model_name: type
- tf_name: type
- type: String
- id: true
- description: Type of action entry
- enum_values: [log, connectionEvents]
- example: log
+ value: zoneBasedFW
+ - model_name: entries
+ tf_name: match_entries
+ data_path: [match]
+ type: List
+ min_list: 1
+ description: List of match entries
+ attributes:
+ - model_name: field
+ tf_name: type
+ type: String
+ id: true
+ mandatory: true
+ description: Type of match entry
+ enum_values:
+ [
+ sourceFqdnList,
+ sourceDataPrefixList,
+ sourceGeoLocationList,
+ sourcePortList,
+ destinationFqdnList,
+ destinationDataPrefixList,
+ destinationGeoLocationList,
+ destinationPortList,
+ appList,
+ protocolNameList,
+ sourceIp,
+ sourcePort,
+ sourceFqdn,
+ destinationIp,
+ destinationFqdn,
+ destinationPort,
+ sourceGeoLocation,
+ destinationGeoLocation,
+ protocolName,
+ protocol,
+ app,
+ ruleSetList,
+ ]
+ example: sourceGeoLocationList
+ - model_name: ref
+ tf_name: policy_id
+ type: String
+ description: policy id for selected match entry
+ example: 0d26a366-4a11-4942-a5ea-82af9502889f
+ test_value: sdwan_geo_location_list_policy_object.test.id
+ - model_name: value
+ tf_name: value
+ type: String
+ description: value for selected match entry
+ exclude_test: true
+ example: 2
+ - model_name: app
+ tf_name: protocol_type
+ type: String
+ description: Should be included with additionally entries for `destinationPort` and `protocol` whenever the type `protocolName` is used.
+ exclude_test: true
+ example: dns
+ - model_name: vipVariableName
+ tf_name: value_variable
+ type: String
+ description: variable value for selected match entry if it has variable option (sourceIp & destinationIp)
+ exclude_test: true
+ example: 2
+ - model_name: actions
+ tf_name: action_entries
+ type: List
+ min_list: 1
+ description: List of actions entries
+ attributes:
+ - model_name: type
+ tf_name: type
+ type: String
+ id: true
+ description: Type of action entry
+ enum_values: [log, connectionEvents]
+ example: log
test_prerequisites: |
resource "sdwan_zone_list_policy_object" "test" {
@@ -152,4 +176,4 @@ test_prerequisites: |
continent = "AS"
}
]
- }
\ No newline at end of file
+ }
diff --git a/gen/definitions/generic/zone_list_policy_object.yaml b/gen/definitions/generic/zone_list_policy_object.yaml
index 8c9ac629e..c18dfa53b 100644
--- a/gen/definitions/generic/zone_list_policy_object.yaml
+++ b/gen/definitions/generic/zone_list_policy_object.yaml
@@ -3,7 +3,7 @@ name: Zone List Policy Object
rest_endpoint: /template/policy/list/zone/
has_version: true
id_attribute: listId
-doc_category: Policy Objects
+doc_category: (Classic) Policy Objects
attributes:
- model_name: type
type: String
diff --git a/gen/definitions/profile_parcels/application_priority_qos.yaml b/gen/definitions/profile_parcels/application_priority_qos.yaml
new file mode 100644
index 000000000..8942a33b2
--- /dev/null
+++ b/gen/definitions/profile_parcels/application_priority_qos.yaml
@@ -0,0 +1,44 @@
+---
+name: Application Priority QoS
+rest_endpoint: /v1/feature-profile/sdwan/application-priority/%v/qos-policy
+minimum_version: 20.12.0
+id_attribute: id
+test_tags: [SDWAN_2012]
+parcel_type: policy
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_application_priority_feature_profile.test.id
+ - model_name: interfaces
+ tf_name: target_interface
+ data_path: [target]
+ example: '{{interface_var_1}}'
+ - model_name: qosSchedulers
+ data_path: [qosMap]
+ attributes:
+ - model_name: refId
+ tf_name: forwarding_class_id
+ data_path: [classMapRef]
+ exclude_test: true
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ - model_name: drops
+ example: tail-drop
+ - model_name: queue
+ id: true
+ example: 0
+ - model_name: bandwidthPercent
+ tf_name: bandwidth
+ example: 10
+ - model_name: scheduling
+ tf_name: scheduling_type
+ example: llq
+
+test_prerequisites: |
+ resource "sdwan_application_priority_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/application_priority_qos_policy.yaml b/gen/definitions/profile_parcels/application_priority_qos_policy.yaml
deleted file mode 100644
index 1ab1295f8..000000000
--- a/gen/definitions/profile_parcels/application_priority_qos_policy.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
----
-name: Application Priority QoS Policy
-rest_endpoint: /v1/feature-profile/sdwan/application-priority/%v/qos-policy
-minimum_version: 20.12.0
-id_attribute: id
-test_tags: [SDWAN_2012]
-attributes:
- - tf_name: feature_profile_id
- reference: true
- type: String
- mandatory: true
- description: Feature Profile ID
- example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
- test_value: sdwan_application_priority_feature_profile.test.id
- - model_name: interfaces
- tf_name: target_interface
- data_path: [target]
- example: '{{interface_var_1}}'
- - model_name: qosSchedulers
- data_path: [qosMap]
- attributes:
- - model_name: refId
- tf_name: forwarding_class_id
- data_path: [classMapRef]
- exclude_test: true
- example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
- - model_name: drops
- example: tail-drop
- - model_name: queue
- id: true
- example: 0
- - model_name: bandwidthPercent
- tf_name: bandwidth
- example: 10
- - model_name: scheduling
- tf_name: scheduling_type
- example: llq
-
-test_prerequisites: |
- resource "sdwan_application_priority_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
- }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/other_thousandeyes.yaml b/gen/definitions/profile_parcels/other_thousandeyes.yaml
new file mode 100644
index 000000000..4d3e77932
--- /dev/null
+++ b/gen/definitions/profile_parcels/other_thousandeyes.yaml
@@ -0,0 +1,58 @@
+---
+name: Other ThousandEyes
+rest_endpoint: /v1/feature-profile/sdwan/other/%v/thousandeyes
+minimum_version: 20.12.0
+id_attribute: parcelId
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_other_feature_profile.test.id
+ - model_name: virtualApplication
+ attributes:
+ - model_name: token
+ tf_name: account_group_token
+ id: true
+ mandatory: true
+ example: qwer
+ - model_name: vpn
+ example: 1
+ - model_name: teMgmtIp
+ tf_name: management_ip
+ example: 10.0.0.2
+ - model_name: teMgmtSubnetMask
+ tf_name: management_subnet_mask
+ example: 255.255.255.0
+ - model_name: teVpgIp
+ tf_name: agent_default_gateway
+ example: 10.0.0.1
+ - model_name: nameServer
+ tf_name: name_server_ip
+ example: 77.77.77.71
+ - model_name: hostname
+ example: thousandeyesHost
+ - model_name: proxyType
+ data_path: [proxyConfig]
+ example: static
+ - model_name: proxyHost
+ data_path: [proxyConfig]
+ example: proxy.thousandeyes.com
+ - model_name: proxyPort
+ data_path: [proxyConfig]
+ example: 3128
+ - model_name: pacUrl
+ data_path: [proxyConfig]
+ exclude_test: true
+ example: www.example.com
+
+test_prerequisites: |
+ resource "sdwan_other_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/other_ucse.yaml b/gen/definitions/profile_parcels/other_ucse.yaml
new file mode 100644
index 000000000..de5f5595a
--- /dev/null
+++ b/gen/definitions/profile_parcels/other_ucse.yaml
@@ -0,0 +1,71 @@
+---
+name: Other UCSE
+rest_endpoint: /v1/feature-profile/sdwan/other/%v/ucse
+minimum_version: 20.12.0
+id_attribute: parcelId
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_other_feature_profile.test.id
+ - model_name: bay
+ mandatory: true
+ id: true
+ example: 2
+ - model_name: slot
+ mandatory: true
+ example: 0
+ - model_name: dedicated
+ tf_name: access_port_dedicated
+ data_path: [imc, access-port]
+ example: false
+ - model_name: lomType
+ tf_name: access_port_shared_type
+ data_path: [imc, access-port, sharedLom]
+ example: ge1
+ - model_name: failOverType
+ tf_name: access_port_shared_failover_type
+ data_path: [imc, access-port, sharedLom]
+ example: ge2
+ - model_name: address
+ tf_name: ipv4_address
+ data_path: [imc, ip]
+ mandatory: true
+ example: 2.2.2.2/24
+ - model_name: defaultGateway
+ data_path: [imc, ip]
+ mandatory: true
+ example: 2.2.2.2
+ - model_name: vlanId
+ data_path: [imc, vlan]
+ example: 3
+ - model_name: priority
+ tf_name: assign_priority
+ data_path: [imc, vlan]
+ example: 3
+ - model_name: interface
+ tf_name: interfaces
+ attributes:
+ - model_name: ifName
+ tf_name: interface_name
+ id: true
+ example: ucse2/0
+ - model_name: l3
+ tf_name: layer_l3
+ example: true
+ - model_name: ucseInterfaceVpn
+ example: 2
+ - model_name: address
+ tf_name: ipv4_address
+ example: 10.1.15.15/24
+
+test_prerequisites: |
+ resource "sdwan_other_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml b/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml
new file mode 100644
index 000000000..20f0b300b
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml
@@ -0,0 +1,37 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: map
+ mandatory: true
+ attributes:
+ - model_name: color
+ id: true
+ mandatory: true
+ example: 3g
+ - model_name: dscp
+ example: 45
+ - model_name: forwardingClass
+ id: true
+ mandatory: true
+ example: classlist1
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_application_list.yaml b/gen/definitions/profile_parcels/policy_object_application_list.yaml
new file mode 100644
index 000000000..5c3a247db
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_application_list.yaml
@@ -0,0 +1,31 @@
+---
+name: Policy Object Application List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/app-list
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: app
+ tf_name: application
+ example: 3com-amp3
+ - model_name: appFamily
+ tf_name: application_family
+ exclude_test: true
+ example: web
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_as_path_list.yaml b/gen/definitions/profile_parcels/policy_object_as_path_list.yaml
new file mode 100644
index 000000000..80e6e2faf
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_as_path_list.yaml
@@ -0,0 +1,33 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: asPathListNum
+ tf_name: as_path_list_id
+ mandatory: true
+ example: 1
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: asPath
+ tf_name: as_path_list
+ id: true
+ mandatory: true
+ example: 110
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_class_map.yaml b/gen/definitions/profile_parcels/policy_object_class_map.yaml
new file mode 100644
index 000000000..647b91416
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_class_map.yaml
@@ -0,0 +1,28 @@
+---
+name: Policy Object Class Map
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/class
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: queue
+ id: true
+ mandatory: true
+ example: 0
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_color_list.yaml b/gen/definitions/profile_parcels/policy_object_color_list.yaml
new file mode 100644
index 000000000..5a4379f96
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_color_list.yaml
@@ -0,0 +1,28 @@
+---
+name: Policy Object Color List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/color
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: color
+ id: true
+ mandatory: true
+ example: blue
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_data_ipv4_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_data_ipv4_prefix_list.yaml
new file mode 100644
index 000000000..2a3b28261
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_data_ipv4_prefix_list.yaml
@@ -0,0 +1,31 @@
+---
+name: Policy Object Data IPv4 Prefix List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/data-prefix
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: ipv4Address
+ id: true
+ mandatory: true
+ example: 10.0.0.0
+ - model_name: ipv4PrefixLength
+ mandatory: true
+ example: 8
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_data_ipv6_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_data_ipv6_prefix_list.yaml
new file mode 100644
index 000000000..90c5620c5
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_data_ipv6_prefix_list.yaml
@@ -0,0 +1,31 @@
+---
+name: Policy Object Data IPv6 Prefix List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/data-ipv6-prefix
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: ipv6Address
+ id: true
+ mandatory: true
+ example: 2001:db8:85a3::8a2e:370:7334
+ - model_name: ipv6PrefixLength
+ mandatory: true
+ example: 64
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_expanded_community_list.yaml b/gen/definitions/profile_parcels/policy_object_expanded_community_list.yaml
new file mode 100644
index 000000000..7a4ea8dba
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_expanded_community_list.yaml
@@ -0,0 +1,26 @@
+---
+name: Policy Object Expanded Community List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/expanded-community
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: expandedCommunityList
+ tf_name: expanded_community_lists
+ id: true
+ mandatory: true
+ example: abcd
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_extended_community_list.yaml b/gen/definitions/profile_parcels/policy_object_extended_community_list.yaml
new file mode 100644
index 000000000..938db6aa7
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_extended_community_list.yaml
@@ -0,0 +1,29 @@
+---
+name: Policy Object Extended Community List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/ext-community
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: extCommunity
+ tf_name: extended_community
+ id: true
+ mandatory: true
+ example: "soo 10.0.0.1:30"
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_ipv4_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_ipv4_prefix_list.yaml
new file mode 100644
index 000000000..139a92004
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_ipv4_prefix_list.yaml
@@ -0,0 +1,39 @@
+---
+name: Policy Object IPv4 Prefix List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/prefix
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: ipv4Address
+ id: true
+ mandatory: true
+ example: 10.0.0.0
+ minimum_test_value: '"10.0.0.0"'
+ - model_name: ipv4PrefixLength
+ id: true
+ mandatory: true
+ example: 8
+ minimum_test_value: "8"
+ - model_name: leRangePrefixLength
+ tf_name: le
+ example: 24
+ - model_name: geRangePrefixLength
+ tf_name: ge
+ example: 16
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_ipv6_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_ipv6_prefix_list.yaml
new file mode 100644
index 000000000..9ba31c2be
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_ipv6_prefix_list.yaml
@@ -0,0 +1,39 @@
+---
+name: Policy Object IPv6 Prefix List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/ipv6-prefix
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: ipv6Address
+ id: true
+ mandatory: true
+ example: 2001:db8:85a3::8a2e:370:7334
+ minimum_test_value: '"2001:db8:85a3::8a2e:370:7334"'
+ - model_name: ipv6PrefixLength
+ id: true
+ mandatory: true
+ example: 64
+ minimum_test_value: "64"
+ - model_name: leRangePrefixLength
+ tf_name: le
+ example: 100
+ - model_name: geRangePrefixLength
+ tf_name: ge
+ example: 70
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_mirror.yaml b/gen/definitions/profile_parcels/policy_object_mirror.yaml
new file mode 100644
index 000000000..0315abe90
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_mirror.yaml
@@ -0,0 +1,34 @@
+---
+name: Policy Object Mirror
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/mirror
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: remoteDestIp
+ tf_name: remote_destination_ip
+ id: true
+ mandatory: true
+ example: 10.0.0.1
+ - model_name: sourceIp
+ tf_name: source_ip
+ id: true
+ mandatory: true
+ example: 10.0.0.2
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_policer.yaml b/gen/definitions/profile_parcels/policy_object_policer.yaml
new file mode 100644
index 000000000..8de5df5dd
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_policer.yaml
@@ -0,0 +1,39 @@
+---
+name: Policy Object Policer
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/policer
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: burst
+ tf_name: burst_bytes
+ id: true
+ mandatory: true
+ example: 56500
+ - model_name: exceed
+ tf_name: exceed_action
+ id: true
+ mandatory: true
+ example: remark
+ - model_name: rate
+ tf_name: rate_bps
+ id: true
+ mandatory: true
+ example: 60000
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_preferred_color_group.yaml b/gen/definitions/profile_parcels/policy_object_preferred_color_group.yaml
new file mode 100644
index 000000000..a3f612b89
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_preferred_color_group.yaml
@@ -0,0 +1,50 @@
+---
+name: Policy Object Preferred Color Group
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/preferred-color-group
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: colorPreference
+ tf_name: primary_color_preference
+ data_path: [primaryPreference]
+ mandatory: true
+ example: default
+ - model_name: pathPreference
+ tf_name: primary_path_preference
+ data_path: [primaryPreference]
+ mandatory: true
+ example: direct-path
+ - model_name: colorPreference
+ tf_name: secondary_color_preference
+ data_path: [secondaryPreference]
+ example: bronze
+ - model_name: pathPreference
+ tf_name: secondary_path_preference
+ data_path: [secondaryPreference]
+ example: all-paths
+ - model_name: colorPreference
+ tf_name: tertiary_color_preference
+ data_path: [tertiaryPreference]
+ example: blue
+ - model_name: pathPreference
+ tf_name: tertiary_path_preference
+ data_path: [tertiaryPreference]
+ example: all-paths
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml
new file mode 100644
index 000000000..4cb3bf6af
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml
@@ -0,0 +1,28 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: ipPrefix
+ id: true
+ mandatory: true
+ example: 10.0.0.0/12
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml b/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml
new file mode 100644
index 000000000..500ce9333
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml
@@ -0,0 +1,28 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: pattern
+ id: true
+ mandatory: true
+ example: cisco.com
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml b/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml
new file mode 100644
index 000000000..d85937024
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml
@@ -0,0 +1,29 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: country
+ example: DZA
+ - model_name: continent
+ example: AF
+ exclude_test: true
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml b/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml
new file mode 100644
index 000000000..67d8f9993
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml
@@ -0,0 +1,28 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ attributes:
+ - model_name: user
+ example: administrator
+ - model_name: userGroup
+ exclude_test: true
+ example: "SDWAN-IDENTITY.CISCO.COM/Users/Domain"
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml b/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml
new file mode 100644
index 000000000..2388f6d69
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml
@@ -0,0 +1,32 @@
+---
+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]
+parcel_type: policy_object
+skip_minimum_test: true
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: generatorId
+ id: true
+ mandatory: true
+ example: 1234
+ - model_name: signatureId
+ id: true
+ mandatory: true
+ example: 5678
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml b/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml
new file mode 100644
index 000000000..ef6e50a80
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml
@@ -0,0 +1,28 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ attributes:
+ - model_name: app
+ example: audible-com
+ - model_name: appFamily
+ example: web
+ exclude_test: true
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml b/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml
new file mode 100644
index 000000000..b67b9dbe4
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml
@@ -0,0 +1,29 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: nameServer
+ tf_name: local_domain
+ id: true
+ mandatory: true
+ example: hello.com
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_port_list.yaml b/gen/definitions/profile_parcels/policy_object_security_port_list.yaml
new file mode 100644
index 000000000..200cdc252
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_port_list.yaml
@@ -0,0 +1,28 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: port
+ id: true
+ mandatory: true
+ example: 100
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml b/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml
new file mode 100644
index 000000000..3d753e81a
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml
@@ -0,0 +1,31 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: sgtName
+ id: true
+ mandatory: true
+ example: ANY
+ - model_name: tag
+ id: true
+ mandatory: true
+ example: 65535
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_security_url_list.yaml b/gen/definitions/profile_parcels/policy_object_security_url_list.yaml
new file mode 100644
index 000000000..7ca29746a
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_security_url_list.yaml
@@ -0,0 +1,28 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: pattern
+ id: true
+ mandatory: true
+ example: www.cisco.com
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_sla_class_list.yaml b/gen/definitions/profile_parcels/policy_object_sla_class_list.yaml
new file mode 100644
index 000000000..2dc3bd435
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_sla_class_list.yaml
@@ -0,0 +1,53 @@
+---
+name: Policy Object SLA Class List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/sla-class
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: latency
+ example: 2
+ - model_name: loss
+ example: 1
+ - model_name: jitter
+ example: 1
+ - model_name: refId
+ tf_name: app_probe_class_list_id
+ data_path: [appProbeClass]
+ exclude_test: true
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ - model_name: criteria
+ tf_name: fallback_best_tunnel_criteria
+ data_path: [fallbackBestTunnel]
+ example: loss
+ - model_name: lossVariance
+ tf_name: fallback_best_tunnel_loss_variance
+ data_path: [fallbackBestTunnel]
+ example: 5
+ - model_name: latencyVariance
+ tf_name: fallback_best_tunnel_latency_variance
+ data_path: [fallbackBestTunnel]
+ exclude_test: true
+ example: 4
+ - model_name: jitterVariance
+ tf_name: fallback_best_tunnel_jitter_variance
+ data_path: [fallbackBestTunnel]
+ exclude_test: true
+ example: 5
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml b/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml
new file mode 100644
index 000000000..9970b9965
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml
@@ -0,0 +1,28 @@
+---
+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]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: standardCommunity
+ id: true
+ mandatory: true
+ example: 1000:10000
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/policy_object_tloc_list.yaml b/gen/definitions/profile_parcels/policy_object_tloc_list.yaml
new file mode 100644
index 000000000..91dc81a81
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_tloc_list.yaml
@@ -0,0 +1,38 @@
+---
+name: Policy Object TLOC List
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/tloc
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: tloc
+ tf_name: tloc_ip
+ id: true
+ mandatory: true
+ example: 10.0.0.0
+ - model_name: color
+ mandatory: true
+ example: 3g
+ - model_name: encap
+ tf_name: encapsulation
+ mandatory: true
+ example: gre
+ - model_name: preference
+ example: 33
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
diff --git a/gen/definitions/profile_parcels/policy_object_vpn_group.yaml b/gen/definitions/profile_parcels/policy_object_vpn_group.yaml
new file mode 100644
index 000000000..27887d7bb
--- /dev/null
+++ b/gen/definitions/profile_parcels/policy_object_vpn_group.yaml
@@ -0,0 +1,28 @@
+---
+name: Policy Object VPN Group
+rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/vpn-group
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: policy_object
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_policy_object_feature_profile.test.id
+ - model_name: entries
+ mandatory: true
+ attributes:
+ - model_name: vpn
+ id: true
+ mandatory: true
+ example: 100
+
+test_prerequisites: |
+ resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_lan_vpn.yaml b/gen/definitions/profile_parcels/service_lan_vpn.yaml
index 64fd9b677..e9c266898 100644
--- a/gen/definitions/profile_parcels/service_lan_vpn.yaml
+++ b/gen/definitions/profile_parcels/service_lan_vpn.yaml
@@ -3,6 +3,7 @@ name: Service LAN VPN
rest_endpoint: /v1/feature-profile/sdwan/service/%v/lan/vpn
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/service_lan_vpn_interface_ethernet.yaml b/gen/definitions/profile_parcels/service_lan_vpn_interface_ethernet.yaml
index ef7f3d632..dab1e6649 100644
--- a/gen/definitions/profile_parcels/service_lan_vpn_interface_ethernet.yaml
+++ b/gen/definitions/profile_parcels/service_lan_vpn_interface_ethernet.yaml
@@ -3,6 +3,7 @@ name: Service LAN VPN Interface Ethernet
rest_endpoint: /v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/ethernet
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,12 +12,12 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_service_feature_profile.test.id
- - tf_name: service_lan_vpn_profile_parcel_id
+ - tf_name: service_lan_vpn_feature_id
reference: true
type: String
- description: Service LAN VPN Profile Profile ID
+ description: Service LAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_service_lan_vpn_profile_parcel.test.id
+ test_value: sdwan_service_lan_vpn_feature.test.id
- model_name: shutdown
example: false
- model_name: interfaceName
@@ -326,7 +327,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_service_lan_vpn_profile_parcel" "test" {
+ resource "sdwan_service_lan_vpn_feature" "test" {
name = "TF_TEST_SLAN"
feature_profile_id = sdwan_service_feature_profile.test.id
}
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_lan_vpn_interface_gre.yaml b/gen/definitions/profile_parcels/service_lan_vpn_interface_gre.yaml
index ba36c0469..191d30528 100644
--- a/gen/definitions/profile_parcels/service_lan_vpn_interface_gre.yaml
+++ b/gen/definitions/profile_parcels/service_lan_vpn_interface_gre.yaml
@@ -3,6 +3,7 @@ name: Service LAN VPN Interface GRE
rest_endpoint: /v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/gre
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,12 +12,12 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_service_feature_profile.test.id
- - tf_name: service_lan_vpn_profile_parcel_id
+ - tf_name: service_lan_vpn_feature_id
reference: true
type: String
- description: Service LAN VPN Profile Parcel ID
+ description: Service LAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_service_lan_vpn_profile_parcel.test.id
+ test_value: sdwan_service_lan_vpn_feature.test.id
- model_name: ifName
tf_name: interface_name
data_path: [basic]
@@ -85,7 +86,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_service_lan_vpn_profile_parcel" "test" {
+ resource "sdwan_service_lan_vpn_feature" "test" {
name = "TF_TEST_SLAN"
feature_profile_id = sdwan_service_feature_profile.test.id
}
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_lan_vpn_interface_ipsec.yaml b/gen/definitions/profile_parcels/service_lan_vpn_interface_ipsec.yaml
index 55baeea1c..22f265365 100644
--- a/gen/definitions/profile_parcels/service_lan_vpn_interface_ipsec.yaml
+++ b/gen/definitions/profile_parcels/service_lan_vpn_interface_ipsec.yaml
@@ -3,6 +3,7 @@ name: Service LAN VPN Interface IPSec
rest_endpoint: /v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/ipsec
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,12 +12,12 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_service_feature_profile.test.id
- - tf_name: service_lan_vpn_profile_parcel_id
+ - tf_name: service_lan_vpn_feature_id
reference: true
type: String
- description: Service LAN VPN Profile Parcel ID
+ description: Service LAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_service_lan_vpn_profile_parcel.test.id
+ test_value: sdwan_service_lan_vpn_feature.test.id
- model_name: ifName
tf_name: interface_name
mandatory: true
@@ -119,7 +120,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_service_lan_vpn_profile_parcel" "test" {
+ resource "sdwan_service_lan_vpn_feature" "test" {
name = "TF_TEST_SLAN"
feature_profile_id = sdwan_service_feature_profile.test.id
}
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_lan_vpn_interface_svi.yaml b/gen/definitions/profile_parcels/service_lan_vpn_interface_svi.yaml
index 5d202d4f2..ce3d349f0 100644
--- a/gen/definitions/profile_parcels/service_lan_vpn_interface_svi.yaml
+++ b/gen/definitions/profile_parcels/service_lan_vpn_interface_svi.yaml
@@ -3,6 +3,7 @@ name: Service LAN VPN Interface SVI
rest_endpoint: /v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/svi
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,12 +12,12 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_service_feature_profile.test.id
- - tf_name: service_lan_vpn_profile_parcel_id
+ - tf_name: service_lan_vpn_feature_id
reference: true
type: String
- description: Service LAN VPN Profile Profile ID
+ description: Service LAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_service_lan_vpn_profile_parcel.test.id
+ test_value: sdwan_service_lan_vpn_feature.test.id
- model_name: shutdown
example: false
- model_name: interfaceName
@@ -206,7 +207,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_service_lan_vpn_profile_parcel" "test" {
+ resource "sdwan_service_lan_vpn_feature" "test" {
name = "TF_TEST_SLAN"
feature_profile_id = sdwan_service_feature_profile.test.id
}
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_object_tracker.yaml b/gen/definitions/profile_parcels/service_object_tracker.yaml
new file mode 100644
index 000000000..e566ba8af
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_object_tracker.yaml
@@ -0,0 +1,40 @@
+---
+name: Service Object Tracker
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/objecttracker
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_service_feature_profile.test.id
+ - model_name: objectId
+ tf_name: object_tracker_id
+ example: 10
+ test_value: '10'
+ minimum_test_value: '10'
+ - model_name: objectTrackerType
+ mandatory: true
+ example: Interface
+ - model_name: interface
+ example: GigabitEthernet1
+ minimum_test_value: '"GigabitEthernet1"'
+ - model_name: routeIp
+ example: 1.2.3.4
+ exclude_test: true
+ - model_name: routeMask
+ example: 0.0.0.0
+ exclude_test: true
+ - model_name: vpn
+ example: 1
+ exclude_test: true
+
+test_prerequisites: |
+ resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
diff --git a/gen/definitions/profile_parcels/service_object_tracker_group.yaml b/gen/definitions/profile_parcels/service_object_tracker_group.yaml
new file mode 100644
index 000000000..9c775ab4e
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_object_tracker_group.yaml
@@ -0,0 +1,57 @@
+name: Service Object Tracker Group
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/objecttrackergroup
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_service_feature_profile.test.id
+ - model_name: objectId
+ tf_name: object_tracker_id
+ example: 10
+ test_value: '10'
+ minimum_test_value: '10'
+ - model_name: trackerRefs
+ tf_name: tracker_elements
+ attributes:
+ - model_name: refId
+ tf_name: object_tracker_id
+ data_path: [trackerRef]
+ id: true
+ mandatory: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ test_value: sdwan_service_object_tracker_feature.test-1.id
+ secondary_test_value: sdwan_service_object_tracker_feature.test-2.id
+ - model_name: criteria
+ tf_name: reachable
+ example: or
+
+test_prerequisites: |
+ resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
+
+ resource "sdwan_service_object_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "My Example"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ object_tracker_id = 11
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+ }
+
+ resource "sdwan_service_object_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "My Example"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ object_tracker_id = 12
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_route_policy.yaml b/gen/definitions/profile_parcels/service_route_policy.yaml
new file mode 100644
index 000000000..5bbf4c5d1
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_route_policy.yaml
@@ -0,0 +1,151 @@
+---
+name: Service Route Policy
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/route-policy
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: defaultAction
+ example: accept
+ - model_name: sequences
+ tf_name:
+ attributes:
+ - model_name: sequenceId
+ tf_name: id
+ id: true
+ example: 1
+ - model_name: sequenceName
+ tf_name: name
+ example: SEQ_1
+ - model_name: baseAction
+ example: reject
+ - model_name: protocol
+ example: IPV4
+ - model_name: matchEntries
+ exclude_test: true
+ tf_name: match_entries
+ attributes:
+ - model_name: refId
+ tf_name: as_path_list_id
+ data_path: [asPathList]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: criteria
+ tf_name: standard_community_list_criteria
+ exclude_test: true
+ data_path: [communityList]
+ example: OR
+ - model_name: standardCommunityList
+ tf_name: standard_community_lists
+ data_path: [communityList]
+ exclude_test: true
+ attributes:
+ - model_name: refId
+ tf_name: id
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: expanded_community_list_id
+ data_path: [communityList, expandedCommunityList]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: extended_community_list_id
+ data_path: [extCommunityList]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: bgpLocalPreference
+ example: 100
+ - model_name: metric
+ example: 1000
+ - model_name: ompTag
+ example: 10000
+ - model_name: ospfTag
+ example: 20000
+ - model_name: refId
+ tf_name: ipv4_address_prefix_list_id
+ data_path: [ipv4Address]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: ipv4_next_hop_prefix_list_id
+ data_path: [ipv4NextHop]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: ipv6_address_prefix_list_id
+ data_path: [ipv6Address]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: ipv6_next_hop_prefix_list_id
+ data_path: [ipv6NextHop]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: actions
+ attributes:
+ - model_name: enableAcceptAction
+ data_path: [accept]
+ example: true
+ - model_name: prepend
+ tf_name: as_path_prepend
+ data_path: [accept, setAsPath]
+ example: 65521
+ - model_name: additive
+ tf_name: community_additive
+ data_path: [accept, setCommunity]
+ example: false
+ - model_name: community
+ tf_name: community
+ data_path: [accept, setCommunity]
+ example: internet
+ - model_name: setLocalPreference
+ tf_name: local_preference
+ data_path: [accept]
+ example: 100
+ - model_name: setMetric
+ tf_name: metric
+ data_path: [accept]
+ example: 20
+ - model_name: setMetricType
+ tf_name: metric_type
+ data_path: [accept]
+ example: type1
+ - model_name: setOmpTag
+ tf_name: omp_tag
+ data_path: [accept]
+ example: 200
+ - model_name: setOrigin
+ tf_name: origin
+ data_path: [accept]
+ example: EGP
+ - model_name: setOspfTag
+ tf_name: ospf_tag
+ data_path: [accept]
+ example: 1200
+ - model_name: setWeight
+ tf_name: weight
+ data_path: [accept]
+ example: 2200
+ - model_name: setIpv4NextHop
+ tf_name: ipv4_next_hop
+ data_path: [accept]
+ example: 10.0.0.1
+ - model_name: setIpv6NextHop
+ tf_name: ipv6_next_hop
+ data_path: [accept]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_routing_bgp.yaml b/gen/definitions/profile_parcels/service_routing_bgp.yaml
new file mode 100644
index 000000000..bc9f86928
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_routing_bgp.yaml
@@ -0,0 +1,331 @@
+---
+name: Service Routing BGP
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/routing/bgp
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: asNum
+ tf_name: as_number
+ example: 429
+ minimum_test_value: '429'
+ - model_name: routerId
+ tf_name: router_id
+ example: "1.2.3.4"
+ - model_name: propagateAspath
+ tf_name: propagate_as_path
+ example: false
+ - model_name: propagateCommunity
+ example: false
+ - model_name: external
+ tf_name: external_routes_distance
+ example: 20
+ - model_name: internal
+ tf_name: internal_routes_distance
+ example: 200
+ - model_name: local
+ tf_name: local_routes_distance
+ example: 20
+ - model_name: keepalive
+ tf_name: keepalive_time
+ example: 60
+ - model_name: holdtime
+ tf_name: hold_time
+ example: 180
+ - model_name: alwaysCompare
+ tf_name: always_compare_med
+ example: false
+ - model_name: deterministic
+ tf_name: deterministic_med
+ example: false
+ - model_name: missingAsWorst
+ tf_name: missing_med_as_worst
+ example: false
+ - model_name: compareRouterId
+ example: false
+ - model_name: multipathRelax
+ example: false
+ - model_name: neighbor
+ tf_name: ipv4_neighbors
+ attributes:
+ - model_name: address
+ id: true
+ example: 1.2.3.4
+ - model_name: description
+ example: neighbor1
+ - model_name: shutdown
+ example: false
+ - model_name: remoteAs
+ example: 200
+ - model_name: localAs
+ example: 200
+ - model_name: keepalive
+ tf_name: keepalive_time
+ example: 40
+ - model_name: holdtime
+ tf_name: hold_time
+ example: 200
+ - model_name: ifName
+ tf_name: update_source_interface
+ example: GigabitEthernet0
+ - model_name: nextHopSelf
+ example: false
+ - model_name: sendCommunity
+ example: true
+ - model_name: sendExtCommunity
+ tf_name: send_extended_community
+ example: true
+ - model_name: ebgpMultihop
+ example: 1
+ - model_name: password
+ write_only: true
+ example: myPassword
+ - model_name: sendLabel
+ example: true
+ - model_name: asOverride
+ example: false
+ - model_name: asNumber
+ tf_name: allowas_in_number
+ example: 1
+ - model_name: addressFamily
+ tf_name: address_families
+ attributes:
+ - model_name: familyType
+ id: true
+ example: ipv4-unicast
+ - model_name: prefixNum
+ tf_name: max_number_of_prefixes
+ data_path: [maxPrefixConfig]
+ example: 2000
+ - model_name: threshold
+ data_path: [maxPrefixConfig]
+ default_value: 75
+ default_value_present: true
+ example: 75
+ - model_name: policyType
+ data_path: [maxPrefixConfig]
+ type: String
+ example: restart
+ - model_name: restartInterval
+ data_path: [maxPrefixConfig]
+ example: 30
+ # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: in_route_policy_id
+ data_path: [inRoutePolicy]
+ exclude_test: true
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # test_value:
+ # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: out_route_policy_id
+ data_path: [outRoutePolicy]
+ exclude_test: true
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # test_value:
+ - model_name: ipv6Neighbor
+ tf_name: ipv6_neighbors
+ attributes:
+ - model_name: address
+ id: true
+ example: "2001::1"
+ - model_name: description
+ example: neighbor2
+ - model_name: shutdown
+ example: false
+ - model_name: remoteAs
+ example: 200
+ - model_name: localAs
+ example: 200
+ - model_name: keepalive
+ tf_name: keepalive_time
+ example: 180
+ - model_name: holdtime
+ tf_name: hold_time
+ example: 60
+ - model_name: ifName
+ tf_name: update_source_interface
+ example: Loopback1
+ - model_name: nextHopSelf
+ example: true
+ - model_name: sendCommunity
+ example: true
+ - model_name: sendExtCommunity
+ tf_name: send_extended_community
+ example: true
+ - model_name: ebgpMultihop
+ example: 3
+ - model_name: password
+ write_only: true
+ example: myPassword
+ - model_name: asOverride
+ example: true
+ - model_name: asNumber
+ tf_name: allowas_in_number
+ example: 3
+ - model_name: addressFamily
+ tf_name: address_families
+ attributes:
+ - model_name: familyType
+ id: true
+ example: ipv6-unicast
+ - model_name: prefixNum
+ tf_name: max_number_of_prefixes
+ data_path: [maxPrefixConfig]
+ example: 2000
+ - model_name: threshold
+ data_path: [maxPrefixConfig]
+ default_value: 75
+ default_value_present: true
+ example: 75
+ - model_name: policyType
+ data_path: [maxPrefixConfig]
+ type: String
+ example: restart
+ - model_name: restartInterval
+ data_path: [maxPrefixConfig]
+ example: 30
+ # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: in_route_policy_id
+ data_path: [inRoutePolicy]
+ exclude_test: true
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # test_value:
+ # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: out_route_policy_id
+ data_path: [outRoutePolicy]
+ exclude_test: true
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # test_value:
+ - model_name: aggregateAddress
+ tf_name: ipv4_aggregate_addresses
+ data_path: [addressFamily]
+ attributes:
+ - model_name: address
+ tf_name: network_address
+ data_path: [prefix]
+ id: true
+ example: 10.10.0.0
+ - model_name: mask
+ tf_name: subnet_mask
+ data_path: [prefix]
+ example: 255.255.0.0
+ - model_name: asSet
+ tf_name: as_set_path
+ example: false
+ - model_name: summaryOnly
+ example: false
+ - model_name: network
+ tf_name: ipv4_networks
+ data_path: [addressFamily]
+ attributes:
+ - model_name: address
+ tf_name: network_address
+ data_path: [prefix]
+ id: true
+ example: 10.10.0.0
+ - model_name: mask
+ tf_name: subnet_mask
+ data_path: [prefix]
+ example: 255.255.0.0
+ - model_name: paths
+ tf_name: ipv4_eibgp_maximum_paths
+ data_path: [addressFamily]
+ example: 1
+ - model_name: originate
+ tf_name: ipv4_originate
+ data_path: [addressFamily]
+ example: false
+ # # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: ipv4_table_map_route_policy_id
+ data_path: [addressFamily, name]
+ always_include_parent: true
+ exclude_test: true
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # # test_value:
+ - model_name: filter
+ tf_name: ipv4_table_map_filter
+ data_path: [addressFamily]
+ example: false
+ - model_name: redistribute
+ tf_name: ipv4_redistributes
+ data_path: [addressFamily]
+ exclude_test: true
+ attributes:
+ - model_name: protocol
+ example: static
+ # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # test_value:
+ - model_name: ipv6AggregateAddress
+ tf_name: ipv6_aggregate_addresses
+ data_path: [ipv6AddressFamily]
+ attributes:
+ - model_name: prefix
+ tf_name: aggregate_prefix
+ id: true
+ example: 3001::1/128
+ - model_name: asSet
+ tf_name: as_set_path
+ example: false
+ - model_name: summaryOnly
+ example: false
+ - model_name: ipv6Network
+ tf_name: ipv6_networks
+ data_path: [ipv6AddressFamily]
+ attributes:
+ - model_name: prefix
+ tf_name: network_prefix
+ id: true
+ example: 2001:0DB8:0000:000b::/64
+ - model_name: paths
+ tf_name: ipv6_eibgp_maximum_paths
+ data_path: [ipv6AddressFamily]
+ example: 2
+ - model_name: originate
+ tf_name: ipv6_originate
+ data_path: [ipv6AddressFamily]
+ example: true
+ # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: ipv6_table_map_route_policy_id
+ data_path: [ipv6AddressFamily, name]
+ always_include_parent: true
+ exclude_test: true
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # test_value:
+ - model_name: filter
+ tf_name: ipv6_table_map_filter
+ data_path: [ipv6AddressFamily]
+ example: false
+ - model_name: redistribute
+ tf_name: ipv6_redistributes
+ data_path: [ipv6AddressFamily]
+ exclude_test: true
+ attributes:
+ - model_name: protocol
+ example: static
+ # === UX2.0 Route Policy Not Supported by Provider ===
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
+ # test_value:
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_routing_ospf.yaml b/gen/definitions/profile_parcels/service_routing_ospf.yaml
new file mode 100644
index 000000000..2641f9a6d
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_routing_ospf.yaml
@@ -0,0 +1,144 @@
+---
+name: Service Routing OSPF
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/routing/ospf
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_service_feature_profile.test.id
+ - model_name: routerId
+ example: 1.2.3.4
+ - model_name: referenceBandwidth
+ example: 101
+ - model_name: rfc1583
+ tf_name: rfc_1583_compatible
+ example: true
+ - model_name: originate
+ tf_name: default_information_originate
+ example: false
+ - model_name: always
+ tf_name: default_information_originate_always
+ example: false
+ - model_name: metric
+ tf_name: default_information_originate_metric
+ example: 1
+ - model_name: metricType
+ tf_name: default_information_originate_metric_type
+ example: type1
+ - model_name: external
+ tf_name: distance_external
+ example: 110
+ - model_name: interArea
+ tf_name: distance_inter_area
+ example: 110
+ - model_name: intraArea
+ tf_name: distance_intra_area
+ example: 110
+ - model_name: delay
+ tf_name: spf_calculation_delay
+ example: 200
+ - model_name: initialHold
+ tf_name: spf_initial_hold_time
+ example: 1000
+ - model_name: maxHold
+ tf_name: spf_maximum_hold_time
+ example: 10000
+ - model_name: redistribute
+ tf_name: redistributes
+ attributes:
+ - model_name: protocol
+ id: true
+ example: static
+ - model_name: dia
+ tf_name: nat_dia
+ example: true
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: routerLsa
+ tf_name: router_lsas
+ attributes:
+ - model_name: adType
+ tf_name: type
+ id: true
+ example: on-startup
+ - model_name: time
+ example: 5
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: area
+ tf_name: areas
+ attributes:
+ - model_name: aNum
+ tf_name: area_number
+ id: true
+ example: 1
+ - model_name: aType
+ tf_name: area_type
+ example: stub
+ - model_name: noSummary
+ example: false
+ - model_name: interface
+ tf_name: interfaces
+ attributes:
+ - model_name: name
+ id: true
+ example: GigabitEthernet2
+ - model_name: helloInterval
+ example: 10
+ - model_name: deadInterval
+ example: 40
+ - model_name: retransmitInterval
+ tf_name: lsa_retransmit_interval
+ example: 5
+ - model_name: cost
+ example: 10
+ - model_name: priority
+ tf_name: designated_router_priority
+ example: 1
+ - model_name: network
+ tf_name: network_type
+ example: broadcast
+ - model_name: passiveInterface
+ example: false
+ - model_name: type
+ tf_name: authentication_type
+ example: message-digest
+ - model_name: messageDigestKey
+ tf_name: message_digest_key_id
+ example: 7
+ - model_name: md5
+ tf_name: message_digest_key
+ write_only: true
+ example: sdjfhsghbjdjr
+ - model_name: range
+ tf_name: ranges
+ attributes:
+ - model_name: ipAddress
+ data_path: [address]
+ id: true
+ example: 10.1.1.0
+ - model_name: subnetMask
+ data_path: [address]
+ example: 255.255.255.0
+ - model_name: cost
+ example: 1
+ - model_name: noAdvertise
+ example: false
+
+test_prerequisites: |
+ resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_routing_ospfv3_ipv4.yaml b/gen/definitions/profile_parcels/service_routing_ospfv3_ipv4.yaml
new file mode 100644
index 000000000..b12c248bb
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_routing_ospfv3_ipv4.yaml
@@ -0,0 +1,173 @@
+---
+name: Service Routing OSPFv3 IPv4
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/routing/ospfv3/ipv4
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_service_feature_profile.test.id
+ - model_name: routerId
+ data_path: [basic]
+ example: 1.2.3.4
+ - model_name: distance
+ data_path: [basic]
+ example: 110
+ - model_name: externalDistance
+ tf_name: distance_external
+ data_path: [basic]
+ example: 110
+ - model_name: interAreaDistance
+ tf_name: distance_inter_area
+ data_path: [basic]
+ example: 110
+ - model_name: intraAreaDistance
+ tf_name: distance_intra_area
+ data_path: [basic]
+ example: 110
+ - model_name: referenceBandwidth
+ data_path: [advanced]
+ example: 101
+ - model_name: compatibleRfc1583
+ tf_name: rfc_1583_compatible
+ data_path: [advanced]
+ example: true
+ - model_name: originate
+ tf_name: default_information_originate
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: always
+ tf_name: default_information_originate_always
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: metric
+ tf_name: default_information_originate_metric
+ data_path: [advanced, defaultOriginate]
+ example: 1
+ - model_name: metricType
+ tf_name: default_information_originate_metric_type
+ data_path: [advanced, defaultOriginate]
+ example: type1
+ - model_name: delay
+ tf_name: spf_calculation_delay
+ data_path: [advanced, spfTimers]
+ example: 200
+ - model_name: initialHold
+ tf_name: spf_initial_hold_time
+ data_path: [advanced, spfTimers]
+ example: 1000
+ - model_name: maxHold
+ tf_name: spf_maximum_hold_time
+ data_path: [advanced, spfTimers]
+ example: 10000
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [advanced, policyName]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: filter
+ data_path: [advanced]
+ example: false
+ - model_name: redistribute
+ tf_name: redistributes
+ attributes:
+ - model_name: protocol
+ id: true
+ example: nat-route
+ - model_name: natDia
+ tf_name: nat_dia
+ example: true
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: action
+ tf_name: router_lsa_action
+ data_path: [maxMetricRouterLsa]
+ example: on-startup
+ - model_name: onStartUpTime
+ tf_name: router_lsa_on_startup_time
+ data_path: [maxMetricRouterLsa]
+ example: 30
+ - model_name: area
+ tf_name: areas
+ attributes:
+ - model_name: areaNum
+ tf_name: area_number
+ id: true
+ mandatory: true
+ example: 1
+ - model_name: areaType
+ tf_name: area_type
+ data_path: [areaTypeConfig]
+ example: stub
+ - model_name: noSummary
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: alwaysTranslate
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: interfaces
+ attributes:
+ - model_name: ifName
+ tf_name: name
+ id: true
+ example: GigabitEthernet2
+ - model_name: helloInterval
+ example: 10
+ - model_name: deadInterval
+ example: 40
+ - model_name: retransmitInterval
+ tf_name: lsa_retransmit_interval
+ example: 5
+ - model_name: cost
+ example: 10
+ - model_name: networkType
+ tf_name: network_type
+ example: broadcast
+ - model_name: passiveInterface
+ example: false
+ - model_name: authType
+ tf_name: authentication_type
+ data_path: [authenticationConfig]
+ example: no-auth
+ - model_name: spi
+ tf_name: authentication_spi
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 12345
+ - model_name: authKey
+ tf_name: authentication_key
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 0123456789012345678901234567890123456789
+ - model_name: ranges
+ attributes:
+ - model_name: address
+ tf_name: ip_address
+ data_path: [network]
+ id: true
+ example: 10.1.1.0
+ - model_name: mask
+ tf_name: subnet_mask
+ data_path: [network]
+ example: 255.255.255.0
+ - model_name: cost
+ example: 1
+ - model_name: noAdvertise
+ example: false
+
+test_prerequisites: |
+ resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_routing_ospfv3_ipv6.yaml b/gen/definitions/profile_parcels/service_routing_ospfv3_ipv6.yaml
new file mode 100644
index 000000000..eb3dd55c8
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_routing_ospfv3_ipv6.yaml
@@ -0,0 +1,165 @@
+---
+name: Service Routing OSPFv3 IPv6
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/routing/ospfv3/ipv6
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_service_feature_profile.test.id
+ - model_name: routerId
+ data_path: [basic]
+ example: 1.2.3.4
+ - model_name: distance
+ data_path: [basic]
+ example: 110
+ - model_name: externalDistance
+ tf_name: distance_external
+ data_path: [basic]
+ example: 110
+ - model_name: interAreaDistance
+ tf_name: distance_inter_area
+ data_path: [basic]
+ example: 110
+ - model_name: intraAreaDistance
+ tf_name: distance_intra_area
+ data_path: [basic]
+ example: 110
+ - model_name: referenceBandwidth
+ data_path: [advanced]
+ example: 101
+ - model_name: compatibleRfc1583
+ tf_name: rfc_1583_compatible
+ data_path: [advanced]
+ example: true
+ - model_name: originate
+ tf_name: default_information_originate
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: always
+ tf_name: default_information_originate_always
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: metric
+ tf_name: default_information_originate_metric
+ data_path: [advanced, defaultOriginate]
+ example: 1
+ - model_name: metricType
+ tf_name: default_information_originate_metric_type
+ data_path: [advanced, defaultOriginate]
+ example: type1
+ - model_name: delay
+ tf_name: spf_calculation_delay
+ data_path: [advanced, spfTimers]
+ example: 200
+ - model_name: initialHold
+ tf_name: spf_initial_hold_time
+ data_path: [advanced, spfTimers]
+ example: 1000
+ - model_name: maxHold
+ tf_name: spf_maximum_hold_time
+ data_path: [advanced, spfTimers]
+ example: 10000
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [advanced, policyName]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: filter
+ data_path: [advanced]
+ example: false
+ - model_name: redistribute
+ tf_name: redistributes
+ attributes:
+ - model_name: protocol
+ id: true
+ example: static
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: action
+ tf_name: router_lsa_action
+ data_path: [maxMetricRouterLsa]
+ example: on-startup
+ - model_name: onStartUpTime
+ tf_name: router_lsa_on_startup_time
+ data_path: [maxMetricRouterLsa]
+ example: 30
+ - model_name: area
+ tf_name: areas
+ attributes:
+ - model_name: areaNum
+ tf_name: area_number
+ id: true
+ mandatory: true
+ example: 1
+ - model_name: areaType
+ tf_name: area_type
+ data_path: [areaTypeConfig]
+ example: stub
+ - model_name: noSummary
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: alwaysTranslate
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: interfaces
+ attributes:
+ - model_name: ifName
+ tf_name: name
+ id: true
+ example: GigabitEthernet2
+ - model_name: helloInterval
+ example: 10
+ - model_name: deadInterval
+ example: 40
+ - model_name: retransmitInterval
+ tf_name: lsa_retransmit_interval
+ example: 5
+ - model_name: cost
+ example: 10
+ - model_name: networkType
+ tf_name: network_type
+ example: broadcast
+ - model_name: passiveInterface
+ example: false
+ - model_name: authType
+ tf_name: authentication_type
+ data_path: [authenticationConfig]
+ example: no-auth
+ - model_name: spi
+ tf_name: authentication_spi
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 12345
+ - model_name: authKey
+ tf_name: authentication_key
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 0123456789012345678901234567890123456789
+ - model_name: ranges
+ attributes:
+ - model_name: network
+ tf_name: prefix
+ id: true
+ example: 3002::/96
+ - model_name: cost
+ example: 1
+ - model_name: noAdvertise
+ example: false
+
+test_prerequisites: |
+ resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_switchport.yaml b/gen/definitions/profile_parcels/service_switchport.yaml
new file mode 100644
index 000000000..ab3274f1d
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_switchport.yaml
@@ -0,0 +1,83 @@
+---
+name: Service Switchport
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/switchport
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_service_feature_profile.test.id
+ - model_name: interface
+ tf_name: interfaces
+ attributes:
+ - model_name: ifName
+ tf_name: interface_name
+ id: true
+ example: GigabitEthernet
+ - model_name: mode
+ example: access
+ - model_name: shutdown
+ example: true
+ - model_name: speed
+ example: 10
+ - model_name: duplex
+ example: full
+ - model_name: switchportAccessVlan
+ example: 1
+ - model_name: switchportTrunkAllowedVlans
+ example: 1
+ - model_name: switchportTrunkNativeVlan
+ example: 1
+ - model_name: portControl
+ example: auto
+ - model_name: voiceVlan
+ example: 1
+ - model_name: paeEnable
+ example: true
+ - model_name: macAuthenticationBypass
+ example: false
+ - model_name: hostMode
+ example: single-host
+ - model_name: enablePeriodicReauth
+ example: false
+ - model_name: inactivity
+ example: 60
+ - model_name: reauthentication
+ example: 1
+ - model_name: controlDirection
+ example: both
+ - model_name: restrictedVlan
+ example: 1
+ - model_name: guestVlan
+ example: 1
+ - model_name: criticalVlan
+ example: 1
+ - model_name: enableVoice
+ example: false
+ - model_name: ageTime
+ tf_name: age_out_time
+ example: 300
+ - model_name: staticMacAddress
+ tf_name: static_mac_addresses
+ attributes:
+ - model_name: macaddr
+ tf_name: mac_address
+ example: 01:02:03:04:05:06
+ - model_name: vlan
+ tf_name: vlan_id
+ id: true
+ example: 1
+ - model_name: ifName
+ tf_name: interface_name
+ example: GigabitEthernet0/0/0
+
+test_prerequisites: |
+ resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/service_tracker.yaml b/gen/definitions/profile_parcels/service_tracker.yaml
index 081fb6b4b..03680868f 100644
--- a/gen/definitions/profile_parcels/service_tracker.yaml
+++ b/gen/definitions/profile_parcels/service_tracker.yaml
@@ -3,6 +3,7 @@ name: Service Tracker
rest_endpoint: /v1/feature-profile/sdwan/service/%v/tracker
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/service_tracker_group.yaml b/gen/definitions/profile_parcels/service_tracker_group.yaml
new file mode 100644
index 000000000..0534a4b83
--- /dev/null
+++ b/gen/definitions/profile_parcels/service_tracker_group.yaml
@@ -0,0 +1,69 @@
+---
+name: Service Tracker Group
+rest_endpoint: /v1/feature-profile/sdwan/service/%v/trackergroup
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_service_feature_profile.test.id
+ - model_name: trackerRefs
+ tf_name: tracker_elements
+ attributes:
+ - model_name: refId
+ tf_name: tracker_id
+ data_path: [trackerRef]
+ id: true
+ mandatory: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ test_value: sdwan_service_tracker_feature.test-1.id
+ secondary_test_value: sdwan_service_tracker_feature.test-2.id
+ - model_name: combineBoolean
+ tf_name: tracker_boolean
+ example: or
+
+test_prerequisites: |
+ resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
+
+ resource "sdwan_service_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "Terraform test"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ tracker_name = "TRACKER_2"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ protocol = "tcp"
+ port = 123
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "static-route"
+ tracker_type = "endpoint"
+ }
+
+ resource "sdwan_service_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "Terraform test"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ tracker_name = "TRACKER_2"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ protocol = "tcp"
+ port = 123
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "static-route"
+ tracker_type = "endpoint"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/system_aaa.yaml b/gen/definitions/profile_parcels/system_aaa.yaml
index 081a782bc..57e4e33e3 100644
--- a/gen/definitions/profile_parcels/system_aaa.yaml
+++ b/gen/definitions/profile_parcels/system_aaa.yaml
@@ -3,6 +3,7 @@ name: System AAA
rest_endpoint: /v1/feature-profile/sdwan/system/%v/aaa
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_banner.yaml b/gen/definitions/profile_parcels/system_banner.yaml
index ca1b8ea2e..78d184de7 100644
--- a/gen/definitions/profile_parcels/system_banner.yaml
+++ b/gen/definitions/profile_parcels/system_banner.yaml
@@ -3,6 +3,7 @@ name: System Banner
rest_endpoint: /v1/feature-profile/sdwan/system/%v/banner
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_basic.yaml b/gen/definitions/profile_parcels/system_basic.yaml
index ee40ae8ca..0ecfd6c71 100644
--- a/gen/definitions/profile_parcels/system_basic.yaml
+++ b/gen/definitions/profile_parcels/system_basic.yaml
@@ -3,6 +3,7 @@ name: System Basic
rest_endpoint: /v1/feature-profile/sdwan/system/%v/basic
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_bfd.yaml b/gen/definitions/profile_parcels/system_bfd.yaml
index e9b539426..de7d4808c 100644
--- a/gen/definitions/profile_parcels/system_bfd.yaml
+++ b/gen/definitions/profile_parcels/system_bfd.yaml
@@ -3,6 +3,7 @@ name: System BFD
rest_endpoint: /v1/feature-profile/sdwan/system/%v/bfd
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_flexible_port_speed.yaml b/gen/definitions/profile_parcels/system_flexible_port_speed.yaml
index ad389013f..5091f9d64 100644
--- a/gen/definitions/profile_parcels/system_flexible_port_speed.yaml
+++ b/gen/definitions/profile_parcels/system_flexible_port_speed.yaml
@@ -3,6 +3,7 @@ name: System Flexible Port Speed
rest_endpoint: /v1/feature-profile/sdwan/system/%v/flexible-port-speed
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_global.yaml b/gen/definitions/profile_parcels/system_global.yaml
index 4d4141767..9d7912c39 100644
--- a/gen/definitions/profile_parcels/system_global.yaml
+++ b/gen/definitions/profile_parcels/system_global.yaml
@@ -3,6 +3,7 @@ name: System Global
rest_endpoint: /v1/feature-profile/sdwan/system/%v/global
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_ipv4_device_access.yaml b/gen/definitions/profile_parcels/system_ipv4_device_access.yaml
index 5459f76a7..754d25dbb 100644
--- a/gen/definitions/profile_parcels/system_ipv4_device_access.yaml
+++ b/gen/definitions/profile_parcels/system_ipv4_device_access.yaml
@@ -3,6 +3,7 @@ name: System IPv4 Device Access
rest_endpoint: /v1/feature-profile/sdwan/system/%v/ipv4-device-access-policy
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_ipv6_device_access.yaml b/gen/definitions/profile_parcels/system_ipv6_device_access.yaml
index 2da725ec9..36a9496c1 100644
--- a/gen/definitions/profile_parcels/system_ipv6_device_access.yaml
+++ b/gen/definitions/profile_parcels/system_ipv6_device_access.yaml
@@ -3,6 +3,7 @@ name: System IPv6 Device Access
rest_endpoint: /v1/feature-profile/sdwan/system/%v/ipv6-device-access-policy
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_logging.yaml b/gen/definitions/profile_parcels/system_logging.yaml
index 5a7d94655..35d2b91b2 100644
--- a/gen/definitions/profile_parcels/system_logging.yaml
+++ b/gen/definitions/profile_parcels/system_logging.yaml
@@ -3,6 +3,7 @@ name: System Logging
rest_endpoint: /v1/feature-profile/sdwan/system/%v/logging
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_mrf.yaml b/gen/definitions/profile_parcels/system_mrf.yaml
index 4ae572c15..e9e2eb988 100644
--- a/gen/definitions/profile_parcels/system_mrf.yaml
+++ b/gen/definitions/profile_parcels/system_mrf.yaml
@@ -3,6 +3,7 @@ name: System MRF
rest_endpoint: /v1/feature-profile/sdwan/system/%v/mrf
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_ntp.yaml b/gen/definitions/profile_parcels/system_ntp.yaml
index 1b74e7179..6a2297d67 100644
--- a/gen/definitions/profile_parcels/system_ntp.yaml
+++ b/gen/definitions/profile_parcels/system_ntp.yaml
@@ -3,6 +3,7 @@ name: System NTP
rest_endpoint: /v1/feature-profile/sdwan/system/%v/ntp
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_omp.yaml b/gen/definitions/profile_parcels/system_omp.yaml
index 08736f4d8..2bf6acbc7 100644
--- a/gen/definitions/profile_parcels/system_omp.yaml
+++ b/gen/definitions/profile_parcels/system_omp.yaml
@@ -3,6 +3,7 @@ name: System OMP
rest_endpoint: /v1/feature-profile/sdwan/system/%v/omp
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_perfomance_monitoring.yaml b/gen/definitions/profile_parcels/system_perfomance_monitoring.yaml
index c3f6c8a2d..d38a60140 100644
--- a/gen/definitions/profile_parcels/system_perfomance_monitoring.yaml
+++ b/gen/definitions/profile_parcels/system_perfomance_monitoring.yaml
@@ -3,6 +3,7 @@ name: System Performance Monitoring
rest_endpoint: /v1/feature-profile/sdwan/system/%v/perfmonitor
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_remote_access.yaml b/gen/definitions/profile_parcels/system_remote_access.yaml
index 5142fa678..a5c2cbed8 100644
--- a/gen/definitions/profile_parcels/system_remote_access.yaml
+++ b/gen/definitions/profile_parcels/system_remote_access.yaml
@@ -3,6 +3,7 @@ name: System Remote Access
rest_endpoint: /v1/feature-profile/sdwan/system/%v/remote-access
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -51,6 +52,7 @@ attributes:
- model_name: preSharedKey
tf_name: psk_authentication_pre_shared_key
data_path: [pskAuth]
+ exclude_test: true
conditional_attribute:
name: psk_authentication_type
value: group
@@ -125,6 +127,7 @@ attributes:
example: false
- model_name: antiReplayWindowSize
tf_name: ipsec_anti_replay_window_size
+ exclude_test: true
conditional_attribute:
name: ipsec_enable_anti_replay
value: true
diff --git a/gen/definitions/profile_parcels/system_security.yaml b/gen/definitions/profile_parcels/system_security.yaml
index f7917bfa2..d9c6c57ea 100644
--- a/gen/definitions/profile_parcels/system_security.yaml
+++ b/gen/definitions/profile_parcels/system_security.yaml
@@ -3,6 +3,7 @@ name: System Security
rest_endpoint: /v1/feature-profile/sdwan/system/%v/security
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/system_snmp.yaml b/gen/definitions/profile_parcels/system_snmp.yaml
index 2edf5e729..63854d7f1 100644
--- a/gen/definitions/profile_parcels/system_snmp.yaml
+++ b/gen/definitions/profile_parcels/system_snmp.yaml
@@ -3,6 +3,7 @@ name: System SNMP
rest_endpoint: /v1/feature-profile/sdwan/system/%v/snmp
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/transport_gps.yaml b/gen/definitions/profile_parcels/transport_gps.yaml
new file mode 100644
index 000000000..0cf0c779f
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_gps.yaml
@@ -0,0 +1,38 @@
+---
+name: Transport GPS
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/gps
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: enable
+ tf_name: gps_enable
+ example: false
+ - model_name: mode
+ tf_name: gps_mode
+ example: "ms-based"
+ - model_name: nmea
+ tf_name: nmea_enable
+ example: false
+ - model_name: sourceAddress
+ tf_name: nmea_source_address
+ example: 1.2.3.4
+ - model_name: destinationAddress
+ tf_name: nmea_destination_address
+ example: 2.3.4.5
+ - model_name: destinationPort
+ tf_name: nmea_destination_port
+ example: 22
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_ipv6_tracker.yaml b/gen/definitions/profile_parcels/transport_ipv6_tracker.yaml
index c49c89256..ead9b31d0 100644
--- a/gen/definitions/profile_parcels/transport_ipv6_tracker.yaml
+++ b/gen/definitions/profile_parcels/transport_ipv6_tracker.yaml
@@ -3,6 +3,7 @@ name: Transport IPv6 Tracker
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/ipv6-tracker
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
diff --git a/gen/definitions/profile_parcels/transport_ipv6_tracker_group.yaml b/gen/definitions/profile_parcels/transport_ipv6_tracker_group.yaml
new file mode 100644
index 000000000..9b8488077
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_ipv6_tracker_group.yaml
@@ -0,0 +1,69 @@
+---
+name: Transport IPv6 Tracker Group
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/ipv6-trackergroup
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: trackerGroupName
+ tf_name: tracker_name
+ mandatory: true
+ example: TRACKER_GROUP_1
+ - model_name: trackerRefs
+ tf_name: tracker_elements
+ attributes:
+ - model_name: refId
+ tf_name: tracker_id
+ data_path: [trackerRef]
+ id: true
+ mandatory: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ test_value: sdwan_transport_ipv6_tracker_feature.test-1.id
+ secondary_test_value: sdwan_transport_ipv6_tracker_feature.test-2.id
+ - model_name: combineBoolean
+ tf_name: tracker_boolean
+ example: or
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
+
+ resource "sdwan_transport_ipv6_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+ }
+
+ resource "sdwan_transport_ipv6_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_management_vpn.yaml b/gen/definitions/profile_parcels/transport_management_vpn.yaml
index aa2016b3e..86fa3d9bc 100644
--- a/gen/definitions/profile_parcels/transport_management_vpn.yaml
+++ b/gen/definitions/profile_parcels/transport_management_vpn.yaml
@@ -3,6 +3,7 @@ name: Transport Management VPN
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/management/vpn
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -69,6 +70,7 @@ attributes:
default_value_present: true
- model_name: distance
tf_name: administrative_distance
+ exclude_test: true
conditional_attribute:
name: gateway
value: null0
diff --git a/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml b/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml
index 3e57112ee..f9b7f8336 100644
--- a/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml
+++ b/gen/definitions/profile_parcels/transport_management_vpn_interface_ethernet.yaml
@@ -3,6 +3,7 @@ name: Transport Management VPN Interface Ethernet
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/management/vpn/%s/interface/ethernet
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -10,12 +11,12 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_transport_feature_profile.test.id
- - tf_name: transport_management_vpn_profile_parcel_id
+ - tf_name: transport_management_vpn_feature_id
reference: true
type: String
- description: Transport Management VPN Profile Parcel ID
+ description: Transport Management VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_transport_management_vpn_profile_parcel.test.id
+ test_value: sdwan_transport_management_vpn_feature.test.id
- model_name: shutdown
example: true
- model_name: interfaceName
@@ -157,7 +158,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_transport_management_vpn_profile_parcel" "test" {
+ resource "sdwan_transport_management_vpn_feature" "test" {
name = "TF_TEST_VPN"
feature_profile_id = sdwan_transport_feature_profile.test.id
}
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_route_policy.yaml b/gen/definitions/profile_parcels/transport_route_policy.yaml
new file mode 100644
index 000000000..eccbd90de
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_route_policy.yaml
@@ -0,0 +1,151 @@
+---
+name: Transport Route Policy
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/route-policy
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: defaultAction
+ example: accept
+ - model_name: sequences
+ tf_name:
+ attributes:
+ - model_name: sequenceId
+ tf_name: id
+ id: true
+ example: 1
+ - model_name: sequenceName
+ tf_name: name
+ example: SEQ_1
+ - model_name: baseAction
+ example: reject
+ - model_name: protocol
+ example: IPV4
+ - model_name: matchEntries
+ exclude_test: true
+ tf_name: match_entries
+ attributes:
+ - model_name: refId
+ tf_name: as_path_list_id
+ data_path: [asPathList]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: criteria
+ tf_name: standard_community_list_criteria
+ exclude_test: true
+ data_path: [communityList]
+ example: OR
+ - model_name: standardCommunityList
+ tf_name: standard_community_lists
+ data_path: [communityList]
+ exclude_test: true
+ attributes:
+ - model_name: refId
+ tf_name: id
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: expanded_community_list_id
+ data_path: [communityList, expandedCommunityList]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: extended_community_list_id
+ data_path: [extCommunityList]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: bgpLocalPreference
+ example: 100
+ - model_name: metric
+ example: 1000
+ - model_name: ompTag
+ example: 10000
+ - model_name: ospfTag
+ example: 20000
+ - model_name: refId
+ tf_name: ipv4_address_prefix_list_id
+ data_path: [ipv4Address]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: ipv4_next_hop_prefix_list_id
+ data_path: [ipv4NextHop]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: ipv6_address_prefix_list_id
+ data_path: [ipv6Address]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: refId
+ tf_name: ipv6_next_hop_prefix_list_id
+ data_path: [ipv6NextHop]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+ - model_name: actions
+ attributes:
+ - model_name: enableAcceptAction
+ data_path: [accept]
+ example: true
+ - model_name: prepend
+ tf_name: as_path_prepend
+ data_path: [accept, setAsPath]
+ example: 65521
+ - model_name: additive
+ tf_name: community_additive
+ data_path: [accept, setCommunity]
+ example: false
+ - model_name: community
+ tf_name: community
+ data_path: [accept, setCommunity]
+ example: internet
+ - model_name: setLocalPreference
+ tf_name: local_preference
+ data_path: [accept]
+ example: 100
+ - model_name: setMetric
+ tf_name: metric
+ data_path: [accept]
+ example: 20
+ - model_name: setMetricType
+ tf_name: metric_type
+ data_path: [accept]
+ example: type1
+ - model_name: setOmpTag
+ tf_name: omp_tag
+ data_path: [accept]
+ example: 200
+ - model_name: setOrigin
+ tf_name: origin
+ data_path: [accept]
+ example: EGP
+ - model_name: setOspfTag
+ tf_name: ospf_tag
+ data_path: [accept]
+ example: 1200
+ - model_name: setWeight
+ tf_name: weight
+ data_path: [accept]
+ example: 2200
+ - model_name: setIpv4NextHop
+ tf_name: ipv4_next_hop
+ data_path: [accept]
+ example: 10.0.0.1
+ - model_name: setIpv6NextHop
+ tf_name: ipv6_next_hop
+ data_path: [accept]
+ exclude_test: true
+ example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_routing_bgp.yaml b/gen/definitions/profile_parcels/transport_routing_bgp.yaml
index 1b266ca8b..33e6baedd 100644
--- a/gen/definitions/profile_parcels/transport_routing_bgp.yaml
+++ b/gen/definitions/profile_parcels/transport_routing_bgp.yaml
@@ -3,6 +3,7 @@ name: Transport Routing BGP
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/routing/bgp
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -54,9 +55,9 @@ attributes:
tf_name: ipv4_neighbors
attributes:
- model_name: address
+ id: true
example: 1.2.3.4
- model_name: description
- id: true
example: neighbor1
- model_name: shutdown
example: false
@@ -135,9 +136,9 @@ attributes:
tf_name: ipv6_neighbors
attributes:
- model_name: address
+ id: true
example: "2001::1"
- model_name: description
- id: true
example: neighbor2
- model_name: shutdown
example: false
@@ -250,7 +251,7 @@ attributes:
- model_name: refId
tf_name: ipv4_table_map_route_policy_id
data_path: [addressFamily, name]
- # exclude_null: true
+ always_include_parent: true
exclude_test: true
example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
# # test_value:
@@ -269,7 +270,6 @@ attributes:
- model_name: refId
tf_name: route_policy_id
data_path: [routePolicy]
- id: true
example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
# test_value:
- model_name: ipv6AggregateAddress
@@ -305,7 +305,7 @@ attributes:
- model_name: refId
tf_name: ipv6_table_map_route_policy_id
data_path: [ipv6AddressFamily, name]
- # exclude_null: true
+ always_include_parent: true
exclude_test: true
example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
# test_value:
@@ -324,7 +324,6 @@ attributes:
- model_name: refId
tf_name: route_policy_id
data_path: [routePolicy]
- id: true
example: a509839f-33aa-492a-ab8e-6a6fe70d7d79
# test_value:
- model_name: mplsInterface
diff --git a/gen/definitions/profile_parcels/transport_routing_ospf.yaml b/gen/definitions/profile_parcels/transport_routing_ospf.yaml
new file mode 100644
index 000000000..ac54b11bd
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_routing_ospf.yaml
@@ -0,0 +1,144 @@
+---
+name: Transport Routing OSPF
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/routing/ospf
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: routerId
+ example: 1.2.3.4
+ - model_name: referenceBandwidth
+ example: 101
+ - model_name: rfc1583
+ tf_name: rfc_1583_compatible
+ example: true
+ - model_name: originate
+ tf_name: default_information_originate
+ example: false
+ - model_name: always
+ tf_name: default_information_originate_always
+ example: false
+ - model_name: metric
+ tf_name: default_information_originate_metric
+ example: 1
+ - model_name: metricType
+ tf_name: default_information_originate_metric_type
+ example: type1
+ - model_name: external
+ tf_name: distance_external
+ example: 110
+ - model_name: interArea
+ tf_name: distance_inter_area
+ example: 110
+ - model_name: intraArea
+ tf_name: distance_intra_area
+ example: 110
+ - model_name: delay
+ tf_name: spf_calculation_delay
+ example: 200
+ - model_name: initialHold
+ tf_name: spf_initial_hold_time
+ example: 1000
+ - model_name: maxHold
+ tf_name: spf_maximum_hold_time
+ example: 10000
+ - model_name: redistribute
+ tf_name: redistributes
+ attributes:
+ - model_name: protocol
+ id: true
+ example: static
+ - model_name: dia
+ tf_name: nat_dia
+ example: true
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: routerLsa
+ tf_name: router_lsas
+ attributes:
+ - model_name: adType
+ tf_name: type
+ id: true
+ example: on-startup
+ - model_name: time
+ example: 5
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: area
+ tf_name: areas
+ attributes:
+ - model_name: aNum
+ tf_name: area_number
+ id: true
+ example: 1
+ - model_name: aType
+ tf_name: area_type
+ example: stub
+ - model_name: noSummary
+ example: false
+ - model_name: interface
+ tf_name: interfaces
+ attributes:
+ - model_name: name
+ id: true
+ example: GigabitEthernet2
+ - model_name: helloInterval
+ example: 10
+ - model_name: deadInterval
+ example: 40
+ - model_name: retransmitInterval
+ tf_name: lsa_retransmit_interval
+ example: 5
+ - model_name: cost
+ example: 10
+ - model_name: priority
+ tf_name: designated_router_priority
+ example: 1
+ - model_name: network
+ tf_name: network_type
+ example: broadcast
+ - model_name: passiveInterface
+ example: false
+ - model_name: type
+ tf_name: authentication_type
+ example: message-digest
+ - model_name: messageDigestKey
+ tf_name: message_digest_key_id
+ example: 7
+ - model_name: md5
+ tf_name: message_digest_key
+ write_only: true
+ example: sdjfhsghbjdjr
+ - model_name: range
+ tf_name: ranges
+ attributes:
+ - model_name: ipAddress
+ data_path: [address]
+ id: true
+ example: 10.1.1.0
+ - model_name: subnetMask
+ data_path: [address]
+ example: 255.255.255.0
+ - model_name: cost
+ example: 1
+ - model_name: noAdvertise
+ example: false
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_routing_ospfv3_ipv4.yaml b/gen/definitions/profile_parcels/transport_routing_ospfv3_ipv4.yaml
new file mode 100644
index 000000000..6cc739295
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_routing_ospfv3_ipv4.yaml
@@ -0,0 +1,173 @@
+---
+name: Transport Routing OSPFv3 IPv4
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/routing/ospfv3/ipv4
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: routerId
+ data_path: [basic]
+ example: 1.2.3.4
+ - model_name: distance
+ data_path: [basic]
+ example: 110
+ - model_name: externalDistance
+ tf_name: distance_external
+ data_path: [basic]
+ example: 110
+ - model_name: interAreaDistance
+ tf_name: distance_inter_area
+ data_path: [basic]
+ example: 110
+ - model_name: intraAreaDistance
+ tf_name: distance_intra_area
+ data_path: [basic]
+ example: 110
+ - model_name: referenceBandwidth
+ data_path: [advanced]
+ example: 101
+ - model_name: compatibleRfc1583
+ tf_name: rfc_1583_compatible
+ data_path: [advanced]
+ example: true
+ - model_name: originate
+ tf_name: default_information_originate
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: always
+ tf_name: default_information_originate_always
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: metric
+ tf_name: default_information_originate_metric
+ data_path: [advanced, defaultOriginate]
+ example: 1
+ - model_name: metricType
+ tf_name: default_information_originate_metric_type
+ data_path: [advanced, defaultOriginate]
+ example: type1
+ - model_name: delay
+ tf_name: spf_calculation_delay
+ data_path: [advanced, spfTimers]
+ example: 200
+ - model_name: initialHold
+ tf_name: spf_initial_hold_time
+ data_path: [advanced, spfTimers]
+ example: 1000
+ - model_name: maxHold
+ tf_name: spf_maximum_hold_time
+ data_path: [advanced, spfTimers]
+ example: 10000
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [advanced, policyName]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: filter
+ data_path: [advanced]
+ example: false
+ - model_name: redistribute
+ tf_name: redistributes
+ attributes:
+ - model_name: protocol
+ id: true
+ example: nat-route
+ - model_name: natDia
+ tf_name: nat_dia
+ example: true
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: action
+ tf_name: router_lsa_action
+ data_path: [maxMetricRouterLsa]
+ example: on-startup
+ - model_name: onStartUpTime
+ tf_name: router_lsa_on_startup_time
+ data_path: [maxMetricRouterLsa]
+ example: 30
+ - model_name: area
+ tf_name: areas
+ attributes:
+ - model_name: areaNum
+ tf_name: area_number
+ id: true
+ mandatory: true
+ example: 1
+ - model_name: areaType
+ tf_name: area_type
+ data_path: [areaTypeConfig]
+ example: stub
+ - model_name: noSummary
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: alwaysTranslate
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: interfaces
+ attributes:
+ - model_name: ifName
+ tf_name: name
+ id: true
+ example: GigabitEthernet2
+ - model_name: helloInterval
+ example: 10
+ - model_name: deadInterval
+ example: 40
+ - model_name: retransmitInterval
+ tf_name: lsa_retransmit_interval
+ example: 5
+ - model_name: cost
+ example: 10
+ - model_name: networkType
+ tf_name: network_type
+ example: broadcast
+ - model_name: passiveInterface
+ example: false
+ - model_name: authType
+ tf_name: authentication_type
+ data_path: [authenticationConfig]
+ example: no-auth
+ - model_name: spi
+ tf_name: authentication_spi
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 12345
+ - model_name: authKey
+ tf_name: authentication_key
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 0123456789012345678901234567890123456789
+ - model_name: ranges
+ attributes:
+ - model_name: address
+ tf_name: ip_address
+ data_path: [network]
+ id: true
+ example: 10.1.1.0
+ - model_name: mask
+ tf_name: subnet_mask
+ data_path: [network]
+ example: 255.255.255.0
+ - model_name: cost
+ example: 1
+ - model_name: noAdvertise
+ example: false
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_routing_ospfv3_ipv6.yaml b/gen/definitions/profile_parcels/transport_routing_ospfv3_ipv6.yaml
new file mode 100644
index 000000000..d8d6c6814
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_routing_ospfv3_ipv6.yaml
@@ -0,0 +1,165 @@
+---
+name: Transport Routing OSPFv3 IPv6
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/routing/ospfv3/ipv6
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: routerId
+ data_path: [basic]
+ example: 1.2.3.4
+ - model_name: distance
+ data_path: [basic]
+ example: 110
+ - model_name: externalDistance
+ tf_name: distance_external
+ data_path: [basic]
+ example: 110
+ - model_name: interAreaDistance
+ tf_name: distance_inter_area
+ data_path: [basic]
+ example: 110
+ - model_name: intraAreaDistance
+ tf_name: distance_intra_area
+ data_path: [basic]
+ example: 110
+ - model_name: referenceBandwidth
+ data_path: [advanced]
+ example: 101
+ - model_name: compatibleRfc1583
+ tf_name: rfc_1583_compatible
+ data_path: [advanced]
+ example: true
+ - model_name: originate
+ tf_name: default_information_originate
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: always
+ tf_name: default_information_originate_always
+ data_path: [advanced, defaultOriginate]
+ example: false
+ - model_name: metric
+ tf_name: default_information_originate_metric
+ data_path: [advanced, defaultOriginate]
+ example: 1
+ - model_name: metricType
+ tf_name: default_information_originate_metric_type
+ data_path: [advanced, defaultOriginate]
+ example: type1
+ - model_name: delay
+ tf_name: spf_calculation_delay
+ data_path: [advanced, spfTimers]
+ example: 200
+ - model_name: initialHold
+ tf_name: spf_initial_hold_time
+ data_path: [advanced, spfTimers]
+ example: 1000
+ - model_name: maxHold
+ tf_name: spf_maximum_hold_time
+ data_path: [advanced, spfTimers]
+ example: 10000
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [advanced, policyName]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: filter
+ data_path: [advanced]
+ example: false
+ - model_name: redistribute
+ tf_name: redistributes
+ attributes:
+ - model_name: protocol
+ id: true
+ example: static
+ - model_name: refId
+ tf_name: route_policy_id
+ data_path: [routePolicy]
+ exclude_test: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ - model_name: action
+ tf_name: router_lsa_action
+ data_path: [maxMetricRouterLsa]
+ example: on-startup
+ - model_name: onStartUpTime
+ tf_name: router_lsa_on_startup_time
+ data_path: [maxMetricRouterLsa]
+ example: 30
+ - model_name: area
+ tf_name: areas
+ attributes:
+ - model_name: areaNum
+ tf_name: area_number
+ id: true
+ mandatory: true
+ example: 1
+ - model_name: areaType
+ tf_name: area_type
+ data_path: [areaTypeConfig]
+ example: stub
+ - model_name: noSummary
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: alwaysTranslate
+ data_path: [areaTypeConfig]
+ exclude_test: true
+ example: false
+ - model_name: interfaces
+ attributes:
+ - model_name: ifName
+ tf_name: name
+ id: true
+ example: GigabitEthernet2
+ - model_name: helloInterval
+ example: 10
+ - model_name: deadInterval
+ example: 40
+ - model_name: retransmitInterval
+ tf_name: lsa_retransmit_interval
+ example: 5
+ - model_name: cost
+ example: 10
+ - model_name: networkType
+ tf_name: network_type
+ example: broadcast
+ - model_name: passiveInterface
+ example: false
+ - model_name: authType
+ tf_name: authentication_type
+ data_path: [authenticationConfig]
+ example: no-auth
+ - model_name: spi
+ tf_name: authentication_spi
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 12345
+ - model_name: authKey
+ tf_name: authentication_key
+ data_path: [authenticationConfig]
+ exclude_test: true
+ example: 0123456789012345678901234567890123456789
+ - model_name: ranges
+ attributes:
+ - model_name: network
+ tf_name: prefix
+ id: true
+ example: 3002::/96
+ - model_name: cost
+ example: 1
+ - model_name: noAdvertise
+ example: false
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_tracker.yaml b/gen/definitions/profile_parcels/transport_tracker.yaml
new file mode 100644
index 000000000..4010a2e3c
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_tracker.yaml
@@ -0,0 +1,39 @@
+---
+name: Transport Tracker
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/tracker
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: trackerName
+ example: TRACKER_1
+ minimum_test_value: '"TRACKER_1"'
+ - model_name: endpointApiUrl
+ example: google.com
+ - model_name: endpointDnsName
+ example: google.com
+ - model_name: endpointIp
+ example: 1.2.3.4
+ - model_name: interval
+ example: 30
+ - model_name: multiplier
+ example: 3
+ - model_name: threshold
+ example: 300
+ - model_name: endpointTrackerType
+ example: interface
+ - model_name: trackerType
+ example: endpoint
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_tracker_group.yaml b/gen/definitions/profile_parcels/transport_tracker_group.yaml
new file mode 100644
index 000000000..d4df137c8
--- /dev/null
+++ b/gen/definitions/profile_parcels/transport_tracker_group.yaml
@@ -0,0 +1,65 @@
+---
+name: Transport Tracker Group
+rest_endpoint: /v1/feature-profile/sdwan/transport/%v/trackergroup
+minimum_version: 20.12.0
+test_tags: [SDWAN_2012]
+skip_minimum_test: true
+parcel_type: feature
+attributes:
+ - tf_name: feature_profile_id
+ reference: true
+ type: String
+ mandatory: true
+ description: Feature Profile ID
+ example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
+ test_value: sdwan_transport_feature_profile.test.id
+ - model_name: trackerRefs
+ tf_name: tracker_elements
+ attributes:
+ - model_name: refId
+ tf_name: tracker_id
+ data_path: [trackerRef]
+ id: true
+ mandatory: true
+ example: 615d948f-34ee-4a2e-810e-a9bd8d3d48ec
+ test_value: sdwan_transport_tracker_feature.test-1.id
+ secondary_test_value: sdwan_transport_tracker_feature.test-2.id
+ - model_name: combineBoolean
+ tf_name: tracker_boolean
+ example: or
+
+test_prerequisites: |
+ resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+ }
+
+ resource "sdwan_transport_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "interface"
+ tracker_type = "endpoint"
+ }
+
+ resource "sdwan_transport_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "interface"
+ tracker_type = "endpoint"
+ }
\ No newline at end of file
diff --git a/gen/definitions/profile_parcels/transport_wan_vpn.yaml b/gen/definitions/profile_parcels/transport_wan_vpn.yaml
index 1713dc247..365fbd303 100644
--- a/gen/definitions/profile_parcels/transport_wan_vpn.yaml
+++ b/gen/definitions/profile_parcels/transport_wan_vpn.yaml
@@ -3,6 +3,7 @@ name: Transport WAN VPN
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/wan/vpn
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -71,6 +72,7 @@ attributes:
example: 1
- model_name: distance
tf_name: administrative_distance
+ exclude_test: true
conditional_attribute:
name: gateway
value: null0
@@ -117,7 +119,6 @@ attributes:
example: 203.0.113.100
- model_name: nat64V4PoolOverload
example: false
-
test_prerequisites: |
resource "sdwan_transport_feature_profile" "test" {
diff --git a/gen/definitions/profile_parcels/transport_wan_vpn_interface_cellular.yaml b/gen/definitions/profile_parcels/transport_wan_vpn_interface_cellular.yaml
index a45be11e4..eb8887ec5 100644
--- a/gen/definitions/profile_parcels/transport_wan_vpn_interface_cellular.yaml
+++ b/gen/definitions/profile_parcels/transport_wan_vpn_interface_cellular.yaml
@@ -3,6 +3,7 @@ name: Transport WAN VPN Interface Cellular
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/cellular
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,12 +12,12 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_transport_feature_profile.test.id
- - tf_name: transport_wan_vpn_profile_parcel_id
+ - tf_name: transport_wan_vpn_feature_id
reference: true
type: String
- description: Transport WAN VPN Profile Parcel ID
+ description: Transport WAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_transport_wan_vpn_profile_parcel.test.id
+ test_value: sdwan_transport_wan_vpn_feature.test.id
- model_name: shutdown
example: true
- model_name: interfaceName
@@ -370,7 +371,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
+ resource "sdwan_transport_wan_vpn_feature" "test" {
name = "TF_TEST_WAN"
description = "Terraform test"
feature_profile_id = sdwan_transport_feature_profile.test.id
@@ -397,7 +398,6 @@ test_prerequisites: |
administrative_distance = 1
}
]
- administrative_distance = 1
}
]
ipv6_static_routes = [
diff --git a/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml b/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml
index 751807d09..4d3d85c94 100644
--- a/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml
+++ b/gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml
@@ -3,6 +3,7 @@ name: Transport WAN VPN Interface Ethernet
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/ethernet
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,12 +12,12 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_transport_feature_profile.test.id
- - tf_name: transport_wan_vpn_profile_parcel_id
+ - tf_name: transport_wan_vpn_feature_id
reference: true
type: String
- description: Transport WAN VPN Profile Parcel ID
+ description: Transport WAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_transport_wan_vpn_profile_parcel.test.id
+ test_value: sdwan_transport_wan_vpn_feature.test.id
- model_name: shutdown
example: true
- model_name: interfaceName
@@ -598,7 +599,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
+ resource "sdwan_transport_wan_vpn_feature" "test" {
name = "TF_TEST_WAN"
description = "Terraform test"
feature_profile_id = sdwan_transport_feature_profile.test.id
@@ -625,7 +626,6 @@ test_prerequisites: |
administrative_distance = 1
}
]
- administrative_distance = 1
}
]
ipv6_static_routes = [
diff --git a/gen/definitions/profile_parcels/transport_wan_vpn_interface_gre.yaml b/gen/definitions/profile_parcels/transport_wan_vpn_interface_gre.yaml
index 9ceae1ce5..71c6ec3a6 100644
--- a/gen/definitions/profile_parcels/transport_wan_vpn_interface_gre.yaml
+++ b/gen/definitions/profile_parcels/transport_wan_vpn_interface_gre.yaml
@@ -3,6 +3,7 @@ name: Transport WAN VPN Interface GRE
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/gre
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,17 +12,18 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_transport_feature_profile.test.id
- - tf_name: transport_wan_vpn_profile_parcel_id
+ - tf_name: transport_wan_vpn_feature_id
reference: true
type: String
- description: Transport WAN VPN Profile Parcel ID
+ description: Transport WAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_transport_wan_vpn_profile_parcel.test.id
+ test_value: sdwan_transport_wan_vpn_feature.test.id
- model_name: ifName
tf_name: interface_name
data_path: [basic]
- mandatory: true
example: gre1
+ test_value: '"gre1"'
+ minimum_test_value: '"gre1"'
- model_name: description
tf_name: interface_description
data_path: [basic]
@@ -29,13 +31,15 @@ attributes:
- model_name: address
tf_name: ipv4_address
data_path: [basic, address]
- mandatory: true
example: 70.1.1.1
+ test_value: '"70.1.1.1"'
+ minimum_test_value: '"70.1.1.1"'
- model_name: mask
tf_name: ipv4_subnet_mask
data_path: [basic, address]
- mandatory: true
example: 255.255.255.0
+ test_value: '"255.255.255.0"'
+ minimum_test_value: '"255.255.255.0"'
- model_name: shutdown
data_path: [basic]
example: true
@@ -61,8 +65,9 @@ attributes:
- model_name: tunnelDestination
tf_name: tunnel_destination_ipv4_address
data_path: [basic]
- mandatory: true
example: 79.1.1.1
+ test_value: '"79.1.1.1"'
+ minimum_test_value: '"79.1.1.1"'
- model_name: mtu
tf_name: ip_mtu
data_path: [basic]
@@ -85,7 +90,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
+ resource "sdwan_transport_wan_vpn_feature" "test" {
name = "TF_TEST_WAN"
description = "Terraform test"
feature_profile_id = sdwan_transport_feature_profile.test.id
@@ -112,7 +117,6 @@ test_prerequisites: |
administrative_distance = 1
}
]
- administrative_distance = 1
}
]
ipv6_static_routes = [
diff --git a/gen/definitions/profile_parcels/transport_wan_vpn_interface_ipsec.yaml b/gen/definitions/profile_parcels/transport_wan_vpn_interface_ipsec.yaml
index 3a789d93d..f33505c51 100644
--- a/gen/definitions/profile_parcels/transport_wan_vpn_interface_ipsec.yaml
+++ b/gen/definitions/profile_parcels/transport_wan_vpn_interface_ipsec.yaml
@@ -3,6 +3,7 @@ name: Transport WAN VPN Interface IPSEC
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/ipsec
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,16 +12,17 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_transport_feature_profile.test.id
- - tf_name: transport_wan_vpn_profile_parcel_id
+ - tf_name: transport_wan_vpn_feature_id
reference: true
type: String
- description: Transport WAN VPN Profile Parcel ID
+ description: Transport WAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_transport_wan_vpn_profile_parcel.test.id
+ test_value: sdwan_transport_wan_vpn_feature.test.id
- model_name: ifName
tf_name: interface_name
- mandatory: true
example: ipsec987
+ test_value: '"ipsec987"'
+ minimum_test_value: '"ipsec987"'
- model_name: shutdown
example: true
- model_name: description
@@ -29,41 +31,49 @@ attributes:
- model_name: address
tf_name: ipv4_address
data_path: [address]
- mandatory: true
example: 9.7.5.4
+ test_value: '"9.7.5.4"'
+ minimum_test_value: '"9.7.5.4"'
- model_name: mask
tf_name: ipv4_subnet_mask
data_path: [address]
- mandatory: true
example: 255.255.255.0
+ test_value: '"255.255.255.0"'
+ minimum_test_value: '"255.255.255.0"'
- model_name: address
tf_name: tunnel_source_ipv4_address
data_path: [tunnelSource]
- mandatory: true
example: 1.3.5.88
+ test_value: '"1.3.5.88"'
+ minimum_test_value: '"1.3.5.88"'
- model_name: mask
tf_name: tunnel_source_ipv4_subnet_mask
data_path: [tunnelSource]
- mandatory: true
example: 255.255.255.0
+ test_value: '"255.255.255.0"'
+ minimum_test_value: '"255.255.255.0"'
- model_name: tunnelSourceInterface
tf_name: tunnel_source_interface
- mandatory: true
example: GigabitEthernet8
+ test_value: '"GigabitEthernet8"'
+ minimum_test_value: '"GigabitEthernet8"'
- model_name: address
tf_name: tunnel_destination_ipv4_address
data_path: [tunnelDestination]
- mandatory: true
example: 2.55.67.99
+ test_value: '"2.55.67.99"'
+ minimum_test_value: '"2.55.67.99"'
- model_name: mask
tf_name: tunnel_destination_ipv4_subnet_mask
data_path: [tunnelDestination]
- mandatory: true
example: 255.255.255.0
+ test_value: '"255.255.255.0"'
+ minimum_test_value: '"255.255.255.0"'
- model_name: application
tf_name: application_tunnel_type
- mandatory: true
example: none
+ test_value: '"none"'
+ minimum_test_value: '"none"'
- model_name: tcpMssAdjust
tf_name: tcp_mss
example: 1460
@@ -78,8 +88,9 @@ attributes:
example: 3
- model_name: preSharedSecret
tf_name: ike_preshared_key
- mandatory: true
example: 123
+ test_value: '"123"'
+ minimum_test_value: '"123"'
- model_name: ikeVersion
example: 1
- model_name: ikeMode
@@ -119,7 +130,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
+ resource "sdwan_transport_wan_vpn_feature" "test" {
name = "TF_TEST_WAN"
description = "Terraform test"
feature_profile_id = sdwan_transport_feature_profile.test.id
@@ -146,7 +157,6 @@ test_prerequisites: |
administrative_distance = 1
}
]
- administrative_distance = 1
}
]
ipv6_static_routes = [
diff --git a/gen/definitions/profile_parcels/transport_wan_vpn_interface_t1_e1_serial.yaml b/gen/definitions/profile_parcels/transport_wan_vpn_interface_t1_e1_serial.yaml
index e72136353..768e796e2 100644
--- a/gen/definitions/profile_parcels/transport_wan_vpn_interface_t1_e1_serial.yaml
+++ b/gen/definitions/profile_parcels/transport_wan_vpn_interface_t1_e1_serial.yaml
@@ -3,6 +3,7 @@ name: Transport WAN VPN Interface T1 E1 Serial
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/serial
minimum_version: 20.12.0
test_tags: [SDWAN_2012]
+parcel_type: feature
attributes:
- tf_name: feature_profile_id
reference: true
@@ -11,17 +12,18 @@ attributes:
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_transport_feature_profile.test.id
- - tf_name: transport_wan_vpn_profile_parcel_id
+ - tf_name: transport_wan_vpn_feature_id
reference: true
type: String
- description: Transport WAN VPN Profile Parcel ID
+ description: Transport WAN VPN Feature ID
example: 140331f6-5418-4755-a059-13c77eb96037
- test_value: sdwan_transport_wan_vpn_profile_parcel.test.id
+ test_value: sdwan_transport_wan_vpn_feature.test.id
- model_name: shutdown
example: true
- model_name: interfaceName
- mandatory: true
example: Serial0
+ test_value: '"Serial0"'
+ minimum_test_value: '"Serial0"'
- model_name: address
tf_name: ipv4_address
data_path: [addressV4]
@@ -263,7 +265,7 @@ test_prerequisites: |
description = "Terraform test"
}
- resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
+ resource "sdwan_transport_wan_vpn_feature" "test" {
name = "TF_TEST_WAN"
description = "Terraform test"
feature_profile_id = sdwan_transport_feature_profile.test.id
@@ -290,7 +292,6 @@ test_prerequisites: |
administrative_distance = 1
}
]
- administrative_distance = 1
}
]
ipv6_static_routes = [
diff --git a/gen/doc_category.go b/gen/doc_category.go
index 1f5637549..9fe914257 100644
--- a/gen/doc_category.go
+++ b/gen/doc_category.go
@@ -37,13 +37,14 @@ const (
type YamlConfig struct {
Name string `yaml:"name"`
DocCategory string `yaml:"doc_category"`
+ ParcelType string `yaml:"parcel_type"`
}
var docPaths = []string{"./docs/data-sources/", "./docs/resources/"}
var extraDocs = map[string]string{
- "attach_feature_device_template": "Device Templates",
- "activate_centralized_policy": "Centralized Policies",
+ "attach_feature_device_template": "(Classic) Device Templates",
+ "activate_centralized_policy": "(Classic) Centralized Policies",
}
func SnakeCase(s string) string {
@@ -90,7 +91,7 @@ func main() {
}
s := string(content)
- s = strings.ReplaceAll(s, `subcategory: ""`, `subcategory: "Feature Templates"`)
+ s = strings.ReplaceAll(s, `subcategory: ""`, `subcategory: "(Classic) Feature Templates"`)
os.WriteFile(filename, []byte(s), 0644)
}
@@ -114,14 +115,26 @@ func main() {
// Update profile parcel doc category
for i := range profileParcelConfigs {
for _, path := range docPaths {
- filename := path + SnakeCase(profileParcelConfigs[i].Name) + "_profile_parcel.md"
+ extension := ""
+ category := ""
+ if profileParcelConfigs[i].ParcelType == "feature" {
+ extension = "_feature.md"
+ category = "Features"
+ } else if profileParcelConfigs[i].ParcelType == "policy" {
+ extension = "_policy.md"
+ category = "Policies"
+ } else if profileParcelConfigs[i].ParcelType == "policy_object" {
+ extension = ".md"
+ category = "Policy Objects"
+ }
+ filename := path + SnakeCase(profileParcelConfigs[i].Name) + extension
content, err := os.ReadFile(filename)
if err != nil {
log.Fatalf("Error opening documentation: %v", err)
}
s := string(content)
- s = strings.ReplaceAll(s, `subcategory: ""`, `subcategory: "Profile Parcels"`)
+ s = strings.ReplaceAll(s, `subcategory: ""`, `subcategory: "`+category+`"`)
os.WriteFile(filename, []byte(s), 0644)
}
diff --git a/gen/generator.go b/gen/generator.go
index 30ad6d887..e6e561083 100644
--- a/gen/generator.go
+++ b/gen/generator.go
@@ -102,42 +102,42 @@ var profileParcelTemplates = []t{
{
path: "./gen/templates/profile_parcels/model.go",
prefix: "./internal/provider/model_sdwan_",
- suffix: "_profile_parcel.go",
+ suffix: "%s.go",
},
{
path: "./gen/templates/profile_parcels/data_source.go",
prefix: "./internal/provider/data_source_sdwan_",
- suffix: "_profile_parcel.go",
+ suffix: "%s.go",
},
{
path: "./gen/templates/profile_parcels/data_source_test.go",
prefix: "./internal/provider/data_source_sdwan_",
- suffix: "_profile_parcel_test.go",
+ suffix: "%s_test.go",
},
{
path: "./gen/templates/profile_parcels/resource.go",
prefix: "./internal/provider/resource_sdwan_",
- suffix: "_profile_parcel.go",
+ suffix: "%s.go",
},
{
path: "./gen/templates/profile_parcels/resource_test.go",
prefix: "./internal/provider/resource_sdwan_",
- suffix: "_profile_parcel_test.go",
+ suffix: "%s_test.go",
},
{
path: "./gen/templates/profile_parcels/data-source.tf",
prefix: "./examples/data-sources/sdwan_",
- suffix: "_profile_parcel/data-source.tf",
+ suffix: "%s/data-source.tf",
},
{
path: "./gen/templates/profile_parcels/resource.tf",
prefix: "./examples/resources/sdwan_",
- suffix: "_profile_parcel/resource.tf",
+ suffix: "%s/resource.tf",
},
{
path: "./gen/templates/profile_parcels/import.sh",
prefix: "./examples/resources/sdwan_",
- suffix: "_profile_parcel/import.sh",
+ suffix: "%s/import.sh",
},
}
@@ -203,6 +203,7 @@ type YamlConfig struct {
SkipTemplates []string `yaml:"skip_templates"`
Attributes []YamlConfigAttribute `yaml:"attributes"`
TestTags []string `yaml:"test_tags"`
+ SkipMinimumTest bool `yaml:"skip_minimum_test"`
TestPrerequisites string `yaml:"test_prerequisites"`
RemoveId bool `yaml:"remove_id"`
TypeValue string `yaml:"type_value"`
@@ -211,6 +212,7 @@ type YamlConfig struct {
NoDataSource bool `yaml:"no_data_source"`
GetBeforeDelete bool `yaml:"get_before_delete"`
DeleteMutex bool `yaml:"delete_mutex"`
+ ParcelType string `yaml:"parcel_type"`
}
type YamlConfigAttribute struct {
@@ -255,8 +257,10 @@ type YamlConfigAttribute struct {
DefaultValueEmptyString bool `yaml:"default_value_empty_string"`
Value string `yaml:"value"`
TestValue string `yaml:"test_value"`
+ SecondaryTestValue string `yaml:"secondary_test_value"`
MinimumTestValue string `yaml:"minimum_test_value"`
AlwaysInclude bool `yaml:"always_include"`
+ AlwaysIncludeParent bool `yaml:"always_include_parent"`
Attributes []YamlConfigAttribute `yaml:"attributes"`
ConditionalAttribute YamlConfigConditionalAttribute `yaml:"conditional_attribute"`
ConditionalListLength string `yaml:"conditional_list_length"`
@@ -329,6 +333,16 @@ func BuildPath(s []string) string {
return strings.Join(s, ".")
}
+// Templating helper function to return true if id included in attributes
+func HasId(attributes []YamlConfigAttribute) bool {
+ for _, attr := range attributes {
+ if attr.Id {
+ return true
+ }
+ }
+ return false
+}
+
// Templating helper function to determine if attributes list contains one or more version attributes
func HasVersionAttribute(attributes []YamlConfigAttribute) bool {
for _, attr := range attributes {
@@ -467,6 +481,22 @@ func GetParentModelName(attribute YamlConfigAttribute) string {
}
}
+// Templating helper function to return the snake case profile parcel suffix
+func GetProfileParcelSuffix(config YamlConfig) string {
+ if config.ParcelType == "feature" {
+ return "_feature"
+ } else if config.ParcelType == "policy" {
+ return "_policy"
+ } else {
+ return ""
+ }
+}
+
+// Templating helper function to return the snake case profile parcel name
+func GetProfileParcelName(config YamlConfig) string {
+ return SnakeCase(config.Name) + GetProfileParcelSuffix(config)
+}
+
func contains(s []string, str string) bool {
for _, v := range s {
if v == str {
@@ -478,27 +508,30 @@ func contains(s []string, str string) bool {
// Map of templating functions
var functions = template.FuncMap{
- "toGoName": ToGoName,
- "camelCase": CamelCase,
- "snakeCase": SnakeCase,
- "sprintf": fmt.Sprintf,
- "toLower": strings.ToLower,
- "path": BuildPath,
- "hasVersionAttribute": HasVersionAttribute,
- "getResponseModelPath": GetResponseModelPath,
- "hasReference": HasReference,
- "getGjsonType": GetGjsonType,
- "getId": GetId,
- "isListSet": IsListSet,
- "isList": IsList,
- "isSet": IsSet,
- "isStringListSet": IsStringListSet,
- "isInt64ListSet": IsInt64ListSet,
- "isNestedListSet": IsNestedListSet,
- "isNestedList": IsNestedList,
- "isNestedSet": IsNestedSet,
- "getParentModelName": GetParentModelName,
- "contains": contains,
+ "toGoName": ToGoName,
+ "camelCase": CamelCase,
+ "snakeCase": SnakeCase,
+ "sprintf": fmt.Sprintf,
+ "toLower": strings.ToLower,
+ "path": BuildPath,
+ "hasId": HasId,
+ "hasVersionAttribute": HasVersionAttribute,
+ "getResponseModelPath": GetResponseModelPath,
+ "hasReference": HasReference,
+ "getGjsonType": GetGjsonType,
+ "getId": GetId,
+ "isListSet": IsListSet,
+ "isList": IsList,
+ "isSet": IsSet,
+ "isStringListSet": IsStringListSet,
+ "isInt64ListSet": IsInt64ListSet,
+ "isNestedListSet": IsNestedListSet,
+ "isNestedList": IsNestedList,
+ "isNestedSet": IsNestedSet,
+ "getParentModelName": GetParentModelName,
+ "getProfileParcelSuffix": GetProfileParcelSuffix,
+ "getProfileParcelName": GetProfileParcelName,
+ "contains": contains,
}
func parseFeatureTemplateAttribute(attr *YamlConfigAttribute, model gjson.Result) {
@@ -677,19 +710,33 @@ func parseProfileParcelAttribute(attr *YamlConfigAttribute, model gjson.Result,
if attr.ModelName == "" {
return
}
+
path := ""
+ prefix := "properties."
for i, e := range attr.DataPath {
- // Check if the next element is a oneOf
- if model.Get("properties." + path + e + ".oneOf").Exists() {
- // We need to find the right element in oneOf which has the next element
- next := ""
- if i+1 < len(attr.DataPath) {
- next = attr.DataPath[i+1]
- } else {
- next = attr.ModelName
- }
+ next := ""
+ if i+1 < len(attr.DataPath) {
+ next = attr.DataPath[i+1]
+ } else {
+ next = attr.ModelName
+ }
+
+ if model.Get("oneOf").Exists() {
+ prefix = "oneOf."
+ }
+ if path == "" && prefix == "oneOf." {
+ index := 0
+ model.Get("oneOf").ForEach(func(k, v gjson.Result) bool {
+ if v.Get(fmt.Sprintf("properties.%v.properties.%v", e, next)).Exists() {
+ path += fmt.Sprintf("%v.properties.%v.properties.", index, e)
+ return false // stop iterating
+ }
+ index += 1
+ return true // keep iterating
+ })
+ } else if model.Get(prefix + path + e + ".oneOf").Exists() {
index := 0
model.Get("properties." + path + e + ".oneOf").ForEach(func(k, v gjson.Result) bool {
if v.Get("properties." + next).Exists() {
@@ -701,16 +748,17 @@ func parseProfileParcelAttribute(attr *YamlConfigAttribute, model gjson.Result,
return true // keep iterating
})
- } else if model.Get("properties." + path + e + ".items").Exists() {
+ } else if model.Get(prefix + path + e + ".items").Exists() {
path += fmt.Sprintf("%s.items.properties.", e)
} else {
path += e + ".properties."
}
}
+
path += attr.ModelName
- r := model.Get("properties." + path)
+ r := model.Get(prefix + path)
if !r.Exists() {
panic(fmt.Sprintf("Could not find element in schema: %v\n%v\n\n", attr.ModelName, model))
@@ -791,7 +839,7 @@ func parseProfileParcelAttribute(attr *YamlConfigAttribute, model gjson.Result,
// }
} else if t.Get("properties.value.const").String() == "true" || t.Get("properties.value.const").String() == "false" {
attr.Type = "Bool"
- } else if t.Get("properties.value.const").String() == "off" || t.Get("properties.value.const").String() == "on" {
+ } else if t.Get("properties.value.const").String() == "off" || t.Get("properties.value.const").String() == "on" || t.Get("properties.value.const").Exists() {
attr.Type = "String"
} else {
fmt.Printf("WARNING: Unsupported type: %s\n", t.Get("properties.value.type").String())
@@ -878,10 +926,10 @@ func augmentProfileParcelConfig(config *YamlConfig) {
}
if config.DsDescription == "" {
- config.DsDescription = fmt.Sprintf("This data source can read the %s profile parcel.", config.Name)
+ config.DsDescription = fmt.Sprintf("This data source can read the %s %s.", config.Name, CamelCase(config.ParcelType))
}
if config.ResDescription == "" {
- config.ResDescription = fmt.Sprintf("This resource can manage a %s profile parcel.", config.Name)
+ config.ResDescription = fmt.Sprintf("This resource can manage a %s %s.", config.Name, CamelCase(config.ParcelType))
}
}
@@ -1062,7 +1110,9 @@ func main() {
// Iterate over templates and render files
for _, t := range profileParcelTemplates {
- renderTemplate(t.path, t.prefix+SnakeCase(profileParcelConfigs[i].Name)+t.suffix, profileParcelConfigs[i])
+ parcelSuffix := GetProfileParcelSuffix(profileParcelConfigs[i])
+ suffix := fmt.Sprintf(t.suffix, parcelSuffix)
+ renderTemplate(t.path, t.prefix+SnakeCase(profileParcelConfigs[i].Name)+suffix, profileParcelConfigs[i])
}
}
configs["ProfileParcels"] = profileParcelConfigs
diff --git a/gen/models/profile_parcels/application_priority_qos_policy.json b/gen/models/profile_parcels/application_priority_qos.json
similarity index 100%
rename from gen/models/profile_parcels/application_priority_qos_policy.json
rename to gen/models/profile_parcels/application_priority_qos.json
diff --git a/gen/models/profile_parcels/other_thousandeyes.json b/gen/models/profile_parcels/other_thousandeyes.json
new file mode 100644
index 000000000..43ef46535
--- /dev/null
+++ b/gen/models/profile_parcels/other_thousandeyes.json
@@ -0,0 +1,930 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/other/thousandeyes/post/request_schema.json",
+ "title": "thousandeyes Parcel Schema",
+ "description": "thousandeyes profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "virtualApplication": {
+ "description": "Virtual application Instance",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "maxItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "description": "Set the Account Group Token",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 210
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "vpn": {
+ "description": "VPN number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 65530
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "teMgmtIp": {
+ "description": "Set the Agent IP Address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "teMgmtSubnetMask": {
+ "description": "Set the Agent SubnetMask",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "teVpgIp": {
+ "description": "Set the Agent default gateway",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "nameServer": {
+ "description": "Set the name server",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "hostname": {
+ "description": "Set the host name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 235
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "proxyConfig": {
+ "description": "Web Proxy Type Config",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "proxyType": {
+ "description": "Select Web Proxy Type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "static"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "proxyHost": {
+ "description": "Set the Proxy Host",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 174
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "proxyPort": {
+ "description": "Set the Proxy Port",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "proxyType",
+ "proxyHost",
+ "proxyPort"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "proxyType": {
+ "description": "Select Web Proxy Type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "pac"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "pacUrl": {
+ "description": "Set the proxy PAC url",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 183
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "proxyType",
+ "pacUrl"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "proxyType": {
+ "description": "Select Web Proxy Type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "none"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "proxyType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "token",
+ "proxyConfig"
+ ],
+ "additionalProperties": false,
+ "dependencies": {
+ "teMgmtIp": {
+ "properties": {
+ "vpn": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ }
+ }
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+ "teMgmtSubnetMask": {
+ "properties": {
+ "vpn": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ }
+ }
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+ "teVpgIp": {
+ "properties": {
+ "vpn": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ }
+ }
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "teMgmtIp": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "teMgmtSubnetMask": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "if": {
+ "properties": {
+ "teMgmtIp": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "teMgmtSubnetMask": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "vedge-ISR-4221X",
+ "vedge-ISR-4321",
+ "vedge-ISR-4331",
+ "vedge-ISR-4351",
+ "vedge-ISR-4431",
+ "vedge-ISR-4451-X",
+ "vedge-ISR-4461",
+ "vedge-C8200-1N-4T",
+ "vedge-C8200L-1N-4T",
+ "vedge-C8300-1N1S-4T2X",
+ "vedge-C8300-1N1S-6T",
+ "vedge-C8300-2N2S-6T",
+ "vedge-C8300-2N2S-4T2X",
+ "vedge-ISR1100X-6G-XE",
+ "vedge-C8500-12X4QC",
+ "vedge-C8500-12X",
+ "vedge-C8500L-8S4X",
+ "vedge-ASR-1001-X",
+ "vedge-ASR-1002-X",
+ "vedge-ASR-1006-X",
+ "vedge-ASR-1001-HX",
+ "vedge-ASR-1002-HX"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for thousandeyes profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "virtualApplication": [
+ {
+ "token": {
+ "optionType": "global",
+ "value": "qwer"
+ },
+ "vpn": {
+ "optionType": "global",
+ "value": 1
+ },
+ "teMgmtIp": {
+ "optionType": "global",
+ "value": "10.0.0.2"
+ },
+ "teMgmtSubnetMask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ },
+ "teVpgIp": {
+ "optionType": "global",
+ "value": "10.0.0.1"
+ },
+ "nameServer": {
+ "optionType": "global",
+ "value": "77.77.77.71"
+ },
+ "hostname": {
+ "optionType": "global",
+ "value": "thousandeyesHost"
+ },
+ "proxyConfig": {
+ "proxyType": {
+ "optionType": "global",
+ "value": "static"
+ },
+ "proxyHost": {
+ "optionType": "global",
+ "value": "proxy.thousandeyes.com"
+ },
+ "proxyPort": {
+ "optionType": "global",
+ "value": 3128
+ }
+ }
+ }
+ ]
+ },
+ "description": "Cedge Other thousandeyes Parcel config",
+ "name": "thousandeyesParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
diff --git a/gen/models/profile_parcels/other_ucse.json b/gen/models/profile_parcels/other_ucse.json
new file mode 100644
index 000000000..6e62cfd1e
--- /dev/null
+++ b/gen/models/profile_parcels/other_ucse.json
@@ -0,0 +1,760 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/other/ucse/common/request_schema.json",
+ "title": "ucse feature Schema",
+ "description": "ucse profile feature schema for request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "bay": {
+ "description": "Bay",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 2,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "slot": {
+ "description": "Slot",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 3,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "imc": {
+ "type": "object",
+ "properties": {
+ "access-port": {
+ "type": "object",
+ "properties": {
+ "dedicated": {
+ "description": "Dedicated",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sharedLom": {
+ "type": "object",
+ "properties": {
+ "lomType": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "ge1",
+ "ge2",
+ "ge3",
+ "te2",
+ "te3",
+ "console",
+ "failover"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "failOverType": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "ge2",
+ "te2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "ip": {
+ "type": "object",
+ "properties": {
+ "address": {
+ "description": "Assign IPv4 address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(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])"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "defaultGateway": {
+ "description": "Assign default gateway",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "address",
+ "defaultGateway"
+ ],
+ "additionalProperties": false
+ },
+ "vlan": {
+ "type": "object",
+ "properties": {
+ "vlanId": {
+ "description": "Assign Vlan Id",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 2,
+ "maximum": 4095,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "priority": {
+ "description": "Assign priority",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 7,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "interface": {
+ "description": "Interface name: GigabitEthernet0/<>/<> when present",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set Inteface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(ucse)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "l3": {
+ "description": "L3",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ucseInterfaceVpn": {
+ "description": "UCSE Interface VPN",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65527,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "address": {
+ "description": "Assign IPv4 address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(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])"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "slot",
+ "bay"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "vedge-C8300-2N2S-4T2X",
+ "vedge-C8300-1N1S-4T2X",
+ "vedge-C8300-2N2S-6T",
+ "vedge-ISR-4451-X",
+ "vedge-C8300-1N1S-6T",
+ "vedge-ISR-4461",
+ "vedge-ISR-4351",
+ "vedge-ISR-4431",
+ "vedge-ISR-4321",
+ "vedge-ISR-4331",
+ "vedge-ISR-4221",
+ "vedge-ISR-4221X"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for request schema for ucse feature",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "bay": {
+ "optionType": "global",
+ "value": 2
+ },
+ "slot": {
+ "optionType": "global",
+ "value": 0
+ },
+ "imc": {
+ "access-port": {
+ "dedicated": {
+ "optionType": "global",
+ "value": true
+ },
+ "sharedLom": {
+ "lomType": {
+ "optionType": "global",
+ "value": "ge1"
+ },
+ "failOverType": {
+ "optionType": "global",
+ "value": "ge2"
+ }
+ }
+ },
+ "ip": {
+ "address": {
+ "optionType": "global",
+ "value": "2.2.2.2/24"
+ },
+ "defaultGateway": {
+ "optionType": "global",
+ "value": "2.2.2.2"
+ }
+ },
+ "vlan": {
+ "vlanId": {
+ "optionType": "global",
+ "value": 3
+ },
+ "priority": {
+ "optionType": "global",
+ "value": 3
+ }
+ }
+ },
+ "interface": [
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "ucse2/0"
+ },
+ "l3": {
+ "optionType": "default",
+ "value": true
+ },
+ "ucseInterfaceVpn": {
+ "optionType": "global",
+ "value": 2
+ },
+ "address": {
+ "optionType": "global",
+ "value": "10.1.15.15/24"
+ }
+ }
+ ]
+ },
+ "name": "UcsefeatureGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
diff --git a/gen/models/profile_parcels/policy_object_app_list.json b/gen/models/profile_parcels/policy_object_app_list.json
new file mode 100644
index 000000000..5ab182a6d
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_app_list.json
@@ -0,0 +1,101 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/centralized-applist/post/request_schema.json",
+ "title": "Centralized Policy App List Parcel Schema",
+ "description": "Centralized Policy App List profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Centralized Policy App List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "app": {
+ "description": "",
+ "type": "object",
+ "$ref": "#/$defs/oneOfEntriesAppOptionsDef"
+ },
+ "appFamily": {
+ "description": "",
+ "type": "object",
+ "$ref": "#/$defs/oneOfEntriesAppFamilyOptionsDef"
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "app"
+ ]
+ },
+ {
+ "required": [
+ "appFamily"
+ ]
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for Centralized Policy App List profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "app": {
+ "optionType": "global",
+ "value": "3com-amp3"
+ }
+ },
+ {
+ "appFamily": {
+ "optionType": "global",
+ "value": "web"
+ }
+ }
+ ]
+ },
+ "name": "centralized-appListParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_app_probe_class.json b/gen/models/profile_parcels/policy_object_app_probe_class.json
new file mode 100644
index 000000000..5842c13bf
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_app_probe_class.json
@@ -0,0 +1,201 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/app-probe/post/request_schema.json",
+ "title": "app-probe Parcel Schema",
+ "description": "app-probe profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "minLength": 1,
+ "maxLength": 32,
+ "pattern": "^[^&<>! \"]+$",
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "App Probe List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "map": {
+ "description": "Map",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "description": "Color",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "3g",
+ "biz-internet",
+ "blue",
+ "bronze",
+ "custom1",
+ "custom2",
+ "custom3",
+ "default",
+ "gold",
+ "green",
+ "lte",
+ "metro-ethernet",
+ "mpls",
+ "private1",
+ "private2",
+ "private3",
+ "private4",
+ "private5",
+ "private6",
+ "public-internet",
+ "red",
+ "silver"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "dscp": {
+ "description": "DSCP number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 63,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "color"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "forwardingClass": {
+ "description": "Forwarding Class Name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "map",
+ "forwardingClass"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for app-probe profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "map": [
+ {
+ "color": {
+ "optionType": "global",
+ "value": "3g"
+ },
+ "dscp": {
+ "optionType": "global",
+ "value": 45
+ }
+ }
+ ],
+ "forwardingClass": {
+ "optionType": "global",
+ "value": "classlist1"
+ }
+ }
+ ]
+ },
+ "name": "app-probeParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_application_list.json b/gen/models/profile_parcels/policy_object_application_list.json
new file mode 100644
index 000000000..d7a522134
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_application_list.json
@@ -0,0 +1,117 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/centralized-applist/post/request_schema.json",
+ "title": "Centralized Policy App List Parcel Schema",
+ "description": "Centralized Policy App List profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Centralized Policy App List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "app": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "appFamily": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "oneOf": [
+ {
+ "required": ["app"]
+ },
+ {
+ "required": ["appFamily"]
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": ["entries"],
+ "additionalProperties": false
+ }
+ },
+ "required": ["data", "name"],
+ "additionalProperties": false,
+ "propertyNames": {
+ "description": "This is the documentation for POST request schema for Centralized Policy App List profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": {
+ "centralized-appListParcelGlobalDefault": {
+ "value": {
+ "data": {
+ "entries": [
+ {
+ "app": {
+ "optionType": "global",
+ "value": "3com-amp3"
+ }
+ },
+ {
+ "appFamily": {
+ "optionType": "global",
+ "value": "web"
+ }
+ }
+ ]
+ },
+ "name": "centralized-appListParcelGlobalDefault"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/gen/models/profile_parcels/policy_object_as_path_list.json b/gen/models/profile_parcels/policy_object_as_path_list.json
new file mode 100644
index 000000000..51dcce39e
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_as_path_list.json
@@ -0,0 +1,147 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/as-path/common/request_schema.json",
+ "title": "AS Path Parcel Schema",
+ "description": "as path profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "asPathListNum": {
+ "type": "object",
+ "description": "As path List Number",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 500
+ }
+ }
+ },
+ "entries": {
+ "description": "AS Path List",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "asPath": {
+ "description": "",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[^<>]*"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "asPath"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries",
+ "asPathListNum"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for AS Path profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "asPathListNum": {
+ "optionType": "global",
+ "value": 1
+ },
+ "entries": [
+ {
+ "asPath": {
+ "optionType": "global",
+ "value": 110
+ }
+ },
+ {
+ "asPath": {
+ "optionType": "global",
+ "value": 220
+ }
+ }
+ ]
+ },
+ "name": "asPath1"
+ },
+ {
+ "data": {
+ "asPathListNum": {
+ "optionType": "global",
+ "value": 2
+ },
+ "entries": [
+ {
+ "asPath": {
+ "optionType": "global",
+ "value": 1100
+ }
+ },
+ {
+ "asPath": {
+ "optionType": "global",
+ "value": 2200
+ }
+ }
+ ]
+ },
+ "name": "asPath2"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_class_map.json b/gen/models/profile_parcels/policy_object_class_map.json
new file mode 100644
index 000000000..d528864fe
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_class_map.json
@@ -0,0 +1,107 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/class/common/request_schema.json",
+ "title": "Class Map Parcel Schema",
+ "description": "class profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "class map List",
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "queue": {
+ "description": "select a queue",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "0",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "queue"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for class profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "queue": {
+ "optionType": "global",
+ "value": "1"
+ }
+ }
+ ]
+ },
+ "name": "classMapList1"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_color_list.json b/gen/models/profile_parcels/policy_object_color_list.json
new file mode 100644
index 000000000..3d32d2fd6
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_color_list.json
@@ -0,0 +1,121 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/color/post/request_schema.json",
+ "title": "color Parcel Schema",
+ "description": "color profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Color List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "3g",
+ "biz-internet",
+ "blue",
+ "bronze",
+ "custom1",
+ "custom2",
+ "custom3",
+ "default",
+ "gold",
+ "green",
+ "lte",
+ "metro-ethernet",
+ "mpls",
+ "private1",
+ "private2",
+ "private3",
+ "private4",
+ "private5",
+ "private6",
+ "public-internet",
+ "red",
+ "silver"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "color"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for color profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "color": {
+ "optionType": "global",
+ "value": "3g"
+ }
+ }
+ ]
+ },
+ "name": "colorParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_data_ipv4_prefix_list.json b/gen/models/profile_parcels/policy_object_data_ipv4_prefix_list.json
new file mode 100644
index 000000000..f00dd6e10
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_data_ipv4_prefix_list.json
@@ -0,0 +1,122 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/data-prefix/post/request_schema.json",
+ "title": "Ipv4 Data Prefix Parcel Schema",
+ "description": "ipv4 data prefix profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "IPv4 Data Prefix List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ipv4Address": {
+ "description": "IPv4 address",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "ipv4PrefixLength": {
+ "description": "IPv4 prefix Length",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 32,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "ipv4Address",
+ "ipv4PrefixLength"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for ipv4 data prefix profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "ipv4Address": {
+ "optionType": "global",
+ "value": "10.0.0.0"
+ },
+ "ipv4PrefixLength": {
+ "optionType": "global",
+ "value": 8
+ }
+ }
+ ]
+ },
+ "name": "Ipv4DataPrefixList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_data_ipv6_prefix_list.json b/gen/models/profile_parcels/policy_object_data_ipv6_prefix_list.json
new file mode 100644
index 000000000..c0f1baac9
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_data_ipv6_prefix_list.json
@@ -0,0 +1,122 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/data-ipv6-prefix/post/request_schema.json",
+ "title": "Ipv6 Data Prefix Parcel Schema",
+ "description": "Ipv6 data prefix profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "IPv6 Prefix List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ipv6Address": {
+ "description": "IPv6 address",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv6"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "ipv6PrefixLength": {
+ "description": "IPv6 prefix",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 128,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "ipv6Address",
+ "ipv6PrefixLength"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for ipv6 data prefix profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "ipv6Address": {
+ "optionType": "global",
+ "value": "2001:db8:85a3::8a2e:370:7334"
+ },
+ "ipv6PrefixLength": {
+ "optionType": "global",
+ "value": 64
+ }
+ }
+ ]
+ },
+ "name": "Ipv6DataPrefixList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_expanded_community_list.json b/gen/models/profile_parcels/policy_object_expanded_community_list.json
new file mode 100644
index 000000000..208ab2819
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_expanded_community_list.json
@@ -0,0 +1,110 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/expanded-community/common/request_schema.json",
+ "title": "Expanded Community List Parcel Schema",
+ "description": "expanded Community list profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "minProperties": 1,
+ "properties": {
+ "expandedCommunityList": {
+ "description": "Expanded Community List",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "array",
+ "items": {
+ "uniqueItems": true,
+ "type": "string",
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "expandedCommunityList"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for expanded community profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "expandedCommunityList": {
+ "optionType": "global",
+ "value": [
+ "123456any",
+ "abcd"
+ ]
+ }
+ },
+ "name": "expandedCommunityList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_extended_community_list.json b/gen/models/profile_parcels/policy_object_extended_community_list.json
new file mode 100644
index 000000000..a233a60c0
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_extended_community_list.json
@@ -0,0 +1,102 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/ext-community/common/request_schema.json",
+ "title": "Extended Community List Parcel Schema",
+ "description": "extended community list profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Extended Community List",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "extCommunity": {
+ "description": "can be soo 10.0.0.1:30 or rt 500:50 etc.",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^(rt|soo) ([\\d\\.]+):(\\d+)$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "extCommunity"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for extended community profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "extCommunity": {
+ "optionType": "global",
+ "value": "soo 10.0.0.1:30"
+ }
+ },
+ {
+ "extCommunity": {
+ "optionType": "global",
+ "value": "rt 500:50"
+ }
+ }
+ ]
+ },
+ "name": "extCommunityList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_ipv4_prefix_list.json b/gen/models/profile_parcels/policy_object_ipv4_prefix_list.json
new file mode 100644
index 000000000..aa40bb729
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_ipv4_prefix_list.json
@@ -0,0 +1,176 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/prefix/common/request_schema.json",
+ "title": "Ipv4 Prefix Parcel Schema",
+ "description": "Ipv4 prefix profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "IPv4 Prefix List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ipv4Address": {
+ "description": "IPv4 address",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "ipv4PrefixLength": {
+ "description": "IPv4 prefix length",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 32,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "leRangePrefixLength": {
+ "description": "IPv4 prefix length with le range operator",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 32,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "geRangePrefixLength": {
+ "description": "IPv4 prefix length with ge range operator",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 32,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "ipv4Address",
+ "ipv4PrefixLength"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for ipv4 prefix profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "ipv4Address": {
+ "optionType": "global",
+ "value": "10.0.0.0"
+ },
+ "ipv4PrefixLength": {
+ "optionType": "global",
+ "value": 8
+ },
+ "leRangePrefixLength": {
+ "optionType": "global",
+ "value": 24
+ },
+ "geRangePrefixLength": {
+ "optionType": "global",
+ "value": 16
+ }
+ }
+ ]
+ },
+ "name": "Ipv4PrefixList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_ipv6_prefix_list.json b/gen/models/profile_parcels/policy_object_ipv6_prefix_list.json
new file mode 100644
index 000000000..49462649b
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_ipv6_prefix_list.json
@@ -0,0 +1,176 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/ipv6-prefix/common/request_schema.json",
+ "title": "Ipv6 Prefix Parcel Schema",
+ "description": "Ipv6 prefix profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "IPv6 Prefix List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ipv6Address": {
+ "description": "IPv6 address",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv6"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "ipv6PrefixLength": {
+ "description": "IPv6 prefix length",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 128,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "leRangePrefixLength": {
+ "description": "IPv6 prefix length with le range operator",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 128,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "geRangePrefixLength": {
+ "description": "IPv6 prefix length with ge range operator",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 128,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "ipv6Address",
+ "ipv6PrefixLength"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for ipv6 prefix profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "ipv6Address": {
+ "optionType": "global",
+ "value": "2001:db8:85a3::8a2e:370:7334"
+ },
+ "ipv6PrefixLength": {
+ "optionType": "global",
+ "value": 64
+ },
+ "leRangePrefixLength": {
+ "optionType": "global",
+ "value": 100
+ },
+ "geRangePrefixLength": {
+ "optionType": "global",
+ "value": 70
+ }
+ }
+ ]
+ },
+ "name": "Ipv6PrefixList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_mirror.json b/gen/models/profile_parcels/policy_object_mirror.json
new file mode 100644
index 000000000..f0e126e5b
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_mirror.json
@@ -0,0 +1,155 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/mirror/post/request_schema.json",
+ "title": "Mirror Parcel Schema",
+ "description": "mirror profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Mirror List",
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "remoteDestIp": {
+ "description": "remote destination ip address",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "oneOf": [
+ {
+ "format": "ipv4"
+ },
+ {
+ "format": "ipv6"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "sourceIp": {
+ "description": "source ip address",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "oneOf": [
+ {
+ "format": "ipv4"
+ },
+ {
+ "format": "ipv6"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "remoteDestIp",
+ "sourceIp"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for mirror profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "remoteDestIp": {
+ "optionType": "global",
+ "value": "10.0.0.1"
+ },
+ "sourceIp": {
+ "optionType": "global",
+ "value": "10.0.0.2"
+ }
+ }
+ ]
+ },
+ "name": "mirrorList1"
+ },
+ {
+ "data": {
+ "entries": [
+ {
+ "remoteDestIp": {
+ "optionType": "global",
+ "value": "10.0.0.1"
+ },
+ "sourceIp": {
+ "optionType": "global",
+ "value": "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
+ }
+ }
+ ]
+ },
+ "name": "mirrorList2"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_policer.json b/gen/models/profile_parcels/policy_object_policer.json
new file mode 100644
index 000000000..fa22819da
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_policer.json
@@ -0,0 +1,155 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/policer/post/request_schema.json",
+ "title": "Policer Parcel Schema",
+ "description": "policer profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Policer Entries",
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "burst": {
+ "description": "Burst (Bytes)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 15000,
+ "maximum": 10000000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "exceed": {
+ "description": "Exceed options such as Drop or Remark",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "drop",
+ "remark"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "rate": {
+ "description": "Rate (bps)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 8,
+ "maximum": 100000000000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "burst",
+ "exceed",
+ "rate"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for policer profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "burst": {
+ "optionType": "global",
+ "value": 56500
+ },
+ "exceed": {
+ "optionType": "global",
+ "value": "remark"
+ },
+ "rate": {
+ "optionType": "global",
+ "value": 60000
+ }
+ }
+ ]
+ },
+ "name": "PolicerList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_preferred_color_group.json b/gen/models/profile_parcels/policy_object_preferred_color_group.json
new file mode 100644
index 000000000..ed03de4cd
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_preferred_color_group.json
@@ -0,0 +1,360 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/preferred-color-group/post/request_schema.json",
+ "title": "preferred-color-group Parcel Schema",
+ "description": "preferred-color-group profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "minLength": 1,
+ "maxLength": 32,
+ "pattern": "^[^&<>! \"]+$",
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Preferred Color Group List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "primaryPreference": {
+ "description": "Object with an color and path preference",
+ "type": "object",
+ "properties": {
+ "colorPreference": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "enum": [
+ "default",
+ "3g",
+ "biz-internet",
+ "blue",
+ "bronze",
+ "custom1",
+ "custom2",
+ "custom3",
+ "gold",
+ "green",
+ "lte",
+ "metro-ethernet",
+ "mpls",
+ "private1",
+ "private2",
+ "private3",
+ "private4",
+ "private5",
+ "private6",
+ "public-internet",
+ "red",
+ "silver"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "pathPreference": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "all-paths",
+ "direct-path",
+ "multi-hop-path"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "secondaryPreference": {
+ "description": "Object with an color and path preference",
+ "type": "object",
+ "properties": {
+ "colorPreference": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "enum": [
+ "default",
+ "3g",
+ "biz-internet",
+ "blue",
+ "bronze",
+ "custom1",
+ "custom2",
+ "custom3",
+ "gold",
+ "green",
+ "lte",
+ "metro-ethernet",
+ "mpls",
+ "private1",
+ "private2",
+ "private3",
+ "private4",
+ "private5",
+ "private6",
+ "public-internet",
+ "red",
+ "silver"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "pathPreference": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "all-paths",
+ "direct-path",
+ "multi-hop-path"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "tertiaryPreference": {
+ "description": "Object with an color and path preference",
+ "type": "object",
+ "properties": {
+ "colorPreference": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "enum": [
+ "default",
+ "3g",
+ "biz-internet",
+ "blue",
+ "bronze",
+ "custom1",
+ "custom2",
+ "custom3",
+ "gold",
+ "green",
+ "lte",
+ "metro-ethernet",
+ "mpls",
+ "private1",
+ "private2",
+ "private3",
+ "private4",
+ "private5",
+ "private6",
+ "public-internet",
+ "red",
+ "silver"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "pathPreference": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "all-paths",
+ "direct-path",
+ "multi-hop-path"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ }
+ },
+ "required": [
+ "primaryPreference"
+ ],
+ "dependentRequired": {
+ "secondaryPreference": [
+ "primaryPreference"
+ ],
+ "tertiaryPreference": [
+ "primaryPreference",
+ "secondaryPreference"
+ ]
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for preferred-color-group profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "primaryPreference": {
+ "colorPreference": {
+ "optionType": "global",
+ "value": "default 3g biz-internet"
+ },
+ "pathPreference": {
+ "optionType": "global",
+ "value": "direct-path"
+ }
+ },
+ "secondaryPreference": {
+ "colorPreference": {
+ "optionType": "global",
+ "value": "bronze blue"
+ },
+ "pathPreference": {
+ "optionType": "global",
+ "value": "all-paths"
+ }
+ },
+ "tertiaryPreference": {
+ "colorPreference": {
+ "optionType": "global",
+ "value": "bronze blue"
+ },
+ "pathPreference": {
+ "optionType": "global",
+ "value": "all-paths"
+ }
+ }
+ }
+ ]
+ },
+ "name": "preferred-color-groupParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_data_ipv4_prefix_list.json b/gen/models/profile_parcels/policy_object_security_data_ipv4_prefix_list.json
new file mode 100644
index 000000000..89f68d4f8
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_data_ipv4_prefix_list.json
@@ -0,0 +1,120 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-data-ip-prefix/post/request_schema.json",
+ "title": "security-data-ip-prefix Parcel Schema",
+ "description": "security-data-ip-prefix profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ipPrefix": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(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])"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ipPrefix"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-data-ip-prefix profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "ipPrefix": {
+ "optionType": "global",
+ "value": "10.0.0.0/12"
+ }
+ }
+ ]
+ },
+ "name": "security-data-ip-prefixParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_fqdn_list.json b/gen/models/profile_parcels/policy_object_security_fqdn_list.json
new file mode 100644
index 000000000..e4d764579
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_fqdn_list.json
@@ -0,0 +1,103 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-fqdn/post/request_schema.json",
+ "title": "security-fqdn Parcel Schema",
+ "description": "security-data-fqdn-prefix profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "type": "array",
+ "maxItems": 64,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "pattern": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "description": "Must be valid FQDN",
+ "pattern": "^([*][.])?(([a-zA-Z0-9-]+.)+)?([a-zA-Z0-9-])+$",
+ "minLength": 1,
+ "maxLength": 120
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "pattern"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-data-fqdn-prefix profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "pattern": {
+ "optionType": "global",
+ "value": "cisco.com"
+ }
+ }
+ ]
+ },
+ "name": "security-data-fqdn-prefixParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_geolocation_list.json b/gen/models/profile_parcels/policy_object_security_geolocation_list.json
new file mode 100644
index 000000000..f1b7bdb46
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_geolocation_list.json
@@ -0,0 +1,393 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-geolocation/post/request_schema.json",
+ "title": "Geolocation Parcel Schema",
+ "description": "Geolocation profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Geolocation List",
+ "type": "array",
+ "maxItems": 64,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "description": "country names",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "AFG",
+ "ALB",
+ "ATA",
+ "DZA",
+ "ASM",
+ "AND",
+ "AGO",
+ "ATG",
+ "AZE",
+ "ARG",
+ "AUS",
+ "AUT",
+ "BHS",
+ "BHR",
+ "BGD",
+ "ARM",
+ "BRB",
+ "BEL",
+ "BMU",
+ "BTN",
+ "BOL",
+ "BIH",
+ "BWA",
+ "BVT",
+ "BRA",
+ "BLZ",
+ "IOT",
+ "SLB",
+ "VGB",
+ "BRN",
+ "BGR",
+ "MMR",
+ "BDI",
+ "BLR",
+ "KHM",
+ "CMR",
+ "CAN",
+ "CPV",
+ "CYM",
+ "CAF",
+ "LKA",
+ "TCD",
+ "CHL",
+ "CHN",
+ "TWN",
+ "CXR",
+ "CCK",
+ "COL",
+ "COM",
+ "MYT",
+ "COG",
+ "COD",
+ "COK",
+ "CRI",
+ "HRV",
+ "CUB",
+ "CYP",
+ "CZE",
+ "BEN",
+ "DNK",
+ "DMA",
+ "DOM",
+ "ECU",
+ "SLV",
+ "GNQ",
+ "ETH",
+ "ERI",
+ "EST",
+ "FRO",
+ "FLK",
+ "SGS",
+ "FJI",
+ "FIN",
+ "ALA",
+ "FRA",
+ "GUF",
+ "PYF",
+ "ATF",
+ "DJI",
+ "GAB",
+ "GEO",
+ "GMB",
+ "PSE",
+ "DEU",
+ "GHA",
+ "GIB",
+ "KIR",
+ "GRC",
+ "GRL",
+ "GRD",
+ "GLP",
+ "GUM",
+ "GTM",
+ "GIN",
+ "GUY",
+ "HTI",
+ "HMD",
+ "VAT",
+ "HND",
+ "HKG",
+ "HUN",
+ "ISL",
+ "IND",
+ "IDN",
+ "IRN",
+ "IRQ",
+ "IRL",
+ "ISR",
+ "ITA",
+ "CIV",
+ "JAM",
+ "JPN",
+ "KAZ",
+ "JOR",
+ "KEN",
+ "PRK",
+ "KOR",
+ "KWT",
+ "KGZ",
+ "LAO",
+ "LBN",
+ "LSO",
+ "LVA",
+ "LBR",
+ "LBY",
+ "LIE",
+ "LTU",
+ "LUX",
+ "MAC",
+ "MDG",
+ "MWI",
+ "MYS",
+ "MDV",
+ "MLI",
+ "MLT",
+ "MTQ",
+ "MRT",
+ "MUS",
+ "MEX",
+ "MCO",
+ "MNG",
+ "MDA",
+ "MNE",
+ "MSR",
+ "MAR",
+ "MOZ",
+ "OMN",
+ "NAM",
+ "NRU",
+ "NPL",
+ "NLD",
+ "ANT",
+ "CUW",
+ "ABW",
+ "SXM",
+ "BES",
+ "NCL",
+ "VUT",
+ "NZL",
+ "NIC",
+ "NER",
+ "NGA",
+ "NIU",
+ "NFK",
+ "NOR",
+ "MNP",
+ "UMI",
+ "FSM",
+ "MHL",
+ "PLW",
+ "PAK",
+ "PAN",
+ "PNG",
+ "PRY",
+ "PER",
+ "PHL",
+ "PCN",
+ "POL",
+ "PRT",
+ "GNB",
+ "TLS",
+ "PRI",
+ "QAT",
+ "REU",
+ "ROU",
+ "RUS",
+ "RWA",
+ "BLM",
+ "SHN",
+ "KNA",
+ "AIA",
+ "LCA",
+ "MAF",
+ "SPM",
+ "VCT",
+ "SMR",
+ "STP",
+ "SAU",
+ "SEN",
+ "SRB",
+ "SYC",
+ "SLE",
+ "SGP",
+ "SVK",
+ "VNM",
+ "SVN",
+ "SOM",
+ "ZAF",
+ "ZWE",
+ "ESP",
+ "SSD",
+ "ESH",
+ "SDN",
+ "SUR",
+ "SJM",
+ "SWZ",
+ "SWE",
+ "CHE",
+ "SYR",
+ "TJK",
+ "THA",
+ "TGO",
+ "TKL",
+ "TON",
+ "TTO",
+ "ARE",
+ "TUN",
+ "TUR",
+ "TKM",
+ "TCA",
+ "TUV",
+ "UGA",
+ "UKR",
+ "MKD",
+ "EGY",
+ "GBR",
+ "GGY",
+ "JEY",
+ "IMN",
+ "TZA",
+ "USA",
+ "VIR",
+ "BFA",
+ "URY",
+ "UZB",
+ "VEN",
+ "WLF",
+ "WSM",
+ "YEM",
+ "ZMB"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "continent": {
+ "description": "continent name",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "AF",
+ "AN",
+ "AS",
+ "EU",
+ "NA",
+ "OC",
+ "SA"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "country"
+ ]
+ },
+ {
+ "required": [
+ "continent"
+ ]
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for Geolocation profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": {
+ "country": {
+ "optionType": "global",
+ "value": "DZA"
+ },
+ "continent": {
+ "optionType": "global",
+ "value": "AF"
+ }
+ }
+ },
+ "name": "GeolocationParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_identity_list.json b/gen/models/profile_parcels/policy_object_security_identity_list.json
new file mode 100644
index 000000000..d98e86ebf
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_identity_list.json
@@ -0,0 +1,146 @@
+{
+ "request": {
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-identity/post/request_schema.json",
+ "title": "security-identity Parcel Schema",
+ "description": "security-identity profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Array of Users and User Groups",
+ "type": "array",
+ "maxItems": 16,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "user": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "description": "Mustn't contain non standard unicode characters",
+ "pattern": "^.*[a-zA-Z0-9]+.*$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "userGroup": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "description": "Mustn't contain non standard unicode characters",
+ "pattern": "^.*[a-zA-Z0-9]+.*$",
+ "maxLength": 96,
+ "minLength": 1
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "user"
+ ]
+ },
+ {
+ "required": [
+ "userGroup"
+ ]
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-identity profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "user": {
+ "optionType": "global",
+ "value": "administrator"
+ }
+ },
+ {
+ "userGroup": {
+ "optionType": "global",
+ "value": "SDWAN-IDENTITY.CISCO.COM/Users/Domain Guests"
+ }
+ }
+ ]
+ },
+ "name": "testIdentityList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_ips_signature.json b/gen/models/profile_parcels/policy_object_security_ips_signature.json
new file mode 100644
index 000000000..15985616d
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_ips_signature.json
@@ -0,0 +1,131 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-ipssignature/post/request_schema.json",
+ "title": "security-ipssignature Parcel Schema",
+ "description": "security-ipssignature profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Ips Signature",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "generatorId": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^(429496729[0-5]|42949672[0-8]\\d|4294967[01]\\d{2}|429496[0-6]\\d{3}|42949[0-5]\\d{4}|4294[0-8]\\d{5}|429[0-3]\\d{6}|42[0-8]\\d{7}|4[01]\\d{8}|[1-3]\\d{9}|[1-9]\\d{8}|[1-9]\\d{7}|[1-9]\\d{6}|[1-9]\\d{5}|[1-9]\\d{4}|[1-9]\\d{3}|[1-9]\\d{2}|[1-9]\\d|\\d)$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "signatureId": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^(429496729[0-5]|42949672[0-8]\\d|4294967[01]\\d{2}|429496[0-6]\\d{3}|42949[0-5]\\d{4}|4294[0-8]\\d{5}|429[0-3]\\d{6}|42[0-8]\\d{7}|4[01]\\d{8}|[1-3]\\d{9}|[1-9]\\d{8}|[1-9]\\d{7}|[1-9]\\d{6}|[1-9]\\d{5}|[1-9]\\d{4}|[1-9]\\d{3}|[1-9]\\d{2}|[1-9]\\d|\\d)$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "generatorId",
+ "signatureId"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-ipssignature profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "generatorId": {
+ "optionType": "global",
+ "value": "1234"
+ },
+ "signatureId": {
+ "optionType": "global",
+ "value": "5678"
+ }
+ }
+ ]
+ },
+ "name": "security-ipssignatureParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_ipssignature.json b/gen/models/profile_parcels/policy_object_security_ipssignature.json
new file mode 100644
index 000000000..15985616d
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_ipssignature.json
@@ -0,0 +1,131 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-ipssignature/post/request_schema.json",
+ "title": "security-ipssignature Parcel Schema",
+ "description": "security-ipssignature profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Ips Signature",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "generatorId": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^(429496729[0-5]|42949672[0-8]\\d|4294967[01]\\d{2}|429496[0-6]\\d{3}|42949[0-5]\\d{4}|4294[0-8]\\d{5}|429[0-3]\\d{6}|42[0-8]\\d{7}|4[01]\\d{8}|[1-3]\\d{9}|[1-9]\\d{8}|[1-9]\\d{7}|[1-9]\\d{6}|[1-9]\\d{5}|[1-9]\\d{4}|[1-9]\\d{3}|[1-9]\\d{2}|[1-9]\\d|\\d)$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "signatureId": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^(429496729[0-5]|42949672[0-8]\\d|4294967[01]\\d{2}|429496[0-6]\\d{3}|42949[0-5]\\d{4}|4294[0-8]\\d{5}|429[0-3]\\d{6}|42[0-8]\\d{7}|4[01]\\d{8}|[1-3]\\d{9}|[1-9]\\d{8}|[1-9]\\d{7}|[1-9]\\d{6}|[1-9]\\d{5}|[1-9]\\d{4}|[1-9]\\d{3}|[1-9]\\d{2}|[1-9]\\d|\\d)$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "generatorId",
+ "signatureId"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-ipssignature profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "generatorId": {
+ "optionType": "global",
+ "value": "1234"
+ },
+ "signatureId": {
+ "optionType": "global",
+ "value": "5678"
+ }
+ }
+ ]
+ },
+ "name": "security-ipssignatureParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_local_application_list.json b/gen/models/profile_parcels/policy_object_security_local_application_list.json
new file mode 100644
index 000000000..4b96fb3b1
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_local_application_list.json
@@ -0,0 +1,139 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-localapp/post/request_schema.json",
+ "title": "security-localapp Parcel Schema",
+ "description": "security-localapp profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Localapp list",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "app": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "appFamily": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "app"
+ ]
+ },
+ {
+ "required": [
+ "appFamily"
+ ]
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-localapp profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "app": {
+ "optionType": "global",
+ "value": "audible-com"
+ }
+ },
+ {
+ "appFamily": {
+ "optionType": "global",
+ "value": "web"
+ }
+ }
+ ]
+ },
+ "name": "security-localappParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_local_domain_list.json b/gen/models/profile_parcels/policy_object_security_local_domain_list.json
new file mode 100644
index 000000000..3cd73fb49
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_local_domain_list.json
@@ -0,0 +1,108 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-localdomain/post/request_schema.json",
+ "title": "security-localdomain Parcel Schema",
+ "description": "security-localdomain profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "type": "array",
+ "maxItems": 64,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "nameServer": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 240,
+ "description": "Must be valid utd regex. String cannot start with a '*' or a '+', be empty, or be more than 240 characters",
+ "pattern": "^[^*+].*"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "nameServer"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-localdomain profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "nameServer": {
+ "optionType": "global",
+ "value": "hello.com"
+ }
+ },
+ {
+ "nameServer": {
+ "optionType": "global",
+ "value": ".*cisco.com"
+ }
+ }
+ ]
+ },
+ "name": "security-localdomainParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_port_list.json b/gen/models/profile_parcels/policy_object_security_port_list.json
new file mode 100644
index 000000000..929f800b9
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_port_list.json
@@ -0,0 +1,118 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-port/post/request_schema.json",
+ "title": "Port Parcel Schema",
+ "description": "Port profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Port List",
+ "type": "array",
+ "maxItems": 64,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "port": {
+ "description": "can be single port or port range",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
+ },
+ {
+ "type": "string",
+ "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\\-(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "port"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for Port profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "port": {
+ "optionType": "global",
+ "value": "100"
+ }
+ },
+ {
+ "port": {
+ "optionType": "global",
+ "value": "200"
+ }
+ },
+ {
+ "port": {
+ "optionType": "global",
+ "value": "300-400"
+ }
+ }
+ ]
+ },
+ "name": "PortList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_protocolname.json b/gen/models/profile_parcels/policy_object_security_protocolname.json
new file mode 100644
index 000000000..dfb6f253e
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_protocolname.json
@@ -0,0 +1,268 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-protocolname/post/request_schema.json",
+ "title": "security-protocolname Parcel Schema",
+ "description": "security-protocolname profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "type": "array",
+ "maxItems": 64,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocolName": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "snmp",
+ "icmp",
+ "tcp",
+ "udp",
+ "echo",
+ "telnet",
+ "wins",
+ "n2h2server",
+ "nntp",
+ "pptp",
+ "rtsp",
+ "bootpc",
+ "gdoi",
+ "tacacs",
+ "gopher",
+ "icabrowser",
+ "skinny",
+ "sunrpc",
+ "biff",
+ "router",
+ "ircs",
+ "orasrv",
+ "ms-cluster-net",
+ "kermit",
+ "isakmp",
+ "sshell",
+ "realsecure",
+ "ircu",
+ "appleqtc",
+ "pwdgen",
+ "rdb-dbs-disp",
+ "creativepartnr",
+ "finger",
+ "ftps",
+ "giop",
+ "rsvd",
+ "hp-alarm-mgr",
+ "uucp",
+ "kerberos",
+ "imap",
+ "time",
+ "bootps",
+ "tftp",
+ "oracle",
+ "snmptrap",
+ "http",
+ "qmtp",
+ "radius",
+ "oracle-em-vp",
+ "tarantella",
+ "pcanywheredata",
+ "ldap",
+ "mgcp",
+ "sqlsrv",
+ "hsrp",
+ "cisco-net-mgmt",
+ "smtp",
+ "pcanywherestat",
+ "exec",
+ "send",
+ "stun",
+ "syslog",
+ "ms-sql-m",
+ "citrix",
+ "creativeserver",
+ "cifs",
+ "cisco-sys",
+ "cisco-tna",
+ "ms-dotnetster",
+ "gtpv1",
+ "gtpv0",
+ "imap3",
+ "fcip-port",
+ "netbios-dgm",
+ "sip-tls",
+ "pop3s",
+ "cisco-fna",
+ "802-11-iapp",
+ "oem-agent",
+ "cisco-tdp",
+ "tr-rsrb",
+ "r-winsock",
+ "sql-net",
+ "syslog-conn",
+ "tacacs-ds",
+ "h225ras",
+ "ace-svr",
+ "dhcp-failover",
+ "igmpv3lite",
+ "irc-serv",
+ "entrust-svcs",
+ "dbcontrol_agent",
+ "cisco-svcs",
+ "ipsec-msft",
+ "microsoft-ds",
+ "ms-sna",
+ "rsvp_tunnel",
+ "rsvp-encap",
+ "hp-collector",
+ "netbios-ns",
+ "msexch-routing",
+ "h323",
+ "l2tp",
+ "ldap-admin",
+ "pop3",
+ "h323callsigalt",
+ "ms-sql",
+ "iscsi-target",
+ "webster",
+ "lotusnote",
+ "ipx",
+ "entrust-svc-hand",
+ "citriximaclient",
+ "rtc-pm-port",
+ "ftp",
+ "aol",
+ "xdmcp",
+ "oraclenames",
+ "login",
+ "iscsi",
+ "ttc",
+ "imaps",
+ "socks",
+ "ssh",
+ "dnsix",
+ "daytime",
+ "sip",
+ "discard",
+ "ntp",
+ "ldaps",
+ "https",
+ "vdolive",
+ "ica",
+ "net8-cman",
+ "cuseeme",
+ "netstat",
+ "sms",
+ "streamworks",
+ "rtelnet",
+ "who",
+ "kazaa",
+ "ssp",
+ "dbase",
+ "timed",
+ "cddbp",
+ "telnets",
+ "ymsgr",
+ "ident",
+ "bgp",
+ "ddns-v3",
+ "vqp",
+ "irc",
+ "ipass",
+ "x11",
+ "dns",
+ "lotusmtap",
+ "mysql",
+ "nfs",
+ "msnmsgr",
+ "netshow",
+ "sqlserv",
+ "hp-managed-node",
+ "ncp",
+ "shell",
+ "realmedia",
+ "msrpc",
+ "clp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocolName"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-protocolname profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "protocolName": {
+ "optionType": "global",
+ "value": "aol"
+ }
+ }
+ ]
+ },
+ "name": "security-protocolnameParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_scalable_group_tag_list.json b/gen/models/profile_parcels/policy_object_security_scalable_group_tag_list.json
new file mode 100644
index 000000000..aa1767ce2
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_scalable_group_tag_list.json
@@ -0,0 +1,131 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-scalablegrouptag/post/request_schema.json",
+ "title": "security-scalablegrouptag Parcel Schema",
+ "description": "security-scalablegrouptag profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "type": "array",
+ "maxItems": 8,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "sgtName": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "tag": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "sgtName",
+ "tag"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-scalablegrouptag profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "sgtName": {
+ "optionType": "global",
+ "value": "ANY"
+ },
+ "tag": {
+ "optionType": "global",
+ "value": "65535"
+ }
+ }
+ ]
+ },
+ "name": "security-scalablegrouptagParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
diff --git a/gen/models/profile_parcels/policy_object_security_url_list.json b/gen/models/profile_parcels/policy_object_security_url_list.json
new file mode 100644
index 000000000..f1ef9da40
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_url_list.json
@@ -0,0 +1,114 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-urllist/post/request_schema.json",
+ "title": "URL List Parcel Schema",
+ "description": "URL List profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "urlallowed",
+ "urlblocked"
+ ]
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "URL List",
+ "type": "array",
+ "maxItems": 64,
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "pattern": {
+ "description": "valid url pattern",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 240,
+ "pattern": "^[^*+].*"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "pattern"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for URL List profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "pattern": {
+ "optionType": "global",
+ "value": "www.google.com"
+ }
+ },
+ {
+ "pattern": {
+ "optionType": "global",
+ "value": "outlook.com"
+ }
+ }
+ ]
+ },
+ "name": "UrlList"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data",
+ "type"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_security_zone.json b/gen/models/profile_parcels/policy_object_security_zone.json
new file mode 100644
index 000000000..5e10984bb
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_security_zone.json
@@ -0,0 +1,145 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/security-zone/post/request_schema.json",
+ "title": "security-zone Parcel Schema",
+ "description": "security-zone profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32,
+ "pattern": "(?i)^(?:(?!\\b(untrusted|self|default|service)\\b).)*$"
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "minItems": 1,
+ "oneOf": [
+ {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "vpn": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "vpn"
+ ],
+ "additionalProperties": false
+ }
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "interface": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "interface"
+ ],
+ "additionalProperties": false
+ }
+ }
+ ]
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for security-zone profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "vpn": {
+ "optionType": "global",
+ "value": "Guest"
+ }
+ }
+ ]
+ },
+ "name": "zoneList1"
+ },
+ {
+ "data": {
+ "entries": [
+ {
+ "interface": {
+ "optionType": "global",
+ "value": "GigabitEthernet1"
+ }
+ }
+ ]
+ },
+ "name": "zoneList2"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_sla_class_list.json b/gen/models/profile_parcels/policy_object_sla_class_list.json
new file mode 100644
index 000000000..19c68f352
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_sla_class_list.json
@@ -0,0 +1,291 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/post/request_schema.json",
+ "title": "Sla class Parcel Schema",
+ "description": "Sla class profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Sla class List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "latency": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 1000,
+ "type": "integer"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "loss": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 100,
+ "type": "integer"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "jitter": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 1000,
+ "type": "integer"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "appProbeClass": {
+ "description": "App Probe Class Ref",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ },
+ "required": ["refId"],
+ "additionalProperties": false
+ },
+ "fallbackBestTunnel": {
+ "description": "Object with a criteria and variance",
+ "type": "object",
+ "properties": {
+ "criteria": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "default": "low",
+ "enum": [
+ "jitter",
+ "latency",
+ "loss",
+ "loss-latency",
+ "loss-jitter",
+ "latency-loss",
+ "latency-jitter",
+ "jitter-latency",
+ "jitter-loss",
+ "loss-latency-jitter",
+ "loss-jitter-latency",
+ "latency-loss-jitter",
+ "latency-jitter-loss",
+ "jitter-latency-loss",
+ "jitter-loss-latency"
+ ],
+ "type": "string"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "lossVariance": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 100,
+ "type": "integer"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "latencyVariance": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 1000,
+ "type": "integer"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "jitterVariance": {
+ "description": "",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 1000,
+ "type": "integer"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ }
+ },
+ "anyOf": [
+ {
+ "required": ["latency"]
+ },
+ {
+ "required": ["loss"]
+ },
+ {
+ "required": ["jitter"]
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": ["entries"],
+ "additionalProperties": false
+ }
+ },
+ "required": ["data", "name"],
+ "additionalProperties": false,
+ "propertyNames": {
+ "description": "This is the documentation for POST request schema for Sla class profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": {
+ "centralized-slaclassParcelGlobalDefault": {
+ "value": {
+ "data": {
+ "entries": [
+ {
+ "latency": {
+ "optionType": "global",
+ "value": 2
+ },
+ "loss": {
+ "optionType": "global",
+ "value": 1
+ },
+ "jitter": {
+ "optionType": "global",
+ "value": 3
+ },
+ "appProbeClass": {
+ "refId": {
+ "optionType": "global",
+ "value": "b61d994e-7f6d-4ba0-a061-3a87cd32219a"
+ }
+ },
+ "fallbackBestTunnel": {
+ "criteria": {
+ "optionType": "global",
+ "value": "loss"
+ },
+ "lossVariance": {
+ "optionType": "global",
+ "value": 5
+ }
+ }
+ }
+ ]
+ },
+ "name": "centralized-slaclassParcelGlobalDefault"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/gen/models/profile_parcels/policy_object_standard_community_list.json b/gen/models/profile_parcels/policy_object_standard_community_list.json
new file mode 100644
index 000000000..8424af8f0
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_standard_community_list.json
@@ -0,0 +1,102 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/standard-community/common/request_schema.json",
+ "title": "Standard Community List Parcel Schema",
+ "description": "standard Community list profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "Standard Community List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "standardCommunity": {
+ "type": "object",
+ "description": "Standard Community",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "enum": [
+ "internet",
+ "local-AS",
+ "no-advertise",
+ "no-export"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "pattern": "^(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5]):(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"
+ }
+ ]
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ },
+ "required": ["standardCommunity"],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": ["entries"],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for standard community profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "standardCommunity": {
+ "optionType": "global",
+ "value": "1000:10000"
+ }
+ },
+ {
+ "standardCommunity": {
+ "optionType": "global",
+ "value": "internet"
+ }
+ }
+ ]
+ },
+ "name": "standardCommunityList1"
+ }
+ ]
+ }
+ },
+ "required": ["name", "data"],
+ "not": {
+ "required": ["documentation"]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_tloc_list.json b/gen/models/profile_parcels/policy_object_tloc_list.json
new file mode 100644
index 000000000..df9f2dd6b
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_tloc_list.json
@@ -0,0 +1,212 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/tloc/post/request_schema.json",
+ "title": "tloc Parcel Schema",
+ "description": "tloc profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "minLength": 1,
+ "maxLength": 32,
+ "pattern": "^[^&<>! \"]+$",
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "TLOC List",
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "tloc": {
+ "description": "tloc",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "color": {
+ "description": "color",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "3g",
+ "biz-internet",
+ "blue",
+ "bronze",
+ "custom1",
+ "custom2",
+ "custom3",
+ "default",
+ "gold",
+ "green",
+ "lte",
+ "metro-ethernet",
+ "mpls",
+ "private1",
+ "private2",
+ "private3",
+ "private4",
+ "private5",
+ "private6",
+ "public-internet",
+ "red",
+ "silver"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "encap": {
+ "description": "encapsulation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "ipsec",
+ "gre"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "preference": {
+ "description": "Preference",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "tloc",
+ "color",
+ "encap"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for tloc profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "tloc": {
+ "optionType": "global",
+ "value": "10.0.0.0"
+ },
+ "color": {
+ "optionType": "global",
+ "value": "3g"
+ },
+ "encap": {
+ "optionType": "global",
+ "value": "gre"
+ },
+ "preference": {
+ "optionType": "global",
+ "value": "33"
+ }
+ }
+ ]
+ },
+ "name": "tlocParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "name"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/policy_object_vpn_group.json b/gen/models/profile_parcels/policy_object_vpn_group.json
new file mode 100644
index 000000000..19dc0783d
--- /dev/null
+++ b/gen/models/profile_parcels/policy_object_vpn_group.json
@@ -0,0 +1,117 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/policy-object/vpn-group/common/request_schema.json",
+ "title": "VPN List Parcel Schema",
+ "description": "vpn list profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "entries": {
+ "description": "VPN List",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "vpn": {
+ "description": "can be single vpn id or vpn id range",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 65530
+ },
+ {
+ "type": "string",
+ "pattern": "^(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|65530)\\-(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|65530)$"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "vpn"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "entries"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for vpn profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "entries": [
+ {
+ "vpn": {
+ "optionType": "global",
+ "value": 100
+ }
+ },
+ {
+ "vpn": {
+ "optionType": "global",
+ "value": 200
+ }
+ },
+ {
+ "vpn": {
+ "optionType": "global",
+ "value": "300-400"
+ }
+ }
+ ]
+ },
+ "name": "vpnList1"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/service_object_tracker.json b/gen/models/profile_parcels/service_object_tracker.json
new file mode 100644
index 000000000..bd040c5f8
--- /dev/null
+++ b/gen/models/profile_parcels/service_object_tracker.json
@@ -0,0 +1,419 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/objecttracker/common/request_schema.json",
+ "title": "common object tracker Feature Schema",
+ "description": "object tracker profile feature schema for common request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set the tracker name",
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "objectId": {
+ "description": "Object tracker ID",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["variable"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "default": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 2048
+ },
+ "description": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 1000
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "objectTrackerType": {
+ "description": "objectTrackerType:Interface SIG Route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "enum": ["Interface", "SIG", "Route"],
+ "type": "string"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interface": {
+ "description": "interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["variable"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "default": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 2048
+ },
+ "description": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routeIp": {
+ "description": "IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["variable"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "default": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 2048
+ },
+ "description": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routeMask": {
+ "description": "IP mask",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["variable"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "default": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 2048
+ },
+ "description": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["default"]
+ },
+ "value": {
+ "enum": ["0.0.0.0"],
+ "type": "string"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "vpn": {
+ "description": "VPN",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 65530
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["variable"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "default": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 2048
+ },
+ "description": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["default"]
+ }
+ },
+ "required": ["optionType"],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "objectTrackerType": {
+ "properties": {
+ "value": {
+ "const": "Interface"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": ["objectId", "interface"]
+ }
+ },
+ {
+ "if": {
+ "properties": {
+ "objectTrackerType": {
+ "properties": {
+ "value": {
+ "const": "Route"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": ["objectId", "routeIp", "routeMask", "vpn"]
+ }
+ },
+ {
+ "if": {
+ "properties": {
+ "objectTrackerType": {
+ "properties": {
+ "value": {
+ "const": "SIG"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": ["objectId"]
+ }
+ }
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for common request schema for common LAN VPN profile feature",
+ "examples": [
+ {
+ "name": "zjtest-object-tracker-interface",
+ "description": "zjtest-object-tracker-interface",
+ "data": {
+ "objectId": {
+ "optionType": "global",
+ "value": 10
+ },
+ "interface": {
+ "optionType": "global",
+ "value": "GigabitEthernet1"
+ },
+ "objectTrackerType": {
+ "optionType": "global",
+ "value": "Interface"
+ }
+ }
+ }
+ ]
+ },
+ "metadata": {
+ "minVManageVersion": "20.15.1"
+ }
+ },
+ "required": ["data"],
+ "not": {
+ "required": ["documentation", "metadata"]
+ },
+ "additionalProperties": false
+ }
+}
diff --git a/gen/models/profile_parcels/service_object_tracker_group.json b/gen/models/profile_parcels/service_object_tracker_group.json
new file mode 100644
index 000000000..ba8a893f6
--- /dev/null
+++ b/gen/models/profile_parcels/service_object_tracker_group.json
@@ -0,0 +1,221 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/objecttrackergroup/common/request_schema.json",
+ "title": "common object tracker group Schema",
+ "description": "common Object TrackerGroup profile feature schema for common request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set the feature name",
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "description": "Set the parcel description",
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "objectId": {
+ "description": "Object ID",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["variable"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "default": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 2048
+ },
+ "description": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 1000
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "trackerRefs": {
+ "description": "Group Tracks ID Refs",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "trackerRef": {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ },
+ "required": ["refId"],
+ "additionalProperties": false
+ }
+ },
+ "required": ["trackerRef"],
+ "additionalProperties": false
+ },
+ "minItems": 2,
+ "maxItems": 2,
+ "uniqueItems": true
+ },
+ "criteria": {
+ "description": "tracker ref list criteria boolean and or",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["variable"]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "default": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 2048
+ },
+ "description": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["global"]
+ },
+ "value": {
+ "type": "string",
+ "enum": ["and", "or"]
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": ["default"]
+ },
+ "value": {
+ "type": "string",
+ "enum": ["or"]
+ }
+ },
+ "required": ["optionType", "value"],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": ["objectId", "trackerRefs", "criteria"],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "parcelRefDefinition": [
+ {
+ "refIdPath": "data.trackerRefs[*].trackerRef",
+ "parcelType": ["objecttracker"]
+ }
+ ],
+ "minVManageVersion": "20.15.1"
+ },
+ "documentation": {
+ "description": "This is the documentation for common request schema for common LAN VPN profile feature",
+ "examples": [
+ {
+ "data": {
+ "objectId": {
+ "optionType": "global",
+ "value": 12
+ },
+ "trackerRefs": [
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ }
+ },
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec12"
+ }
+ }
+ }
+ ],
+ "combineBoolean": {
+ "optionType": "global",
+ "value": "and"
+ }
+ },
+ "description": "common_object_track_group_cedge_parcel_1",
+ "name": "common_object_track_group_cedge_parcel_1"
+ }
+ ]
+ }
+ },
+ "required": ["name", "data"],
+ "not": {
+ "required": ["metadata", "documentation"]
+ },
+ "additionalProperties": false
+ }
+}
diff --git a/gen/models/profile_parcels/service_route_policy.json b/gen/models/profile_parcels/service_route_policy.json
new file mode 100644
index 000000000..f72232741
--- /dev/null
+++ b/gen/models/profile_parcels/service_route_policy.json
@@ -0,0 +1,1397 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/route-policy/common/request_schema.json",
+ "title": "Route Policy Parcel Schema",
+ "description": "Route policy profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "defaultAction": {
+ "description": "Default Action",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "reject",
+ "enum": [
+ "reject",
+ "accept"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "reject"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sequences": {
+ "description": "Route Policy List",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "sequenceId": {
+ "description": "Sequence Id",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65536,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sequenceName": {
+ "description": "Sequence Name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 19
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "baseAction": {
+ "description": "Base Action",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "reject",
+ "enum": [
+ "reject",
+ "accept"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "reject"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "protocol": {
+ "description": "protocol such as IPV4, IPV6, or BOTH",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "IPV4",
+ "enum": [
+ "IPV4",
+ "IPV6",
+ "BOTH"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "IPV4"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "matchEntries": {
+ "description": "Define match conditions",
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "minProperties": 1,
+ "properties": {
+ "asPathList": {
+ "description": "As Path List",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "communityList": {
+ "description": "Community List",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "criteria": {
+ "description": "Select a condition such as OR, AND or EXACT",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "OR",
+ "enum": [
+ "OR",
+ "AND",
+ "EXACT"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "OR"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "standardCommunityList": {
+ "description": "Select a standard community list",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "criteria",
+ "standardCommunityList"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "expandedCommunityList": {
+ "description": "Select a expanded community list",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "expandedCommunityList"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "extCommunityList": {
+ "description": "Extended Community List",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "bgpLocalPreference": {
+ "description": "BGP Local Preference",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Select Metric",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ompTag": {
+ "description": "Select OMP Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ospfTag": {
+ "description": "Select OSPF Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ipv4Address": {
+ "description": "Ipv4 Address",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "ipv4NextHop": {
+ "description": "Ipv4 Next Hop",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "ipv6Address": {
+ "description": "Ipv6 Address",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "ipv6NextHop": {
+ "description": "Ipv6 Next Hop",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ }
+ },
+ "actions": {
+ "description": "Define list of actions",
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "accept": {
+ "description": "Accept Action",
+ "type": "object",
+ "properties": {
+ "enableAcceptAction": {
+ "description": "Enable Accept Action",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "setAsPath": {
+ "description": "Set AS Path",
+ "type": "object",
+ "properties": {
+ "prepend": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "items": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 4294967295
+ },
+ "additionalProperties": false,
+ "uniqueItems": false,
+ "type": "array",
+ "minItems": 1
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "setCommunity": {
+ "description": "Set Community",
+ "type": "object",
+ "properties": {
+ "additive": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "community": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "array",
+ "items": {
+ "uniqueItems": true,
+ "type": "string",
+ "oneOf": [
+ {
+ "enum": [
+ "internet",
+ "local-AS",
+ "no-advertise",
+ "no-export"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "pattern": "^(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5]):(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"
+ }
+ ]
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "setLocalPreference": {
+ "description": "Set Local Preference",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setMetric": {
+ "description": "Set Metric",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setMetricType": {
+ "description": "Set Metric Type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setOmpTag": {
+ "description": "Set OMP Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setOrigin": {
+ "description": "Set Origin",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "EGP",
+ "IGP",
+ "Incomplete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setOspfTag": {
+ "description": "Set OSPF Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setWeight": {
+ "description": "Set Weight",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setIpv4NextHop": {
+ "description": "Set Ipv4 Next Hop",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setIpv6NextHop": {
+ "description": "Set Ipv6 Next Hop",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv6"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "enableAcceptAction"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "accept"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "reject": {
+ "description": "Reject Action",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "reject"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "sequenceId",
+ "sequenceName",
+ "baseAction",
+ "protocol"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "defaultAction"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "asr",
+ "c1100",
+ "c8000be",
+ "csr1000v",
+ "ir8100",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for route policy profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "defaultAction": {
+ "optionType": "default",
+ "value": "reject"
+ },
+ "sequences": [
+ {
+ "sequenceId": {
+ "optionType": "global",
+ "value": 1
+ },
+ "sequenceName": {
+ "optionType": "global",
+ "value": "Route1"
+ },
+ "baseAction": {
+ "optionType": "default",
+ "value": "reject"
+ },
+ "protocol": {
+ "optionType": "default",
+ "value": "IPV4"
+ },
+ "matchEntries": [
+ {
+ "ipv4Address": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "asPathList": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "communityList": {
+ "criteria": {
+ "optionType": "default",
+ "value": "OR"
+ },
+ "standardCommunityList": [
+ {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D52C"
+ }
+ }
+ ]
+ },
+ "extCommunityList": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "bgpLocalPreference": {
+ "optionType": "global",
+ "value": 100
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 1000
+ },
+ "ipv4NextHop": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "ompTag": {
+ "optionType": "global",
+ "value": 10000
+ },
+ "ospfTag": {
+ "optionType": "global",
+ "value": 20000
+ }
+ }
+ ],
+ "actions": [
+ {
+ "accept": {
+ "enableAcceptAction": {
+ "optionType": "default",
+ "value": true
+ },
+ "setAsPath": {
+ "prepend": {
+ "optionType": "global",
+ "value": [
+ 65521,
+ 65521
+ ]
+ }
+ },
+ "setCommunity": {
+ "community": {
+ "optionType": "global",
+ "value": "internet"
+ },
+ "additive": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "setLocalPreference": {
+ "optionType": "global",
+ "value": 100
+ },
+ "setMetric": {
+ "optionType": "global",
+ "value": 20
+ },
+ "setMetricType": {
+ "optionType": "global",
+ "value": "type1"
+ },
+ "setIpv4NextHop": {
+ "optionType": "global",
+ "value": "10.0.0.1"
+ },
+ "setOmpTag": {
+ "optionType": "global",
+ "value": 200
+ },
+ "setOrigin": {
+ "optionType": "global",
+ "value": "EGP"
+ },
+ "setOspfTag": {
+ "optionType": "global",
+ "value": 1200
+ },
+ "setWeight": {
+ "optionType": "global",
+ "value": 2200
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "route1"
+ },
+ {
+ "data": {
+ "defaultAction": {
+ "optionType": "default",
+ "value": "reject"
+ },
+ "sequences": [
+ {
+ "sequenceId": {
+ "optionType": "global",
+ "value": 11
+ },
+ "sequenceName": {
+ "optionType": "global",
+ "value": "Route2"
+ },
+ "baseAction": {
+ "optionType": "global",
+ "value": "reject"
+ },
+ "protocol": {
+ "optionType": "default",
+ "value": "IPV6"
+ },
+ "matchEntries": [
+ {
+ "ipv6Address": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "communityList": {
+ "expandedCommunityList": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ }
+ },
+ "ipv6NextHop": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ }
+ }
+ ],
+ "actions": [
+ {
+ "reject": {
+ "optionType": "default",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "route2"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/service_routing_bgp.json b/gen/models/profile_parcels/service_routing_bgp.json
new file mode 100644
index 000000000..48c2daf96
--- /dev/null
+++ b/gen/models/profile_parcels/service_routing_bgp.json
@@ -0,0 +1,5966 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/service/routing/bgp/common/request_schema.json",
+ "title": "routing/bgp Parcel Schema",
+ "description": "routing/bgp profile parcel schema for request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "asNum": {
+ "description": "Set autonomous system number <1..4294967295> or ",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ },
+ {
+ "type": "string",
+ "pattern": "^([1-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\\.([0-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routerId": {
+ "description": "Configure BGP router identifier",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "propagateAspath": {
+ "description": "Propagate AS Path",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "propagateCommunity": {
+ "description": "Propagate Community",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "external": {
+ "description": "Set administrative distance for external BGP routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 20,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 20,
+ "maximum": 20
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "internal": {
+ "description": "Set administrative distance for internal BGP routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "local": {
+ "description": "Set administrative distance for local BGP routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 20,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 20,
+ "maximum": 20
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "keepalive": {
+ "description": "Interval (seconds) of keepalive messages sent to its BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 60,
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 60,
+ "maximum": 60
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "holdtime": {
+ "description": "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 180,
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 180,
+ "maximum": 180,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "alwaysCompare": {
+ "description": "Compare MEDs from all ASs when selecting active BGP paths",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deterministic": {
+ "description": "Compare MEDs from all routes from same AS when selecting active BGP paths",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "missingAsWorst": {
+ "description": "If path has no MED, consider it to be worst path when selecting active BGP paths",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "compareRouterId": {
+ "description": "Compare router IDs when selecting active BGP paths",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "multipathRelax": {
+ "description": "Ignore AS for multipath selection",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "neighbor": {
+ "description": "Set BGP IPv4 neighbors",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "address": {
+ "description": "Set neighbor address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "description": {
+ "description": "Set description",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "shutdown": {
+ "description": "Enable or disable a BGP neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "remoteAs": {
+ "description": "Set remote autonomous system number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ },
+ {
+ "type": "string",
+ "pattern": "^([1-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\\.([0-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "localAs": {
+ "description": "Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ },
+ {
+ "type": "string",
+ "pattern": "^([1-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\\.([0-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "keepalive": {
+ "description": "Interval (seconds) of keepalive messages sent to its BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 60,
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 60,
+ "maximum": 60
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "holdtime": {
+ "description": "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 180,
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 180,
+ "maximum": 180,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ifName": {
+ "description": "Source interface name for BGP neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "nextHopSelf": {
+ "description": "Set router to be next hop for routes advertised to neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sendCommunity": {
+ "description": "Send community attribute",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sendExtCommunity": {
+ "description": "Send extended community attribute",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ebgpMultihop": {
+ "description": "Set TTL value for peers that are not directly connected",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 1
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "password": {
+ "description": "Set MD5 password on TCP connection with BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 25
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sendLabel": {
+ "description": "Send label",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "asOverride": {
+ "description": "Override matching AS-number while sending update",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "asNumber": {
+ "description": "The number of accept as-path with my AS present in it",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 10,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "addressFamily": {
+ "description": "Set BGP address family",
+ "type": "array",
+ "uniqueItems": true,
+ "maxItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "familyType": {
+ "description": "Set IPv4 unicast address family",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "ipv4-unicast"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "maxPrefixConfig": {
+ "description": "Set maximum number of prefixes accepted from BGP peer and threshold exceeded policy actions(restart or warning)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "policyType": {
+ "description": "Neighbor received maximum prefix policy is disabled.",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "off"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "policyType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "policyType": {
+ "description": "Neighbor maximum prefix policy is enabled, when maximum prefix threshold is exceeded, policy action is restarting device.",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "restart"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "prefixNum": {
+ "description": "Set maximum number of prefixes accepted from BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "threshold": {
+ "description": "Set threshold(1 to 100) at which to generate a warning message",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 75,
+ "minimum": 1,
+ "maximum": 100,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 75,
+ "maximum": 75,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "restartInterval": {
+ "description": "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "policyType",
+ "prefixNum",
+ "threshold",
+ "restartInterval"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "policyType": {
+ "description": "Neighbor maximum prefix policy is enabled, when maximum prefix threshold is exceeded, policy action is warning-only or disable-peer.",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "warning-only",
+ "disable-peer"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "prefixNum": {
+ "description": "Set maximum number of prefixes accepted from BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "threshold": {
+ "description": "Set threshold(1 to 100) at which to generate a warning message",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 75,
+ "minimum": 1,
+ "maximum": 100,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 75,
+ "maximum": 75,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "policyType",
+ "prefixNum",
+ "threshold"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "inRoutePolicy": {
+ "description": "In direction route policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "outRoutePolicy": {
+ "description": "out direction route policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "familyType"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "address",
+ "remoteAs"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ipv6Neighbor": {
+ "description": "Set BGP IPv6 neighbors",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "address": {
+ "description": "Set IPv6 neighbor address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv6"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "description": {
+ "description": "Set description",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "shutdown": {
+ "description": "Enable or disable a BGP neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "remoteAs": {
+ "description": "Set remote autonomous system number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ },
+ {
+ "type": "string",
+ "pattern": "^([1-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\\.([0-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "localAs": {
+ "description": "Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "oneOf": [
+ {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ },
+ {
+ "type": "string",
+ "pattern": "^([1-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\\.([0-9]|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
+ }
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "keepalive": {
+ "description": "Set how often to advertise keepalive messages to BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 60,
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 60,
+ "maximum": 60
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "holdtime": {
+ "description": "Set how long to wait since receiving a keepalive message to consider BGP peer unavailable",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 180,
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 180,
+ "maximum": 180,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ifName": {
+ "description": "Source interface name for BGP neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "nextHopSelf": {
+ "description": "Set router to be next hop for routes advertised to neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sendCommunity": {
+ "description": "Send community attribute",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sendExtCommunity": {
+ "description": "Send extended community attribute",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ebgpMultihop": {
+ "description": "Set TTL value for peers that are not directly connected",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 1
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "password": {
+ "description": "Set MD5 password on TCP connection with BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 25
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "asOverride": {
+ "description": "Override matching AS-number while sending update",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "asNumber": {
+ "description": "The number of accept as-path with my AS present in it",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 10,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "addressFamily": {
+ "description": "Set IPv6 BGP address family",
+ "type": "array",
+ "uniqueItems": true,
+ "maxItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "familyType": {
+ "description": "Set IPv6 unicast address family",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "ipv6-unicast"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "maxPrefixConfig": {
+ "description": "Set maximum number of prefixes accepted from BGP peer and threshold exceeded policy actions(restart or warning)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "policyType": {
+ "description": "Neighbor received maximum prefix policy is disabled.",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "off"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "policyType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "policyType": {
+ "description": "Neighbor maximum prefix policy is enabled, when maximum prefix threshold is exceeded, policy action is restarting device.",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "const": "restart"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "prefixNum": {
+ "description": "Set maximum number of prefixes accepted from BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "threshold": {
+ "description": "Set threshold(1 to 100) at which to generate a warning message",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 75,
+ "minimum": 1,
+ "maximum": 100,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 75,
+ "maximum": 75,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "restartInterval": {
+ "description": "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "policyType",
+ "prefixNum",
+ "threshold",
+ "restartInterval"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "policyType": {
+ "description": "Neighbor maximum prefix policy is enabled, when maximum prefix threshold is exceeded, policy action is warning-only or disable-peer.",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "warning-only",
+ "disable-peer"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "prefixNum": {
+ "description": "Set maximum number of prefixes accepted from BGP peer",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "threshold": {
+ "description": "Set threshold(1 to 100) at which to generate a warning message",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 75,
+ "minimum": 1,
+ "maximum": 100,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 75,
+ "maximum": 75,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "policyType",
+ "prefixNum",
+ "threshold"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "inRoutePolicy": {
+ "description": "In direction route policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "outRoutePolicy": {
+ "description": "out direction route policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "familyType"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "address",
+ "remoteAs"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "addressFamily": {
+ "description": "Set IPv4 unicast BGP address family",
+ "type": "object",
+ "properties": {
+ "aggregateAddress": {
+ "description": "Aggregate prefixes in specific range",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "prefix": {
+ "description": "Configure the IPv4 prefixes to aggregate",
+ "type": "object",
+ "properties": {
+ "address": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "mask": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "address",
+ "mask"
+ ],
+ "additionalProperties": false
+ },
+ "asSet": {
+ "description": "Set AS set path information",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "summaryOnly": {
+ "description": "Filter out more specific routes from updates",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "prefix"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "network": {
+ "description": "Configure the networks for BGP to advertise",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "prefix": {
+ "description": "Configure the prefixes for BGP to announce",
+ "type": "object",
+ "properties": {
+ "address": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "mask": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "address",
+ "mask"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "prefix"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "paths": {
+ "description": "Set maximum number of parallel IBGP paths for multipath load sharing",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 32,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "originate": {
+ "description": "BGP Default Information Originate",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "name": {
+ "description": "Table Map Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "redistribute": {
+ "description": "Redistribute routes into BGP",
+ "type": "array",
+ "uniqueItems": true,
+ "maxItems": 7,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol to redistribute routes from",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "static",
+ "connected",
+ "omp",
+ "nat",
+ "ospf",
+ "ospfv3",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Configure policy to apply to prefixes received from BGP neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "ipv6AddressFamily": {
+ "description": "Set BGP address family",
+ "type": "object",
+ "properties": {
+ "ipv6AggregateAddress": {
+ "description": "IPv6 Aggregate prefixes in specific range",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "prefix": {
+ "description": "Configure the IPv6 prefixes to aggregate",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "((^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*(\/)(\\b([0-9]{1,2}|1[01][0-9]|12[0-8])\\b)$))"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "asSet": {
+ "description": "Set AS set path information",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "summaryOnly": {
+ "description": "Filter out more specific routes from updates",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "prefix"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ipv6Network": {
+ "description": "Configure the networks for BGP to advertise",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "prefix": {
+ "description": "Configure the prefixes for BGP to announce",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "((^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*(\/)(\\b([0-9]{1,2}|1[01][0-9]|12[0-8])\\b)$))"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "prefix"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "paths": {
+ "description": "Set maximum number of parallel IBGP paths for multipath load sharing",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 32,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "originate": {
+ "description": "BGP Default Information Originate",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "name": {
+ "description": "Table Map Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "redistribute": {
+ "description": "Redistribute routes into BGP",
+ "type": "array",
+ "uniqueItems": true,
+ "maxItems": 5,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol to redistribute routes from",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "static",
+ "connected",
+ "ospf",
+ "omp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Configure policy to apply to prefixes received from BGP neighbor",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "asNum"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "asr",
+ "c1100",
+ "c8000be",
+ "csr1000v",
+ "ir8100",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for request schema for routing/bgp profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "asNum": {
+ "optionType": "variable",
+ "value": "{{asNum}}"
+ },
+ "routerId": {
+ "optionType": "global",
+ "value": "1.1.1.1"
+ },
+ "propagateAspath": {
+ "optionType": "global",
+ "value": true
+ },
+ "propagateCommunity": {
+ "optionType": "global",
+ "value": true
+ },
+ "external": {
+ "optionType": "global",
+ "value": 30
+ },
+ "internal": {
+ "optionType": "default",
+ "value": 200
+ },
+ "local": {
+ "optionType": "default",
+ "value": 20
+ },
+ "keepalive": {
+ "optionType": "global",
+ "value": 50
+ },
+ "holdtime": {
+ "optionType": "global",
+ "value": 120
+ },
+ "alwaysCompare": {
+ "optionType": "global",
+ "value": true
+ },
+ "deterministic": {
+ "optionType": "global",
+ "value": true
+ },
+ "missingAsWorst": {
+ "optionType": "global",
+ "value": true
+ },
+ "compareRouterId": {
+ "optionType": "global",
+ "value": true
+ },
+ "multipathRelax": {
+ "optionType": "global",
+ "value": true
+ },
+ "neighbor": [
+ {
+ "address": {
+ "optionType": "global",
+ "value": "10.1.1.2"
+ },
+ "description": {
+ "optionType": "global",
+ "value": "neighbor1"
+ },
+ "shutdown": {
+ "optionType": "default",
+ "value": false
+ },
+ "remoteAs": {
+ "optionType": "global",
+ "value": 200
+ },
+ "localAs": {
+ "optionType": "global",
+ "value": 300
+ },
+ "keepalive": {
+ "optionType": "global",
+ "value": 30
+ },
+ "holdtime": {
+ "optionType": "global",
+ "value": 140
+ },
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet0"
+ },
+ "nextHopSelf": {
+ "optionType": "global",
+ "value": true
+ },
+ "sendCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "sendExtCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "ebgpMultihop": {
+ "optionType": "global",
+ "value": 2
+ },
+ "password": {
+ "optionType": "global",
+ "value": "myPassword"
+ },
+ "sendLabel": {
+ "optionType": "global",
+ "value": true
+ },
+ "asOverride": {
+ "optionType": "global",
+ "value": true
+ },
+ "asNumber": {
+ "optionType": "global",
+ "value": 3
+ },
+ "addressFamily": [
+ {
+ "familyType": {
+ "optionType": "global",
+ "value": "ipv4-unicast"
+ },
+ "maxPrefixConfig": {
+ "policyType": {
+ "optionType": "global",
+ "value": "warning-only"
+ },
+ "prefixNum": {
+ "optionType": "global",
+ "value": 8000
+ },
+ "threshold": {
+ "optionType": "global",
+ "value": 80
+ }
+ },
+ "inRoutePolicy": {
+ "optionType": "default"
+ },
+ "outRoutePolicy": {
+ "optionType": "default"
+ }
+ }
+ ]
+ },
+ {
+ "address": {
+ "optionType": "global",
+ "value": "20.1.1.2"
+ },
+ "description": {
+ "optionType": "default"
+ },
+ "shutdown": {
+ "optionType": "global",
+ "value": true
+ },
+ "remoteAs": {
+ "optionType": "global",
+ "value": 100
+ },
+ "keepalive": {
+ "optionType": "global",
+ "value": 50
+ },
+ "holdtime": {
+ "optionType": "global",
+ "value": 100
+ },
+ "ifName": {
+ "optionType": "global",
+ "value": "Vlan10"
+ },
+ "nextHopSelf": {
+ "optionType": "default",
+ "value": false
+ },
+ "sendCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "sendExtCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "ebgpMultihop": {
+ "optionType": "default",
+ "value": 1
+ },
+ "password": {
+ "optionType": "global",
+ "value": "myPassword123k1j2lkjlaljd"
+ },
+ "sendLabel": {
+ "optionType": "global",
+ "value": true
+ },
+ "asOverride": {
+ "optionType": "default",
+ "value": false
+ },
+ "asNumber": {
+ "optionType": "global",
+ "value": 1
+ },
+ "addressFamily": [
+ {
+ "familyType": {
+ "optionType": "global",
+ "value": "ipv4-unicast"
+ },
+ "maxPrefixConfig": {
+ "policyType": {
+ "optionType": "global",
+ "value": "restart"
+ },
+ "prefixNum": {
+ "optionType": "global",
+ "value": 1000
+ },
+ "threshold": {
+ "optionType": "global",
+ "value": 80
+ },
+ "restartInterval": {
+ "optionType": "global",
+ "value": 20
+ }
+ },
+ "inRoutePolicy": {
+ "optionType": "default"
+ },
+ "outRoutePolicy": {
+ "optionType": "default"
+ }
+ }
+ ]
+ }
+ ],
+ "addressFamily": {
+ "aggregateAddress": [
+ {
+ "prefix": {
+ "address": {
+ "optionType": "global",
+ "value": "10.10.0.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.0.0"
+ }
+ },
+ "asSet": {
+ "optionType": "default",
+ "value": false
+ },
+ "summaryOnly": {
+ "optionType": "default",
+ "value": false
+ }
+ }
+ ],
+ "network": [
+ {
+ "prefix": {
+ "address": {
+ "optionType": "global",
+ "value": "100.2.2.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ }
+ }
+ ],
+ "paths": {
+ "optionType": "global",
+ "value": 3
+ },
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "name": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "static"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "ospf"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "ospfv3"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "eigrp"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "nat"
+ }
+ }
+ ]
+ },
+ "ipv6Neighbor": [
+ {
+ "address": {
+ "optionType": "global",
+ "value": "2001::1"
+ },
+ "description": {
+ "optionType": "global",
+ "value": "ipv6 neighbor"
+ },
+ "shutdown": {
+ "optionType": "default",
+ "value": false
+ },
+ "remoteAs": {
+ "optionType": "global",
+ "value": 200
+ },
+ "keepalive": {
+ "optionType": "global",
+ "value": 30
+ },
+ "holdtime": {
+ "optionType": "global",
+ "value": 60
+ },
+ "ifName": {
+ "optionType": "global",
+ "value": "Loopback1"
+ },
+ "nextHopSelf": {
+ "optionType": "global",
+ "value": true
+ },
+ "sendCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "sendExtCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "ebgpMultihop": {
+ "optionType": "default",
+ "value": 1
+ },
+ "password": {
+ "optionType": "global",
+ "value": "myPassword2"
+ },
+ "asOverride": {
+ "optionType": "global",
+ "value": true
+ },
+ "asNumber": {
+ "optionType": "global",
+ "value": 3
+ },
+ "addressFamily": [
+ {
+ "familyType": {
+ "optionType": "global",
+ "value": "ipv6-unicast"
+ },
+ "maxPrefixConfig": {
+ "policyType": {
+ "optionType": "global",
+ "value": "disable-peer"
+ },
+ "prefixNum": {
+ "optionType": "global",
+ "value": 1000
+ },
+ "threshold": {
+ "optionType": "global",
+ "value": 80
+ }
+ },
+ "inRoutePolicy": {
+ "optionType": "default"
+ },
+ "outRoutePolicy": {
+ "optionType": "default"
+ }
+ }
+ ]
+ },
+ {
+ "address": {
+ "optionType": "global",
+ "value": "5001::1"
+ },
+ "description": {
+ "optionType": "global",
+ "value": "ipv6 neighbor"
+ },
+ "shutdown": {
+ "optionType": "default",
+ "value": false
+ },
+ "remoteAs": {
+ "optionType": "global",
+ "value": 300
+ },
+ "keepalive": {
+ "optionType": "default",
+ "value": 60
+ },
+ "holdtime": {
+ "optionType": "default",
+ "value": 180
+ },
+ "ifName": {
+ "optionType": "default"
+ },
+ "nextHopSelf": {
+ "optionType": "default",
+ "value": false
+ },
+ "sendCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "sendExtCommunity": {
+ "optionType": "default",
+ "value": true
+ },
+ "ebgpMultihop": {
+ "optionType": "default",
+ "value": 1
+ },
+ "password": {
+ "optionType": "default"
+ },
+ "asOverride": {
+ "optionType": "global",
+ "value": true
+ },
+ "asNumber": {
+ "optionType": "global",
+ "value": 3
+ },
+ "addressFamily": [
+ {
+ "familyType": {
+ "optionType": "global",
+ "value": "ipv6-unicast"
+ },
+ "inRoutePolicy": {
+ "optionType": "default"
+ },
+ "outRoutePolicy": {
+ "optionType": "default"
+ }
+ }
+ ]
+ }
+ ],
+ "ipv6AddressFamily": {
+ "ipv6AggregateAddress": [
+ {
+ "prefix": {
+ "optionType": "global",
+ "value": "3001::1/128"
+ },
+ "asSet": {
+ "optionType": "default",
+ "value": false
+ },
+ "summaryOnly": {
+ "optionType": "default",
+ "value": false
+ }
+ }
+ ],
+ "ipv6Network": [
+ {
+ "prefix": {
+ "optionType": "global",
+ "value": "2001:0DB8:0000:000b::/64"
+ }
+ },
+ {
+ "prefix": {
+ "optionType": "global",
+ "value": "3002:0DB8:0000:000b::/64"
+ }
+ }
+ ],
+ "paths": {
+ "optionType": "global",
+ "value": 2
+ },
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "name": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "static"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "ospf"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "eigrp"
+ }
+ }
+ ]
+ }
+ },
+ "name": "ServiceBgpParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/service_routing_ospf.json b/gen/models/profile_parcels/service_routing_ospf.json
new file mode 100644
index 000000000..9f9e60d4a
--- /dev/null
+++ b/gen/models/profile_parcels/service_routing_ospf.json
@@ -0,0 +1,2581 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospf/common/request_schema.json",
+ "title": "Routing Ospf Parcel Schema",
+ "description": "routing ospf profile parcel schema for request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "rfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "originate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "external": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 110,
+ "minimum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interArea": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 110,
+ "minimum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraArea": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 110,
+ "minimum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 200,
+ "minimum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 1000,
+ "minimum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 10000,
+ "minimum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "static",
+ "connected",
+ "bgp",
+ "omp",
+ "nat",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "dia": {
+ "description": "Enable NAT DIA for redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false,
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "const": "nat"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": [
+ "protocol",
+ "dia"
+ ]
+ },
+ "else": {
+ "required": [
+ "protocol"
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "routerLsa": {
+ "description": "Advertise own router LSA with infinite distance",
+ "type": "array",
+ "uniqueItems": true,
+ "maxItems": 2,
+ "items": {
+ "type": "object",
+ "properties": {
+ "adType": {
+ "description": "Set the router LSA advertisement type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "administrative",
+ "on-startup"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "time": {
+ "description": "Set how long to advertise maximum metric after router starts up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "adType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "routePolicy": {
+ "description": "Route Policy",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPF area",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "aNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "aType": {
+ "description": "set the area type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "stub",
+ "nssa"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noSummary": {
+ "description": "Do not inject interarea routes into STUB or NSSA",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interface": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 10,
+ "minimum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 40,
+ "minimum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 5,
+ "minimum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "priority": {
+ "description": "Set router’s priority to be elected as designated router",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1,
+ "minimum": 0,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 1,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "network": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "broadcast",
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "broadcast"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "type": {
+ "description": "Set OSPF interface authentication type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "message-digest"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "messageDigestKey": {
+ "description": "Set MD5 message digest key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "md5": {
+ "description": "Set MD5 authentication key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "maxLength": 127,
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "range": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "address": {
+ "description": "Set matching prefix",
+ "type": "object",
+ "properties": {
+ "ipAddress": {
+ "description": "IP Address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "subnetMask": {
+ "description": "Subnet Mask",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "dependencies": {
+ "ipAddress": {
+ "required": [
+ "subnetMask"
+ ]
+ },
+ "subnetMask": {
+ "required": [
+ "ipAddress"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "dependencies": {
+ "address": {
+ "required": [
+ "noAdvertise"
+ ]
+ },
+ "noAdvertise": {
+ "required": [
+ "address"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "aNum"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "asr",
+ "c1100",
+ "c8000be",
+ "csr1000v",
+ "ir8100",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for request schema for Ospf profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.2.3.4"
+ },
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 101
+ },
+ "rfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "originate": {
+ "optionType": "default",
+ "value": false
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "default"
+ },
+ "metricType": {
+ "optionType": "default"
+ },
+ "external": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interArea": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraArea": {
+ "optionType": "default",
+ "value": 110
+ },
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "default",
+ "value": 1000
+ },
+ "maxHold": {
+ "optionType": "default",
+ "value": 10000
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "static"
+ },
+ "dia": {
+ "optionType": "default",
+ "value": true
+ }
+ }
+ ],
+ "routerLsa": [
+ {
+ "adType": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "time": {
+ "optionType": "global",
+ "value": 5
+ }
+ }
+ ],
+ "area": [
+ {
+ "aNum": {
+ "optionType": "global",
+ "value": 1
+ },
+ "aType": {
+ "optionType": "default"
+ },
+ "noSummary": {
+ "optionType": "default",
+ "value": false
+ },
+ "interface": [
+ {
+ "name": {
+ "optionType": "global",
+ "value": "GigabitEthernet2"
+ },
+ "helloInterval": {
+ "optionType": "default",
+ "value": 10
+ },
+ "deadInterval": {
+ "optionType": "default",
+ "value": 40
+ },
+ "retransmitInterval": {
+ "optionType": "default",
+ "value": 5
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "priority": {
+ "optionType": "default",
+ "value": 1
+ },
+ "network": {
+ "optionType": "default",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "default",
+ "value": false
+ },
+ "type": {
+ "optionType": "global",
+ "value": "message-digest"
+ },
+ "messageDigestKey": {
+ "optionType": "global",
+ "value": 7
+ },
+ "md5": {
+ "optionType": "global",
+ "value": "sdjfhsghbjdjr"
+ }
+ }
+ ],
+ "range": [
+ {
+ "address": {
+ "ipAddress": {
+ "optionType": "global",
+ "value": "10.1.1.0"
+ },
+ "subnetMask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 1
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "ServiceOspfParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/service_routing_ospfv3_ipv4.json b/gen/models/profile_parcels/service_routing_ospfv3_ipv4.json
new file mode 100644
index 000000000..e2b375808
--- /dev/null
+++ b/gen/models/profile_parcels/service_routing_ospfv3_ipv4.json
@@ -0,0 +1,3222 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospfv3/ipv4/common/request_schema.json",
+ "title": "Routing protocol OSPFv3 for IPv4 Address family feature schema",
+ "description": "Routing protocol OSPFv3 for IPv4 Address family feature schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 256
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "basic": {
+ "description": "basic configuration",
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "distance": {
+ "description": "Distance",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "externalDistance": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interAreaDistance": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraAreaDistance": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "advanced": {
+ "description": "advanced configuration",
+ "type": "object",
+ "properties": {
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "compatibleRfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "defaultOriginate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF disabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF enabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route metric type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "originate"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "spfTimers": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "properties": {
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1000,
+ "maximum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10000,
+ "maximum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "policyName": {
+ "description": "Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "nat-route",
+ "bgp",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "natDia": {
+ "description": "Enable NAT DIA for redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false,
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "const": "nat-route"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": [
+ "protocol",
+ "natDia"
+ ]
+ }
+ },
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "bgp",
+ "eigrp"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "not": {
+ "required": [
+ "natDia"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ },
+ "maxMetricRouterLsa": {
+ "description": "Sets the protocol to advertise a maximum metric so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Not advertise maximum metric Router LSA policy by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "const": "disabled"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric Router LSA immediately",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "immediately"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric router LSA after router start up with configured duration time(seconds)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "on-startup"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "onStartUpTime": {
+ "description": "Set how long to advertise maximum metric after router boot up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "action",
+ "onStartUpTime"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPFv3 IPv4 area",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "areaNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "areaTypeConfig": {
+ "description": "Set OSPFv3 area type(stub/nssa/normal)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "areaType": {
+ "description": "stub area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "stub"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "NSSA area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "nssa"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "alwaysTranslate": {
+ "description": "Always translate type7 LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "Normal area type, area number 0 only support normal area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "normal"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interfaces": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10,
+ "maximum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 40,
+ "maximum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 5,
+ "maximum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "networkType": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authenticationConfig": {
+ "description": "Set OSPF interface authentication configuration",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "authType": {
+ "description": "No Authentication by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "no-auth"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "authType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "authType": {
+ "description": "IPSec authentication with SHA1",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ipsec-sha1"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "spi": {
+ "description": "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 256,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authKey": {
+ "description": "Set OSPF interface authentication IPSEC key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]{40}$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "authType",
+ "spi",
+ "authKey"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ranges": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "network": {
+ "description": "Ipv4 network",
+ "type": "object",
+ "properties": {
+ "address": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "mask": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "address",
+ "mask"
+ ],
+ "additionalProperties": false
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "network",
+ "noAdvertise"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "areaNum",
+ "interfaces"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "area"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "metadata": {},
+ "documentation": {
+ "description": "This is the documentation for request schema for OSPFv3 feature",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "name": "LAN_OSPFv3_IPv4_AF",
+ "description": "LAN OSPFv3 IPv4 address family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.1.1.1"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "default",
+ "value": 100
+ },
+ "compatibleRfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 10
+ },
+ "metricType": {
+ "optionType": "global",
+ "value": "type2"
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1100
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 9000
+ }
+ },
+ "policyName": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ },
+ "filter": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "bgp"
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "nat-route"
+ },
+ "natDia": {
+ "optionType": "default",
+ "value": true
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b90"
+ }
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "onStartUpTime": {
+ "optionType": "global",
+ "value": 30
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "global",
+ "value": 10
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "nssa"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ },
+ "alwaysTranslate": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet2"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 100
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "default",
+ "value": false
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "default",
+ "value": "no-auth"
+ }
+ }
+ },
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet3"
+ },
+ "helloInterval": {
+ "optionType": "default",
+ "value": 10
+ },
+ "deadInterval": {
+ "optionType": "default",
+ "value": 40
+ },
+ "retransmitInterval": {
+ "optionType": "default",
+ "value": 5
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "global",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "global",
+ "value": "ipsec-sha1"
+ },
+ "spi": {
+ "optionType": "global",
+ "value": 261
+ },
+ "authKey": {
+ "optionType": "global",
+ "value": "0123456789012345678901234567890123456789"
+ }
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "address": {
+ "optionType": "global",
+ "value": "10.2.2.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ {
+ "network": {
+ "address": {
+ "optionType": "global",
+ "value": "10.2.2.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "noAdvertise": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "name": "WAN_OSPFv3_IPv4_AF",
+ "description": "WAN OSPFv3 IPv4 address family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "2.1.1.1"
+ },
+ "distance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_distance}}"
+ },
+ "externalDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_external_distance}}"
+ },
+ "interAreaDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_inter_area_distance}}"
+ },
+ "intraAreaDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_intra_area_distance}}"
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "default",
+ "value": 100
+ },
+ "compatibleRfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 10
+ },
+ "metricType": {
+ "optionType": "global",
+ "value": "type2"
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1100
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 9000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_redis_protocal_0}}"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_redis_protocal_1}}"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "nat-route"
+ },
+ "natDia": {
+ "optionType": "default",
+ "value": true
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "default",
+ "value": "disabled"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_area_0_areanum}}"
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "nssa"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ },
+ "alwaysTranslate": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_area_0_intf_0_ifname}}"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 100
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "global",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "global",
+ "value": "ipsec-sha1"
+ },
+ "spi": {
+ "optionType": "global",
+ "value": 261
+ },
+ "authKey": {
+ "optionType": "global",
+ "value": "0123456789012345678901234567890123456789"
+ }
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "address": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_address}}"
+ },
+ "mask": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_mask}}"
+ }
+ },
+ "cost": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_cost}}"
+ },
+ "noAdvertise": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_noadvertise}}"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/service_routing_ospfv3_ipv6.json b/gen/models/profile_parcels/service_routing_ospfv3_ipv6.json
new file mode 100644
index 000000000..1642dee66
--- /dev/null
+++ b/gen/models/profile_parcels/service_routing_ospfv3_ipv6.json
@@ -0,0 +1,2862 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospfv3/ipv6/common/request_schema.json",
+ "title": "Routing protocol OSPFv3 for IPv6 Address family feature schema",
+ "description": "Routing protocol OSPFv3 for IPv6 Address family feature schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 256
+ },
+ "data": {
+ "description": "IPv6 address family configuration",
+ "type": "object",
+ "properties": {
+ "basic": {
+ "description": "basic configuration",
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "distance": {
+ "description": "Distance",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "externalDistance": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interAreaDistance": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraAreaDistance": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "advanced": {
+ "description": "advanced configuration",
+ "type": "object",
+ "properties": {
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "compatibleRfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "defaultOriginate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF disabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF enabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route metric type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "originate"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "spfTimers": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "properties": {
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1000,
+ "maximum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10000,
+ "maximum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "policyName": {
+ "description": "Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "bgp",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "maxMetricRouterLsa": {
+ "description": "Sets the protocol to advertise a maximum metric so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Not advertise maximum metric Router LSA policy by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "const": "disabled"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric Router LSA immediately",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "immediately"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric router LSA after router start up with configured duration time(seconds)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "on-startup"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "onStartUpTime": {
+ "description": "Set how long to advertise maximum metric after router boot up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "action",
+ "onStartUpTime"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPFv3 IPv6 area",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "areaNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "areaTypeConfig": {
+ "description": "Set OSPFv3 area type(stub/nssa/normal)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "areaType": {
+ "description": "stub area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "stub"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "NSSA area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "nssa"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "alwaysTranslate": {
+ "description": "Always translate type7 LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "Normal area type, area number 0 only support normal area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "normal"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interfaces": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10,
+ "maximum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 40,
+ "maximum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 5,
+ "maximum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "networkType": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authenticationConfig": {
+ "description": "Set OSPF interface authentication configuration",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "authType": {
+ "description": "No Authentication by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "no-auth"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "authType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "authType": {
+ "description": "IPSec authentication with SHA1",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ipsec-sha1"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "spi": {
+ "description": "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 256,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authKey": {
+ "description": "Set OSPF interface authentication IPSEC key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]{40}$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "authType",
+ "spi",
+ "authKey"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ranges": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "network": {
+ "description": "IPv6 prefix,for example 2001::/64",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "((^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*(\/)(\\b([0-9]{1,2}|1[01][0-9]|12[0-8])\\b)$))"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "network",
+ "noAdvertise"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "areaNum",
+ "interfaces"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "area"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {},
+ "documentation": {
+ "description": "This is the documentation for request schema for OSPFv3 feature",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "name": "LAN_OSPFv3_IPv6",
+ "description": "LAN OSPFv3 IPv6 Address Family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.1.1.2"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 200
+ },
+ "compatibleRfc1583": {
+ "optionType": "global",
+ "value": false
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "global",
+ "value": 300
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1400
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 11000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "onStartUpTime": {
+ "optionType": "variable",
+ "value": "{{onStartUpTime}}"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "global",
+ "value": 20
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "stub"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet4"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 40
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "optionType": "global",
+ "value": "3002::/96"
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ {
+ "network": {
+ "optionType": "global",
+ "value": "2002::/96"
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "noAdvertise": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "name": "WAN_OSPFv3_IPv6",
+ "description": "WAN OSPFv3 IPv6 Address Family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "3.1.1.2"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 200
+ },
+ "compatibleRfc1583": {
+ "optionType": "global",
+ "value": false
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "global",
+ "value": 300
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1400
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 11000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "static"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "immediately"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv6_area_0_areanum}}"
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "stub"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv6_area_0_intf_0_ifname}}"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 40
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ],
+ "ranges": []
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/service_switchport.json b/gen/models/profile_parcels/service_switchport.json
new file mode 100644
index 000000000..9da9daa47
--- /dev/null
+++ b/gen/models/profile_parcels/service_switchport.json
@@ -0,0 +1,1656 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/service/switchport/post/request_schema.json",
+ "title": "SwitchPort Parcel Schema",
+ "description": "SwitchPort profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "interface": {
+ "description": "Interface name: GigabitEthernet0/<>/<> when present",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set Interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 32,
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "mode": {
+ "description": "Set type of switch port: access/trunk",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "access",
+ "trunk"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "shutdown": {
+ "description": "Administrative state",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "speed": {
+ "description": "Set interface speed",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "10",
+ "100",
+ "1000",
+ "2500",
+ "10000"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "duplex": {
+ "description": "Duplex mode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "full",
+ "half"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "switchportAccessVlan": {
+ "description": "Set VLAN identifier associated with bridging domain",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4094,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "switchportTrunkAllowedVlans": {
+ "description": "Configure VLAN IDs used with the trunk",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^(?:[1-9]\\d{0,2}|[1-3]\\d{3}|40(?:[0-8]\\d|9[0-4]))(?:[,-](?:[1-9]\\d{0,2}|[1-3]\\d{3}|40(?:[0-8]\\d|9[0-4])))*$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "switchportTrunkNativeVlan": {
+ "description": "Configure VLAN ID used for native VLAN",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4094,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "portControl": {
+ "description": "Set Port-Control Mode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "force-authorized",
+ "enum": [
+ "auto",
+ "force-unauthorized",
+ "force-authorized"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "voiceVlan": {
+ "description": "Configure Voice Vlan",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4094,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "paeEnable": {
+ "description": "Set 802.1x Interface Pae Type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "macAuthenticationBypass": {
+ "description": "MAC Authentication Bypass",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "hostMode": {
+ "description": "Set host mode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "single-host",
+ "enum": [
+ "single-host",
+ "multi-auth",
+ "multi-host",
+ "multi-domain"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "enablePeriodicReauth": {
+ "description": "Enable Periodic Reauthentication",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "inactivity": {
+ "description": "Periodic Reauthentication Inactivity Timeout (in seconds)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "reauthentication": {
+ "description": "Periodic Reauthentication Interval (in seconds)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 3600,
+ "minimum": 1,
+ "maximum": 1073741823,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 3600,
+ "maximum": 3600
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "controlDirection": {
+ "description": "Set uni or bi directional authorization mode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "both",
+ "enum": [
+ "both",
+ "in"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "restrictedVlan": {
+ "description": "Set Restricted VLAN ID",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4094,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "guestVlan": {
+ "description": "Set vlan to drop non-802.1x enabled clients into if client is not in MAB list",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4094,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "criticalVlan": {
+ "description": "Set Critical VLAN",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4094,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "enableVoice": {
+ "description": "Enable Critical Voice VLAN",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ageTime": {
+ "description": "Set when a MAC table entry ages out (0 to disable, 10-1000000 otherwise)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 300,
+ "minimum": 0,
+ "maximum": 1000000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 300,
+ "maximum": 300
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "staticMacAddress": {
+ "description": "Add static MAC address entries for interface",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "macaddr": {
+ "description": "Set MAC address in xxxx.xxxx.xxxx format",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "vlan": {
+ "description": "Configure VLAN ID used with the mac and interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 4094,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ifName": {
+ "description": "Interface name: GigabitEthernet0/<>/<>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "macaddr",
+ "vlan"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "c1100",
+ "c8000be",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for Switchport profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "interface": {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet"
+ },
+ "mode": {
+ "optionType": "global",
+ "value": "access"
+ },
+ "shutdown": {
+ "optionType": "default",
+ "value": true
+ },
+ "speed": {
+ "optionType": "global",
+ "value": "10"
+ },
+ "duplex": {
+ "optionType": "global",
+ "value": "full"
+ },
+ "switchportAccessVlan": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "vlans": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "switchportTrunkNativeVlan": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "portControl": {
+ "optionType": "default",
+ "value": "auto"
+ },
+ "voiceVlan": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "paeEnable": {
+ "optionType": "default",
+ "value": true
+ },
+ "macAuthenticationBypass": {
+ "optionType": "default",
+ "value": false
+ },
+ "hostMode": {
+ "optionType": "default",
+ "value": "single-host"
+ },
+ "enablePeriodicReauth": {
+ "optionType": "default",
+ "value": false
+ },
+ "inactivity": {
+ "optionType": "default",
+ "value": 60
+ },
+ "reauthentication": {
+ "optionType": "global",
+ "value": "0"
+ },
+ "controlDirection": {
+ "optionType": "default",
+ "value": "both"
+ },
+ "restrictedVlan": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "guestVlan": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "criticalVlan": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "enableVoice": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "ageTime": {
+ "optionType": "default",
+ "value": 300
+ },
+ "staticMacAddress": {
+ "macaddr": {
+ "optionType": "global",
+ "value": "xxx"
+ },
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet0/0/0"
+ },
+ "vlan": {
+ "optionType": "global",
+ "value": "1"
+ }
+ }
+ },
+ "name": "SwitchPortParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/service_tracker_group.json b/gen/models/profile_parcels/service_tracker_group.json
new file mode 100644
index 000000000..410e43273
--- /dev/null
+++ b/gen/models/profile_parcels/service_tracker_group.json
@@ -0,0 +1,199 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/trackergroup/common/request_schema.json",
+ "title": "common tracker group Schema",
+ "description": "TrackerGroup profile parcel schema for common request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set the parcel name",
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "description": "Set the parcel description",
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "trackerRefs": {
+ "description": "tracker parcel ref list",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "trackerRef": {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "trackerRef"
+ ],
+ "additionalProperties": false
+ },
+ "minItems": 2,
+ "maxItems": 2,
+ "uniqueItems": true
+ },
+ "combineBoolean": {
+ "description": "tracker ref list combine boolean and or",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "and",
+ "or"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "or"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "trackerRefs",
+ "combineBoolean"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "parcelRefDefinition": [
+ {
+ "refIdPath": "data.trackerRefs[*].trackerRef",
+ "parcelType": [
+ "tracker"
+ ]
+ }
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for common request schema for common LAN/WAN VPN profile parcel",
+ "examples": [
+ {
+ "data": {
+ "trackerRefs": [
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ }
+ },
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec12"
+ }
+ }
+ }
+ ],
+ "combineBoolean": {
+ "optionType": "global",
+ "value": "and"
+ }
+ },
+ "description": "common_track_group_cedge_parcel_1",
+ "name": "common_track_group_cedge_parcel_1"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/tranport_routing_ospfv3_ipv4.json b/gen/models/profile_parcels/tranport_routing_ospfv3_ipv4.json
new file mode 100644
index 000000000..e2b375808
--- /dev/null
+++ b/gen/models/profile_parcels/tranport_routing_ospfv3_ipv4.json
@@ -0,0 +1,3222 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospfv3/ipv4/common/request_schema.json",
+ "title": "Routing protocol OSPFv3 for IPv4 Address family feature schema",
+ "description": "Routing protocol OSPFv3 for IPv4 Address family feature schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 256
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "basic": {
+ "description": "basic configuration",
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "distance": {
+ "description": "Distance",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "externalDistance": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interAreaDistance": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraAreaDistance": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "advanced": {
+ "description": "advanced configuration",
+ "type": "object",
+ "properties": {
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "compatibleRfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "defaultOriginate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF disabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF enabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route metric type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "originate"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "spfTimers": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "properties": {
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1000,
+ "maximum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10000,
+ "maximum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "policyName": {
+ "description": "Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "nat-route",
+ "bgp",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "natDia": {
+ "description": "Enable NAT DIA for redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false,
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "const": "nat-route"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": [
+ "protocol",
+ "natDia"
+ ]
+ }
+ },
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "bgp",
+ "eigrp"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "not": {
+ "required": [
+ "natDia"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ },
+ "maxMetricRouterLsa": {
+ "description": "Sets the protocol to advertise a maximum metric so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Not advertise maximum metric Router LSA policy by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "const": "disabled"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric Router LSA immediately",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "immediately"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric router LSA after router start up with configured duration time(seconds)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "on-startup"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "onStartUpTime": {
+ "description": "Set how long to advertise maximum metric after router boot up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "action",
+ "onStartUpTime"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPFv3 IPv4 area",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "areaNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "areaTypeConfig": {
+ "description": "Set OSPFv3 area type(stub/nssa/normal)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "areaType": {
+ "description": "stub area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "stub"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "NSSA area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "nssa"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "alwaysTranslate": {
+ "description": "Always translate type7 LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "Normal area type, area number 0 only support normal area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "normal"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interfaces": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10,
+ "maximum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 40,
+ "maximum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 5,
+ "maximum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "networkType": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authenticationConfig": {
+ "description": "Set OSPF interface authentication configuration",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "authType": {
+ "description": "No Authentication by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "no-auth"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "authType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "authType": {
+ "description": "IPSec authentication with SHA1",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ipsec-sha1"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "spi": {
+ "description": "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 256,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authKey": {
+ "description": "Set OSPF interface authentication IPSEC key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]{40}$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "authType",
+ "spi",
+ "authKey"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ranges": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "network": {
+ "description": "Ipv4 network",
+ "type": "object",
+ "properties": {
+ "address": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "mask": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "address",
+ "mask"
+ ],
+ "additionalProperties": false
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "network",
+ "noAdvertise"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "areaNum",
+ "interfaces"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "area"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "metadata": {},
+ "documentation": {
+ "description": "This is the documentation for request schema for OSPFv3 feature",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "name": "LAN_OSPFv3_IPv4_AF",
+ "description": "LAN OSPFv3 IPv4 address family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.1.1.1"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "default",
+ "value": 100
+ },
+ "compatibleRfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 10
+ },
+ "metricType": {
+ "optionType": "global",
+ "value": "type2"
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1100
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 9000
+ }
+ },
+ "policyName": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ },
+ "filter": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "bgp"
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "nat-route"
+ },
+ "natDia": {
+ "optionType": "default",
+ "value": true
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b90"
+ }
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "onStartUpTime": {
+ "optionType": "global",
+ "value": 30
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "global",
+ "value": 10
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "nssa"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ },
+ "alwaysTranslate": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet2"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 100
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "default",
+ "value": false
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "default",
+ "value": "no-auth"
+ }
+ }
+ },
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet3"
+ },
+ "helloInterval": {
+ "optionType": "default",
+ "value": 10
+ },
+ "deadInterval": {
+ "optionType": "default",
+ "value": 40
+ },
+ "retransmitInterval": {
+ "optionType": "default",
+ "value": 5
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "global",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "global",
+ "value": "ipsec-sha1"
+ },
+ "spi": {
+ "optionType": "global",
+ "value": 261
+ },
+ "authKey": {
+ "optionType": "global",
+ "value": "0123456789012345678901234567890123456789"
+ }
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "address": {
+ "optionType": "global",
+ "value": "10.2.2.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ {
+ "network": {
+ "address": {
+ "optionType": "global",
+ "value": "10.2.2.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "noAdvertise": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "name": "WAN_OSPFv3_IPv4_AF",
+ "description": "WAN OSPFv3 IPv4 address family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "2.1.1.1"
+ },
+ "distance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_distance}}"
+ },
+ "externalDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_external_distance}}"
+ },
+ "interAreaDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_inter_area_distance}}"
+ },
+ "intraAreaDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_intra_area_distance}}"
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "default",
+ "value": 100
+ },
+ "compatibleRfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 10
+ },
+ "metricType": {
+ "optionType": "global",
+ "value": "type2"
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1100
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 9000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_redis_protocal_0}}"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_redis_protocal_1}}"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "nat-route"
+ },
+ "natDia": {
+ "optionType": "default",
+ "value": true
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "default",
+ "value": "disabled"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_area_0_areanum}}"
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "nssa"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ },
+ "alwaysTranslate": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_area_0_intf_0_ifname}}"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 100
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "global",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "global",
+ "value": "ipsec-sha1"
+ },
+ "spi": {
+ "optionType": "global",
+ "value": 261
+ },
+ "authKey": {
+ "optionType": "global",
+ "value": "0123456789012345678901234567890123456789"
+ }
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "address": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_address}}"
+ },
+ "mask": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_mask}}"
+ }
+ },
+ "cost": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_cost}}"
+ },
+ "noAdvertise": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_noadvertise}}"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/tranport_routing_ospfv3_ipv6.json b/gen/models/profile_parcels/tranport_routing_ospfv3_ipv6.json
new file mode 100644
index 000000000..1642dee66
--- /dev/null
+++ b/gen/models/profile_parcels/tranport_routing_ospfv3_ipv6.json
@@ -0,0 +1,2862 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospfv3/ipv6/common/request_schema.json",
+ "title": "Routing protocol OSPFv3 for IPv6 Address family feature schema",
+ "description": "Routing protocol OSPFv3 for IPv6 Address family feature schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 256
+ },
+ "data": {
+ "description": "IPv6 address family configuration",
+ "type": "object",
+ "properties": {
+ "basic": {
+ "description": "basic configuration",
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "distance": {
+ "description": "Distance",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "externalDistance": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interAreaDistance": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraAreaDistance": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "advanced": {
+ "description": "advanced configuration",
+ "type": "object",
+ "properties": {
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "compatibleRfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "defaultOriginate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF disabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF enabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route metric type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "originate"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "spfTimers": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "properties": {
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1000,
+ "maximum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10000,
+ "maximum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "policyName": {
+ "description": "Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "bgp",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "maxMetricRouterLsa": {
+ "description": "Sets the protocol to advertise a maximum metric so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Not advertise maximum metric Router LSA policy by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "const": "disabled"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric Router LSA immediately",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "immediately"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric router LSA after router start up with configured duration time(seconds)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "on-startup"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "onStartUpTime": {
+ "description": "Set how long to advertise maximum metric after router boot up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "action",
+ "onStartUpTime"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPFv3 IPv6 area",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "areaNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "areaTypeConfig": {
+ "description": "Set OSPFv3 area type(stub/nssa/normal)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "areaType": {
+ "description": "stub area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "stub"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "NSSA area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "nssa"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "alwaysTranslate": {
+ "description": "Always translate type7 LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "Normal area type, area number 0 only support normal area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "normal"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interfaces": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10,
+ "maximum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 40,
+ "maximum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 5,
+ "maximum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "networkType": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authenticationConfig": {
+ "description": "Set OSPF interface authentication configuration",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "authType": {
+ "description": "No Authentication by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "no-auth"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "authType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "authType": {
+ "description": "IPSec authentication with SHA1",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ipsec-sha1"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "spi": {
+ "description": "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 256,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authKey": {
+ "description": "Set OSPF interface authentication IPSEC key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]{40}$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "authType",
+ "spi",
+ "authKey"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ranges": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "network": {
+ "description": "IPv6 prefix,for example 2001::/64",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "((^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*(\/)(\\b([0-9]{1,2}|1[01][0-9]|12[0-8])\\b)$))"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "network",
+ "noAdvertise"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "areaNum",
+ "interfaces"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "area"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {},
+ "documentation": {
+ "description": "This is the documentation for request schema for OSPFv3 feature",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "name": "LAN_OSPFv3_IPv6",
+ "description": "LAN OSPFv3 IPv6 Address Family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.1.1.2"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 200
+ },
+ "compatibleRfc1583": {
+ "optionType": "global",
+ "value": false
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "global",
+ "value": 300
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1400
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 11000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "onStartUpTime": {
+ "optionType": "variable",
+ "value": "{{onStartUpTime}}"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "global",
+ "value": 20
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "stub"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet4"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 40
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "optionType": "global",
+ "value": "3002::/96"
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ {
+ "network": {
+ "optionType": "global",
+ "value": "2002::/96"
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "noAdvertise": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "name": "WAN_OSPFv3_IPv6",
+ "description": "WAN OSPFv3 IPv6 Address Family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "3.1.1.2"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 200
+ },
+ "compatibleRfc1583": {
+ "optionType": "global",
+ "value": false
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "global",
+ "value": 300
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1400
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 11000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "static"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "immediately"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv6_area_0_areanum}}"
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "stub"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv6_area_0_intf_0_ifname}}"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 40
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ],
+ "ranges": []
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_cellular_controller.json b/gen/models/profile_parcels/transport_cellular_controller.json
new file mode 100644
index 000000000..a9de9e6a3
--- /dev/null
+++ b/gen/models/profile_parcels/transport_cellular_controller.json
@@ -0,0 +1,424 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/transport/cellular-controller/post/request_schema.json",
+ "title": "CellularController",
+ "description": "CellularController profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set the parcel name",
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "description": "Set the parcel description",
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "description": "Regular Cellular controller (non-eSim) config",
+ "properties": {
+ "configType": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "non-eSim"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "controllerConfig": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "description": "Cellular ID",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "slot": {
+ "description": "Set primary SIM slot",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 1,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxRetry": {
+ "description": "Set SIM failover retries",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "failovertimer": {
+ "description": "Set SIM failover timeout in minutes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 3,
+ "maximum": 7,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "autoSim": {
+ "description": "Enable/Disable Firmware Auto Sim",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "configType",
+ "controllerConfig"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "c1100_lte",
+ "c8000be",
+ "ir8100",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for Transport CellularController profile parcel",
+ "examples": [
+ {
+ "name": "Cedge_CG1_Transport_CellularController_parcel1",
+ "data": {
+ "configType": {
+ "optionType": "default",
+ "value": "non-eSim"
+ },
+ "controllerConfig": {
+ "id": {
+ "optionType": "global",
+ "value": "1"
+ },
+ "slot": {
+ "optionType": "global",
+ "value": 0
+ },
+ "maxRetry": {
+ "optionType": "global",
+ "value": 5
+ },
+ "failovertimer": {
+ "optionType": "global",
+ "value": 3
+ },
+ "autoSim": {
+ "optionType": "default",
+ "value": true
+ }
+ }
+ },
+ "description": "Cedge Transport CellularController Parcel config"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_cellular_profile.json b/gen/models/profile_parcels/transport_cellular_profile.json
new file mode 100644
index 000000000..8a7ea2f28
--- /dev/null
+++ b/gen/models/profile_parcels/transport_cellular_profile.json
@@ -0,0 +1,561 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/transport/cellular-profile/post/request_schema.json",
+ "title": "WAN VPN Schema",
+ "description": "CellularProfile profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set the parcel name",
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "description": "Set the parcel description",
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "description": "Regular Cellular profile (non-eSim) config",
+ "properties": {
+ "configType": {
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "non-eSim"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "profileConfig": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "description": "Set Profile ID",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 16,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "profileInfo": {
+ "type": "object",
+ "properties": {
+ "apn": {
+ "description": "Set access point name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authentication": {
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "noAuthentication": {
+ "type": "object",
+ "description": "No Authentication",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "none"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "noAuthentication"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "needAuthentication": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "description": "Set authentication type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "pap",
+ "chap",
+ "pap_chap"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "username": {
+ "description": "Set the profile username",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "password": {
+ "description": "Set the profile password",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "type",
+ "username",
+ "password"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "needAuthentication"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "pdnType": {
+ "description": "Set packet data network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "ipv4",
+ "enum": [
+ "ipv4",
+ "ipv4v6",
+ "ipv6"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ipv4"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noOverwrite": {
+ "description": "No Overwrite",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "apn"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "id",
+ "profileInfo"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "configType",
+ "profileConfig"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "c1100_lte",
+ "c8000be",
+ "ir8100",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for Transport WAN VPN profile parcel",
+ "examples": [
+ {
+ "data": {
+ "configType": {
+ "optionType": "default",
+ "value": "non-eSim"
+ },
+ "profileConfig": {
+ "id": {
+ "optionType": "global",
+ "value": 1
+ },
+ "profileInfo": {
+ "apn": {
+ "optionType": "global",
+ "value": "apn1"
+ },
+ "authentication": {
+ "noAuthentication": {
+ "optionType": "default",
+ "value": "none"
+ }
+ },
+ "pdnType": {
+ "optionType": "default",
+ "value": "ipv4"
+ },
+ "noOverwrite": {
+ "optionType": "global",
+ "value": false
+ }
+ }
+ }
+ },
+ "description": "Cedge Transport CellularProfile Parcel config",
+ "name": "Cedge_CG1_Transport_CellularProfile_parcel1"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_gps.json b/gen/models/profile_parcels/transport_gps.json
new file mode 100644
index 000000000..2dd50c78d
--- /dev/null
+++ b/gen/models/profile_parcels/transport_gps.json
@@ -0,0 +1,542 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/transport/gps/post/request_schema.json",
+ "title": "Gps Parcel Schema",
+ "description": "Gps profile parcel schema for POST request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "enable": {
+ "description": "Enable/disable GPS",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "mode": {
+ "description": "Select GPS mode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "ms-based",
+ "enum": [
+ "ms-based",
+ "standalone"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ms-based"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "nmea": {
+ "description": "Enable/disable NMEA data",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sourceAddress": {
+ "description": "Source address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "destinationAddress": {
+ "description": "Destination address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "destinationPort": {
+ "description": "Destination port",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "vedge-C1131-8PLTEPW",
+ "vedge-C1109-2PLTEVZ",
+ "vedge-C1111-4PLTEEA",
+ "vedge-C1161-8PLTEP",
+ "vedge-C1117-4PLTEEAW",
+ "vedge-C1121X-8P",
+ "vedge-C8200-1N-4T",
+ "vedge-C8300-2N2S-6T",
+ "vedge-C1127-8PMLTEP",
+ "vedge-ESR-6300",
+ "vedge-ISR-4331",
+ "vedge-ISR-4221X",
+ "vedge-ISR1100-4GLTEGB-XE",
+ "vedge-ISRv",
+ "vedge-C1127X-8PMLTEP",
+ "vedge-C1109-2PLTEGB",
+ "vedge-C1117-4PMLTEEAWE",
+ "vedge-ISR-4451-X",
+ "vedge-C1113-8PLTEW",
+ "vedge-C8200L-1N-4T",
+ "vedge-C1121X-8PLTEPW",
+ "vedge-C1113-8PLTEEA",
+ "vedge-C1121-4PLTEP",
+ "vedge-IR-1821",
+ "vedge-C1111-8PLTEEA",
+ "vedge-C1117-4PLTEEA",
+ "vedge-C1127X-8PLTEP",
+ "vedge-C1109-2PLTEUS",
+ "vedge-ISR-4321",
+ "vedge-C1112-8PLTEEAWE",
+ "vedge-C1116-4PLTEEAWE",
+ "vedge-C1109-4PLTE2P",
+ "vedge-C1161X-8P",
+ "vedge-C1111-8PW",
+ "vedge-C1161X-8PLTEP",
+ "vedge-C1121-8P",
+ "vedge-C1101-4PLTEPW",
+ "vedge-IR-1101",
+ "vedge-C1111-8PLTEEAW",
+ "vedge-C1101-4PLTEP",
+ "vedge-ISR1100-4GLTENA-XE",
+ "vedge-C1111-8PLTELA",
+ "vedge-C1117-4PMLTEEA",
+ "vedge-IR-1835",
+ "vedge-C1121X-8PLTEP",
+ "vedge-C1113-8PLTELA",
+ "vedge-IR-1833",
+ "vedge-C1131X-8PW",
+ "vedge-C1111-8PLTELAW",
+ "vedge-C1131-8PW",
+ "vedge-C8300-1N1S-4T2X",
+ "vedge-C1161-8PLTEP",
+ "vedge-C1121-4P",
+ "vedge-ISR-4351",
+ "vedge-ISR-4431",
+ "vedge-C1117-4PLTELA",
+ "vedge-C1109-4PLTE2PW",
+ "vedge-IR-1831",
+ "vedge-C1127-8PLTEP",
+ "vedge-C1121-8PLTEPW",
+ "vedge-C1126-8PLTEP",
+ "vedge-C1128-8PLTEP",
+ "vedge-C8300-1N1S-6T",
+ "vedge-C1121-8PLTEP",
+ "vedge-IR-8340",
+ "vedge-C1113-8PLTEEAW",
+ "vedge-C8300-2N2S-4T2X",
+ "vedge-C1113-8PMLTEEA",
+ "vedge-C1131X-8PLTEPW",
+ "vedge-C1112-8PLTEEA",
+ "vedge-C1111-4PLTELA",
+ "vedge-ISR-4461",
+ "vedge-C1116-4PLTEEA",
+ "vedge-ISR-4221",
+ "vedge-C1111X-8P",
+ "vedge-C1126X-8PLTEP",
+ "vedge-C8000V",
+ "vedge-C1117-4PLTELAWZ",
+ "vedge-C1113-8PLTELAWZ"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for POST request schema for gps profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "enable": {
+ "optionType": "default",
+ "value": false
+ },
+ "mode": {
+ "optionType": "default",
+ "value": "ms-based"
+ },
+ "nmea": {
+ "optionType": "default",
+ "value": false
+ },
+ "sourceAddress": {
+ "optionType": "global",
+ "value": "xxx"
+ },
+ "destinationAddress": {
+ "optionType": "global",
+ "value": "xxx"
+ },
+ "destinationPort": {
+ "optionType": "global",
+ "value": "xxx"
+ }
+ },
+ "name": "gpsParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_ipv6_tracker_group.json b/gen/models/profile_parcels/transport_ipv6_tracker_group.json
new file mode 100644
index 000000000..4502cb648
--- /dev/null
+++ b/gen/models/profile_parcels/transport_ipv6_tracker_group.json
@@ -0,0 +1,247 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/transport/ipv6-trackergroup/common/request_schema.json",
+ "title": "transport ipv6 tracker group Schema",
+ "description": "IPv6 TrackerGroup profile parcel schema for common request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set the feature name",
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "description": "Set the feature description",
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "trackerGroupName": {
+ "description": "Tracker Name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "maxLength": 128,
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "trackerRefs": {
+ "description": "trackers ref list",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "trackerRef": {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "trackerRef"
+ ],
+ "additionalProperties": false
+ },
+ "minItems": 2,
+ "maxItems": 2,
+ "uniqueItems": true
+ },
+ "combineBoolean": {
+ "description": "tracker ref list combine boolean and or",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "and",
+ "or"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "or"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "trackerGroupName",
+ "trackerRefs",
+ "combineBoolean"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "parcelRefDefinition": [
+ {
+ "refIdPath": "data.trackerRefs[*].trackerRef",
+ "parcelType": [
+ "ipv6-tracker"
+ ]
+ }
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for common request schema for WAN VPN ipv6-trackergroup profile parcel",
+ "examples": [
+ {
+ "data": {
+ "trackerRefs": [
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ }
+ },
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec12"
+ }
+ }
+ }
+ ],
+ "combineBoolean": {
+ "optionType": "global",
+ "value": "and"
+ }
+ },
+ "description": "common_track_group_cedge_parcel_1",
+ "name": "common_track_group_cedge_parcel_1"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_route_policy.json b/gen/models/profile_parcels/transport_route_policy.json
new file mode 100644
index 000000000..f72232741
--- /dev/null
+++ b/gen/models/profile_parcels/transport_route_policy.json
@@ -0,0 +1,1397 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/route-policy/common/request_schema.json",
+ "title": "Route Policy Parcel Schema",
+ "description": "Route policy profile parcel schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "defaultAction": {
+ "description": "Default Action",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "reject",
+ "enum": [
+ "reject",
+ "accept"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "reject"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sequences": {
+ "description": "Route Policy List",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "sequenceId": {
+ "description": "Sequence Id",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65536,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "sequenceName": {
+ "description": "Sequence Name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 19
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "baseAction": {
+ "description": "Base Action",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "reject",
+ "enum": [
+ "reject",
+ "accept"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "reject"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "protocol": {
+ "description": "protocol such as IPV4, IPV6, or BOTH",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "IPV4",
+ "enum": [
+ "IPV4",
+ "IPV6",
+ "BOTH"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "IPV4"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "matchEntries": {
+ "description": "Define match conditions",
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "minProperties": 1,
+ "properties": {
+ "asPathList": {
+ "description": "As Path List",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "communityList": {
+ "description": "Community List",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "criteria": {
+ "description": "Select a condition such as OR, AND or EXACT",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "OR",
+ "enum": [
+ "OR",
+ "AND",
+ "EXACT"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "OR"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "standardCommunityList": {
+ "description": "Select a standard community list",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "criteria",
+ "standardCommunityList"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "expandedCommunityList": {
+ "description": "Select a expanded community list",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "expandedCommunityList"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "extCommunityList": {
+ "description": "Extended Community List",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "bgpLocalPreference": {
+ "description": "BGP Local Preference",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Select Metric",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ompTag": {
+ "description": "Select OMP Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ospfTag": {
+ "description": "Select OSPF Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "ipv4Address": {
+ "description": "Ipv4 Address",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "ipv4NextHop": {
+ "description": "Ipv4 Next Hop",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "ipv6Address": {
+ "description": "Ipv6 Address",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ },
+ "ipv6NextHop": {
+ "description": "Ipv6 Next Hop",
+ "type": "object",
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ }
+ },
+ "actions": {
+ "description": "Define list of actions",
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "accept": {
+ "description": "Accept Action",
+ "type": "object",
+ "properties": {
+ "enableAcceptAction": {
+ "description": "Enable Accept Action",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "setAsPath": {
+ "description": "Set AS Path",
+ "type": "object",
+ "properties": {
+ "prepend": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "items": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 4294967295
+ },
+ "additionalProperties": false,
+ "uniqueItems": false,
+ "type": "array",
+ "minItems": 1
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "setCommunity": {
+ "description": "Set Community",
+ "type": "object",
+ "properties": {
+ "additive": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "community": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "array",
+ "items": {
+ "uniqueItems": true,
+ "type": "string",
+ "oneOf": [
+ {
+ "enum": [
+ "internet",
+ "local-AS",
+ "no-advertise",
+ "no-export"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "pattern": "^(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5]):(0|[1-9]\\d{0,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"
+ }
+ ]
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "setLocalPreference": {
+ "description": "Set Local Preference",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setMetric": {
+ "description": "Set Metric",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setMetricType": {
+ "description": "Set Metric Type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setOmpTag": {
+ "description": "Set OMP Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setOrigin": {
+ "description": "Set Origin",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "EGP",
+ "IGP",
+ "Incomplete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setOspfTag": {
+ "description": "Set OSPF Tag",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setWeight": {
+ "description": "Set Weight",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setIpv4NextHop": {
+ "description": "Set Ipv4 Next Hop",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "setIpv6NextHop": {
+ "description": "Set Ipv6 Next Hop",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv6"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "enableAcceptAction"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "accept"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "reject": {
+ "description": "Reject Action",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "reject"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "sequenceId",
+ "sequenceName",
+ "baseAction",
+ "protocol"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "defaultAction"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "asr",
+ "c1100",
+ "c8000be",
+ "csr1000v",
+ "ir8100",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for route policy profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "defaultAction": {
+ "optionType": "default",
+ "value": "reject"
+ },
+ "sequences": [
+ {
+ "sequenceId": {
+ "optionType": "global",
+ "value": 1
+ },
+ "sequenceName": {
+ "optionType": "global",
+ "value": "Route1"
+ },
+ "baseAction": {
+ "optionType": "default",
+ "value": "reject"
+ },
+ "protocol": {
+ "optionType": "default",
+ "value": "IPV4"
+ },
+ "matchEntries": [
+ {
+ "ipv4Address": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "asPathList": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "communityList": {
+ "criteria": {
+ "optionType": "default",
+ "value": "OR"
+ },
+ "standardCommunityList": [
+ {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D52C"
+ }
+ }
+ ]
+ },
+ "extCommunityList": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "bgpLocalPreference": {
+ "optionType": "global",
+ "value": 100
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 1000
+ },
+ "ipv4NextHop": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "ompTag": {
+ "optionType": "global",
+ "value": 10000
+ },
+ "ospfTag": {
+ "optionType": "global",
+ "value": 20000
+ }
+ }
+ ],
+ "actions": [
+ {
+ "accept": {
+ "enableAcceptAction": {
+ "optionType": "default",
+ "value": true
+ },
+ "setAsPath": {
+ "prepend": {
+ "optionType": "global",
+ "value": [
+ 65521,
+ 65521
+ ]
+ }
+ },
+ "setCommunity": {
+ "community": {
+ "optionType": "global",
+ "value": "internet"
+ },
+ "additive": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "setLocalPreference": {
+ "optionType": "global",
+ "value": 100
+ },
+ "setMetric": {
+ "optionType": "global",
+ "value": 20
+ },
+ "setMetricType": {
+ "optionType": "global",
+ "value": "type1"
+ },
+ "setIpv4NextHop": {
+ "optionType": "global",
+ "value": "10.0.0.1"
+ },
+ "setOmpTag": {
+ "optionType": "global",
+ "value": 200
+ },
+ "setOrigin": {
+ "optionType": "global",
+ "value": "EGP"
+ },
+ "setOspfTag": {
+ "optionType": "global",
+ "value": 1200
+ },
+ "setWeight": {
+ "optionType": "global",
+ "value": 2200
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "route1"
+ },
+ {
+ "data": {
+ "defaultAction": {
+ "optionType": "default",
+ "value": "reject"
+ },
+ "sequences": [
+ {
+ "sequenceId": {
+ "optionType": "global",
+ "value": 11
+ },
+ "sequenceName": {
+ "optionType": "global",
+ "value": "Route2"
+ },
+ "baseAction": {
+ "optionType": "global",
+ "value": "reject"
+ },
+ "protocol": {
+ "optionType": "default",
+ "value": "IPV6"
+ },
+ "matchEntries": [
+ {
+ "ipv6Address": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ },
+ "communityList": {
+ "expandedCommunityList": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ }
+ },
+ "ipv6NextHop": {
+ "refId": {
+ "optionType": "global",
+ "value": "28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C"
+ }
+ }
+ }
+ ],
+ "actions": [
+ {
+ "reject": {
+ "optionType": "default",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "route2"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_routing_ospf.json b/gen/models/profile_parcels/transport_routing_ospf.json
new file mode 100644
index 000000000..9f9e60d4a
--- /dev/null
+++ b/gen/models/profile_parcels/transport_routing_ospf.json
@@ -0,0 +1,2581 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospf/common/request_schema.json",
+ "title": "Routing Ospf Parcel Schema",
+ "description": "routing ospf profile parcel schema for request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "rfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "originate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "external": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 110,
+ "minimum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interArea": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 110,
+ "minimum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraArea": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 110,
+ "minimum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 200,
+ "minimum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 1000,
+ "minimum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 10000,
+ "minimum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "static",
+ "connected",
+ "bgp",
+ "omp",
+ "nat",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "dia": {
+ "description": "Enable NAT DIA for redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false,
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "const": "nat"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": [
+ "protocol",
+ "dia"
+ ]
+ },
+ "else": {
+ "required": [
+ "protocol"
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "routerLsa": {
+ "description": "Advertise own router LSA with infinite distance",
+ "type": "array",
+ "uniqueItems": true,
+ "maxItems": 2,
+ "items": {
+ "type": "object",
+ "properties": {
+ "adType": {
+ "description": "Set the router LSA advertisement type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "administrative",
+ "on-startup"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "time": {
+ "description": "Set how long to advertise maximum metric after router starts up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "adType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "routePolicy": {
+ "description": "Route Policy",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPF area",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "aNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "aType": {
+ "description": "set the area type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "stub",
+ "nssa"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noSummary": {
+ "description": "Do not inject interarea routes into STUB or NSSA",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interface": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 10,
+ "minimum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 40,
+ "minimum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "maximum": 5,
+ "minimum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "priority": {
+ "description": "Set router’s priority to be elected as designated router",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1,
+ "minimum": 0,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 1,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "network": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": "broadcast",
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "broadcast"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "type": {
+ "description": "Set OSPF interface authentication type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "message-digest"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "messageDigestKey": {
+ "description": "Set MD5 message digest key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "md5": {
+ "description": "Set MD5 authentication key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "maxLength": 127,
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "range": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "address": {
+ "description": "Set matching prefix",
+ "type": "object",
+ "properties": {
+ "ipAddress": {
+ "description": "IP Address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "subnetMask": {
+ "description": "Subnet Mask",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "dependencies": {
+ "ipAddress": {
+ "required": [
+ "subnetMask"
+ ]
+ },
+ "subnetMask": {
+ "required": [
+ "ipAddress"
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "dependencies": {
+ "address": {
+ "required": [
+ "noAdvertise"
+ ]
+ },
+ "noAdvertise": {
+ "required": [
+ "address"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "aNum"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "metadata": {
+ "supportedDeviceTypes": [
+ "asr",
+ "c1100",
+ "c8000be",
+ "csr1000v",
+ "ir8100",
+ "ir8340",
+ "isr",
+ "ISRv",
+ "ir1101"
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for request schema for Ospf profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.2.3.4"
+ },
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 101
+ },
+ "rfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "originate": {
+ "optionType": "default",
+ "value": false
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "default"
+ },
+ "metricType": {
+ "optionType": "default"
+ },
+ "external": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interArea": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraArea": {
+ "optionType": "default",
+ "value": 110
+ },
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "default",
+ "value": 1000
+ },
+ "maxHold": {
+ "optionType": "default",
+ "value": 10000
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "static"
+ },
+ "dia": {
+ "optionType": "default",
+ "value": true
+ }
+ }
+ ],
+ "routerLsa": [
+ {
+ "adType": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "time": {
+ "optionType": "global",
+ "value": 5
+ }
+ }
+ ],
+ "area": [
+ {
+ "aNum": {
+ "optionType": "global",
+ "value": 1
+ },
+ "aType": {
+ "optionType": "default"
+ },
+ "noSummary": {
+ "optionType": "default",
+ "value": false
+ },
+ "interface": [
+ {
+ "name": {
+ "optionType": "global",
+ "value": "GigabitEthernet2"
+ },
+ "helloInterval": {
+ "optionType": "default",
+ "value": 10
+ },
+ "deadInterval": {
+ "optionType": "default",
+ "value": 40
+ },
+ "retransmitInterval": {
+ "optionType": "default",
+ "value": 5
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "priority": {
+ "optionType": "default",
+ "value": 1
+ },
+ "network": {
+ "optionType": "default",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "default",
+ "value": false
+ },
+ "type": {
+ "optionType": "global",
+ "value": "message-digest"
+ },
+ "messageDigestKey": {
+ "optionType": "global",
+ "value": 7
+ },
+ "md5": {
+ "optionType": "global",
+ "value": "sdjfhsghbjdjr"
+ }
+ }
+ ],
+ "range": [
+ {
+ "address": {
+ "ipAddress": {
+ "optionType": "global",
+ "value": "10.1.1.0"
+ },
+ "subnetMask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 1
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "ServiceOspfParcelGlobalDefault"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_routing_ospfv3_ipv4.json b/gen/models/profile_parcels/transport_routing_ospfv3_ipv4.json
new file mode 100644
index 000000000..3002123d0
--- /dev/null
+++ b/gen/models/profile_parcels/transport_routing_ospfv3_ipv4.json
@@ -0,0 +1,3222 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospfv3/ipv4/common/request_schema.json",
+ "title": "Routing protocol OSPFv3 for IPv4 Address family feature schema",
+ "description": "Routing protocol OSPFv3 for IPv4 Address family feature schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 256
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "basic": {
+ "description": "basic configuration",
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "distance": {
+ "description": "Distance",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 255,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "externalDistance": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interAreaDistance": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraAreaDistance": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "advanced": {
+ "description": "advanced configuration",
+ "type": "object",
+ "properties": {
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "compatibleRfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "defaultOriginate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF disabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF enabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route metric type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "originate"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "spfTimers": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "properties": {
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1000,
+ "maximum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10000,
+ "maximum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "policyName": {
+ "description": "Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "nat-route",
+ "bgp",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "natDia": {
+ "description": "Enable NAT DIA for redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false,
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "const": "nat-route"
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "required": [
+ "protocol",
+ "natDia"
+ ]
+ }
+ },
+ {
+ "if": {
+ "properties": {
+ "protocol": {
+ "properties": {
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "bgp",
+ "eigrp"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "not": {
+ "required": [
+ "natDia"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ },
+ "maxMetricRouterLsa": {
+ "description": "Sets the protocol to advertise a maximum metric so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Not advertise maximum metric Router LSA policy by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "const": "disabled"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric Router LSA immediately",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "immediately"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric router LSA after router start up with configured duration time(seconds)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "on-startup"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "onStartUpTime": {
+ "description": "Set how long to advertise maximum metric after router boot up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "action",
+ "onStartUpTime"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPFv3 IPv4 area",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "areaNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "areaTypeConfig": {
+ "description": "Set OSPFv3 area type(stub/nssa/normal)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "areaType": {
+ "description": "stub area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "stub"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "NSSA area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "nssa"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "alwaysTranslate": {
+ "description": "Always translate type7 LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "Normal area type, area number 0 only support normal area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "normal"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interfaces": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10,
+ "maximum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 40,
+ "maximum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 5,
+ "maximum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "networkType": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authenticationConfig": {
+ "description": "Set OSPF interface authentication configuration",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "authType": {
+ "description": "No Authentication by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "no-auth"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "authType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "authType": {
+ "description": "IPSec authentication with SHA1",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ipsec-sha1"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "spi": {
+ "description": "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 256,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authKey": {
+ "description": "Set OSPF interface authentication IPSEC key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]{40}$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "authType",
+ "spi",
+ "authKey"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ranges": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "network": {
+ "description": "Ipv4 network",
+ "type": "object",
+ "properties": {
+ "address": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "mask": {
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "255.255.255.255",
+ "255.255.255.254",
+ "255.255.255.252",
+ "255.255.255.248",
+ "255.255.255.240",
+ "255.255.255.224",
+ "255.255.255.192",
+ "255.255.255.128",
+ "255.255.255.0",
+ "255.255.254.0",
+ "255.255.252.0",
+ "255.255.248.0",
+ "255.255.240.0",
+ "255.255.224.0",
+ "255.255.192.0",
+ "255.255.128.0",
+ "255.255.0.0",
+ "255.254.0.0",
+ "255.252.0.0",
+ "255.240.0.0",
+ "255.224.0.0",
+ "255.192.0.0",
+ "255.128.0.0",
+ "255.0.0.0",
+ "254.0.0.0",
+ "252.0.0.0",
+ "248.0.0.0",
+ "240.0.0.0",
+ "224.0.0.0",
+ "192.0.0.0",
+ "128.0.0.0",
+ "0.0.0.0"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "address",
+ "mask"
+ ],
+ "additionalProperties": false
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "network",
+ "noAdvertise"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "areaNum",
+ "interfaces"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "area"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "metadata": {},
+ "documentation": {
+ "description": "This is the documentation for request schema for OSPFv3 feature",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "name": "LAN_OSPFv3_IPv4_AF",
+ "description": "LAN OSPFv3 IPv4 address family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.1.1.1"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "default",
+ "value": 100
+ },
+ "compatibleRfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 10
+ },
+ "metricType": {
+ "optionType": "global",
+ "value": "type2"
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1100
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 9000
+ }
+ },
+ "policyName": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ },
+ "filter": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "bgp"
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "nat-route"
+ },
+ "natDia": {
+ "optionType": "default",
+ "value": true
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b90"
+ }
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "onStartUpTime": {
+ "optionType": "global",
+ "value": 30
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "global",
+ "value": 10
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "nssa"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ },
+ "alwaysTranslate": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet2"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 100
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "default",
+ "value": false
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "default",
+ "value": "no-auth"
+ }
+ }
+ },
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet3"
+ },
+ "helloInterval": {
+ "optionType": "default",
+ "value": 10
+ },
+ "deadInterval": {
+ "optionType": "default",
+ "value": 40
+ },
+ "retransmitInterval": {
+ "optionType": "default",
+ "value": 5
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "global",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "global",
+ "value": "ipsec-sha1"
+ },
+ "spi": {
+ "optionType": "global",
+ "value": 261
+ },
+ "authKey": {
+ "optionType": "global",
+ "value": "0123456789012345678901234567890123456789"
+ }
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "address": {
+ "optionType": "global",
+ "value": "10.2.2.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ {
+ "network": {
+ "address": {
+ "optionType": "global",
+ "value": "10.2.2.0"
+ },
+ "mask": {
+ "optionType": "global",
+ "value": "255.255.255.0"
+ }
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "noAdvertise": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "name": "WAN_OSPFv3_IPv4_AF",
+ "description": "WAN OSPFv3 IPv4 address family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "2.1.1.1"
+ },
+ "distance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_distance}}"
+ },
+ "externalDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_external_distance}}"
+ },
+ "interAreaDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_inter_area_distance}}"
+ },
+ "intraAreaDistance": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_intra_area_distance}}"
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "default",
+ "value": 100
+ },
+ "compatibleRfc1583": {
+ "optionType": "default",
+ "value": true
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "global",
+ "value": true
+ },
+ "always": {
+ "optionType": "default",
+ "value": false
+ },
+ "metric": {
+ "optionType": "global",
+ "value": 10
+ },
+ "metricType": {
+ "optionType": "global",
+ "value": "type2"
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "default",
+ "value": 200
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1100
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 9000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_redis_protocal_0}}"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_redis_protocal_1}}"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "nat-route"
+ },
+ "natDia": {
+ "optionType": "default",
+ "value": true
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "default",
+ "value": "disabled"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_area_0_areanum}}"
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "nssa"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ },
+ "alwaysTranslate": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_area_0_intf_0_ifname}}"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 100
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 20
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "global",
+ "value": "broadcast"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ },
+ "authenticationConfig": {
+ "authType": {
+ "optionType": "global",
+ "value": "ipsec-sha1"
+ },
+ "spi": {
+ "optionType": "global",
+ "value": 261
+ },
+ "authKey": {
+ "optionType": "global",
+ "value": "0123456789012345678901234567890123456789"
+ }
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "address": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_address}}"
+ },
+ "mask": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_mask}}"
+ }
+ },
+ "cost": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_cost}}"
+ },
+ "noAdvertise": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv4_range_0_noadvertise}}"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_routing_ospfv3_ipv6.json b/gen/models/profile_parcels/transport_routing_ospfv3_ipv6.json
new file mode 100644
index 000000000..1642dee66
--- /dev/null
+++ b/gen/models/profile_parcels/transport_routing_ospfv3_ipv6.json
@@ -0,0 +1,2862 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/common/routing/ospfv3/ipv6/common/request_schema.json",
+ "title": "Routing protocol OSPFv3 for IPv6 Address family feature schema",
+ "description": "Routing protocol OSPFv3 for IPv6 Address family feature schema",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 256
+ },
+ "data": {
+ "description": "IPv6 address family configuration",
+ "type": "object",
+ "properties": {
+ "basic": {
+ "description": "basic configuration",
+ "type": "object",
+ "properties": {
+ "routerId": {
+ "description": "Set OSPF router ID to override system IP address",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "format": "ipv4"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "distance": {
+ "description": "Distance",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "externalDistance": {
+ "description": "Set distance for external routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interAreaDistance": {
+ "description": "Set distance for inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "intraAreaDistance": {
+ "description": "Set distance for intra-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 110,
+ "minimum": 1,
+ "maximum": 254,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 110,
+ "maximum": 110
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "advanced": {
+ "description": "advanced configuration",
+ "type": "object",
+ "properties": {
+ "referenceBandwidth": {
+ "description": "Set reference bandwidth method to assign OSPF cost",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 100,
+ "minimum": 1,
+ "maximum": 4294967,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 100
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "compatibleRfc1583": {
+ "description": "Calculate summary route cost based on RFC 1583",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "defaultOriginate": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF disabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "originate": {
+ "description": "Distribute default external route into OSPF enabled",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "always": {
+ "description": "Always advertise default route",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metric": {
+ "description": "Set metric used to generate default route <0..16777214>",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "metricType": {
+ "description": "Set default route metric type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "type1",
+ "type2"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "originate"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "spfTimers": {
+ "description": "Distribute default external route into OSPF",
+ "type": "object",
+ "properties": {
+ "delay": {
+ "description": "Set delay from first change received until performing SPF calculation",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 200,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 200
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "initialHold": {
+ "description": "Set initial hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 1000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 1000,
+ "maximum": 1000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "maxHold": {
+ "description": "Set maximum hold time between consecutive SPF calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10000,
+ "minimum": 1,
+ "maximum": 600000,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10000,
+ "maximum": 10000
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "policyName": {
+ "description": "Policy name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "filter": {
+ "description": "Table map filtered or not",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "redistribute": {
+ "description": "Redistribute routes",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "protocol": {
+ "description": "Set the protocol",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "connected",
+ "static",
+ "omp",
+ "bgp",
+ "eigrp"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "routePolicy": {
+ "description": "Set route policy to apply to redistributed routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "protocol"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "maxMetricRouterLsa": {
+ "description": "Sets the protocol to advertise a maximum metric so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Not advertise maximum metric Router LSA policy by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "const": "disabled"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric Router LSA immediately",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "immediately"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "action"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "action": {
+ "description": "Advertise maximum metric router LSA after router start up with configured duration time(seconds)",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "const": "global"
+ },
+ "value": {
+ "const": "on-startup"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "onStartUpTime": {
+ "description": "Set how long to advertise maximum metric after router boot up",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 5,
+ "maximum": 86400,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "action",
+ "onStartUpTime"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "area": {
+ "description": "Configure OSPFv3 IPv6 area",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "areaNum": {
+ "description": "Set OSPF area number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "areaTypeConfig": {
+ "description": "Set OSPFv3 area type(stub/nssa/normal)",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "areaType": {
+ "description": "stub area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "stub"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "NSSA area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "nssa"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "noSummary": {
+ "description": "Do not inject inter-area routes",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "alwaysTranslate": {
+ "description": "Always translate type7 LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "Normal area type, area number 0 only support normal area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "normal"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "areaType": {
+ "description": "area type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ },
+ "interfaces": {
+ "description": "Set OSPF interface parameters",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "ifName": {
+ "description": "Set interface name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)",
+ "minLength": 3,
+ "maxLength": 32
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "helloInterval": {
+ "description": "Set interval between OSPF hello packets",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 10,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 10,
+ "maximum": 10
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "deadInterval": {
+ "description": "Set interval after which neighbor is declared to be down",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 40,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 40,
+ "maximum": 40
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "retransmitInterval": {
+ "description": "Set time between retransmitting LSAs",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "default": 5,
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "integer",
+ "minimum": 5,
+ "maximum": 5
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost of OSPF interface",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 1,
+ "maximum": 65535,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "networkType": {
+ "description": "Set the OSPF network type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "broadcast",
+ "point-to-point",
+ "non-broadcast",
+ "point-to-multipoint"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "passiveInterface": {
+ "description": "Set the interface to advertise its address, but not to actively run OSPF",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authenticationConfig": {
+ "description": "Set OSPF interface authentication configuration",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "authType": {
+ "description": "No Authentication by default",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global",
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "no-auth"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "authType"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "authType": {
+ "description": "IPSec authentication with SHA1",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "ipsec-sha1"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "spi": {
+ "description": "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 256,
+ "maximum": 4294967295,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "authKey": {
+ "description": "Set OSPF interface authentication IPSEC key",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^[0-9a-fA-F]{40}$"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "authType",
+ "spi",
+ "authKey"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "ifName"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "ranges": {
+ "description": "Summarize OSPF routes at an area boundary",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "network": {
+ "description": "IPv6 prefix,for example 2001::/64",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "((^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*(\/)(\\b([0-9]{1,2}|1[01][0-9]|12[0-8])\\b)$))"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "noAdvertise": {
+ "description": "Do not advertise this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "boolean",
+ "enum": [
+ false
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cost": {
+ "description": "Set cost for this range",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 16777214,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "network",
+ "noAdvertise"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "areaNum",
+ "interfaces"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "area"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {},
+ "documentation": {
+ "description": "This is the documentation for request schema for OSPFv3 feature",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "name": "LAN_OSPFv3_IPv6",
+ "description": "LAN OSPFv3 IPv6 Address Family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "1.1.1.2"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 200
+ },
+ "compatibleRfc1583": {
+ "optionType": "global",
+ "value": false
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "global",
+ "value": 300
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1400
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 11000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "omp"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ },
+ "routePolicy": {
+ "refId": {
+ "optionType": "global",
+ "value": "8bd324a6-c273-411b-a489-941865f58b66"
+ }
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "on-startup"
+ },
+ "onStartUpTime": {
+ "optionType": "variable",
+ "value": "{{onStartUpTime}}"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "global",
+ "value": 20
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "stub"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "global",
+ "value": "GigabitEthernet4"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 40
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ],
+ "ranges": [
+ {
+ "network": {
+ "optionType": "global",
+ "value": "3002::/96"
+ },
+ "cost": {
+ "optionType": "default"
+ },
+ "noAdvertise": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ {
+ "network": {
+ "optionType": "global",
+ "value": "2002::/96"
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 10
+ },
+ "noAdvertise": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "name": "WAN_OSPFv3_IPv6",
+ "description": "WAN OSPFv3 IPv6 Address Family",
+ "data": {
+ "basic": {
+ "routerId": {
+ "optionType": "global",
+ "value": "3.1.1.2"
+ },
+ "distance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "externalDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "interAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ },
+ "intraAreaDistance": {
+ "optionType": "default",
+ "value": 110
+ }
+ },
+ "advanced": {
+ "referenceBandwidth": {
+ "optionType": "global",
+ "value": 200
+ },
+ "compatibleRfc1583": {
+ "optionType": "global",
+ "value": false
+ },
+ "defaultOriginate": {
+ "originate": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "spfTimers": {
+ "delay": {
+ "optionType": "global",
+ "value": 300
+ },
+ "initialHold": {
+ "optionType": "global",
+ "value": 1400
+ },
+ "maxHold": {
+ "optionType": "global",
+ "value": 11000
+ }
+ },
+ "policyName": {
+ "optionType": "default"
+ },
+ "filter": {
+ "optionType": "default",
+ "value": false
+ }
+ },
+ "redistribute": [
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "connected"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ },
+ {
+ "protocol": {
+ "optionType": "global",
+ "value": "static"
+ },
+ "routePolicy": {
+ "optionType": "default"
+ }
+ }
+ ],
+ "maxMetricRouterLsa": {
+ "action": {
+ "optionType": "global",
+ "value": "immediately"
+ }
+ },
+ "area": [
+ {
+ "areaNum": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv6_area_0_areanum}}"
+ },
+ "areaTypeConfig": {
+ "areaType": {
+ "optionType": "global",
+ "value": "stub"
+ },
+ "noSummary": {
+ "optionType": "global",
+ "value": true
+ }
+ },
+ "interfaces": [
+ {
+ "ifName": {
+ "optionType": "variable",
+ "value": "{{wospfv3_ipv6_area_0_intf_0_ifname}}"
+ },
+ "helloInterval": {
+ "optionType": "global",
+ "value": 40
+ },
+ "deadInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "retransmitInterval": {
+ "optionType": "global",
+ "value": 30
+ },
+ "cost": {
+ "optionType": "global",
+ "value": 5
+ },
+ "networkType": {
+ "optionType": "default"
+ },
+ "passiveInterface": {
+ "optionType": "global",
+ "value": true
+ }
+ }
+ ],
+ "ranges": []
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_t1_e1_controller.json b/gen/models/profile_parcels/transport_t1_e1_controller.json
new file mode 100644
index 000000000..281e23b0d
--- /dev/null
+++ b/gen/models/profile_parcels/transport_t1_e1_controller.json
@@ -0,0 +1,1077 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/transport/t1-e1-controller/common/request_schema.json",
+ "title": "T1E1Controller Parcel Schema",
+ "description": "T1E1Controller profile parcel schema for POST/PUT request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "description": "Card Type",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "e1",
+ "t1"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "slot": {
+ "description": "Slot number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "maxLength": 100,
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "controllerTxExList": {
+ "description": "Controller tx-ex List",
+ "type": "array",
+ "uniqueItems": true,
+ "minItems": 1,
+ "maxItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "basic": {
+ "description": "Basic Config",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "T1": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Card Type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "T1"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "framing": {
+ "description": "Framing",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "esf",
+ "sf"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "linecode": {
+ "description": "LineCode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "ami",
+ "b8zs"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "T1"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "E1": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Card Type",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "E1"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "framing": {
+ "type": "object",
+ "description": "Framing",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "crc4",
+ "no-crc4"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "linecode": {
+ "description": "LineCode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "ami",
+ "hdb3"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "E1"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "cable": {
+ "description": "Cable Config",
+ "type": "object",
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "cableLength": {
+ "description": "Cable Config",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "cableLength": {
+ "description": "Cable Config",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "short"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "lengthShort": {
+ "description": "length",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "110ft",
+ "220ft",
+ "330ft",
+ "440ft",
+ "550ft",
+ "660ft"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "cableLength": {
+ "description": "Cable Config",
+ "type": "object",
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "long"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ "lengthLong": {
+ "description": "length",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "-15db",
+ "-22.5db",
+ "-7.5db",
+ "0db"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "clockSource": {
+ "description": "Clock Source",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "line",
+ "internal",
+ "loop-timed",
+ "network"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "lineMode": {
+ "description": "Line Mode",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "enum": [
+ "secondary",
+ "primary"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "description": {
+ "description": "Description",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 240
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ },
+ "required": [
+ "optionType"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "channelGroup": {
+ "description": "Channel Group List",
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "number": {
+ "description": "Number",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minimum": 0,
+ "maximum": 23,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ },
+ "timeslots": {
+ "description": "Time slots",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "type": "string",
+ "maxLength": 24
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "number",
+ "timeslots"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "basic"
+ ],
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "cable": {
+ "properties": {
+ "cableLength": {
+ "properties": {
+ "value": {
+ "const": "short"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "cable": {
+ "properties": {
+ "lengthShort": {
+ "required": [
+ "value"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ {
+ "if": {
+ "properties": {
+ "cable": {
+ "properties": {
+ "cableLength": {
+ "properties": {
+ "value": {
+ "const": "long"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "cable": {
+ "properties": {
+ "lengthLong": {
+ "required": [
+ "value"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "type",
+ "slot",
+ "controllerTxExList"
+ ],
+ "additionalProperties": false
+ },
+ "documentation": {
+ "description": "This is the documentation for common request schema for T1E1Controller profile parcel",
+ "details-1": "variable name should be present with given format as specified in schema if optionType value is variable",
+ "details-2": "variable name should not be present if optionType value is NOT variable",
+ "details-3": "when option Type is global, value should be present with given format/restrictions as specified in schema",
+ "details-4": "when option Type is default, value should be present with given default value as specified in schema",
+ "examples": [
+ {
+ "data": {
+ "type": {
+ "optionType": "global",
+ "value": "t1"
+ },
+ "slot": {
+ "optionType": "global",
+ "value": 11
+ },
+ "controllerTxExList": [
+ {
+ "basic": {
+ "name": {
+ "optionType": "global",
+ "value": "T1"
+ },
+ "framing": {
+ "optionType": "variable",
+ "value": "{{sss}}"
+ },
+ "linecode": {
+ "optionType": "global",
+ "value": "ami"
+ }
+ },
+ "cable": {
+ "cableLength": {
+ "optionType": "global",
+ "value": "long"
+ },
+ "length": {
+ "optionType": "global",
+ "value": "-7.5db"
+ }
+ },
+ "clockSource": {
+ "optionType": "global",
+ "value": "line"
+ },
+ "lineMode": {
+ "optionType": "global",
+ "value": "primary"
+ },
+ "description": {
+ "optionType": "global",
+ "value": "desc"
+ },
+ "channelGroup": [
+ {
+ "number": {
+ "optionType": "global",
+ "value": 13
+ },
+ "timeslots": {
+ "optionType": "global",
+ "value": "timeslots 15"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "t_controllerParcel1"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "not": {
+ "required": [
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/models/profile_parcels/transport_tracker.json b/gen/models/profile_parcels/transport_tracker.json
new file mode 100644
index 000000000..fbbe7f2f9
--- /dev/null
+++ b/gen/models/profile_parcels/transport_tracker.json
@@ -0,0 +1,608 @@
+{
+ "request": {
+ "$schema": "http://json-schema.org/draft/2019-09/schema",
+ "$id": "https://cisco.com/schema/profileparcel/sdwan/transport/tracker/common/request_schema.json",
+ "title": "WAN tracker Schema",
+ "description": "Tracker profile parcel schema for common request",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Set the parcel name",
+ "type": "string",
+ "pattern": "^[^&<>! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "description": "Set the parcel description",
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "trackerName": {
+ "description": "Tracker Name",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "minLength": 1,
+ "maxLength": 128,
+ "pattern": "^[^! \"]+$",
+ "minLength": 1,
+ "maxLength": 128
+ },
+ "description": {
+ "description": "Set the parcel description",
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "trackerRefs": {
+ "description": "tracker parcel ref list",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "trackerRef": {
+ "properties": {
+ "refId": {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "refId"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "trackerRef"
+ ],
+ "additionalProperties": false
+ },
+ "minItems": 2,
+ "maxItems": 2,
+ "uniqueItems": true
+ },
+ "combineBoolean": {
+ "description": "tracker ref list combine boolean and or",
+ "type": "object",
+ "oneOf": [
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "variable"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "pattern": "^\\{\\{[.\/\\[\\]a-zA-Z0-9_-]+\\}\\}$",
+ "minLength": 1,
+ "maxLength": 64
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "global"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "and",
+ "or"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "properties": {
+ "optionType": {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ },
+ "value": {
+ "type": "string",
+ "enum": [
+ "or"
+ ]
+ }
+ },
+ "required": [
+ "optionType",
+ "value"
+ ],
+ "additionalProperties": false
+ }
+ ]
+ }
+ },
+ "required": [
+ "trackerRefs",
+ "combineBoolean"
+ ],
+ "additionalProperties": false
+ },
+ "metadata": {
+ "parcelRefDefinition": [
+ {
+ "refIdPath": "data.trackerRefs[*].trackerRef",
+ "parcelType": [
+ "tracker"
+ ]
+ }
+ ]
+ },
+ "documentation": {
+ "description": "This is the documentation for common request schema for common LAN/WAN VPN profile parcel",
+ "examples": [
+ {
+ "data": {
+ "trackerRefs": [
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec"
+ }
+ }
+ },
+ {
+ "trackerRef": {
+ "refId": {
+ "optionType": "global",
+ "value": "615d948f-34ee-4a2e-810e-a9bd8d3d48ec12"
+ }
+ }
+ }
+ ],
+ "combineBoolean": {
+ "optionType": "global",
+ "value": "and"
+ }
+ },
+ "description": "common_track_group_cedge_parcel_1",
+ "name": "common_track_group_cedge_parcel_1"
+ }
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "data"
+ ],
+ "not": {
+ "required": [
+ "metadata",
+ "documentation"
+ ]
+ },
+ "additionalProperties": false
+ }
+}
\ No newline at end of file
diff --git a/gen/schema/schema.yaml b/gen/schema/schema.yaml
index 1fa46adb7..b28e406c7 100644
--- a/gen/schema/schema.yaml
+++ b/gen/schema/schema.yaml
@@ -25,6 +25,8 @@ no_data_source: bool(required=False) # Set to true if no data source should be c
no_resource: bool(required=False) # Set to true if no resource should be created
get_before_delete: bool(required=False) # This does a GET "all" before doing a DELETE, which is a workaround for an API issue with some endpoints where the reference count is not updated otherwise
delete_mutex: bool(required=False) # Set to true if DELETE operation is mutually exclusive with other DELETE operations
+skip_minimum_test: bool(required=False) # Set to true to prevent "minimum" resource acceptance testing
+parcel_type: enum('feature', 'policy', 'policy_object', required=False) # Type of profile parcel
---
attribute:
model_name: str(required=False) # Name of the attribute in the model (payload)
@@ -68,8 +70,10 @@ attribute:
default_value_empty_string: bool(required=False) # Set to true if default value should be an empty string
value: any(str(), int(), bool(), required=False) # Hardcoded value for the attribute
test_value: str(required=False) # Value used for acceptance test
+ secondary_test_value: str(required=False) # Value used for acceptance test
minimum_test_value: any(str(), int(), bool(), num(), required=False) # Value used for "minimum" resource acceptance test
always_include: bool(required=False) # Include attribute always in payload
+ always_include_parent: bool(required=False) # Include attributes parent always in payload
attributes: list(include('attribute'), required=False) # List of attributes, only relevant if type is "List" or "Set"
conditional_attribute: include('conditional_attribute', required=False) # Add attribute to payload only if condition is true
conditional_list_length: str(required=False) # Add attribute to payload only if referenced list has a length greater than 0
diff --git a/gen/templates/generic/resource.go b/gen/templates/generic/resource.go
index d1e0c94f9..980b84067 100644
--- a/gen/templates/generic/resource.go
+++ b/gen/templates/generic/resource.go
@@ -466,7 +466,7 @@ func (r *{{camelCase .Name}}Resource) Read(ctx context.Context, req resource.Rea
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get({{if .GetRestEndpoint}}"{{.GetRestEndpoint}}"{{else}}state.getPath(){{end}}{{if not .RemoveId}} + url.QueryEscape(state.Id.ValueString()){{end}})
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/gen/templates/profile_parcels/data-source.tf b/gen/templates/profile_parcels/data-source.tf
index 6bdd151b1..459b4697d 100644
--- a/gen/templates/profile_parcels/data-source.tf
+++ b/gen/templates/profile_parcels/data-source.tf
@@ -1,4 +1,4 @@
-data "sdwan_{{snakeCase .Name}}_profile_parcel" "example" {
+data "sdwan_{{getProfileParcelName .}}" "example" {
id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
{{- range .Attributes}}
{{- if .Reference}}
diff --git a/gen/templates/profile_parcels/data_source.go b/gen/templates/profile_parcels/data_source.go
index a4dabae18..f283cf2ef 100644
--- a/gen/templates/profile_parcels/data_source.go
+++ b/gen/templates/profile_parcels/data_source.go
@@ -53,7 +53,7 @@ type {{camelCase .Name}}ProfileParcelDataSource struct {
}
func (d *{{camelCase .Name}}ProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_{{snakeCase .Name}}_profile_parcel"
+ resp.TypeName = req.ProviderTypeName + "_{{getProfileParcelName .}}"
}
func (d *{{camelCase .Name}}ProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
@@ -63,19 +63,19 @@ func (d *{{camelCase .Name}}ProfileParcelDataSource) Schema(ctx context.Context,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
- MarkdownDescription: "The id of the profile parcel",
+ MarkdownDescription: "The id of the {{camelCase .ParcelType}}",
Required: true,
},
"version": schema.Int64Attribute{
- MarkdownDescription: "The version of the profile parcel",
+ MarkdownDescription: "The version of the {{camelCase .ParcelType}}",
Computed: true,
},
"name": schema.StringAttribute{
- MarkdownDescription: "The name of the profile parcel",
+ MarkdownDescription: "The name of the {{camelCase .ParcelType}}",
Computed: true,
},
"description": schema.StringAttribute{
- MarkdownDescription: "The description of the profile parcel",
+ MarkdownDescription: "The description of the {{camelCase .ParcelType}}",
Computed: true,
},
{{- range .Attributes}}
diff --git a/gen/templates/profile_parcels/data_source_test.go b/gen/templates/profile_parcels/data_source_test.go
index 5e231a731..7c8d0039b 100644
--- a/gen/templates/profile_parcels/data_source_test.go
+++ b/gen/templates/profile_parcels/data_source_test.go
@@ -34,36 +34,36 @@ func TestAccDataSourceSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
}
{{- end}}
var checks []resource.TestCheckFunc
- {{- $name := .Name }}
+ {{- $config := . }}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value)}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue)}}
{{- if isNestedListSet .}}
{{- $list := .TfName }}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
{{- end}}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value)}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue)}}
{{- if isNestedListSet .}}
{{- $clist := .TfName }}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
{{- end}}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value)}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue)}}
{{- if isNestedListSet .}}
{{- $cclist := .TfName }}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
{{- end}}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not (isListSet .))}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue) (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -73,10 +73,10 @@ func TestAccDataSourceSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
{{- else if (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -87,10 +87,10 @@ func TestAccDataSourceSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
{{- else if (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -101,10 +101,10 @@ func TestAccDataSourceSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
{{- else if (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{snakeCase $name}}_profile_parcel.test", "{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_{{getProfileParcelName $config}}.test", "{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -132,7 +132,7 @@ const testAccDataSourceSdwan{{camelCase .Name}}PrerequisitesProfileParcelConfig
// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
func testAccDataSourceSdwan{{camelCase .Name}}ProfileParcelConfig() string {
- config := `resource "sdwan_{{snakeCase $name}}_profile_parcel" "test" {` + "\n"
+ config := `resource "sdwan_{{getProfileParcelName $config}}" "test" {` + "\n"
config += ` name = "TF_TEST"` + "\n"
config += ` description = "Terraform integration test"` + "\n"
{{- range .Attributes}}
@@ -161,9 +161,17 @@ func testAccDataSourceSdwan{{camelCase .Name}}ProfileParcelConfig() string {
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
}
{{- else}}
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
{{- end}}
{{- end}}
{{- end}}
@@ -175,9 +183,17 @@ func testAccDataSourceSdwan{{camelCase .Name}}ProfileParcelConfig() string {
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
}
{{- else}}
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
{{- end}}
{{- end}}
{{- end}}
@@ -190,9 +206,17 @@ func testAccDataSourceSdwan{{camelCase .Name}}ProfileParcelConfig() string {
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
}
{{- else}}
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
{{- end}}
{{- end}}
{{- end}}
@@ -215,8 +239,8 @@ func testAccDataSourceSdwan{{camelCase .Name}}ProfileParcelConfig() string {
config += `}` + "\n"
config += `
- data "sdwan_{{snakeCase .Name}}_profile_parcel" "test" {
- id = sdwan_{{snakeCase $name}}_profile_parcel.test.id
+ data "sdwan_{{getProfileParcelName $config}}" "test" {
+ id = sdwan_{{getProfileParcelName $config}}.test.id
{{- range .Attributes}}
{{- if .Reference}}
{{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}
diff --git a/gen/templates/profile_parcels/import.sh b/gen/templates/profile_parcels/import.sh
index 1bdbeb350..e1eddc5e0 100644
--- a/gen/templates/profile_parcels/import.sh
+++ b/gen/templates/profile_parcels/import.sh
@@ -1 +1 @@
-terraform import sdwan_{{snakeCase .Name}}_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
+terraform import sdwan_{{getProfileParcelName .}}.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
diff --git a/gen/templates/profile_parcels/model.go b/gen/templates/profile_parcels/model.go
index 45d41fb3c..0c63a8ca1 100644
--- a/gen/templates/profile_parcels/model.go
+++ b/gen/templates/profile_parcels/model.go
@@ -177,6 +177,8 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default")
{{if or .DefaultValue .DefaultValueEmptyString}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}}
}
+ } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() {
+ body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default")
} else {{else}}if !data.{{toGoName .TfName}}.IsNull(){{end}} {
if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} {
body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global")
@@ -212,6 +214,8 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default")
{{if or .DefaultValue .DefaultValueEmptyString}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}}
}
+ } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() {
+ body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default")
} else {{else}}if !item.{{toGoName .TfName}}.IsNull(){{end}} {
if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} {
itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global")
@@ -247,6 +251,8 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default")
{{if or .DefaultValue .DefaultValueEmptyString}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}}
}
+ } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() {
+ body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default")
} else {{else}}if !childItem.{{toGoName .TfName}}.IsNull(){{end}} {
if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} {
itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global")
@@ -281,6 +287,8 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} {
itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default")
{{if or .DefaultValue .DefaultValueEmptyString}}itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}}
+ } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() {
+ body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default")
} else {{else}}if !childChildItem.{{toGoName .TfName}}.IsNull(){{end}} {
if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} {
itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global")
@@ -435,23 +443,26 @@ func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.R
{{- else if isNestedListSet .}}
{{- $list := (toGoName .TfName)}}
for i := range data.{{toGoName .TfName}} {
- keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} }
- keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} }
- keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} }
+ keys := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} }
+ keyValues := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} }
+ keyValuesVariables := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if .Variable}}data.{{$list}}[i].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} }
var r gjson.Result
res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach(
func(_, v gjson.Result) bool {
found := false
for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
}
- found = false
- break
+ continue
}
if found {
r = v
@@ -476,23 +487,26 @@ func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.R
{{- else if isNestedListSet .}}
{{- $clist := (toGoName .TfName)}}
for ci := range data.{{$list}}[i].{{toGoName .TfName}} {
- keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} }
- keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} }
- keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} }
+ keys := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} }
+ keyValues := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} }
+ keyValuesVariables := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} }
var cr gjson.Result
r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach(
func(_, v gjson.Result) bool {
found := false
for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
}
- found = false
- break
+ continue
}
if found {
cr = v
@@ -517,23 +531,26 @@ func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.R
{{- else if isNestedListSet .}}
{{- $cclist := (toGoName .TfName)}}
for cci := range data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} {
- keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} }
- keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} }
- keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} }
+ keys := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} }
+ keyValues := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} }
+ keyValuesVariables := [...]string{ {{$noId := not (hasId .Attributes)}}{{range .Attributes}}{{if or .Id $noId}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} }
var ccr gjson.Result
cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach(
func(_, v gjson.Result) bool {
found := false
for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
}
- found = false
- break
+ continue
}
if found {
ccr = v
diff --git a/gen/templates/profile_parcels/resource.go b/gen/templates/profile_parcels/resource.go
index 8f03a4c91..e2562980b 100644
--- a/gen/templates/profile_parcels/resource.go
+++ b/gen/templates/profile_parcels/resource.go
@@ -55,7 +55,7 @@ type {{camelCase .Name}}ProfileParcelResource struct {
}
func (r *{{camelCase .Name}}ProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_{{snakeCase .Name}}_profile_parcel"
+ resp.TypeName = req.ProviderTypeName + "_{{getProfileParcelName .}}"
}
func (r *{{camelCase .Name}}ProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
@@ -65,22 +65,22 @@ func (r *{{camelCase .Name}}ProfileParcelResource) Schema(ctx context.Context, r
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
- MarkdownDescription: "The id of the profile parcel",
+ MarkdownDescription: "The id of the {{camelCase .ParcelType}}",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"version": schema.Int64Attribute{
- MarkdownDescription: "The version of the profile parcel",
+ MarkdownDescription: "The version of the {{camelCase .ParcelType}}",
Computed: true,
},
"name": schema.StringAttribute{
- MarkdownDescription: "The name of the profile parcel",
+ MarkdownDescription: "The name of the {{camelCase .ParcelType}}",
Required: true,
},
"description": schema.StringAttribute{
- MarkdownDescription: "The description of the profile parcel",
+ MarkdownDescription: "The description of the {{camelCase .ParcelType}}",
Optional: true,
},
{{- range .Attributes}}
diff --git a/gen/templates/profile_parcels/resource.tf b/gen/templates/profile_parcels/resource.tf
index 244b9c62b..954469b79 100644
--- a/gen/templates/profile_parcels/resource.tf
+++ b/gen/templates/profile_parcels/resource.tf
@@ -1,4 +1,4 @@
-resource "sdwan_{{snakeCase .Name}}_profile_parcel" "example" {
+resource "sdwan_{{getProfileParcelName .}}" "example" {
name = "Example"
description = "My Example"
{{- range .Attributes}}
diff --git a/gen/templates/profile_parcels/resource_test.go b/gen/templates/profile_parcels/resource_test.go
index f67f8526f..a99404844 100644
--- a/gen/templates/profile_parcels/resource_test.go
+++ b/gen/templates/profile_parcels/resource_test.go
@@ -34,36 +34,36 @@ func TestAccSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
}
{{- end}}
var checks []resource.TestCheckFunc
- {{- $name := .Name }}
+ {{- $config := . }}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value)}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue)}}
{{- if isNestedListSet .}}
{{- $list := .TfName }}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
{{- end}}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value)}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue)}}
{{- if isNestedListSet .}}
{{- $clist := .TfName }}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
{{- end}}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value)}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue)}}
{{- if isNestedListSet .}}
{{- $cclist := .TfName }}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
{{- end}}
{{- range .Attributes}}
- {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not (isListSet .))}}
+ {{- if and (not .WriteOnly) (not .ExcludeTest) (not .Reference) (not .Value) (not .TestValue) (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{$cclist}}.0.{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -73,10 +73,10 @@ func TestAccSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
{{- else if (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{$clist}}.0.{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -87,10 +87,10 @@ func TestAccSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
{{- else if (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{$list}}.0.{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -101,10 +101,10 @@ func TestAccSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
{{- else if (not (isListSet .))}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{.TfName}}", "{{.Example}}"))
}
{{- else}}
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{snakeCase $name}}_profile_parcel.test", "{{.TfName}}", "{{.Example}}"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_{{getProfileParcelName $config}}.test", "{{.TfName}}", "{{.Example}}"))
{{- end}}
{{- end}}
{{- end}}
@@ -113,9 +113,9 @@ func TestAccSdwan{{camelCase .Name}}ProfileParcel(t *testing.T) {
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
- {
+ {{if not .SkipMinimumTest}}{
Config: {{if .TestPrerequisites}}testAccSdwan{{camelCase .Name}}PrerequisitesProfileParcelConfig+{{end}}testAccSdwan{{camelCase .Name}}ProfileParcelConfig_minimum(),
- },
+ },{{end}}
{
Config: {{if .TestPrerequisites}}testAccSdwan{{camelCase .Name}}PrerequisitesProfileParcelConfig+{{end}}testAccSdwan{{camelCase .Name}}ProfileParcelConfig_all(),
Check: resource.ComposeTestCheckFunc(checks...),
@@ -134,12 +134,77 @@ const testAccSdwan{{camelCase .Name}}PrerequisitesProfileParcelConfig = `
// End of section. //template:end testPrerequisites
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwan{{camelCase .Name}}ProfileParcelConfig_minimum() string {
- config := `resource "sdwan_{{snakeCase $name}}_profile_parcel" "test" {` + "\n"
+{{if not .SkipMinimumTest}}func testAccSdwan{{camelCase .Name}}ProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_{{getProfileParcelName $config}}" "test" {` + "\n"
config += ` name = "TF_TEST_MIN"` + "\n"
config += ` description = "Terraform integration test"` + "\n"
{{- range .Attributes}}
{{- if and (or .Reference .Mandatory .MinimumTestValue) (not .Optional)}}
+ {{- if isNestedListSet .}}
+ {{- if len .TestTags}}
+ if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
+ {{- end}}
+ config += ` {{.TfName}} = [{` + "\n"
+ {{- range .Attributes}}
+ {{- if and (or .Reference .Mandatory .MinimumTestValue) (not .Optional)}}
+ {{- if isNestedListSet .}}
+ {{- if len .TestTags}}
+ if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
+ {{- end}}
+ config += ` {{.TfName}} = [{` + "\n"
+ {{- range .Attributes}}
+ {{- if and (or .Reference .Mandatory .MinimumTestValue) (not .Optional)}}
+ {{- if isNestedListSet .}}
+ {{- if len .TestTags}}
+ if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
+ {{- end}}
+ config += ` {{.TfName}} = [{` + "\n"
+ {{- range .Attributes}}
+ {{- if and (or .Reference .Mandatory .MinimumTestValue) (not .Optional)}}
+ {{- if len .TestTags}}
+ if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
+ config += ` {{.TfName}} = {{if .MinimumTestValue}}{{.MinimumTestValue}}{{else if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ }
+ {{- else}}
+ config += ` {{.TfName}} = {{if .MinimumTestValue}}{{.MinimumTestValue}}{{else if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- end}}
+ {{- end}}
+ {{- end}}
+ config += ` }]` + "\n"
+ {{- if len .TestTags}}
+ }
+ {{- end}}
+ {{- else}}
+ {{- if len .TestTags}}
+ if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
+ config += ` {{.TfName}} = {{if .MinimumTestValue}}{{.MinimumTestValue}}{{else if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ }
+ {{- else}}
+ config += ` {{.TfName}} = {{if .MinimumTestValue}}{{.MinimumTestValue}}{{else if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- end}}
+ {{- end}}
+ {{- end}}
+ {{- end}}
+ config += ` }]` + "\n"
+ {{- if len .TestTags}}
+ }
+ {{- end}}
+ {{- else}}
+ {{- if len .TestTags}}
+ if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
+ config += ` {{.TfName}} = {{if .MinimumTestValue}}{{.MinimumTestValue}}{{else if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ }
+ {{- else}}
+ config += ` {{.TfName}} = {{if .MinimumTestValue}}{{.MinimumTestValue}}{{else if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- end}}
+ {{- end}}
+ {{- end}}
+ {{- end}}
+ config += ` }]` + "\n"
+ {{- if len .TestTags}}
+ }
+ {{- end}}
+ {{- else}}
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
config += ` {{.TfName}} = {{if .MinimumTestValue}}{{.MinimumTestValue}}{{else if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
@@ -149,14 +214,15 @@ func testAccSdwan{{camelCase .Name}}ProfileParcelConfig_minimum() string {
{{- end}}
{{- end}}
{{- end}}
+ {{- end}}
config += `}` + "\n"
return config
-}
+}{{end}}
// End of section. //template:end testAccConfigMinimum
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
func testAccSdwan{{camelCase .Name}}ProfileParcelConfig_all() string {
- config := `resource "sdwan_{{snakeCase $name}}_profile_parcel" "test" {` + "\n"
+ config := `resource "sdwan_{{getProfileParcelName $config}}" "test" {` + "\n"
config += ` name = "TF_TEST_ALL"` + "\n"
config += ` description = "Terraform integration test"` + "\n"
{{- range .Attributes}}
@@ -185,9 +251,17 @@ func testAccSdwan{{camelCase .Name}}ProfileParcelConfig_all() string {
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
}
{{- else}}
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
{{- end}}
{{- end}}
{{- end}}
@@ -199,9 +273,17 @@ func testAccSdwan{{camelCase .Name}}ProfileParcelConfig_all() string {
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
}
{{- else}}
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
{{- end}}
{{- end}}
{{- end}}
@@ -214,9 +296,17 @@ func testAccSdwan{{camelCase .Name}}ProfileParcelConfig_all() string {
{{- if len .TestTags}}
if {{range $i, $e := .TestTags}}{{if $i}} || {{end}}os.Getenv("{{$e}}") != ""{{end}} {
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
}
{{- else}}
config += ` {{.TfName}} = {{if .TestValue}}{{.TestValue}}{{else}}{{if eq .Type "String"}}"{{.Example}}"{{else if isStringListSet .}}["{{.Example}}"]{{else if isInt64ListSet .}}[{{.Example}}]{{else}}{{.Example}}{{end}}{{end}}` + "\n"
+ {{- if .SecondaryTestValue}}
+ config += ` }, {` + "\n"
+ config += ` {{.TfName}} = {{if .SecondaryTestValue}}{{.SecondaryTestValue}}{{end}}` + "\n"
+ {{- end}}
{{- end}}
{{- end}}
{{- end}}
diff --git a/go.mod b/go.mod
index a97707897..be0793974 100644
--- a/go.mod
+++ b/go.mod
@@ -6,15 +6,15 @@ toolchain go1.21.6
require (
github.com/hashicorp/terraform-plugin-docs v0.19.4
- github.com/hashicorp/terraform-plugin-framework v1.10.0
+ github.com/hashicorp/terraform-plugin-framework v1.11.0
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-go v0.23.0
github.com/hashicorp/terraform-plugin-log v0.9.0
- github.com/hashicorp/terraform-plugin-testing v1.9.0
+ github.com/hashicorp/terraform-plugin-testing v1.10.0
github.com/netascode/go-sdwan v0.1.6
github.com/tidwall/gjson v1.17.3
github.com/tidwall/sjson v1.2.5
- golang.org/x/tools v0.23.0
+ golang.org/x/tools v0.24.0
gopkg.in/yaml.v3 v3.0.1
)
@@ -43,9 +43,10 @@ require (
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
+ github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
- github.com/hashicorp/hc-install v0.7.0 // indirect
+ github.com/hashicorp/hc-install v0.8.0 // indirect
github.com/hashicorp/hcl/v2 v2.21.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.21.0 // indirect
@@ -75,15 +76,15 @@ require (
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yuin/goldmark v1.7.1 // indirect
github.com/yuin/goldmark-meta v1.1.0 // indirect
- github.com/zclconf/go-cty v1.14.4 // indirect
+ github.com/zclconf/go-cty v1.15.0 // indirect
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
- golang.org/x/crypto v0.25.0 // indirect
+ golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect
- golang.org/x/mod v0.19.0 // indirect
- golang.org/x/net v0.27.0 // indirect
- golang.org/x/sync v0.7.0 // indirect
- golang.org/x/sys v0.22.0 // indirect
- golang.org/x/text v0.16.0 // indirect
+ golang.org/x/mod v0.20.0 // indirect
+ golang.org/x/net v0.28.0 // indirect
+ golang.org/x/sync v0.8.0 // indirect
+ golang.org/x/sys v0.23.0 // indirect
+ golang.org/x/text v0.17.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.2 // indirect
diff --git a/go.sum b/go.sum
index 1a55a3288..1779e0cc2 100644
--- a/go.sum
+++ b/go.sum
@@ -84,13 +84,15 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A=
github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI=
+github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
+github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
-github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC1659aBk=
-github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA=
+github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI=
+github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU=
github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14=
github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA=
github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=
@@ -101,8 +103,8 @@ github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7
github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A=
github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSeyEljqjH3G39w28JK4c=
github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA=
-github.com/hashicorp/terraform-plugin-framework v1.10.0 h1:xXhICE2Fns1RYZxEQebwkB2+kXouLC932Li9qelozrc=
-github.com/hashicorp/terraform-plugin-framework v1.10.0/go.mod h1:qBXLDn69kM97NNVi/MQ9qgd1uWWsVftGSnygYG1tImM=
+github.com/hashicorp/terraform-plugin-framework v1.11.0 h1:M7+9zBArexHFXDx/pKTxjE6n/2UCXY6b8FIq9ZYhwfE=
+github.com/hashicorp/terraform-plugin-framework v1.11.0/go.mod h1:qBXLDn69kM97NNVi/MQ9qgd1uWWsVftGSnygYG1tImM=
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 h1:bxZfGo9DIUoLLtHMElsu+zwqI4IsMZQBRRy4iLzZJ8E=
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0/go.mod h1:wGeI02gEhj9nPANU62F2jCaHjXulejm/X+af4PdZaNo=
github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/125t+AAurhqphJ2Co=
@@ -111,8 +113,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0/go.mod h1:sl/UoabMc37HA6ICVMmGO+/0wofkVIRxf+BMb/dnoIg=
-github.com/hashicorp/terraform-plugin-testing v1.9.0 h1:xOsQRqqlHKXpFq6etTxih3ubdK3HVDtfE1IY7Rpd37o=
-github.com/hashicorp/terraform-plugin-testing v1.9.0/go.mod h1:fhhVx/8+XNJZTD5o3b4stfZ6+q7z9+lIWigIYdT6/44=
+github.com/hashicorp/terraform-plugin-testing v1.10.0 h1:2+tmRNhvnfE4Bs8rB6v58S/VpqzGC6RCh9Y8ujdn+aw=
+github.com/hashicorp/terraform-plugin-testing v1.10.0/go.mod h1:iWRW3+loP33WMch2P/TEyCxxct/ZEcCGMquSLSCVsrc=
github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI=
github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM=
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
@@ -213,8 +215,8 @@ github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U=
github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc=
github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0=
-github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8=
-github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
+github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ=
+github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo=
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw=
@@ -222,25 +224,25 @@ go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
-golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
-golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
+golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
+golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
-golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
+golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
-golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
-golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
+golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
-golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
+golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -254,8 +256,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
-golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
+golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
@@ -265,13 +267,13 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
-golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
+golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
-golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
+golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
+golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
diff --git a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go
index 60cf127bf..7c72159a4 100644
--- a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go
+++ b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go
@@ -120,6 +120,10 @@ func (d *ApplicationAwareRoutingPolicyDefinitionDataSource) Schema(ctx context.C
MarkdownDescription: "DNS Application list version",
Computed: true,
},
+ "icmp_message": schema.StringAttribute{
+ MarkdownDescription: "ICMP Message",
+ Computed: true,
+ },
"dns": schema.StringAttribute{
MarkdownDescription: "DNS request or response",
Computed: true,
diff --git a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go
index 043c5bc65..4c5d9d34c 100644
--- a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go
+++ b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go
@@ -61,6 +61,7 @@ resource "sdwan_application_list_policy_object" "test" {
}
]
}
+
`
// End of section. //template:end testPrerequisites
diff --git a/internal/provider/data_source_sdwan_application_priority_qos_policy.go b/internal/provider/data_source_sdwan_application_priority_qos_policy.go
new file mode 100644
index 000000000..cf56496ac
--- /dev/null
+++ b/internal/provider/data_source_sdwan_application_priority_qos_policy.go
@@ -0,0 +1,160 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &ApplicationPriorityQoSProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ApplicationPriorityQoSProfileParcelDataSource{}
+)
+
+func NewApplicationPriorityQoSProfileParcelDataSource() datasource.DataSource {
+ return &ApplicationPriorityQoSProfileParcelDataSource{}
+}
+
+type ApplicationPriorityQoSProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ApplicationPriorityQoSProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_application_priority_qos_policy"
+}
+
+func (d *ApplicationPriorityQoSProfileParcelDataSource) 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 Application Priority QoS Policy.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "target_interface": schema.SetAttribute{
+ MarkdownDescription: "interfaces",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "target_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_schedulers": schema.ListNestedAttribute{
+ MarkdownDescription: "qosSchedulers",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "forwarding_class_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "drops": schema.StringAttribute{
+ MarkdownDescription: "drops",
+ Computed: true,
+ },
+ "queue": schema.StringAttribute{
+ MarkdownDescription: "queue",
+ Computed: true,
+ },
+ "bandwidth": schema.StringAttribute{
+ MarkdownDescription: "bandwidthPercent",
+ Computed: true,
+ },
+ "scheduling_type": schema.StringAttribute{
+ MarkdownDescription: "scheduling",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ApplicationPriorityQoSProfileParcelDataSource) 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 *ApplicationPriorityQoSProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ApplicationPriorityQoS
+
+ // 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_application_priority_qos_policy_profile_parcel.go b/internal/provider/data_source_sdwan_application_priority_qos_policy_profile_parcel.go
deleted file mode 100644
index 83518aa26..000000000
--- a/internal/provider/data_source_sdwan_application_priority_qos_policy_profile_parcel.go
+++ /dev/null
@@ -1,160 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &ApplicationPriorityQoSPolicyProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &ApplicationPriorityQoSPolicyProfileParcelDataSource{}
-)
-
-func NewApplicationPriorityQoSPolicyProfileParcelDataSource() datasource.DataSource {
- return &ApplicationPriorityQoSPolicyProfileParcelDataSource{}
-}
-
-type ApplicationPriorityQoSPolicyProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *ApplicationPriorityQoSPolicyProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_application_priority_qos_policy_profile_parcel"
-}
-
-func (d *ApplicationPriorityQoSPolicyProfileParcelDataSource) 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 Application Priority QoS Policy 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,
- },
- "target_interface": schema.SetAttribute{
- MarkdownDescription: "interfaces",
- ElementType: types.StringType,
- Computed: true,
- },
- "target_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_schedulers": schema.ListNestedAttribute{
- MarkdownDescription: "qosSchedulers",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "forwarding_class_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "drops": schema.StringAttribute{
- MarkdownDescription: "drops",
- Computed: true,
- },
- "queue": schema.StringAttribute{
- MarkdownDescription: "queue",
- Computed: true,
- },
- "bandwidth": schema.StringAttribute{
- MarkdownDescription: "bandwidthPercent",
- Computed: true,
- },
- "scheduling_type": schema.StringAttribute{
- MarkdownDescription: "scheduling",
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *ApplicationPriorityQoSPolicyProfileParcelDataSource) 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 *ApplicationPriorityQoSPolicyProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config ApplicationPriorityQoSPolicy
-
- // 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_application_priority_qos_policy_profile_parcel_test.go b/internal/provider/data_source_sdwan_application_priority_qos_policy_profile_parcel_test.go
deleted file mode 100644
index 9d9081c24..000000000
--- a/internal/provider/data_source_sdwan_application_priority_qos_policy_profile_parcel_test.go
+++ /dev/null
@@ -1,88 +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 TestAccDataSourceSdwanApplicationPriorityQoSPolicyProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.drops", "tail-drop"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.queue", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.bandwidth", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.scheduling_type", "llq"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanApplicationPriorityQoSPolicyPrerequisitesProfileParcelConfig + testAccDataSourceSdwanApplicationPriorityQoSPolicyProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanApplicationPriorityQoSPolicyPrerequisitesProfileParcelConfig = `
-resource "sdwan_application_priority_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanApplicationPriorityQoSPolicyProfileParcelConfig() string {
- config := `resource "sdwan_application_priority_qos_policy_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_application_priority_feature_profile.test.id` + "\n"
- config += ` target_interface = ["{{interface_var_1}}"]` + "\n"
- config += ` qos_schedulers = [{` + "\n"
- config += ` drops = "tail-drop"` + "\n"
- config += ` queue = "0"` + "\n"
- config += ` bandwidth = "10"` + "\n"
- config += ` scheduling_type = "llq"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_application_priority_qos_policy_profile_parcel" "test" {
- id = sdwan_application_priority_qos_policy_profile_parcel.test.id
- feature_profile_id = sdwan_application_priority_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_application_priority_qos_policy_test.go b/internal/provider/data_source_sdwan_application_priority_qos_policy_test.go
new file mode 100644
index 000000000..f84e5810c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_application_priority_qos_policy_test.go
@@ -0,0 +1,88 @@
+// 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 TestAccDataSourceSdwanApplicationPriorityQoSProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy.test", "qos_schedulers.0.drops", "tail-drop"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy.test", "qos_schedulers.0.queue", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy.test", "qos_schedulers.0.bandwidth", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_application_priority_qos_policy.test", "qos_schedulers.0.scheduling_type", "llq"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanApplicationPriorityQoSPrerequisitesProfileParcelConfig + testAccDataSourceSdwanApplicationPriorityQoSProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanApplicationPriorityQoSPrerequisitesProfileParcelConfig = `
+resource "sdwan_application_priority_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanApplicationPriorityQoSProfileParcelConfig() string {
+ config := `resource "sdwan_application_priority_qos_policy" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_application_priority_feature_profile.test.id` + "\n"
+ config += ` target_interface = ["{{interface_var_1}}"]` + "\n"
+ config += ` qos_schedulers = [{` + "\n"
+ config += ` drops = "tail-drop"` + "\n"
+ config += ` queue = "0"` + "\n"
+ config += ` bandwidth = "10"` + "\n"
+ config += ` scheduling_type = "llq"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_application_priority_qos_policy" "test" {
+ id = sdwan_application_priority_qos_policy.test.id
+ feature_profile_id = sdwan_application_priority_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_cli_config_feature.go b/internal/provider/data_source_sdwan_cli_config_feature.go
new file mode 100644
index 000000000..edd689da8
--- /dev/null
+++ b/internal/provider/data_source_sdwan_cli_config_feature.go
@@ -0,0 +1,125 @@
+// 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 = &CLIConfigFeatureDataSource{}
+ _ datasource.DataSourceWithConfigure = &CLIConfigFeatureDataSource{}
+)
+
+func NewCLIConfigFeatureDataSource() datasource.DataSource {
+ return &CLIConfigFeatureDataSource{}
+}
+
+type CLIConfigFeatureDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *CLIConfigFeatureDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_cli_config_feature"
+}
+
+func (d *CLIConfigFeatureDataSource) 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 CLI Config Feature .",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "cli_configuration": schema.StringAttribute{
+ MarkdownDescription: "CLI configuration",
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *CLIConfigFeatureDataSource) 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 *CLIConfigFeatureDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config CLIConfigFeature
+
+ // 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.Id.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_cli_config_feature_test.go b/internal/provider/data_source_sdwan_cli_config_feature_test.go
new file mode 100644
index 000000000..38591d090
--- /dev/null
+++ b/internal/provider/data_source_sdwan_cli_config_feature_test.go
@@ -0,0 +1,82 @@
+// 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 TestAccDataSourceSdwanCLIConfigFeature(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cli_config_feature.test", "name", "Example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cli_config_feature.test", "description", "My Example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cli_config_feature.test", "cli_configuration", "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanCLIConfigFeaturePrerequisitesConfig + testAccDataSourceSdwanCLIConfigFeatureConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanCLIConfigFeaturePrerequisitesConfig = `
+resource "sdwan_cli_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanCLIConfigFeatureConfig() string {
+ config := ""
+ config += `resource "sdwan_cli_config_feature" "test" {` + "\n"
+ config += ` feature_profile_id = sdwan_cli_feature_profile.test.id` + "\n"
+ config += ` name = "Example"` + "\n"
+ config += ` description = "My Example"` + "\n"
+ config += ` cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_cli_config_feature" "test" {
+ feature_profile_id = sdwan_cli_feature_profile.test.id
+ id = sdwan_cli_config_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_cli_config_profile_parcel.go b/internal/provider/data_source_sdwan_cli_config_profile_parcel.go
deleted file mode 100644
index e4f0bf3b3..000000000
--- a/internal/provider/data_source_sdwan_cli_config_profile_parcel.go
+++ /dev/null
@@ -1,125 +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 = &CLIConfigProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &CLIConfigProfileParcelDataSource{}
-)
-
-func NewCLIConfigProfileParcelDataSource() datasource.DataSource {
- return &CLIConfigProfileParcelDataSource{}
-}
-
-type CLIConfigProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *CLIConfigProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_cli_config_profile_parcel"
-}
-
-func (d *CLIConfigProfileParcelDataSource) 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 CLI Config Profile Parcel .",
-
- Attributes: map[string]schema.Attribute{
- "id": schema.StringAttribute{
- MarkdownDescription: "The id of the object",
- Required: true,
- },
- "version": schema.Int64Attribute{
- MarkdownDescription: "The version of the object",
- Computed: true,
- },
- "feature_profile_id": schema.StringAttribute{
- MarkdownDescription: "Feature Profile ID",
- Required: 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,
- },
- "cli_configuration": schema.StringAttribute{
- MarkdownDescription: "CLI configuration",
- Computed: true,
- },
- },
- }
-}
-
-func (d *CLIConfigProfileParcelDataSource) 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 *CLIConfigProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config CLIConfigProfileParcel
-
- // 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.Id.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_cli_config_profile_parcel_test.go b/internal/provider/data_source_sdwan_cli_config_profile_parcel_test.go
deleted file mode 100644
index e264b282c..000000000
--- a/internal/provider/data_source_sdwan_cli_config_profile_parcel_test.go
+++ /dev/null
@@ -1,82 +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 TestAccDataSourceSdwanCLIConfigProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cli_config_profile_parcel.test", "name", "Example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cli_config_profile_parcel.test", "description", "My Example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_cli_config_profile_parcel.test", "cli_configuration", "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanCLIConfigProfileParcelPrerequisitesConfig + testAccDataSourceSdwanCLIConfigProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanCLIConfigProfileParcelPrerequisitesConfig = `
-resource "sdwan_cli_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanCLIConfigProfileParcelConfig() string {
- config := ""
- config += `resource "sdwan_cli_config_profile_parcel" "test" {` + "\n"
- config += ` feature_profile_id = sdwan_cli_feature_profile.test.id` + "\n"
- config += ` name = "Example"` + "\n"
- config += ` description = "My Example"` + "\n"
- config += ` cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_cli_config_profile_parcel" "test" {
- feature_profile_id = sdwan_cli_feature_profile.test.id
- id = sdwan_cli_config_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_dns_security_feature_profile.go b/internal/provider/data_source_sdwan_dns_security_feature_profile.go
new file mode 100644
index 000000000..aa860be63
--- /dev/null
+++ b/internal/provider/data_source_sdwan_dns_security_feature_profile.go
@@ -0,0 +1,113 @@
+// 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 = &DNSSecurityFeatureProfileDataSource{}
+ _ datasource.DataSourceWithConfigure = &DNSSecurityFeatureProfileDataSource{}
+)
+
+func NewDNSSecurityFeatureProfileDataSource() datasource.DataSource {
+ return &DNSSecurityFeatureProfileDataSource{}
+}
+
+type DNSSecurityFeatureProfileDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *DNSSecurityFeatureProfileDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_dns_security_feature_profile"
+}
+
+func (d *DNSSecurityFeatureProfileDataSource) 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 DNS Security Feature Profile .",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Required: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the dns security feature profile",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Description",
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *DNSSecurityFeatureProfileDataSource) 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 *DNSSecurityFeatureProfileDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config DNSSecurityFeatureProfile
+
+ // 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.Id.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_dns_security_feature_profile_test.go b/internal/provider/data_source_sdwan_dns_security_feature_profile_test.go
new file mode 100644
index 000000000..685203f27
--- /dev/null
+++ b/internal/provider/data_source_sdwan_dns_security_feature_profile_test.go
@@ -0,0 +1,71 @@
+// 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 TestAccDataSourceSdwanDNSSecurityFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_dns_security_feature_profile.test", "name", "DNS_SECURITY_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_dns_security_feature_profile.test", "description", "My dns security feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanDNSSecurityFeatureProfileConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanDNSSecurityFeatureProfileConfig() string {
+ config := ""
+ config += `resource "sdwan_dns_security_feature_profile" "test" {` + "\n"
+ config += ` name = "DNS_SECURITY_FP_1"` + "\n"
+ config += ` description = "My dns security feature profile 1"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_dns_security_feature_profile" "test" {
+ id = sdwan_dns_security_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_embedded_security_feature_profile.go b/internal/provider/data_source_sdwan_embedded_security_feature_profile.go
new file mode 100644
index 000000000..f08fa6296
--- /dev/null
+++ b/internal/provider/data_source_sdwan_embedded_security_feature_profile.go
@@ -0,0 +1,113 @@
+// 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 = &EmbeddedSecurityFeatureProfileDataSource{}
+ _ datasource.DataSourceWithConfigure = &EmbeddedSecurityFeatureProfileDataSource{}
+)
+
+func NewEmbeddedSecurityFeatureProfileDataSource() datasource.DataSource {
+ return &EmbeddedSecurityFeatureProfileDataSource{}
+}
+
+type EmbeddedSecurityFeatureProfileDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *EmbeddedSecurityFeatureProfileDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_embedded_security_feature_profile"
+}
+
+func (d *EmbeddedSecurityFeatureProfileDataSource) 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 Embedded Security Feature Profile .",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Required: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the embedded security feature profile",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Description",
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *EmbeddedSecurityFeatureProfileDataSource) 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 *EmbeddedSecurityFeatureProfileDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config EmbeddedSecurityFeatureProfile
+
+ // 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.Id.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_embedded_security_feature_profile_test.go b/internal/provider/data_source_sdwan_embedded_security_feature_profile_test.go
new file mode 100644
index 000000000..a852773ab
--- /dev/null
+++ b/internal/provider/data_source_sdwan_embedded_security_feature_profile_test.go
@@ -0,0 +1,71 @@
+// 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 TestAccDataSourceSdwanEmbeddedSecurityFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_embedded_security_feature_profile.test", "name", "EMBEDDED_SECURITY_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_embedded_security_feature_profile.test", "description", "My embedded security feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanEmbeddedSecurityFeatureProfileConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanEmbeddedSecurityFeatureProfileConfig() string {
+ config := ""
+ config += `resource "sdwan_embedded_security_feature_profile" "test" {` + "\n"
+ config += ` name = "EMBEDDED_SECURITY_FP_1"` + "\n"
+ config += ` description = "My embedded security feature profile 1"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_embedded_security_feature_profile" "test" {
+ id = sdwan_embedded_security_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go b/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go
index 8425eccb1..5b99f536a 100644
--- a/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go
+++ b/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go
@@ -116,6 +116,10 @@ func (d *IPv4ACLPolicyDefinitionDataSource) Schema(ctx context.Context, req data
MarkdownDescription: "Source IP prefix",
Computed: true,
},
+ "icmp_message": schema.StringAttribute{
+ MarkdownDescription: "ICMP Message",
+ Computed: true,
+ },
"destination_ip": schema.StringAttribute{
MarkdownDescription: "Destination IP prefix",
Computed: true,
diff --git a/internal/provider/data_source_sdwan_other_feature_profile.go b/internal/provider/data_source_sdwan_other_feature_profile.go
new file mode 100644
index 000000000..1ddfad48a
--- /dev/null
+++ b/internal/provider/data_source_sdwan_other_feature_profile.go
@@ -0,0 +1,113 @@
+// 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 = &OtherFeatureProfileDataSource{}
+ _ datasource.DataSourceWithConfigure = &OtherFeatureProfileDataSource{}
+)
+
+func NewOtherFeatureProfileDataSource() datasource.DataSource {
+ return &OtherFeatureProfileDataSource{}
+}
+
+type OtherFeatureProfileDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *OtherFeatureProfileDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_other_feature_profile"
+}
+
+func (d *OtherFeatureProfileDataSource) 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 Other Feature Profile .",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Required: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the transport feature profile",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Description",
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *OtherFeatureProfileDataSource) 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 *OtherFeatureProfileDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config OtherFeatureProfile
+
+ // 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.Id.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_other_feature_profile_test.go b/internal/provider/data_source_sdwan_other_feature_profile_test.go
new file mode 100644
index 000000000..a41eef215
--- /dev/null
+++ b/internal/provider/data_source_sdwan_other_feature_profile_test.go
@@ -0,0 +1,71 @@
+// 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 TestAccDataSourceSdwanOtherFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_feature_profile.test", "name", "OTHER_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_feature_profile.test", "description", "My Other feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanOtherFeatureProfileConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanOtherFeatureProfileConfig() string {
+ config := ""
+ config += `resource "sdwan_other_feature_profile" "test" {` + "\n"
+ config += ` name = "OTHER_FP_1"` + "\n"
+ config += ` description = "My Other feature profile 1"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_other_feature_profile" "test" {
+ id = sdwan_other_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_other_thousandeyes_feature.go b/internal/provider/data_source_sdwan_other_thousandeyes_feature.go
new file mode 100644
index 000000000..492256237
--- /dev/null
+++ b/internal/provider/data_source_sdwan_other_thousandeyes_feature.go
@@ -0,0 +1,214 @@
+// 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 = &OtherThousandEyesProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &OtherThousandEyesProfileParcelDataSource{}
+)
+
+func NewOtherThousandEyesProfileParcelDataSource() datasource.DataSource {
+ return &OtherThousandEyesProfileParcelDataSource{}
+}
+
+type OtherThousandEyesProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *OtherThousandEyesProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_other_thousandeyes_feature"
+}
+
+func (d *OtherThousandEyesProfileParcelDataSource) 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 Other ThousandEyes Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "virtual_application": schema.ListNestedAttribute{
+ MarkdownDescription: "Virtual application Instance",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "account_group_token": schema.StringAttribute{
+ MarkdownDescription: "Set the Account Group Token",
+ Computed: true,
+ },
+ "account_group_token_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "VPN number",
+ Computed: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "management_ip": schema.StringAttribute{
+ MarkdownDescription: "Set the Agent IP Address",
+ Computed: true,
+ },
+ "management_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "management_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Set the Agent SubnetMask",
+ Computed: true,
+ },
+ "management_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "agent_default_gateway": schema.StringAttribute{
+ MarkdownDescription: "Set the Agent default gateway",
+ Computed: true,
+ },
+ "agent_default_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "name_server_ip": schema.StringAttribute{
+ MarkdownDescription: "Set the name server",
+ Computed: true,
+ },
+ "name_server_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hostname": schema.StringAttribute{
+ MarkdownDescription: "Set the host name",
+ Computed: true,
+ },
+ "hostname_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "proxy_type": schema.StringAttribute{
+ MarkdownDescription: "Select Web Proxy Type",
+ Computed: true,
+ },
+ "proxy_host": schema.StringAttribute{
+ MarkdownDescription: "Set the Proxy Host",
+ Computed: true,
+ },
+ "proxy_host_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "proxy_port": schema.Int64Attribute{
+ MarkdownDescription: "Set the Proxy Port",
+ Computed: true,
+ },
+ "proxy_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "pac_url": schema.StringAttribute{
+ MarkdownDescription: "Set the proxy PAC url",
+ Computed: true,
+ },
+ "pac_url_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *OtherThousandEyesProfileParcelDataSource) 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 *OtherThousandEyesProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config OtherThousandEyes
+
+ // 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_other_thousandeyes_feature_test.go b/internal/provider/data_source_sdwan_other_thousandeyes_feature_test.go
new file mode 100644
index 000000000..25c600a13
--- /dev/null
+++ b/internal/provider/data_source_sdwan_other_thousandeyes_feature_test.go
@@ -0,0 +1,99 @@
+// 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 TestAccDataSourceSdwanOtherThousandEyesProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.account_group_token", "qwer"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.management_ip", "10.0.0.2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.management_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.agent_default_gateway", "10.0.0.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.name_server_ip", "77.77.77.71"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.hostname", "thousandeyesHost"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.proxy_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.proxy_host", "proxy.thousandeyes.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_thousandeyes_feature.test", "virtual_application.0.proxy_port", "3128"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanOtherThousandEyesPrerequisitesProfileParcelConfig + testAccDataSourceSdwanOtherThousandEyesProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanOtherThousandEyesPrerequisitesProfileParcelConfig = `
+resource "sdwan_other_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanOtherThousandEyesProfileParcelConfig() string {
+ config := `resource "sdwan_other_thousandeyes_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_other_feature_profile.test.id` + "\n"
+ config += ` virtual_application = [{` + "\n"
+ config += ` account_group_token = "qwer"` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` management_ip = "10.0.0.2"` + "\n"
+ config += ` management_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` agent_default_gateway = "10.0.0.1"` + "\n"
+ config += ` name_server_ip = "77.77.77.71"` + "\n"
+ config += ` hostname = "thousandeyesHost"` + "\n"
+ config += ` proxy_type = "static"` + "\n"
+ config += ` proxy_host = "proxy.thousandeyes.com"` + "\n"
+ config += ` proxy_port = 3128` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_other_thousandeyes_feature" "test" {
+ id = sdwan_other_thousandeyes_feature.test.id
+ feature_profile_id = sdwan_other_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_other_ucse_feature.go b/internal/provider/data_source_sdwan_other_ucse_feature.go
new file mode 100644
index 000000000..6e72aee1c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_other_ucse_feature.go
@@ -0,0 +1,206 @@
+// 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 = &OtherUCSEProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &OtherUCSEProfileParcelDataSource{}
+)
+
+func NewOtherUCSEProfileParcelDataSource() datasource.DataSource {
+ return &OtherUCSEProfileParcelDataSource{}
+}
+
+type OtherUCSEProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *OtherUCSEProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_other_ucse_feature"
+}
+
+func (d *OtherUCSEProfileParcelDataSource) 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 Other UCSE Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "bay": schema.Int64Attribute{
+ MarkdownDescription: "Bay",
+ Computed: true,
+ },
+ "slot": schema.Int64Attribute{
+ MarkdownDescription: "Slot",
+ Computed: true,
+ },
+ "access_port_dedicated": schema.BoolAttribute{
+ MarkdownDescription: "Dedicated",
+ Computed: true,
+ },
+ "access_port_shared_type": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "access_port_shared_failover_type": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "Assign IPv4 address",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_gateway": schema.StringAttribute{
+ MarkdownDescription: "Assign default gateway",
+ Computed: true,
+ },
+ "default_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vlan_id": schema.Int64Attribute{
+ MarkdownDescription: "Assign Vlan Id",
+ Computed: true,
+ },
+ "vlan_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "assign_priority": schema.Int64Attribute{
+ MarkdownDescription: "Assign priority",
+ Computed: true,
+ },
+ "assign_priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Interface name: GigabitEthernet0/<>/<> when present",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Set Inteface name",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ucse_interface_vpn": schema.Int64Attribute{
+ MarkdownDescription: "UCSE Interface VPN",
+ Computed: true,
+ },
+ "ucse_interface_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "Assign IPv4 address",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *OtherUCSEProfileParcelDataSource) 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 *OtherUCSEProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config OtherUCSE
+
+ // 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_other_ucse_feature_test.go b/internal/provider/data_source_sdwan_other_ucse_feature_test.go
new file mode 100644
index 000000000..240914999
--- /dev/null
+++ b/internal/provider/data_source_sdwan_other_ucse_feature_test.go
@@ -0,0 +1,103 @@
+// 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 TestAccDataSourceSdwanOtherUCSEProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "bay", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "slot", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "access_port_dedicated", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "access_port_shared_type", "ge1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "access_port_shared_failover_type", "ge2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "ipv4_address", "2.2.2.2/24"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "default_gateway", "2.2.2.2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "vlan_id", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "assign_priority", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "interfaces.0.interface_name", "ucse2/0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "interfaces.0.ucse_interface_vpn", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_other_ucse_feature.test", "interfaces.0.ipv4_address", "10.1.15.15/24"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanOtherUCSEPrerequisitesProfileParcelConfig + testAccDataSourceSdwanOtherUCSEProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanOtherUCSEPrerequisitesProfileParcelConfig = `
+resource "sdwan_other_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanOtherUCSEProfileParcelConfig() string {
+ config := `resource "sdwan_other_ucse_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_other_feature_profile.test.id` + "\n"
+ config += ` bay = 2` + "\n"
+ config += ` slot = 0` + "\n"
+ config += ` access_port_dedicated = false` + "\n"
+ config += ` access_port_shared_type = "ge1"` + "\n"
+ config += ` access_port_shared_failover_type = "ge2"` + "\n"
+ config += ` ipv4_address = "2.2.2.2/24"` + "\n"
+ config += ` default_gateway = "2.2.2.2"` + "\n"
+ config += ` vlan_id = 3` + "\n"
+ config += ` assign_priority = 3` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` interface_name = "ucse2/0"` + "\n"
+ config += ` ucse_interface_vpn = 2` + "\n"
+ config += ` ipv4_address = "10.1.15.15/24"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_other_ucse_feature" "test" {
+ id = sdwan_other_ucse_feature.test.id
+ feature_profile_id = sdwan_other_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_app_probe_class.go b/internal/provider/data_source_sdwan_policy_object_app_probe_class.go
new file mode 100644
index 000000000..146db62f5
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_app_probe_class.go
@@ -0,0 +1,149 @@
+// 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 = &PolicyObjectAppProbeClassProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectAppProbeClassProfileParcelDataSource{}
+)
+
+func NewPolicyObjectAppProbeClassProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectAppProbeClassProfileParcelDataSource{}
+}
+
+type PolicyObjectAppProbeClassProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectAppProbeClassProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_app_probe_class"
+}
+
+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 Class Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "App Probe List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "map": schema.ListNestedAttribute{
+ MarkdownDescription: "Map",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "color": schema.StringAttribute{
+ MarkdownDescription: "Color",
+ Computed: true,
+ },
+ "dscp": schema.Int64Attribute{
+ MarkdownDescription: "DSCP number",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "forwarding_class": schema.StringAttribute{
+ MarkdownDescription: "Forwarding Class Name",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectAppProbeClassProfileParcelDataSource) 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 *PolicyObjectAppProbeClassProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectAppProbeClass
+
+ // 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_app_probe_class_test.go b/internal/provider/data_source_sdwan_policy_object_app_probe_class_test.go
new file mode 100644
index 000000000..f574c08a3
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_app_probe_class_test.go
@@ -0,0 +1,87 @@
+// 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 TestAccDataSourceSdwanPolicyObjectAppProbeClassProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_class.test", "entries.0.map.0.color", "3g"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_class.test", "entries.0.map.0.dscp", "45"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_class.test", "entries.0.forwarding_class", "classlist1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectAppProbeClassProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectAppProbeClassProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_app_probe_class" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` map = [{` + "\n"
+ config += ` color = "3g"` + "\n"
+ config += ` dscp = 45` + "\n"
+ config += ` }]` + "\n"
+ config += ` forwarding_class = "classlist1"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_app_probe_class" "test" {
+ id = sdwan_policy_object_app_probe_class.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_application_list.go b/internal/provider/data_source_sdwan_policy_object_application_list.go
new file mode 100644
index 000000000..3e4beeecb
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_application_list.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 = &PolicyObjectApplicationListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectApplicationListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectApplicationListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectApplicationListProfileParcelDataSource{}
+}
+
+type PolicyObjectApplicationListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectApplicationListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_application_list"
+}
+
+func (d *PolicyObjectApplicationListProfileParcelDataSource) 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 Application List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Centralized Policy App List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "application": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "application_family": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectApplicationListProfileParcelDataSource) 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 *PolicyObjectApplicationListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectApplicationList
+
+ // 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_application_list_test.go b/internal/provider/data_source_sdwan_policy_object_application_list_test.go
new file mode 100644
index 000000000..bef6a0bfc
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_application_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectApplicationListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_application_list.test", "entries.0.application", "3com-amp3"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectApplicationListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectApplicationListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectApplicationListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectApplicationListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_application_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` application = "3com-amp3"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_application_list" "test" {
+ id = sdwan_policy_object_application_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_as_path_list.go b/internal/provider/data_source_sdwan_policy_object_as_path_list.go
new file mode 100644
index 000000000..a66700d91
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_as_path_list.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 = &PolicyObjectASPathListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectASPathListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectASPathListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectASPathListProfileParcelDataSource{}
+}
+
+type PolicyObjectASPathListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectASPathListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_as_path_list"
+}
+
+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 List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "as_path_list_id": schema.Int64Attribute{
+ MarkdownDescription: "As path List Number",
+ Computed: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "AS Path List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_list": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectASPathListProfileParcelDataSource) 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 *PolicyObjectASPathListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectASPathList
+
+ // 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_as_path_list_test.go b/internal/provider/data_source_sdwan_policy_object_as_path_list_test.go
new file mode 100644
index 000000000..c06251379
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_as_path_list_test.go
@@ -0,0 +1,83 @@
+// 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 TestAccDataSourceSdwanPolicyObjectASPathListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_as_path_list.test", "as_path_list_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_as_path_list.test", "entries.0.as_path_list", "110"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectASPathListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectASPathListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_as_path_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` as_path_list_id = 1` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` as_path_list = "110"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_as_path_list" "test" {
+ id = sdwan_policy_object_as_path_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_class_map.go b/internal/provider/data_source_sdwan_policy_object_class_map.go
new file mode 100644
index 000000000..f0e152041
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_class_map.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectClassMapProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectClassMapProfileParcelDataSource{}
+)
+
+func NewPolicyObjectClassMapProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectClassMapProfileParcelDataSource{}
+}
+
+type PolicyObjectClassMapProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectClassMapProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_class_map"
+}
+
+func (d *PolicyObjectClassMapProfileParcelDataSource) 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 Class Map Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "class map List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "queue": schema.StringAttribute{
+ MarkdownDescription: "select a queue",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectClassMapProfileParcelDataSource) 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 *PolicyObjectClassMapProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectClassMap
+
+ // 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_class_map_test.go b/internal/provider/data_source_sdwan_policy_object_class_map_test.go
new file mode 100644
index 000000000..1a0eb1f90
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_class_map_test.go
@@ -0,0 +1,82 @@
+// 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 TestAccDataSourceSdwanPolicyObjectClassMapProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_class_map.test", "entries.0.queue", "0"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectClassMapPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectClassMapProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectClassMapPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectClassMapProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_class_map" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` queue = "0"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_class_map" "test" {
+ id = sdwan_policy_object_class_map.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_color_list.go b/internal/provider/data_source_sdwan_policy_object_color_list.go
new file mode 100644
index 000000000..4aad86855
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_color_list.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectColorListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectColorListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectColorListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectColorListProfileParcelDataSource{}
+}
+
+type PolicyObjectColorListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectColorListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_color_list"
+}
+
+func (d *PolicyObjectColorListProfileParcelDataSource) 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 Color List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Color List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "color": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectColorListProfileParcelDataSource) 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 *PolicyObjectColorListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectColorList
+
+ // 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_color_list_test.go b/internal/provider/data_source_sdwan_policy_object_color_list_test.go
new file mode 100644
index 000000000..9c89d7b5c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_color_list_test.go
@@ -0,0 +1,82 @@
+// 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 TestAccDataSourceSdwanPolicyObjectColorListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_color_list.test", "entries.0.color", "blue"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectColorListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectColorListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectColorListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectColorListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_color_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` color = "blue"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_color_list" "test" {
+ id = sdwan_policy_object_color_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_data_ipv4_prefix_list.go b/internal/provider/data_source_sdwan_policy_object_data_ipv4_prefix_list.go
new file mode 100644
index 000000000..75c5a4449
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_data_ipv4_prefix_list.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 = &PolicyObjectDataIPv4PrefixListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectDataIPv4PrefixListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectDataIPv4PrefixListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectDataIPv4PrefixListProfileParcelDataSource{}
+}
+
+type PolicyObjectDataIPv4PrefixListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectDataIPv4PrefixListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_data_ipv4_prefix_list"
+}
+
+func (d *PolicyObjectDataIPv4PrefixListProfileParcelDataSource) 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 Data IPv4 Prefix List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Data Prefix List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "IPv4 address",
+ Computed: true,
+ },
+ "ipv4_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: "IPv4 prefix Length",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectDataIPv4PrefixListProfileParcelDataSource) 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 *PolicyObjectDataIPv4PrefixListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectDataIPv4PrefixList
+
+ // 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_data_ipv4_prefix_list_test.go b/internal/provider/data_source_sdwan_policy_object_data_ipv4_prefix_list_test.go
new file mode 100644
index 000000000..c81de28c3
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_data_ipv4_prefix_list_test.go
@@ -0,0 +1,84 @@
+// 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 TestAccDataSourceSdwanPolicyObjectDataIPv4PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_data_ipv4_prefix_list.test", "entries.0.ipv4_address", "10.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_data_ipv4_prefix_list.test", "entries.0.ipv4_prefix_length", "8"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectDataIPv4PrefixListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectDataIPv4PrefixListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectDataIPv4PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectDataIPv4PrefixListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_data_ipv4_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv4_address = "10.0.0.0"` + "\n"
+ config += ` ipv4_prefix_length = 8` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_data_ipv4_prefix_list" "test" {
+ id = sdwan_policy_object_data_ipv4_prefix_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_data_ipv6_prefix_list.go b/internal/provider/data_source_sdwan_policy_object_data_ipv6_prefix_list.go
new file mode 100644
index 000000000..a0548363b
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_data_ipv6_prefix_list.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 = &PolicyObjectDataIPv6PrefixListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectDataIPv6PrefixListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectDataIPv6PrefixListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectDataIPv6PrefixListProfileParcelDataSource{}
+}
+
+type PolicyObjectDataIPv6PrefixListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectDataIPv6PrefixListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_data_ipv6_prefix_list"
+}
+
+func (d *PolicyObjectDataIPv6PrefixListProfileParcelDataSource) 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 Data IPv6 Prefix List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Prefix List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 address",
+ Computed: true,
+ },
+ "ipv6_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: "IPv6 prefix",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectDataIPv6PrefixListProfileParcelDataSource) 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 *PolicyObjectDataIPv6PrefixListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectDataIPv6PrefixList
+
+ // 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_data_ipv6_prefix_list_test.go b/internal/provider/data_source_sdwan_policy_object_data_ipv6_prefix_list_test.go
new file mode 100644
index 000000000..e1dc5dd7f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_data_ipv6_prefix_list_test.go
@@ -0,0 +1,84 @@
+// 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 TestAccDataSourceSdwanPolicyObjectDataIPv6PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_data_ipv6_prefix_list.test", "entries.0.ipv6_address", "2001:db8:85a3::8a2e:370:7334"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_data_ipv6_prefix_list.test", "entries.0.ipv6_prefix_length", "64"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectDataIPv6PrefixListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectDataIPv6PrefixListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectDataIPv6PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectDataIPv6PrefixListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_data_ipv6_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv6_address = "2001:db8:85a3::8a2e:370:7334"` + "\n"
+ config += ` ipv6_prefix_length = 64` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_data_ipv6_prefix_list" "test" {
+ id = sdwan_policy_object_data_ipv6_prefix_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_expanded_community_list.go b/internal/provider/data_source_sdwan_policy_object_expanded_community_list.go
new file mode 100644
index 000000000..81fc82635
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_expanded_community_list.go
@@ -0,0 +1,132 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &PolicyObjectExpandedCommunityListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectExpandedCommunityListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectExpandedCommunityListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectExpandedCommunityListProfileParcelDataSource{}
+}
+
+type PolicyObjectExpandedCommunityListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectExpandedCommunityListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_expanded_community_list"
+}
+
+func (d *PolicyObjectExpandedCommunityListProfileParcelDataSource) 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 Expanded Community List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "expanded_community_lists": schema.SetAttribute{
+ MarkdownDescription: "Expanded Community List",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "expanded_community_lists_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectExpandedCommunityListProfileParcelDataSource) 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 *PolicyObjectExpandedCommunityListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectExpandedCommunityList
+
+ // 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_expanded_community_list_test.go b/internal/provider/data_source_sdwan_policy_object_expanded_community_list_test.go
new file mode 100644
index 000000000..38f0e1541
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_expanded_community_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccDataSourceSdwanPolicyObjectExpandedCommunityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectExpandedCommunityListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectExpandedCommunityListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectExpandedCommunityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectExpandedCommunityListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_expanded_community_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` expanded_community_lists = ["abcd"]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_expanded_community_list" "test" {
+ id = sdwan_policy_object_expanded_community_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_extended_community_list.go b/internal/provider/data_source_sdwan_policy_object_extended_community_list.go
new file mode 100644
index 000000000..d0c268426
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_extended_community_list.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectExtendedCommunityListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectExtendedCommunityListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectExtendedCommunityListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectExtendedCommunityListProfileParcelDataSource{}
+}
+
+type PolicyObjectExtendedCommunityListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectExtendedCommunityListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_extended_community_list"
+}
+
+func (d *PolicyObjectExtendedCommunityListProfileParcelDataSource) 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 Extended Community List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Extended Community List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "extended_community": schema.StringAttribute{
+ MarkdownDescription: "can be soo 10.0.0.1:30 or rt 500:50 etc.",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectExtendedCommunityListProfileParcelDataSource) 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 *PolicyObjectExtendedCommunityListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectExtendedCommunityList
+
+ // 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_extended_community_list_test.go b/internal/provider/data_source_sdwan_policy_object_extended_community_list_test.go
new file mode 100644
index 000000000..836eaac71
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_extended_community_list_test.go
@@ -0,0 +1,82 @@
+// 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 TestAccDataSourceSdwanPolicyObjectExtendedCommunityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_extended_community_list.test", "entries.0.extended_community", "soo 10.0.0.1:30"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectExtendedCommunityListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectExtendedCommunityListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectExtendedCommunityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectExtendedCommunityListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_extended_community_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` extended_community = "soo 10.0.0.1:30"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_extended_community_list" "test" {
+ id = sdwan_policy_object_extended_community_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_feature_profile.go b/internal/provider/data_source_sdwan_policy_object_feature_profile.go
new file mode 100644
index 000000000..2ee7d13a9
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_feature_profile.go
@@ -0,0 +1,113 @@
+// 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 = &PolicyObjectFeatureProfileDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectFeatureProfileDataSource{}
+)
+
+func NewPolicyObjectFeatureProfileDataSource() datasource.DataSource {
+ return &PolicyObjectFeatureProfileDataSource{}
+}
+
+type PolicyObjectFeatureProfileDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectFeatureProfileDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_feature_profile"
+}
+
+func (d *PolicyObjectFeatureProfileDataSource) 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 Feature Profile .",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Required: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the policy object feature profile",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Description",
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectFeatureProfileDataSource) 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 *PolicyObjectFeatureProfileDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectFeatureProfile
+
+ // 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.Id.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_feature_profile_test.go b/internal/provider/data_source_sdwan_policy_object_feature_profile_test.go
new file mode 100644
index 000000000..1497a2a26
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_feature_profile_test.go
@@ -0,0 +1,71 @@
+// 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 TestAccDataSourceSdwanPolicyObjectFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_feature_profile.test", "name", "POLICY_OBJECT_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_feature_profile.test", "description", "My policy object feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectFeatureProfileConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectFeatureProfileConfig() string {
+ config := ""
+ config += `resource "sdwan_policy_object_feature_profile" "test" {` + "\n"
+ config += ` name = "POLICY_OBJECT_FP_1"` + "\n"
+ config += ` description = "My policy object feature profile 1"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_feature_profile" "test" {
+ id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_ipv4_prefix_list.go b/internal/provider/data_source_sdwan_policy_object_ipv4_prefix_list.go
new file mode 100644
index 000000000..2afcaf101
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_ipv4_prefix_list.go
@@ -0,0 +1,145 @@
+// 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 = &PolicyObjectIPv4PrefixListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectIPv4PrefixListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectIPv4PrefixListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectIPv4PrefixListProfileParcelDataSource{}
+}
+
+type PolicyObjectIPv4PrefixListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectIPv4PrefixListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_ipv4_prefix_list"
+}
+
+func (d *PolicyObjectIPv4PrefixListProfileParcelDataSource) 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 IPv4 Prefix List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Prefix List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "IPv4 address",
+ Computed: true,
+ },
+ "ipv4_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: "IPv4 prefix length",
+ Computed: true,
+ },
+ "le": schema.Int64Attribute{
+ MarkdownDescription: "IPv4 prefix length with le range operator",
+ Computed: true,
+ },
+ "ge": schema.Int64Attribute{
+ MarkdownDescription: "IPv4 prefix length with ge range operator",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectIPv4PrefixListProfileParcelDataSource) 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 *PolicyObjectIPv4PrefixListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectIPv4PrefixList
+
+ // 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_ipv4_prefix_list_test.go b/internal/provider/data_source_sdwan_policy_object_ipv4_prefix_list_test.go
new file mode 100644
index 000000000..a7042f9ac
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_ipv4_prefix_list_test.go
@@ -0,0 +1,88 @@
+// 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 TestAccDataSourceSdwanPolicyObjectIPv4PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv4_prefix_list.test", "entries.0.ipv4_address", "10.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv4_prefix_list.test", "entries.0.ipv4_prefix_length", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv4_prefix_list.test", "entries.0.le", "24"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv4_prefix_list.test", "entries.0.ge", "16"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectIPv4PrefixListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectIPv4PrefixListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectIPv4PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectIPv4PrefixListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_ipv4_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv4_address = "10.0.0.0"` + "\n"
+ config += ` ipv4_prefix_length = 8` + "\n"
+ config += ` le = 24` + "\n"
+ config += ` ge = 16` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_ipv4_prefix_list" "test" {
+ id = sdwan_policy_object_ipv4_prefix_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_ipv6_prefix_list.go b/internal/provider/data_source_sdwan_policy_object_ipv6_prefix_list.go
new file mode 100644
index 000000000..edb9c8ab1
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_ipv6_prefix_list.go
@@ -0,0 +1,145 @@
+// 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 = &PolicyObjectIPv6PrefixListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectIPv6PrefixListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectIPv6PrefixListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectIPv6PrefixListProfileParcelDataSource{}
+}
+
+type PolicyObjectIPv6PrefixListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectIPv6PrefixListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_ipv6_prefix_list"
+}
+
+func (d *PolicyObjectIPv6PrefixListProfileParcelDataSource) 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 IPv6 Prefix List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Prefix List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 address",
+ Computed: true,
+ },
+ "ipv6_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: "IPv6 prefix length",
+ Computed: true,
+ },
+ "le": schema.Int64Attribute{
+ MarkdownDescription: "IPv6 prefix length with le range operator",
+ Computed: true,
+ },
+ "ge": schema.Int64Attribute{
+ MarkdownDescription: "IPv6 prefix length with ge range operator",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectIPv6PrefixListProfileParcelDataSource) 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 *PolicyObjectIPv6PrefixListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectIPv6PrefixList
+
+ // 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_ipv6_prefix_list_test.go b/internal/provider/data_source_sdwan_policy_object_ipv6_prefix_list_test.go
new file mode 100644
index 000000000..89a3d52df
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_ipv6_prefix_list_test.go
@@ -0,0 +1,88 @@
+// 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 TestAccDataSourceSdwanPolicyObjectIPv6PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv6_prefix_list.test", "entries.0.ipv6_address", "2001:db8:85a3::8a2e:370:7334"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv6_prefix_list.test", "entries.0.ipv6_prefix_length", "64"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv6_prefix_list.test", "entries.0.le", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_ipv6_prefix_list.test", "entries.0.ge", "70"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectIPv6PrefixListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectIPv6PrefixListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectIPv6PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectIPv6PrefixListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_ipv6_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv6_address = "2001:db8:85a3::8a2e:370:7334"` + "\n"
+ config += ` ipv6_prefix_length = 64` + "\n"
+ config += ` le = 100` + "\n"
+ config += ` ge = 70` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_ipv6_prefix_list" "test" {
+ id = sdwan_policy_object_ipv6_prefix_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_mirror.go b/internal/provider/data_source_sdwan_policy_object_mirror.go
new file mode 100644
index 000000000..3a64d2492
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_mirror.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 = &PolicyObjectMirrorProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectMirrorProfileParcelDataSource{}
+)
+
+func NewPolicyObjectMirrorProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectMirrorProfileParcelDataSource{}
+}
+
+type PolicyObjectMirrorProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectMirrorProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_mirror"
+}
+
+func (d *PolicyObjectMirrorProfileParcelDataSource) 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 Mirror Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Mirror List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "remote_destination_ip": schema.StringAttribute{
+ MarkdownDescription: "remote destination ip address",
+ Computed: true,
+ },
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: "source ip address",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectMirrorProfileParcelDataSource) 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 *PolicyObjectMirrorProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectMirror
+
+ // 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_mirror_test.go b/internal/provider/data_source_sdwan_policy_object_mirror_test.go
new file mode 100644
index 000000000..5bae717fd
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_mirror_test.go
@@ -0,0 +1,84 @@
+// 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 TestAccDataSourceSdwanPolicyObjectMirrorProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_mirror.test", "entries.0.remote_destination_ip", "10.0.0.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_mirror.test", "entries.0.source_ip", "10.0.0.2"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectMirrorPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectMirrorProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectMirrorPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectMirrorProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_mirror" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` remote_destination_ip = "10.0.0.1"` + "\n"
+ config += ` source_ip = "10.0.0.2"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_mirror" "test" {
+ id = sdwan_policy_object_mirror.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_policer.go b/internal/provider/data_source_sdwan_policy_object_policer.go
new file mode 100644
index 000000000..3add155f4
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_policer.go
@@ -0,0 +1,141 @@
+// 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 = &PolicyObjectPolicerProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectPolicerProfileParcelDataSource{}
+)
+
+func NewPolicyObjectPolicerProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectPolicerProfileParcelDataSource{}
+}
+
+type PolicyObjectPolicerProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectPolicerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_policer"
+}
+
+func (d *PolicyObjectPolicerProfileParcelDataSource) 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 Policer Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Policer Entries",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "burst_bytes": schema.Int64Attribute{
+ MarkdownDescription: "Burst (Bytes)",
+ Computed: true,
+ },
+ "exceed_action": schema.StringAttribute{
+ MarkdownDescription: "Exceed options such as Drop or Remark",
+ Computed: true,
+ },
+ "rate_bps": schema.Int64Attribute{
+ MarkdownDescription: "Rate (bps)",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectPolicerProfileParcelDataSource) 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 *PolicyObjectPolicerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectPolicer
+
+ // 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_policer_test.go b/internal/provider/data_source_sdwan_policy_object_policer_test.go
new file mode 100644
index 000000000..bba3ba725
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_policer_test.go
@@ -0,0 +1,86 @@
+// 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 TestAccDataSourceSdwanPolicyObjectPolicerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_policer.test", "entries.0.burst_bytes", "56500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_policer.test", "entries.0.exceed_action", "remark"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_policer.test", "entries.0.rate_bps", "60000"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectPolicerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectPolicerProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectPolicerPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectPolicerProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_policer" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` burst_bytes = 56500` + "\n"
+ config += ` exceed_action = "remark"` + "\n"
+ config += ` rate_bps = 60000` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_policer" "test" {
+ id = sdwan_policy_object_policer.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_preferred_color_group.go b/internal/provider/data_source_sdwan_policy_object_preferred_color_group.go
new file mode 100644
index 000000000..f7bb35e88
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_preferred_color_group.go
@@ -0,0 +1,157 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &PolicyObjectPreferredColorGroupProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectPreferredColorGroupProfileParcelDataSource{}
+)
+
+func NewPolicyObjectPreferredColorGroupProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectPreferredColorGroupProfileParcelDataSource{}
+}
+
+type PolicyObjectPreferredColorGroupProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectPreferredColorGroupProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_preferred_color_group"
+}
+
+func (d *PolicyObjectPreferredColorGroupProfileParcelDataSource) 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 Preferred Color Group Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Preferred Color Group List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "primary_color_preference": schema.SetAttribute{
+ MarkdownDescription: "",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "primary_path_preference": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "secondary_color_preference": schema.SetAttribute{
+ MarkdownDescription: "",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "secondary_path_preference": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tertiary_color_preference": schema.SetAttribute{
+ MarkdownDescription: "",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "tertiary_path_preference": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectPreferredColorGroupProfileParcelDataSource) 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 *PolicyObjectPreferredColorGroupProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectPreferredColorGroup
+
+ // 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_preferred_color_group_test.go b/internal/provider/data_source_sdwan_policy_object_preferred_color_group_test.go
new file mode 100644
index 000000000..9684c1202
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_preferred_color_group_test.go
@@ -0,0 +1,88 @@
+// 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 TestAccDataSourceSdwanPolicyObjectPreferredColorGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_preferred_color_group.test", "entries.0.primary_path_preference", "direct-path"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_preferred_color_group.test", "entries.0.secondary_path_preference", "all-paths"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_preferred_color_group.test", "entries.0.tertiary_path_preference", "all-paths"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectPreferredColorGroupPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectPreferredColorGroupProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectPreferredColorGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectPreferredColorGroupProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_preferred_color_group" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` primary_color_preference = ["default"]` + "\n"
+ config += ` primary_path_preference = "direct-path"` + "\n"
+ config += ` secondary_color_preference = ["bronze"]` + "\n"
+ config += ` secondary_path_preference = "all-paths"` + "\n"
+ config += ` tertiary_color_preference = ["blue"]` + "\n"
+ config += ` tertiary_path_preference = "all-paths"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_preferred_color_group" "test" {
+ id = sdwan_policy_object_preferred_color_group.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list.go b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list.go
new file mode 100644
index 000000000..e66f1a08e
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list.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"
+}
+
+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 Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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_test.go b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_test.go
new file mode 100644
index 000000000..6daf0faec
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_test.go
@@ -0,0 +1,81 @@
+// 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") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_data_ipv4_prefix_list.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 = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.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" "test" {
+ id = sdwan_policy_object_security_data_ipv4_prefix_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_fqdn_list.go b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list.go
new file mode 100644
index 000000000..191932a81
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectSecurityFQDNListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityFQDNListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityFQDNListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityFQDNListProfileParcelDataSource{}
+}
+
+type PolicyObjectSecurityFQDNListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSecurityFQDNListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_fqdn_list"
+}
+
+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 FQDN List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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 *PolicyObjectSecurityFQDNListProfileParcelDataSource) 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 *PolicyObjectSecurityFQDNListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityFQDNList
+
+ // 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_fqdn_list_test.go b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list_test.go
new file mode 100644
index 000000000..6e89be64f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityFQDNListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_fqdn_list.test", "entries.0.pattern", "cisco.com"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityFQDNListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSecurityFQDNListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_security_fqdn_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` pattern = "cisco.com"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_fqdn_list" "test" {
+ id = sdwan_policy_object_security_fqdn_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_geolocation_list.go b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list.go
new file mode 100644
index 000000000..0bb11f4a3
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list.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 = &PolicyObjectSecurityGeolocationListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityGeolocationListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityGeolocationListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityGeolocationListProfileParcelDataSource{}
+}
+
+type PolicyObjectSecurityGeolocationListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSecurityGeolocationListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_geolocation_list"
+}
+
+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 List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Geolocation List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "country": schema.StringAttribute{
+ MarkdownDescription: "country names",
+ Computed: true,
+ },
+ "continent": schema.StringAttribute{
+ MarkdownDescription: "continent name",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectSecurityGeolocationListProfileParcelDataSource) 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 *PolicyObjectSecurityGeolocationListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityGeolocationList
+
+ // 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_list_test.go b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list_test.go
new file mode 100644
index 000000000..267bfac4b
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityGeolocationListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_geolocation_list.test", "entries.0.country", "DZA"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_security_geolocation_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` country = "DZA"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_geolocation_list" "test" {
+ id = sdwan_policy_object_security_geolocation_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_identity_list.go b/internal/provider/data_source_sdwan_policy_object_security_identity_list.go
new file mode 100644
index 000000000..8096a2ce8
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_identity_list.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 = &PolicyObjectSecurityIdentityListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityIdentityListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityIdentityListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityIdentityListProfileParcelDataSource{}
+}
+
+type PolicyObjectSecurityIdentityListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSecurityIdentityListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_identity_list"
+}
+
+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 Identity List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Array of Users and User Groups",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "user": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "user_group": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectSecurityIdentityListProfileParcelDataSource) 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 *PolicyObjectSecurityIdentityListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityIdentityList
+
+ // 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_identity_list_test.go b/internal/provider/data_source_sdwan_policy_object_security_identity_list_test.go
new file mode 100644
index 000000000..95e55995c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_identity_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityIdentityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_identity_list.test", "entries.0.user", "administrator"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityIdentityListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSecurityIdentityListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_security_identity_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` user = "administrator"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_identity_list" "test" {
+ id = sdwan_policy_object_security_identity_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_ips_signature.go b/internal/provider/data_source_sdwan_policy_object_security_ips_signature.go
new file mode 100644
index 000000000..b3fec340a
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_ips_signature.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 = &PolicyObjectSecurityIPSSignatureProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityIPSSignatureProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityIPSSignatureProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityIPSSignatureProfileParcelDataSource{}
+}
+
+type PolicyObjectSecurityIPSSignatureProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSecurityIPSSignatureProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_ips_signature"
+}
+
+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 Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Ips Signature",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "generator_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "signature_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectSecurityIPSSignatureProfileParcelDataSource) 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 *PolicyObjectSecurityIPSSignatureProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityIPSSignature
+
+ // 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_ips_signature_test.go b/internal/provider/data_source_sdwan_policy_object_security_ips_signature_test.go
new file mode 100644
index 000000000..a9538768e
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_ips_signature_test.go
@@ -0,0 +1,83 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityIPSSignatureProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_ips_signature.test", "entries.0.generator_id", "1234"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_ips_signature.test", "entries.0.signature_id", "5678"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_security_ips_signature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` generator_id = "1234"` + "\n"
+ config += ` signature_id = "5678"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_ips_signature" "test" {
+ id = sdwan_policy_object_security_ips_signature.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_local_application_list.go b/internal/provider/data_source_sdwan_policy_object_security_local_application_list.go
new file mode 100644
index 000000000..d276664a4
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_local_application_list.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"
+}
+
+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 Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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_test.go b/internal/provider/data_source_sdwan_policy_object_security_local_application_list_test.go
new file mode 100644
index 000000000..b03bde68b
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_local_application_list_test.go
@@ -0,0 +1,81 @@
+// 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") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_local_application_list.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 = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` app = "audible-com"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_local_application_list" "test" {
+ id = sdwan_policy_object_security_local_application_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_local_domain_list.go b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list.go
new file mode 100644
index 000000000..13f7c9c4f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectSecurityLocalDomainListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityLocalDomainListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityLocalDomainListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityLocalDomainListProfileParcelDataSource{}
+}
+
+type PolicyObjectSecurityLocalDomainListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSecurityLocalDomainListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_local_domain_list"
+}
+
+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 Local Domain List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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{
+ "local_domain": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectSecurityLocalDomainListProfileParcelDataSource) 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 *PolicyObjectSecurityLocalDomainListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityLocalDomainList
+
+ // 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_domain_list_test.go b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list_test.go
new file mode 100644
index 000000000..3cc674abd
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityLocalDomainListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_local_domain_list.test", "entries.0.local_domain", "hello.com"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_security_local_domain_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` local_domain = "hello.com"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_local_domain_list" "test" {
+ id = sdwan_policy_object_security_local_domain_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_port_list.go b/internal/provider/data_source_sdwan_policy_object_security_port_list.go
new file mode 100644
index 000000000..3586a41f4
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_port_list.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectSecurityPortListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityPortListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityPortListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityPortListProfileParcelDataSource{}
+}
+
+type PolicyObjectSecurityPortListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSecurityPortListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_port_list"
+}
+
+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 Port List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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 *PolicyObjectSecurityPortListProfileParcelDataSource) 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 *PolicyObjectSecurityPortListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityPortList
+
+ // 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_list_test.go b/internal/provider/data_source_sdwan_policy_object_security_port_list_test.go
new file mode 100644
index 000000000..6ef5b1f88
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_port_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityPortListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_port_list.test", "entries.0.port", "100"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityPortListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSecurityPortListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_security_port_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` port = "100"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_port_list" "test" {
+ id = sdwan_policy_object_security_port_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list.go b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list.go
new file mode 100644
index 000000000..0517bb78f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list.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 = &PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityScalableGroupTagListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource{}
+}
+
+type PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_scalable_group_tag_list"
+}
+
+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 List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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{
+ "sgt_name": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tag": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource) 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 *PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityScalableGroupTagList
+
+ // 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_scalable_group_tag_list_test.go b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_test.go
new file mode 100644
index 000000000..f5325d012
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_test.go
@@ -0,0 +1,83 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_scalable_group_tag_list.test", "entries.0.sgt_name", "ANY"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_scalable_group_tag_list.test", "entries.0.tag", "65535"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_security_scalable_group_tag_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` sgt_name = "ANY"` + "\n"
+ config += ` tag = "65535"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_scalable_group_tag_list" "test" {
+ id = sdwan_policy_object_security_scalable_group_tag_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_security_url_list.go b/internal/provider/data_source_sdwan_policy_object_security_url_list.go
new file mode 100644
index 000000000..ba55a2231
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_url_list.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectSecurityURLListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityURLListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSecurityURLListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSecurityURLListProfileParcelDataSource{}
+}
+
+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_url_list"
+}
+
+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 URL List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "URL List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "pattern": schema.StringAttribute{
+ MarkdownDescription: "valid url pattern",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectSecurityURLListProfileParcelDataSource) 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 *PolicyObjectSecurityURLListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSecurityURLList
+
+ // 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_url_list_test.go b/internal/provider/data_source_sdwan_policy_object_security_url_list_test.go
new file mode 100644
index 000000000..69e21ba5a
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_security_url_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSecurityURLListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_url_list.test", "entries.0.pattern", "www.cisco.com"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSecurityURLListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityURLListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSecurityURLListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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_url_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` pattern = "www.cisco.com"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_security_url_list" "test" {
+ id = sdwan_policy_object_security_url_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_sla_class_list.go b/internal/provider/data_source_sdwan_policy_object_sla_class_list.go
new file mode 100644
index 000000000..4c70d6d6c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_sla_class_list.go
@@ -0,0 +1,161 @@
+// 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 = &PolicyObjectSLAClassListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectSLAClassListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectSLAClassListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectSLAClassListProfileParcelDataSource{}
+}
+
+type PolicyObjectSLAClassListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectSLAClassListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_sla_class_list"
+}
+
+func (d *PolicyObjectSLAClassListProfileParcelDataSource) 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 SLA Class List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Sla class List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "latency": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "loss": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "jitter": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "app_probe_class_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "fallback_best_tunnel_criteria": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "fallback_best_tunnel_loss_variance": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "fallback_best_tunnel_latency_variance": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "fallback_best_tunnel_jitter_variance": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectSLAClassListProfileParcelDataSource) 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 *PolicyObjectSLAClassListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectSLAClassList
+
+ // 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_sla_class_list_test.go b/internal/provider/data_source_sdwan_policy_object_sla_class_list_test.go
new file mode 100644
index 000000000..910317f13
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_sla_class_list_test.go
@@ -0,0 +1,90 @@
+// 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 TestAccDataSourceSdwanPolicyObjectSLAClassListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_sla_class_list.test", "entries.0.latency", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_sla_class_list.test", "entries.0.loss", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_sla_class_list.test", "entries.0.jitter", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_sla_class_list.test", "entries.0.fallback_best_tunnel_criteria", "loss"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_sla_class_list.test", "entries.0.fallback_best_tunnel_loss_variance", "5"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectSLAClassListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSLAClassListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectSLAClassListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectSLAClassListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_sla_class_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` latency = 2` + "\n"
+ config += ` loss = 1` + "\n"
+ config += ` jitter = 1` + "\n"
+ config += ` fallback_best_tunnel_criteria = "loss"` + "\n"
+ config += ` fallback_best_tunnel_loss_variance = 5` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_sla_class_list" "test" {
+ id = sdwan_policy_object_sla_class_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_standard_community_list.go b/internal/provider/data_source_sdwan_policy_object_standard_community_list.go
new file mode 100644
index 000000000..738793fdd
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_standard_community_list.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectStandardCommunityListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectStandardCommunityListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectStandardCommunityListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectStandardCommunityListProfileParcelDataSource{}
+}
+
+type PolicyObjectStandardCommunityListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectStandardCommunityListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_standard_community_list"
+}
+
+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 List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Standard Community List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "standard_community": schema.StringAttribute{
+ MarkdownDescription: "Standard Community",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectStandardCommunityListProfileParcelDataSource) 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 *PolicyObjectStandardCommunityListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectStandardCommunityList
+
+ // 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_standard_community_list_test.go b/internal/provider/data_source_sdwan_policy_object_standard_community_list_test.go
new file mode 100644
index 000000000..e5b764d29
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_standard_community_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectStandardCommunityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_standard_community_list.test", "entries.0.standard_community", "1000:10000"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectStandardCommunityListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectStandardCommunityListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_standard_community_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` standard_community = "1000:10000"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_standard_community_list" "test" {
+ id = sdwan_policy_object_standard_community_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_tloc_list.go b/internal/provider/data_source_sdwan_policy_object_tloc_list.go
new file mode 100644
index 000000000..d67b72570
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_tloc_list.go
@@ -0,0 +1,145 @@
+// 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 = &PolicyObjectTLOCListProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectTLOCListProfileParcelDataSource{}
+)
+
+func NewPolicyObjectTLOCListProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectTLOCListProfileParcelDataSource{}
+}
+
+type PolicyObjectTLOCListProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectTLOCListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_tloc_list"
+}
+
+func (d *PolicyObjectTLOCListProfileParcelDataSource) 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 TLOC List Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "TLOC List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "tloc_ip": schema.StringAttribute{
+ MarkdownDescription: "tloc",
+ Computed: true,
+ },
+ "color": schema.StringAttribute{
+ MarkdownDescription: "color",
+ Computed: true,
+ },
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: "encapsulation",
+ Computed: true,
+ },
+ "preference": schema.StringAttribute{
+ MarkdownDescription: "Preference",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectTLOCListProfileParcelDataSource) 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 *PolicyObjectTLOCListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectTLOCList
+
+ // 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_tloc_list_test.go b/internal/provider/data_source_sdwan_policy_object_tloc_list_test.go
new file mode 100644
index 000000000..c52a2edaf
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_tloc_list_test.go
@@ -0,0 +1,88 @@
+// 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 TestAccDataSourceSdwanPolicyObjectTLOCListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_tloc_list.test", "entries.0.tloc_ip", "10.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_tloc_list.test", "entries.0.color", "3g"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_tloc_list.test", "entries.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_tloc_list.test", "entries.0.preference", "33"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectTLOCListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectTLOCListProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectTLOCListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectTLOCListProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_tloc_list" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` tloc_ip = "10.0.0.0"` + "\n"
+ config += ` color = "3g"` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = "33"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_tloc_list" "test" {
+ id = sdwan_policy_object_tloc_list.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_policy_object_vpn_group.go b/internal/provider/data_source_sdwan_policy_object_vpn_group.go
new file mode 100644
index 000000000..608f44f5f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_vpn_group.go
@@ -0,0 +1,133 @@
+// 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 = &PolicyObjectVPNGroupProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &PolicyObjectVPNGroupProfileParcelDataSource{}
+)
+
+func NewPolicyObjectVPNGroupProfileParcelDataSource() datasource.DataSource {
+ return &PolicyObjectVPNGroupProfileParcelDataSource{}
+}
+
+type PolicyObjectVPNGroupProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *PolicyObjectVPNGroupProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_vpn_group"
+}
+
+func (d *PolicyObjectVPNGroupProfileParcelDataSource) 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 VPN Group Policy_object.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: "VPN List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "can be single vpn id or vpn id range",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *PolicyObjectVPNGroupProfileParcelDataSource) 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 *PolicyObjectVPNGroupProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config PolicyObjectVPNGroup
+
+ // 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_vpn_group_test.go b/internal/provider/data_source_sdwan_policy_object_vpn_group_test.go
new file mode 100644
index 000000000..0dc8acb36
--- /dev/null
+++ b/internal/provider/data_source_sdwan_policy_object_vpn_group_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanPolicyObjectVPNGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_vpn_group.test", "entries.0.vpn", "100"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanPolicyObjectVPNGroupPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectVPNGroupProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanPolicyObjectVPNGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanPolicyObjectVPNGroupProfileParcelConfig() string {
+ config := `resource "sdwan_policy_object_vpn_group" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` vpn = 100` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_policy_object_vpn_group" "test" {
+ id = sdwan_policy_object_vpn_group.test.id
+ feature_profile_id = sdwan_policy_object_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_feature.go b/internal/provider/data_source_sdwan_service_lan_vpn_feature.go
new file mode 100644
index 000000000..1828f7d2c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_feature.go
@@ -0,0 +1,991 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &ServiceLANVPNProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceLANVPNProfileParcelDataSource{}
+)
+
+func NewServiceLANVPNProfileParcelDataSource() datasource.DataSource {
+ return &ServiceLANVPNProfileParcelDataSource{}
+}
+
+type ServiceLANVPNProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceLANVPNProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_feature"
+}
+
+func (d *ServiceLANVPNProfileParcelDataSource) 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 Service LAN VPN Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "VPN",
+ Computed: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "config_description": schema.StringAttribute{
+ MarkdownDescription: "Name",
+ Computed: true,
+ },
+ "config_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "omp_admin_distance_ipv4": schema.Int64Attribute{
+ MarkdownDescription: "OMP Admin Distance IPv4",
+ Computed: true,
+ },
+ "omp_admin_distance_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "omp_admin_distance_ipv6": schema.Int64Attribute{
+ MarkdownDescription: "OMP Admin Distance IPv6",
+ Computed: true,
+ },
+ "omp_admin_distance_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "enable_sdwan_remote_access": schema.BoolAttribute{
+ MarkdownDescription: "Enable SDWAN Remote Access",
+ Computed: true,
+ },
+ "primary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: "Primary DNS Address (IPv4)",
+ Computed: true,
+ },
+ "primary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: "Secondary DNS Address (IPv4)",
+ Computed: true,
+ },
+ "secondary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "primary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: "Primary DNS Address (IPv6)",
+ Computed: true,
+ },
+ "primary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: "Secondary DNS Address (IPv6)",
+ Computed: true,
+ },
+ "secondary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "host_mappings": schema.ListNestedAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "host_name": schema.StringAttribute{
+ MarkdownDescription: "Hostname",
+ Computed: true,
+ },
+ "host_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "list_of_ips": schema.SetAttribute{
+ MarkdownDescription: "List of IP",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "list_of_ips_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "advertise_omp_ipv4s": schema.ListNestedAttribute{
+ MarkdownDescription: "OMP Advertise IPv4",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "prefixes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Prefix List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "aggregate_only": schema.BoolAttribute{
+ MarkdownDescription: "Aggregate Only",
+ Computed: true,
+ },
+ "region": schema.StringAttribute{
+ MarkdownDescription: "Applied to Region",
+ Computed: true,
+ },
+ "region_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "advertise_omp_ipv6s": schema.ListNestedAttribute{
+ MarkdownDescription: "OMP Advertise IPv6",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "protocol_sub_type": schema.StringAttribute{
+ MarkdownDescription: "Protocol Sub Type",
+ Computed: true,
+ },
+ "protocol_sub_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "prefixes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Prefix List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Prefix",
+ Computed: true,
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "aggregate_only": schema.BoolAttribute{
+ MarkdownDescription: "Aggregate Only",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Static Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Route Gateway Next Hop",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "next_hop_with_trackers": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Route Gateway Next Hop with Tracker",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "null0": schema.BoolAttribute{
+ MarkdownDescription: "IPv4 Route Gateway Next Hop",
+ Computed: true,
+ },
+ "gateway_dhcp": schema.BoolAttribute{
+ MarkdownDescription: "IPv4 Route Gateway DHCP",
+ Computed: true,
+ },
+ "vpn": schema.BoolAttribute{
+ MarkdownDescription: "IPv4 Route Gateway VPN",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Static Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: "Prefix",
+ Computed: true,
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Route Gateway Next Hop",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "null0": schema.BoolAttribute{
+ MarkdownDescription: "IPv6 Route Gateway Next Hop",
+ Computed: true,
+ },
+ "nat": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Nat",
+ Computed: true,
+ },
+ "nat_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "services": schema.ListNestedAttribute{
+ MarkdownDescription: "Service",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "service_type": schema.StringAttribute{
+ MarkdownDescription: "Service Type",
+ Computed: true,
+ },
+ "service_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_addresses": schema.SetAttribute{
+ MarkdownDescription: "IPv4 Addresses (Maximum: 4)",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "ipv4_addresses_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracking": schema.BoolAttribute{
+ MarkdownDescription: "Tracking",
+ Computed: true,
+ },
+ "tracking_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "service_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "Service",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "service": schema.StringAttribute{
+ MarkdownDescription: "Service",
+ Computed: true,
+ },
+ "service_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "Service",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "gre_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Static GRE Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface": schema.SetAttribute{
+ MarkdownDescription: "Interface",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "Service",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipsec_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Static IPSEC Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface": schema.SetAttribute{
+ MarkdownDescription: "Interface",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "nat_pools": schema.ListNestedAttribute{
+ MarkdownDescription: "NAT Pool",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "nat_pool_name": schema.Int64Attribute{
+ MarkdownDescription: "NAT Pool Name",
+ Computed: true,
+ },
+ "nat_pool_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "prefix_length": schema.Int64Attribute{
+ MarkdownDescription: "NAT Pool Prefix Length",
+ Computed: true,
+ },
+ "prefix_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "range_start": schema.StringAttribute{
+ MarkdownDescription: "NAT Pool Range Start",
+ Computed: true,
+ },
+ "range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "range_end": schema.StringAttribute{
+ MarkdownDescription: "NAT Pool Range End",
+ Computed: true,
+ },
+ "range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "overload": schema.BoolAttribute{
+ MarkdownDescription: "NAT Overload",
+ Computed: true,
+ },
+ "overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "direction": schema.StringAttribute{
+ MarkdownDescription: "NAT Direction",
+ Computed: true,
+ },
+ "direction_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_object_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "nat_port_forwards": schema.ListNestedAttribute{
+ MarkdownDescription: "NAT Port Forward",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "nat_pool_name": schema.Int64Attribute{
+ MarkdownDescription: "NAT Pool Name",
+ Computed: true,
+ },
+ "nat_pool_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_port": schema.Int64Attribute{
+ MarkdownDescription: "Source Port",
+ Computed: true,
+ },
+ "source_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "translate_port": schema.Int64Attribute{
+ MarkdownDescription: "Translate Port",
+ Computed: true,
+ },
+ "translate_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: "Source IP Address",
+ Computed: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "translated_source_ip": schema.StringAttribute{
+ MarkdownDescription: "Translated Source IP Address",
+ Computed: true,
+ },
+ "translated_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "static_nats": schema.ListNestedAttribute{
+ MarkdownDescription: "Static NAT Rules",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "nat_pool_name": schema.Int64Attribute{
+ MarkdownDescription: "NAT Pool Name",
+ Computed: true,
+ },
+ "nat_pool_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: "Source IP Address",
+ Computed: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "translated_source_ip": schema.StringAttribute{
+ MarkdownDescription: "Translated Source IP Address",
+ Computed: true,
+ },
+ "translated_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "static_nat_direction": schema.StringAttribute{
+ MarkdownDescription: "Static NAT Direction",
+ Computed: true,
+ },
+ "static_nat_direction_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_object_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "nat_64_v4_pools": schema.ListNestedAttribute{
+ MarkdownDescription: "NAT64 V4 Pool",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "NAT64 v4 Pool Name",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "range_start": schema.StringAttribute{
+ MarkdownDescription: "NAT64 Pool Range Start",
+ Computed: true,
+ },
+ "range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "range_end": schema.StringAttribute{
+ MarkdownDescription: "NAT64 Pool Range End",
+ Computed: true,
+ },
+ "range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "overload": schema.BoolAttribute{
+ MarkdownDescription: "NAT64 Overload",
+ Computed: true,
+ },
+ "overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "route_leak_from_global_vpns": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable route leaking from Global to Service VPN",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_protocol": schema.StringAttribute{
+ MarkdownDescription: "Leak Routes of particular protocol from Global to Service VPN",
+ Computed: true,
+ },
+ "route_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "redistributions": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute Routes to specific Protocol on Service VPN",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Protocol to restributed leaked routes",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistribution_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "route_leak_to_global_vpns": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable route leaking from Service to Global VPN",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_protocol": schema.StringAttribute{
+ MarkdownDescription: "Leak Routes of particular protocol from Service to Global VPN",
+ Computed: true,
+ },
+ "route_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "redistributions": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute Routes to specific Protocol on Global VPN",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Protocol to restributed leaked routes",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistribution_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "route_leak_from_other_services": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable route leak from another Service VPN to current Service VPN",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_vpn": schema.Int64Attribute{
+ MarkdownDescription: "Source Service VPN from where route are to be leaked",
+ Computed: true,
+ },
+ "source_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_protocol": schema.StringAttribute{
+ MarkdownDescription: "Leak Route of particular protocol from Source Service VPN",
+ Computed: true,
+ },
+ "route_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "redistributions": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute Route to specific Protocol on Current Service VPN",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Protocol to restributed leaked routes",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistribution_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_import_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: "Route target",
+ Computed: true,
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_export_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: "Route target",
+ Computed: true,
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_import_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: "Route target",
+ Computed: true,
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_export_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: "Route target",
+ Computed: true,
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ServiceLANVPNProfileParcelDataSource) 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 *ServiceLANVPNProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceLANVPN
+
+ // 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_service_lan_vpn_feature_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_feature_test.go
new file mode 100644
index 000000000..2a61ef770
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_feature_test.go
@@ -0,0 +1,219 @@
+// 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 TestAccDataSourceSdwanServiceLANVPNProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "config_description", "VPN1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "omp_admin_distance_ipv4", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "omp_admin_distance_ipv6", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "enable_sdwan_remote_access", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "primary_dns_address_ipv4", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "secondary_dns_address_ipv4", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "host_mappings.0.host_name", "HOSTMAPPING1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv6_static_routes.0.prefix", "2001:0:0:1::0/12"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "services.0.service_type", "FW"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "services.0.tracking", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "service_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "service_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "service_routes.0.service", "SIG"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "service_routes.0.vpn", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "gre_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "gre_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "gre_routes.0.vpn", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipsec_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipsec_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_pools.0.nat_pool_name", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_pools.0.prefix_length", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_pools.0.range_start", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_pools.0.range_end", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_pools.0.overload", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_pools.0.direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.nat_pool_name", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.source_port", "122"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.translate_port", "330"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.translated_source_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.protocol", "TCP"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "static_nats.0.nat_pool_name", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "static_nats.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "static_nats.0.translated_source_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "static_nats.0.static_nat_direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.name", "NATPOOL1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.range_start", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.range_end", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.overload", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv4_import_route_targets.0.route_target", "1.1.1.3:200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv4_export_route_targets.0.route_target", "1.1.1.3:200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv6_import_route_targets.0.route_target", "1.1.1.3:200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_feature.test", "ipv6_export_route_targets.0.route_target", "1.1.1.3:200"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceLANVPNPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceLANVPNPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceLANVPNProfileParcelConfig() string {
+ config := `resource "sdwan_service_lan_vpn_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` config_description = "VPN1"` + "\n"
+ config += ` omp_admin_distance_ipv4 = 1` + "\n"
+ config += ` omp_admin_distance_ipv6 = 1` + "\n"
+ config += ` enable_sdwan_remote_access = false` + "\n"
+ config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
+ config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
+ config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
+ config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
+ config += ` host_mappings = [{` + "\n"
+ config += ` host_name = "HOSTMAPPING1"` + "\n"
+ config += ` list_of_ips = ["1.2.3.4"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_static_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_static_routes = [{` + "\n"
+ config += ` prefix = "2001:0:0:1::0/12"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "2001:0:0:1::0"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` services = [{` + "\n"
+ config += ` service_type = "FW"` + "\n"
+ config += ` ipv4_addresses = ["1.2.3.4"]` + "\n"
+ config += ` tracking = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` service_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` service = "SIG"` + "\n"
+ config += ` vpn = 0` + "\n"
+ config += ` }]` + "\n"
+ config += ` gre_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` interface = ["gre01"]` + "\n"
+ config += ` vpn = 0` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipsec_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` interface = ["ipsec01"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_pools = [{` + "\n"
+ config += ` nat_pool_name = 1` + "\n"
+ config += ` prefix_length = 3` + "\n"
+ config += ` range_start = "1.2.3.4"` + "\n"
+ config += ` range_end = "2.3.4.5"` + "\n"
+ config += ` overload = true` + "\n"
+ config += ` direction = "inside"` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_port_forwards = [{` + "\n"
+ config += ` nat_pool_name = 2` + "\n"
+ config += ` source_port = 122` + "\n"
+ config += ` translate_port = 330` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translated_source_ip = "2.3.4.5"` + "\n"
+ config += ` protocol = "TCP"` + "\n"
+ config += ` }]` + "\n"
+ config += ` static_nats = [{` + "\n"
+ config += ` nat_pool_name = 3` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translated_source_ip = "2.3.4.5"` + "\n"
+ config += ` static_nat_direction = "inside"` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_64_v4_pools = [{` + "\n"
+ config += ` name = "NATPOOL1"` + "\n"
+ config += ` range_start = "1.2.3.4"` + "\n"
+ config += ` range_end = "2.3.4.5"` + "\n"
+ config += ` overload = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_import_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_export_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_import_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_export_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_lan_vpn_feature" "test" {
+ id = sdwan_service_lan_vpn_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_feature.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..e52cd5f7e
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_feature.go
@@ -0,0 +1,712 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &ServiceLANVPNInterfaceEthernetProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceEthernetProfileParcelDataSource{}
+)
+
+func NewServiceLANVPNInterfaceEthernetProfileParcelDataSource() datasource.DataSource {
+ return &ServiceLANVPNInterfaceEthernetProfileParcelDataSource{}
+}
+
+type ServiceLANVPNInterfaceEthernetProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ethernet_feature"
+}
+
+func (d *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) 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 Service LAN VPN Interface Ethernet Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Service LAN VPN Feature ID",
+ Required: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_dhcp_distance": schema.Int64Attribute{
+ MarkdownDescription: "DHCP Distance",
+ Computed: true,
+ },
+ "ipv4_dhcp_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Secondary IpV4 Addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IpV4 Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helper": schema.SetAttribute{
+ MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "ipv4_dhcp_helper_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: "Enable DHCPv6",
+ Computed: true,
+ },
+ "ipv6_dhcp_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "secondary IPv6 addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address Secondary",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address Secondary",
+ Computed: true,
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Static secondary IPv6 addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address Secondary",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_dhcp_helpers": schema.ListNestedAttribute{
+ MarkdownDescription: "DHCPv6 Helper",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "DHCPv6 Helper address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dhcpv6_helper_vpn": schema.Int64Attribute{
+ MarkdownDescription: "DHCPv6 Helper VPN",
+ Computed: true,
+ },
+ "dhcpv6_helper_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_nat": schema.BoolAttribute{
+ MarkdownDescription: "enable Network Address Translation on this interface",
+ Computed: true,
+ },
+ "ipv4_nat_type": schema.StringAttribute{
+ MarkdownDescription: "NAT Type",
+ Computed: true,
+ },
+ "ipv4_nat_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_nat_range_start": schema.StringAttribute{
+ MarkdownDescription: "NAT Pool Range Start",
+ Computed: true,
+ },
+ "ipv4_nat_range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_nat_range_end": schema.StringAttribute{
+ MarkdownDescription: "NAT Pool Range End",
+ Computed: true,
+ },
+ "ipv4_nat_range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_nat_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: "NAT Pool Prefix Length",
+ Computed: true,
+ },
+ "ipv4_nat_prefix_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_nat_overload": schema.BoolAttribute{
+ MarkdownDescription: "NAT Overload",
+ Computed: true,
+ },
+ "ipv4_nat_overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_nat_loopback": schema.StringAttribute{
+ MarkdownDescription: "NAT Inside Source Loopback Interface",
+ Computed: true,
+ },
+ "ipv4_nat_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_nat_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT UDP session timeout, in minutes",
+ Computed: true,
+ },
+ "ipv4_nat_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_nat_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT TCP session timeout, in minutes",
+ Computed: true,
+ },
+ "ipv4_nat_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "static_nats": schema.ListNestedAttribute{
+ MarkdownDescription: "static NAT",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: "Source IP address to be translated",
+ Computed: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "translate_ip": schema.StringAttribute{
+ MarkdownDescription: "Statically translated source IP address",
+ Computed: true,
+ },
+ "translate_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "direction": schema.StringAttribute{
+ MarkdownDescription: "Direction of static NAT translation",
+ Computed: true,
+ },
+ "source_vpn": schema.Int64Attribute{
+ MarkdownDescription: "Source VPN ID",
+ Computed: true,
+ },
+ "source_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_nat": schema.BoolAttribute{
+ MarkdownDescription: "enable Network Address Translation ipv6 on this interface",
+ Computed: true,
+ },
+ "nat64": schema.BoolAttribute{
+ MarkdownDescription: "NAT64 on this interface",
+ Computed: true,
+ },
+ "acl_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: "Shaping Rate (Kbps)",
+ Computed: true,
+ },
+ "acl_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "acl_ipv4_egress_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "acl_ipv4_ingress_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "acl_ipv6_egress_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "acl_ipv6_ingress_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv6_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable VRRP Ipv6",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: "Group ID",
+ Computed: true,
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: "Set priority",
+ Computed: true,
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
+ Computed: true,
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: "Track OMP status",
+ Computed: true,
+ },
+ "ipv6_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 VRRP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "link_local_address": schema.StringAttribute{
+ MarkdownDescription: "Use link-local IPv6 Address",
+ Computed: true,
+ },
+ "link_local_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "global_address": schema.StringAttribute{
+ MarkdownDescription: "Assign Global IPv6 Prefix",
+ Computed: true,
+ },
+ "global_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable VRRP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: "Group ID",
+ Computed: true,
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: "Set priority",
+ Computed: true,
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
+ Computed: true,
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: "Track OMP status",
+ Computed: true,
+ },
+ "address": schema.StringAttribute{
+ MarkdownDescription: "VRRP Ip Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "VRRP Secondary Ip Addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Ip Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "tloc_prefix_change": schema.BoolAttribute{
+ MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
+ Computed: true,
+ },
+ "tloc_pref_change_value": schema.Int64Attribute{
+ MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure ARP entries",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "IPV4 Address",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC Address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "trustsec_enable_sgt_propogation": schema.BoolAttribute{
+ MarkdownDescription: "Indicates that the interface is trustworthy for CTS",
+ Computed: true,
+ },
+ "trustsec_propogate": schema.BoolAttribute{
+ MarkdownDescription: "Enables the interface for CTS SGT authorization and forwarding",
+ Computed: true,
+ },
+ "trustsec_security_group_tag": schema.Int64Attribute{
+ MarkdownDescription: "SGT value between 2 and 65519",
+ Computed: true,
+ },
+ "trustsec_security_group_tag_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "trustsec_enable_enforced_propogation": schema.BoolAttribute{
+ MarkdownDescription: "Enable/Disable SGT Enforcement on an interface",
+ Computed: true,
+ },
+ "trustsec_enforced_security_group_tag": schema.Int64Attribute{
+ MarkdownDescription: "SGT value between 2 and 65519",
+ Computed: true,
+ },
+ "trustsec_enforced_security_group_tag_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: "Duplex mode",
+ Computed: true,
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC Address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU",
+ Computed: true,
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: "Set interface speed",
+ Computed: true,
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
+ Computed: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "autonegotiate": schema.BoolAttribute{
+ MarkdownDescription: "Link autonegotiation",
+ Computed: true,
+ },
+ "autonegotiate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "media_type": schema.StringAttribute{
+ MarkdownDescription: "Media type",
+ Computed: true,
+ },
+ "media_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "load_interval": schema.Int64Attribute{
+ MarkdownDescription: "Interval for interface load calculation",
+ Computed: true,
+ },
+ "load_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker": schema.StringAttribute{
+ MarkdownDescription: "Enable tracker for this interface",
+ Computed: true,
+ },
+ "tracker_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
+ Computed: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "xconnect": schema.StringAttribute{
+ MarkdownDescription: "Extend remote TLOC over a GRE tunnel to a local LAN interface",
+ Computed: true,
+ },
+ "xconnect_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "IP Directed-Broadcast",
+ Computed: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) 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 *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceLANVPNInterfaceEthernet
+
+ // 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_service_lan_vpn_interface_ethernet_feature_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_feature_test.go
new file mode 100644
index 000000000..f561a8386
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_feature_test.go
@@ -0,0 +1,223 @@
+// 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 TestAccDataSourceSdwanServiceLANVPNInterfaceEthernetProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "interface_description", "LAN"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_dhcp_helpers.0.dhcpv6_helper_vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_type", "pool"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_range_start", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_range_end", "4.5.6.7"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_prefix_length", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_overload", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_loopback", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_udp_timeout", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_tcp_timeout", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.translate_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.source_vpn", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_nat", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "nat64", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "acl_shaping_rate", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.ipv6_addresses.0.link_local_address", "1::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.ipv6_addresses.0.global_address", "1::1/24"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.tloc_pref_change_value", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_enable_sgt_propogation", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_propogate", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_security_group_tag", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_enable_enforced_propogation", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_enforced_security_group_tag", "1234"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "tcp_mss", "500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "speed", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "autonegotiate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "media_type", "auto-select"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "load_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "tracker", "TRACKER1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "icmp_redirect_disable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "xconnect", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig() string {
+ config := `resource "sdwan_service_lan_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` interface_name = "GigabitEthernet3"` + "\n"
+ config += ` interface_description = "LAN"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "1.2.3.5"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` ipv6_dhcp_helpers = [{` + "\n"
+ config += ` address = "2001:0:0:1::0"` + "\n"
+ config += ` dhcpv6_helper_vpn = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_nat = false` + "\n"
+ config += ` ipv4_nat_type = "pool"` + "\n"
+ config += ` ipv4_nat_range_start = "1.2.3.4"` + "\n"
+ config += ` ipv4_nat_range_end = "4.5.6.7"` + "\n"
+ config += ` ipv4_nat_prefix_length = 1` + "\n"
+ config += ` ipv4_nat_overload = true` + "\n"
+ config += ` ipv4_nat_loopback = "123"` + "\n"
+ config += ` ipv4_nat_udp_timeout = 123` + "\n"
+ config += ` ipv4_nat_tcp_timeout = 123` + "\n"
+ config += ` static_nats = [{` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translate_ip = "2.3.4.5"` + "\n"
+ config += ` direction = "inside"` + "\n"
+ config += ` source_vpn = 0` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_nat = true` + "\n"
+ config += ` nat64 = false` + "\n"
+ config += ` acl_shaping_rate = 12` + "\n"
+ config += ` ipv6_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` ipv6_addresses = [{` + "\n"
+ config += ` link_local_address = "1::1"` + "\n"
+ config += ` global_address = "1::1/24"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` secondary_addresses = [{` + "\n"
+ config += ` address = "2.3.4.5"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` tloc_prefix_change = true` + "\n"
+ config += ` tloc_pref_change_value = 100` + "\n"
+ config += ` }]` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` trustsec_enable_sgt_propogation = false` + "\n"
+ config += ` trustsec_propogate = true` + "\n"
+ config += ` trustsec_security_group_tag = 123` + "\n"
+ config += ` trustsec_enable_enforced_propogation = false` + "\n"
+ config += ` trustsec_enforced_security_group_tag = 1234` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 500` + "\n"
+ config += ` speed = "1000"` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` autonegotiate = false` + "\n"
+ config += ` media_type = "auto-select"` + "\n"
+ config += ` load_interval = 30` + "\n"
+ config += ` tracker = "TRACKER1"` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += ` xconnect = "1"` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_lan_vpn_interface_ethernet_feature" "test" {
+ id = sdwan_service_lan_vpn_interface_ethernet_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index c8c99ef89..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,712 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &ServiceLANVPNInterfaceEthernetProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceEthernetProfileParcelDataSource{}
-)
-
-func NewServiceLANVPNInterfaceEthernetProfileParcelDataSource() datasource.DataSource {
- return &ServiceLANVPNInterfaceEthernetProfileParcelDataSource{}
-}
-
-type ServiceLANVPNInterfaceEthernetProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ethernet_profile_parcel"
-}
-
-func (d *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) 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 Service LAN VPN Interface Ethernet 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Service LAN VPN Profile Profile ID",
- Required: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_dhcp_distance": schema.Int64Attribute{
- MarkdownDescription: "DHCP Distance",
- Computed: true,
- },
- "ipv4_dhcp_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Secondary IpV4 Addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IpV4 Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
- ElementType: types.StringType,
- Computed: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: "Enable DHCPv6",
- Computed: true,
- },
- "ipv6_dhcp_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "secondary IPv6 addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address Secondary",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address Secondary",
- Computed: true,
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Static secondary IPv6 addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address Secondary",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_dhcp_helpers": schema.ListNestedAttribute{
- MarkdownDescription: "DHCPv6 Helper",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "DHCPv6 Helper address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "dhcpv6_helper_vpn": schema.Int64Attribute{
- MarkdownDescription: "DHCPv6 Helper VPN",
- Computed: true,
- },
- "dhcpv6_helper_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_nat": schema.BoolAttribute{
- MarkdownDescription: "enable Network Address Translation on this interface",
- Computed: true,
- },
- "ipv4_nat_type": schema.StringAttribute{
- MarkdownDescription: "NAT Type",
- Computed: true,
- },
- "ipv4_nat_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_nat_range_start": schema.StringAttribute{
- MarkdownDescription: "NAT Pool Range Start",
- Computed: true,
- },
- "ipv4_nat_range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_nat_range_end": schema.StringAttribute{
- MarkdownDescription: "NAT Pool Range End",
- Computed: true,
- },
- "ipv4_nat_range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_nat_prefix_length": schema.Int64Attribute{
- MarkdownDescription: "NAT Pool Prefix Length",
- Computed: true,
- },
- "ipv4_nat_prefix_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_nat_overload": schema.BoolAttribute{
- MarkdownDescription: "NAT Overload",
- Computed: true,
- },
- "ipv4_nat_overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_nat_loopback": schema.StringAttribute{
- MarkdownDescription: "NAT Inside Source Loopback Interface",
- Computed: true,
- },
- "ipv4_nat_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_nat_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT UDP session timeout, in minutes",
- Computed: true,
- },
- "ipv4_nat_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_nat_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT TCP session timeout, in minutes",
- Computed: true,
- },
- "ipv4_nat_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "static_nats": schema.ListNestedAttribute{
- MarkdownDescription: "static NAT",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_ip": schema.StringAttribute{
- MarkdownDescription: "Source IP address to be translated",
- Computed: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "translate_ip": schema.StringAttribute{
- MarkdownDescription: "Statically translated source IP address",
- Computed: true,
- },
- "translate_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "direction": schema.StringAttribute{
- MarkdownDescription: "Direction of static NAT translation",
- Computed: true,
- },
- "source_vpn": schema.Int64Attribute{
- MarkdownDescription: "Source VPN ID",
- Computed: true,
- },
- "source_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_nat": schema.BoolAttribute{
- MarkdownDescription: "enable Network Address Translation ipv6 on this interface",
- Computed: true,
- },
- "nat64": schema.BoolAttribute{
- MarkdownDescription: "NAT64 on this interface",
- Computed: true,
- },
- "acl_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: "Shaping Rate (Kbps)",
- Computed: true,
- },
- "acl_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "acl_ipv4_egress_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "acl_ipv4_ingress_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "acl_ipv6_egress_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "acl_ipv6_ingress_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv6_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: "Enable VRRP Ipv6",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: "Group ID",
- Computed: true,
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: "Set priority",
- Computed: true,
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
- Computed: true,
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: "Track OMP status",
- Computed: true,
- },
- "ipv6_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 VRRP",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "link_local_address": schema.StringAttribute{
- MarkdownDescription: "Use link-local IPv6 Address",
- Computed: true,
- },
- "link_local_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "global_address": schema.StringAttribute{
- MarkdownDescription: "Assign Global IPv6 Prefix",
- Computed: true,
- },
- "global_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "ipv4_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: "Enable VRRP",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: "Group ID",
- Computed: true,
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: "Set priority",
- Computed: true,
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
- Computed: true,
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: "Track OMP status",
- Computed: true,
- },
- "address": schema.StringAttribute{
- MarkdownDescription: "VRRP Ip Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "VRRP Secondary Ip Addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Ip Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "tloc_prefix_change": schema.BoolAttribute{
- MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
- Computed: true,
- },
- "tloc_pref_change_value": schema.Int64Attribute{
- MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
- Computed: true,
- },
- },
- },
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: "Configure ARP entries",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: "IPV4 Address",
- Computed: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC Address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "trustsec_enable_sgt_propogation": schema.BoolAttribute{
- MarkdownDescription: "Indicates that the interface is trustworthy for CTS",
- Computed: true,
- },
- "trustsec_propogate": schema.BoolAttribute{
- MarkdownDescription: "Enables the interface for CTS SGT authorization and forwarding",
- Computed: true,
- },
- "trustsec_security_group_tag": schema.Int64Attribute{
- MarkdownDescription: "SGT value between 2 and 65519",
- Computed: true,
- },
- "trustsec_security_group_tag_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "trustsec_enable_enforced_propogation": schema.BoolAttribute{
- MarkdownDescription: "Enable/Disable SGT Enforcement on an interface",
- Computed: true,
- },
- "trustsec_enforced_security_group_tag": schema.Int64Attribute{
- MarkdownDescription: "SGT value between 2 and 65519",
- Computed: true,
- },
- "trustsec_enforced_security_group_tag_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "duplex": schema.StringAttribute{
- MarkdownDescription: "Duplex mode",
- Computed: true,
- },
- "duplex_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC Address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU",
- Computed: true,
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "speed": schema.StringAttribute{
- MarkdownDescription: "Set interface speed",
- Computed: true,
- },
- "speed_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
- Computed: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "autonegotiate": schema.BoolAttribute{
- MarkdownDescription: "Link autonegotiation",
- Computed: true,
- },
- "autonegotiate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "media_type": schema.StringAttribute{
- MarkdownDescription: "Media type",
- Computed: true,
- },
- "media_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "load_interval": schema.Int64Attribute{
- MarkdownDescription: "Interval for interface load calculation",
- Computed: true,
- },
- "load_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker": schema.StringAttribute{
- MarkdownDescription: "Enable tracker for this interface",
- Computed: true,
- },
- "tracker_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
- Computed: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "xconnect": schema.StringAttribute{
- MarkdownDescription: "Extend remote TLOC over a GRE tunnel to a local LAN interface",
- Computed: true,
- },
- "xconnect_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: "IP Directed-Broadcast",
- Computed: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) 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 *ServiceLANVPNInterfaceEthernetProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config ServiceLANVPNInterfaceEthernet
-
- // 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_service_lan_vpn_interface_ethernet_profile_parcel_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_profile_parcel_test.go
deleted file mode 100644
index 1d55e944a..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ethernet_profile_parcel_test.go
+++ /dev/null
@@ -1,223 +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 TestAccDataSourceSdwanServiceLANVPNInterfaceEthernetProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "interface_name", "GigabitEthernet3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "interface_description", "LAN"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.address", "1.2.3.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_dhcp_helpers.0.dhcpv6_helper_vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_type", "pool"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_range_start", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_range_end", "4.5.6.7"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_prefix_length", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_overload", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_loopback", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_udp_timeout", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_tcp_timeout", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.translate_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.source_vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_nat", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "nat64", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "acl_shaping_rate", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.ipv6_addresses.0.link_local_address", "1::1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.ipv6_addresses.0.global_address", "1::1/24"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.tloc_pref_change_value", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_enable_sgt_propogation", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_propogate", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_security_group_tag", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_enable_enforced_propogation", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_enforced_security_group_tag", "1234"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "duplex", "full"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "tcp_mss", "500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "speed", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "autonegotiate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "media_type", "auto-select"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "load_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "tracker", "TRACKER1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "icmp_redirect_disable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "xconnect", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig() string {
- config := `resource "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` interface_name = "GigabitEthernet3"` + "\n"
- config += ` interface_description = "LAN"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "1.2.3.5"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` ipv6_dhcp_helpers = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` dhcpv6_helper_vpn = 1` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_nat = false` + "\n"
- config += ` ipv4_nat_type = "pool"` + "\n"
- config += ` ipv4_nat_range_start = "1.2.3.4"` + "\n"
- config += ` ipv4_nat_range_end = "4.5.6.7"` + "\n"
- config += ` ipv4_nat_prefix_length = 1` + "\n"
- config += ` ipv4_nat_overload = true` + "\n"
- config += ` ipv4_nat_loopback = "123"` + "\n"
- config += ` ipv4_nat_udp_timeout = 123` + "\n"
- config += ` ipv4_nat_tcp_timeout = 123` + "\n"
- config += ` static_nats = [{` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translate_ip = "2.3.4.5"` + "\n"
- config += ` direction = "inside"` + "\n"
- config += ` source_vpn = 0` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_nat = true` + "\n"
- config += ` nat64 = false` + "\n"
- config += ` acl_shaping_rate = 12` + "\n"
- config += ` ipv6_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` ipv6_addresses = [{` + "\n"
- config += ` link_local_address = "1::1"` + "\n"
- config += ` global_address = "1::1/24"` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` secondary_addresses = [{` + "\n"
- config += ` address = "2.3.4.5"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` tloc_prefix_change = true` + "\n"
- config += ` tloc_pref_change_value = 100` + "\n"
- config += ` }]` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` trustsec_enable_sgt_propogation = false` + "\n"
- config += ` trustsec_propogate = true` + "\n"
- config += ` trustsec_security_group_tag = 123` + "\n"
- config += ` trustsec_enable_enforced_propogation = false` + "\n"
- config += ` trustsec_enforced_security_group_tag = 1234` + "\n"
- config += ` duplex = "full"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 500` + "\n"
- config += ` speed = "1000"` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` autonegotiate = false` + "\n"
- config += ` media_type = "auto-select"` + "\n"
- config += ` load_interval = 30` + "\n"
- config += ` tracker = "TRACKER1"` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += ` xconnect = "1"` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "test" {
- id = sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test.id
- feature_profile_id = sdwan_service_feature_profile.test.id
- service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_feature.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_feature.go
new file mode 100644
index 000000000..fb803caf9
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_feature.go
@@ -0,0 +1,238 @@
+// 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 = &ServiceLANVPNInterfaceGREProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceGREProfileParcelDataSource{}
+)
+
+func NewServiceLANVPNInterfaceGREProfileParcelDataSource() datasource.DataSource {
+ return &ServiceLANVPNInterfaceGREProfileParcelDataSource{}
+}
+
+type ServiceLANVPNInterfaceGREProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceLANVPNInterfaceGREProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_gre_feature"
+}
+
+func (d *ServiceLANVPNInterfaceGREProfileParcelDataSource) 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 Service LAN VPN Interface GRE Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Service LAN VPN Feature ID",
+ Required: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Interface name (1..255)",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "Interface description",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Administrative state",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "Tunnel source IP Address",
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name",
+ Computed: true,
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_interface_loopback": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name",
+ Computed: true,
+ },
+ "tunnel_source_interface_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_route_via_loopback": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name, can't be Loopback interface",
+ Computed: true,
+ },
+ "tunnel_route_via_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "Tunnel destination IP Address",
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU <576..9976>, in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
+ Computed: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: "Enable Application Tunnel Type",
+ Computed: true,
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceLANVPNInterfaceGREProfileParcelDataSource) 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 *ServiceLANVPNInterfaceGREProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceLANVPNInterfaceGRE
+
+ // 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_service_lan_vpn_interface_gre_feature_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_feature_test.go
new file mode 100644
index 000000000..0015b9b62
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_feature_test.go
@@ -0,0 +1,106 @@
+// 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 TestAccDataSourceSdwanServiceLANVPNInterfaceGREProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "interface_name", "gre1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "interface_description", "gre1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "ipv4_address", "70.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "tunnel_source_ipv4_address", "78.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "tunnel_destination_ipv4_address", "79.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_feature.test", "application_tunnel_type", "none"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceGREProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceLANVPNInterfaceGREProfileParcelConfig() string {
+ config := `resource "sdwan_service_lan_vpn_interface_gre_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "gre1"` + "\n"
+ config += ` interface_description = "gre1"` + "\n"
+ config += ` ipv4_address = "70.1.1.1"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_lan_vpn_interface_gre_feature" "test" {
+ id = sdwan_service_lan_vpn_interface_gre_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_profile_parcel.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_profile_parcel.go
deleted file mode 100644
index 65c22e518..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_profile_parcel.go
+++ /dev/null
@@ -1,238 +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/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 = &ServiceLANVPNInterfaceGREProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceGREProfileParcelDataSource{}
-)
-
-func NewServiceLANVPNInterfaceGREProfileParcelDataSource() datasource.DataSource {
- return &ServiceLANVPNInterfaceGREProfileParcelDataSource{}
-}
-
-type ServiceLANVPNInterfaceGREProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *ServiceLANVPNInterfaceGREProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_gre_profile_parcel"
-}
-
-func (d *ServiceLANVPNInterfaceGREProfileParcelDataSource) 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 Service LAN VPN Interface GRE 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Service LAN VPN Profile Parcel ID",
- Required: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "Interface name (1..255)",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "Interface description",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Administrative state",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "Tunnel source IP Address",
- Computed: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name",
- Computed: true,
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_interface_loopback": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name",
- Computed: true,
- },
- "tunnel_source_interface_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_route_via_loopback": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name, can't be Loopback interface",
- Computed: true,
- },
- "tunnel_route_via_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "Tunnel destination IP Address",
- Computed: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU <576..9976>, in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
- Computed: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: "Enable Application Tunnel Type",
- Computed: true,
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *ServiceLANVPNInterfaceGREProfileParcelDataSource) 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 *ServiceLANVPNInterfaceGREProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config ServiceLANVPNInterfaceGRE
-
- // 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_service_lan_vpn_interface_gre_profile_parcel_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_profile_parcel_test.go
deleted file mode 100644
index 94facdddc..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_gre_profile_parcel_test.go
+++ /dev/null
@@ -1,106 +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 TestAccDataSourceSdwanServiceLANVPNInterfaceGREProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "interface_name", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "interface_description", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "ipv4_address", "70.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "tunnel_source_ipv4_address", "78.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "tunnel_destination_ipv4_address", "79.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "application_tunnel_type", "none"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceGREProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanServiceLANVPNInterfaceGREProfileParcelConfig() string {
- config := `resource "sdwan_service_lan_vpn_interface_gre_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "gre1"` + "\n"
- config += ` interface_description = "gre1"` + "\n"
- config += ` ipv4_address = "70.1.1.1"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
- config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_service_lan_vpn_interface_gre_profile_parcel" "test" {
- id = sdwan_service_lan_vpn_interface_gre_profile_parcel.test.id
- feature_profile_id = sdwan_service_feature_profile.test.id
- service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_feature.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_feature.go
new file mode 100644
index 000000000..8ade1dacb
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_feature.go
@@ -0,0 +1,362 @@
+// 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 = &ServiceLANVPNInterfaceIPSecProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceIPSecProfileParcelDataSource{}
+)
+
+func NewServiceLANVPNInterfaceIPSecProfileParcelDataSource() datasource.DataSource {
+ return &ServiceLANVPNInterfaceIPSecProfileParcelDataSource{}
+}
+
+type ServiceLANVPNInterfaceIPSecProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ipsec_feature"
+}
+
+func (d *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) 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 Service LAN VPN Interface IPSec Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Service LAN VPN Feature ID",
+ Required: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Interface name: IPsec when present",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Administrative state",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "Interface description",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
+ Computed: true,
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: "Enable Application Tunnel Type",
+ Computed: true,
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
+ Computed: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU <68..9216>, in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dpd_interval": schema.Int64Attribute{
+ MarkdownDescription: "IKE keepalive interval (seconds)",
+ Computed: true,
+ },
+ "dpd_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dpd_retries": schema.Int64Attribute{
+ MarkdownDescription: "IKE keepalive retries",
+ Computed: true,
+ },
+ "dpd_retries_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_preshared_key": schema.StringAttribute{
+ MarkdownDescription: "Use preshared key to authenticate IKE peer",
+ Computed: true,
+ },
+ "ike_preshared_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_version": schema.Int64Attribute{
+ MarkdownDescription: "IKE Version <1..2>",
+ Computed: true,
+ },
+ "ike_integrity_protocol": schema.StringAttribute{
+ MarkdownDescription: "IKE integrity protocol",
+ Computed: true,
+ },
+ "ike_integrity_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: "IKE rekey interval <60..86400> seconds",
+ Computed: true,
+ },
+ "ike_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: "IKE identity the IKE preshared secret belongs to",
+ Computed: true,
+ },
+ "ike_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_diffie_hellman_group": schema.StringAttribute{
+ MarkdownDescription: "IKE Diffie Hellman Groups",
+ Computed: true,
+ },
+ "ike_diffie_hellman_group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_id_local_end_point": schema.StringAttribute{
+ MarkdownDescription: "IKE ID for the local endpoint. Input IPv4 address, domain name, or email address",
+ Computed: true,
+ },
+ "ike_id_local_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_id_remote_end_point": schema.StringAttribute{
+ MarkdownDescription: "IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address",
+ Computed: true,
+ },
+ "ike_id_remote_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: "IPsec rekey interval <300..1209600> seconds",
+ Computed: true,
+ },
+ "ipsec_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_replay_window": schema.Int64Attribute{
+ MarkdownDescription: "Replay window size 32..8192 (must be a power of 2)",
+ Computed: true,
+ },
+ "ipsec_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: "IPsec(ESP) encryption and integrity protocol",
+ Computed: true,
+ },
+ "ipsec_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "perfect_forward_secrecy": schema.StringAttribute{
+ MarkdownDescription: "IPsec perfect forward secrecy settings",
+ Computed: true,
+ },
+ "perfect_forward_secrecy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: "Enable tracker for this interface",
+ Computed: true,
+ },
+ "tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_route_via": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
+ Computed: true,
+ },
+ "tunnel_route_via_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) 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 *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceLANVPNInterfaceIPSec
+
+ // 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_service_lan_vpn_interface_ipsec_feature_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_feature_test.go
new file mode 100644
index 000000000..81b6bb62a
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_feature_test.go
@@ -0,0 +1,142 @@
+// 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 TestAccDataSourceSdwanServiceLANVPNInterfaceIPSecProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "interface_name", "ipsec987"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "interface_description", "ipsec987"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipv4_address", "9.7.5.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_source_ipv4_address", "1.3.5.88"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_source_ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_source_interface", "GigabitEthernet8"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_destination_ipv4_address", "2.55.67.99"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_destination_ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "application_tunnel_type", "none"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "dpd_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "dpd_retries", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_preshared_key", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_version", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_integrity_protocol", "main"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_rekey_interval", "14400"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_ciphersuite", "aes256-cbc-sha1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_diffie_hellman_group", "16"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_id_local_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_id_remote_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipsec_rekey_interval", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipsec_replay_window", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipsec_ciphersuite", "aes256-gcm"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "perfect_forward_secrecy", "group-16"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_route_via", "2222"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig() string {
+ config := `resource "sdwan_service_lan_vpn_interface_ipsec_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "ipsec987"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_description = "ipsec987"` + "\n"
+ config += ` ipv4_address = "9.7.5.4"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
+ config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
+ config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` dpd_interval = 10` + "\n"
+ config += ` dpd_retries = 3` + "\n"
+ config += ` ike_preshared_key = "123"` + "\n"
+ config += ` ike_version = 1` + "\n"
+ config += ` ike_integrity_protocol = "main"` + "\n"
+ config += ` ike_rekey_interval = 14400` + "\n"
+ config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
+ config += ` ike_diffie_hellman_group = "16"` + "\n"
+ config += ` ike_id_local_end_point = "xxx"` + "\n"
+ config += ` ike_id_remote_end_point = "xxx"` + "\n"
+ config += ` ipsec_rekey_interval = 3600` + "\n"
+ config += ` ipsec_replay_window = 512` + "\n"
+ config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
+ config += ` perfect_forward_secrecy = "group-16"` + "\n"
+ config += ` tunnel_route_via = "2222"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_lan_vpn_interface_ipsec_feature" "test" {
+ id = sdwan_service_lan_vpn_interface_ipsec_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go
deleted file mode 100644
index 6075dc64b..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go
+++ /dev/null
@@ -1,362 +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/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 = &ServiceLANVPNInterfaceIPSecProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceIPSecProfileParcelDataSource{}
-)
-
-func NewServiceLANVPNInterfaceIPSecProfileParcelDataSource() datasource.DataSource {
- return &ServiceLANVPNInterfaceIPSecProfileParcelDataSource{}
-}
-
-type ServiceLANVPNInterfaceIPSecProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ipsec_profile_parcel"
-}
-
-func (d *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) 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 Service LAN VPN Interface IPSec 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Service LAN VPN Profile Parcel ID",
- Required: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "Interface name: IPsec when present",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Administrative state",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "Interface description",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
- Computed: true,
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: "Enable Application Tunnel Type",
- Computed: true,
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
- Computed: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU <68..9216>, in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "dpd_interval": schema.Int64Attribute{
- MarkdownDescription: "IKE keepalive interval (seconds)",
- Computed: true,
- },
- "dpd_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "dpd_retries": schema.Int64Attribute{
- MarkdownDescription: "IKE keepalive retries",
- Computed: true,
- },
- "dpd_retries_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_preshared_key": schema.StringAttribute{
- MarkdownDescription: "Use preshared key to authenticate IKE peer",
- Computed: true,
- },
- "ike_preshared_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_version": schema.Int64Attribute{
- MarkdownDescription: "IKE Version <1..2>",
- Computed: true,
- },
- "ike_integrity_protocol": schema.StringAttribute{
- MarkdownDescription: "IKE integrity protocol",
- Computed: true,
- },
- "ike_integrity_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: "IKE rekey interval <60..86400> seconds",
- Computed: true,
- },
- "ike_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_ciphersuite": schema.StringAttribute{
- MarkdownDescription: "IKE identity the IKE preshared secret belongs to",
- Computed: true,
- },
- "ike_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_diffie_hellman_group": schema.StringAttribute{
- MarkdownDescription: "IKE Diffie Hellman Groups",
- Computed: true,
- },
- "ike_diffie_hellman_group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_id_local_end_point": schema.StringAttribute{
- MarkdownDescription: "IKE ID for the local endpoint. Input IPv4 address, domain name, or email address",
- Computed: true,
- },
- "ike_id_local_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_id_remote_end_point": schema.StringAttribute{
- MarkdownDescription: "IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address",
- Computed: true,
- },
- "ike_id_remote_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: "IPsec rekey interval <300..1209600> seconds",
- Computed: true,
- },
- "ipsec_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_replay_window": schema.Int64Attribute{
- MarkdownDescription: "Replay window size 32..8192 (must be a power of 2)",
- Computed: true,
- },
- "ipsec_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_ciphersuite": schema.StringAttribute{
- MarkdownDescription: "IPsec(ESP) encryption and integrity protocol",
- Computed: true,
- },
- "ipsec_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "perfect_forward_secrecy": schema.StringAttribute{
- MarkdownDescription: "IPsec perfect forward secrecy settings",
- Computed: true,
- },
- "perfect_forward_secrecy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker_id": schema.StringAttribute{
- MarkdownDescription: "Enable tracker for this interface",
- Computed: true,
- },
- "tracker_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_route_via": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
- Computed: true,
- },
- "tunnel_route_via_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) 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 *ServiceLANVPNInterfaceIPSecProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config ServiceLANVPNInterfaceIPSec
-
- // 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_service_lan_vpn_interface_ipsec_profile_parcel_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_profile_parcel_test.go
deleted file mode 100644
index 0a4728d6f..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_ipsec_profile_parcel_test.go
+++ /dev/null
@@ -1,142 +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 TestAccDataSourceSdwanServiceLANVPNInterfaceIPSecProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "interface_name", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "interface_description", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipv4_address", "9.7.5.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_address", "1.3.5.88"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_interface", "GigabitEthernet8"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_address", "2.55.67.99"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "application_tunnel_type", "none"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "dpd_interval", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "dpd_retries", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_preshared_key", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_version", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_integrity_protocol", "main"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_rekey_interval", "14400"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_ciphersuite", "aes256-cbc-sha1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_diffie_hellman_group", "16"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_id_local_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_id_remote_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipsec_rekey_interval", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipsec_replay_window", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipsec_ciphersuite", "aes256-gcm"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "perfect_forward_secrecy", "group-16"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_route_via", "2222"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig() string {
- config := `resource "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "ipsec987"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_description = "ipsec987"` + "\n"
- config += ` ipv4_address = "9.7.5.4"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
- config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
- config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
- config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` dpd_interval = 10` + "\n"
- config += ` dpd_retries = 3` + "\n"
- config += ` ike_preshared_key = "123"` + "\n"
- config += ` ike_version = 1` + "\n"
- config += ` ike_integrity_protocol = "main"` + "\n"
- config += ` ike_rekey_interval = 14400` + "\n"
- config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
- config += ` ike_diffie_hellman_group = "16"` + "\n"
- config += ` ike_id_local_end_point = "xxx"` + "\n"
- config += ` ike_id_remote_end_point = "xxx"` + "\n"
- config += ` ipsec_rekey_interval = 3600` + "\n"
- config += ` ipsec_replay_window = 512` + "\n"
- config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
- config += ` perfect_forward_secrecy = "group-16"` + "\n"
- config += ` tunnel_route_via = "2222"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "test" {
- id = sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test.id
- feature_profile_id = sdwan_service_feature_profile.test.id
- service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_feature.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_feature.go
new file mode 100644
index 000000000..50ac0ab9c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_feature.go
@@ -0,0 +1,500 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &ServiceLANVPNInterfaceSVIProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceSVIProfileParcelDataSource{}
+)
+
+func NewServiceLANVPNInterfaceSVIProfileParcelDataSource() datasource.DataSource {
+ return &ServiceLANVPNInterfaceSVIProfileParcelDataSource{}
+}
+
+type ServiceLANVPNInterfaceSVIProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceLANVPNInterfaceSVIProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_svi_feature"
+}
+
+func (d *ServiceLANVPNInterfaceSVIProfileParcelDataSource) 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 Service LAN VPN Interface SVI Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Service LAN VPN Feature ID",
+ Required: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Administrative state",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Interface name: VLAN 1 - VLAN 4094 when present",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "Interface description",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU <1500..9216> in bytes",
+ Computed: true,
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "IP MTU <576..Interface MTU>, in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Assign secondary IP addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IpV4 Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helpers": schema.SetAttribute{
+ MarkdownDescription: "List of DHCP helper addresses",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "ipv4_dhcp_helpers_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: "Assign IPv6 address",
+ Computed: true,
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Assign secondary IPv6 addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_dhcp_helpers": schema.ListNestedAttribute{
+ MarkdownDescription: "DHCPv6 Helper",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "DHCPv6 Helper address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "DHCPv6 Helper VPN",
+ Computed: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure static ARP entries",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable ipv4 VRRP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: "Group ID",
+ Computed: true,
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: "Set priority",
+ Computed: true,
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
+ Computed: true,
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: "Track OMP status",
+ Computed: true,
+ },
+ "track_omp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "prefix_list": schema.StringAttribute{
+ MarkdownDescription: "Track Prefix List",
+ Computed: true,
+ },
+ "prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Assign IPV4 Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "VRRP Secondary IPV4 address",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "VRRP Secondary IPV4 address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "tloc_prefix_change": schema.BoolAttribute{
+ MarkdownDescription: "change TLOC preference",
+ Computed: true,
+ },
+ "tloc_prefix_change_value": schema.Int64Attribute{
+ MarkdownDescription: "Set tloc preference change value",
+ Computed: true,
+ },
+ "tloc_prefix_change_value_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable ipv6 VRRP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: "Group ID",
+ Computed: true,
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: "Set priority",
+ Computed: true,
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
+ Computed: true,
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: "Track OMP status",
+ Computed: true,
+ },
+ "track_omp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_prefix_list": schema.StringAttribute{
+ MarkdownDescription: "Track Prefix List",
+ Computed: true,
+ },
+ "track_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 VRRP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "link_local_address": schema.StringAttribute{
+ MarkdownDescription: "Use link-local IPv6 Address",
+ Computed: true,
+ },
+ "link_local_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "global_address": schema.StringAttribute{
+ MarkdownDescription: "Assign Global IPv6 Prefix",
+ Computed: true,
+ },
+ "global_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Secondary IP address",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Secondary IP address",
+ Computed: true,
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: "Enable DHCPv6",
+ Computed: true,
+ },
+ "enable_dhcpv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
+ Computed: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "IP Directed-Broadcast",
+ Computed: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
+ Computed: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceLANVPNInterfaceSVIProfileParcelDataSource) 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 *ServiceLANVPNInterfaceSVIProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceLANVPNInterfaceSVI
+
+ // 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_service_lan_vpn_interface_svi_feature_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_feature_test.go
new file mode 100644
index 000000000..b1012659f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_feature_test.go
@@ -0,0 +1,177 @@
+// 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 TestAccDataSourceSdwanServiceLANVPNInterfaceSVIProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "interface_name", "Vlan1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "interface_description", "SVI"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_secondary_addresses.0.address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_secondary_addresses.0.ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_address", "2001:0:0:1::0/32"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_secondary_addresses.0.address", "::2/32"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_dhcp_helpers.0.vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.prefix_list", "prefix"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.tloc_prefix_change_value", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.track_prefix_list", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.addresses.0.link_local_address", "1::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.addresses.0.global_address", "1::1/24"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.secondary_addresses.0.prefix", "::20/32"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "enable_dhcpv6", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "tcp_mss", "1024"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "ip_directed_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_feature.test", "icmp_redirect_disable", "true"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceSVIProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceLANVPNInterfaceSVIProfileParcelConfig() string {
+ config := `resource "sdwan_service_lan_vpn_interface_svi_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` interface_name = "Vlan1"` + "\n"
+ config += ` interface_description = "SVI"` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "2.3.4.5"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helpers = ["4.5.6.7"]` + "\n"
+ config += ` ipv6_address = "2001:0:0:1::0/32"` + "\n"
+ config += ` ipv6_secondary_addresses = [{` + "\n"
+ config += ` address = "::2/32"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_dhcp_helpers = [{` + "\n"
+ config += ` address = "2001:0:0:1::0"` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` prefix_list = "prefix"` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` secondary_addresses = [{` + "\n"
+ config += ` address = "2.3.4.5"` + "\n"
+ config += ` }]` + "\n"
+ config += ` tloc_prefix_change = true` + "\n"
+ config += ` tloc_prefix_change_value = 100` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` track_prefix_list = "1"` + "\n"
+ config += ` addresses = [{` + "\n"
+ config += ` link_local_address = "1::1"` + "\n"
+ config += ` global_address = "1::1/24"` + "\n"
+ config += ` }]` + "\n"
+ config += ` secondary_addresses = [{` + "\n"
+ config += ` prefix = "::20/32"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` enable_dhcpv6 = false` + "\n"
+ config += ` tcp_mss = 1024` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_lan_vpn_interface_svi_feature" "test" {
+ id = sdwan_service_lan_vpn_interface_svi_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_profile_parcel.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_profile_parcel.go
deleted file mode 100644
index bc1a4c572..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_profile_parcel.go
+++ /dev/null
@@ -1,500 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &ServiceLANVPNInterfaceSVIProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &ServiceLANVPNInterfaceSVIProfileParcelDataSource{}
-)
-
-func NewServiceLANVPNInterfaceSVIProfileParcelDataSource() datasource.DataSource {
- return &ServiceLANVPNInterfaceSVIProfileParcelDataSource{}
-}
-
-type ServiceLANVPNInterfaceSVIProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *ServiceLANVPNInterfaceSVIProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_svi_profile_parcel"
-}
-
-func (d *ServiceLANVPNInterfaceSVIProfileParcelDataSource) 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 Service LAN VPN Interface SVI 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Service LAN VPN Profile Profile ID",
- Required: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Administrative state",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "Interface name: VLAN 1 - VLAN 4094 when present",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "Interface description",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU <1500..9216> in bytes",
- Computed: true,
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "IP MTU <576..Interface MTU>, in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Assign secondary IP addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IpV4 Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_dhcp_helpers": schema.SetAttribute{
- MarkdownDescription: "List of DHCP helper addresses",
- ElementType: types.StringType,
- Computed: true,
- },
- "ipv4_dhcp_helpers_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: "Assign IPv6 address",
- Computed: true,
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Assign secondary IPv6 addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_dhcp_helpers": schema.ListNestedAttribute{
- MarkdownDescription: "DHCPv6 Helper",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "DHCPv6 Helper address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "DHCPv6 Helper VPN",
- Computed: true,
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: "Configure static ARP entries",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: "Enable ipv4 VRRP",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: "Group ID",
- Computed: true,
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: "Set priority",
- Computed: true,
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
- Computed: true,
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: "Track OMP status",
- Computed: true,
- },
- "track_omp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "prefix_list": schema.StringAttribute{
- MarkdownDescription: "Track Prefix List",
- Computed: true,
- },
- "prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "address": schema.StringAttribute{
- MarkdownDescription: "Assign IPV4 Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "VRRP Secondary IPV4 address",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "VRRP Secondary IPV4 address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "tloc_prefix_change": schema.BoolAttribute{
- MarkdownDescription: "change TLOC preference",
- Computed: true,
- },
- "tloc_prefix_change_value": schema.Int64Attribute{
- MarkdownDescription: "Set tloc preference change value",
- Computed: true,
- },
- "tloc_prefix_change_value_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: "Enable ipv6 VRRP",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: "Group ID",
- Computed: true,
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: "Set priority",
- Computed: true,
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: "Timer interval for successive advertisements, in milliseconds",
- Computed: true,
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: "Track OMP status",
- Computed: true,
- },
- "track_omp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_prefix_list": schema.StringAttribute{
- MarkdownDescription: "Track Prefix List",
- Computed: true,
- },
- "track_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "addresses": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 VRRP",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "link_local_address": schema.StringAttribute{
- MarkdownDescription: "Use link-local IPv6 Address",
- Computed: true,
- },
- "link_local_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "global_address": schema.StringAttribute{
- MarkdownDescription: "Assign Global IPv6 Prefix",
- Computed: true,
- },
- "global_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Secondary IP address",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: "IPv6 Secondary IP address",
- Computed: true,
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: "Enable DHCPv6",
- Computed: true,
- },
- "enable_dhcpv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
- Computed: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: "IP Directed-Broadcast",
- Computed: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
- Computed: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *ServiceLANVPNInterfaceSVIProfileParcelDataSource) 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 *ServiceLANVPNInterfaceSVIProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config ServiceLANVPNInterfaceSVI
-
- // 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_service_lan_vpn_interface_svi_profile_parcel_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_profile_parcel_test.go
deleted file mode 100644
index 4770546ce..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_interface_svi_profile_parcel_test.go
+++ /dev/null
@@ -1,177 +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 TestAccDataSourceSdwanServiceLANVPNInterfaceSVIProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "interface_name", "Vlan1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "interface_description", "SVI"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_secondary_addresses.0.address", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_secondary_addresses.0.ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_address", "2001:0:0:1::0/32"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_secondary_addresses.0.address", "::2/32"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_dhcp_helpers.0.vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.prefix_list", "prefix"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.tloc_prefix_change_value", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.track_prefix_list", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.addresses.0.link_local_address", "1::1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.addresses.0.global_address", "1::1/24"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.secondary_addresses.0.prefix", "::20/32"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "enable_dhcpv6", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "tcp_mss", "1024"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ip_directed_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "icmp_redirect_disable", "true"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNInterfaceSVIProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanServiceLANVPNInterfaceSVIProfileParcelConfig() string {
- config := `resource "sdwan_service_lan_vpn_interface_svi_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` interface_name = "Vlan1"` + "\n"
- config += ` interface_description = "SVI"` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "2.3.4.5"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helpers = ["4.5.6.7"]` + "\n"
- config += ` ipv6_address = "2001:0:0:1::0/32"` + "\n"
- config += ` ipv6_secondary_addresses = [{` + "\n"
- config += ` address = "::2/32"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_dhcp_helpers = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` vpn = 1` + "\n"
- config += ` }]` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` prefix_list = "prefix"` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` secondary_addresses = [{` + "\n"
- config += ` address = "2.3.4.5"` + "\n"
- config += ` }]` + "\n"
- config += ` tloc_prefix_change = true` + "\n"
- config += ` tloc_prefix_change_value = 100` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` track_prefix_list = "1"` + "\n"
- config += ` addresses = [{` + "\n"
- config += ` link_local_address = "1::1"` + "\n"
- config += ` global_address = "1::1/24"` + "\n"
- config += ` }]` + "\n"
- config += ` secondary_addresses = [{` + "\n"
- config += ` prefix = "::20/32"` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` enable_dhcpv6 = false` + "\n"
- config += ` tcp_mss = 1024` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_service_lan_vpn_interface_svi_profile_parcel" "test" {
- id = sdwan_service_lan_vpn_interface_svi_profile_parcel.test.id
- feature_profile_id = sdwan_service_feature_profile.test.id
- service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_lan_vpn_profile_parcel.go b/internal/provider/data_source_sdwan_service_lan_vpn_profile_parcel.go
deleted file mode 100644
index 46f5c31c9..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_profile_parcel.go
+++ /dev/null
@@ -1,991 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &ServiceLANVPNProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &ServiceLANVPNProfileParcelDataSource{}
-)
-
-func NewServiceLANVPNProfileParcelDataSource() datasource.DataSource {
- return &ServiceLANVPNProfileParcelDataSource{}
-}
-
-type ServiceLANVPNProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *ServiceLANVPNProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_profile_parcel"
-}
-
-func (d *ServiceLANVPNProfileParcelDataSource) 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 Service LAN VPN 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,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "VPN",
- Computed: true,
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "config_description": schema.StringAttribute{
- MarkdownDescription: "Name",
- Computed: true,
- },
- "config_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "omp_admin_distance_ipv4": schema.Int64Attribute{
- MarkdownDescription: "OMP Admin Distance IPv4",
- Computed: true,
- },
- "omp_admin_distance_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "omp_admin_distance_ipv6": schema.Int64Attribute{
- MarkdownDescription: "OMP Admin Distance IPv6",
- Computed: true,
- },
- "omp_admin_distance_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "enable_sdwan_remote_access": schema.BoolAttribute{
- MarkdownDescription: "Enable SDWAN Remote Access",
- Computed: true,
- },
- "primary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: "Primary DNS Address (IPv4)",
- Computed: true,
- },
- "primary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: "Secondary DNS Address (IPv4)",
- Computed: true,
- },
- "secondary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "primary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: "Primary DNS Address (IPv6)",
- Computed: true,
- },
- "primary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: "Secondary DNS Address (IPv6)",
- Computed: true,
- },
- "secondary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "host_mappings": schema.ListNestedAttribute{
- MarkdownDescription: "",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "host_name": schema.StringAttribute{
- MarkdownDescription: "Hostname",
- Computed: true,
- },
- "host_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "list_of_ips": schema.SetAttribute{
- MarkdownDescription: "List of IP",
- ElementType: types.StringType,
- Computed: true,
- },
- "list_of_ips_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "advertise_omp_ipv4s": schema.ListNestedAttribute{
- MarkdownDescription: "OMP Advertise IPv4",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Protocol",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "prefixes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Prefix List",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "aggregate_only": schema.BoolAttribute{
- MarkdownDescription: "Aggregate Only",
- Computed: true,
- },
- "region": schema.StringAttribute{
- MarkdownDescription: "Applied to Region",
- Computed: true,
- },
- "region_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "advertise_omp_ipv6s": schema.ListNestedAttribute{
- MarkdownDescription: "OMP Advertise IPv6",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Protocol",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "protocol_sub_type": schema.StringAttribute{
- MarkdownDescription: "Protocol Sub Type",
- Computed: true,
- },
- "protocol_sub_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "prefixes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Prefix List",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: "IPv6 Prefix",
- Computed: true,
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "aggregate_only": schema.BoolAttribute{
- MarkdownDescription: "Aggregate Only",
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "ipv4_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Static Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Route Gateway Next Hop",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "next_hop_with_trackers": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Route Gateway Next Hop with Tracker",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: "IPv4 Route Gateway Next Hop",
- Computed: true,
- },
- "gateway_dhcp": schema.BoolAttribute{
- MarkdownDescription: "IPv4 Route Gateway DHCP",
- Computed: true,
- },
- "vpn": schema.BoolAttribute{
- MarkdownDescription: "IPv4 Route Gateway VPN",
- Computed: true,
- },
- },
- },
- },
- "ipv6_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Static Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: "Prefix",
- Computed: true,
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Route Gateway Next Hop",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: "IPv6 Route Gateway Next Hop",
- Computed: true,
- },
- "nat": schema.StringAttribute{
- MarkdownDescription: "IPv6 Nat",
- Computed: true,
- },
- "nat_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "services": schema.ListNestedAttribute{
- MarkdownDescription: "Service",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "service_type": schema.StringAttribute{
- MarkdownDescription: "Service Type",
- Computed: true,
- },
- "service_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_addresses": schema.SetAttribute{
- MarkdownDescription: "IPv4 Addresses (Maximum: 4)",
- ElementType: types.StringType,
- Computed: true,
- },
- "ipv4_addresses_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracking": schema.BoolAttribute{
- MarkdownDescription: "Tracking",
- Computed: true,
- },
- "tracking_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "service_routes": schema.ListNestedAttribute{
- MarkdownDescription: "Service",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "service": schema.StringAttribute{
- MarkdownDescription: "Service",
- Computed: true,
- },
- "service_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "Service",
- Computed: true,
- },
- },
- },
- },
- "gre_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Static GRE Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface": schema.SetAttribute{
- MarkdownDescription: "Interface",
- ElementType: types.StringType,
- Computed: true,
- },
- "interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "Service",
- Computed: true,
- },
- },
- },
- },
- "ipsec_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Static IPSEC Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface": schema.SetAttribute{
- MarkdownDescription: "Interface",
- ElementType: types.StringType,
- Computed: true,
- },
- "interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "nat_pools": schema.ListNestedAttribute{
- MarkdownDescription: "NAT Pool",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat_pool_name": schema.Int64Attribute{
- MarkdownDescription: "NAT Pool Name",
- Computed: true,
- },
- "nat_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "prefix_length": schema.Int64Attribute{
- MarkdownDescription: "NAT Pool Prefix Length",
- Computed: true,
- },
- "prefix_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "range_start": schema.StringAttribute{
- MarkdownDescription: "NAT Pool Range Start",
- Computed: true,
- },
- "range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "range_end": schema.StringAttribute{
- MarkdownDescription: "NAT Pool Range End",
- Computed: true,
- },
- "range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "overload": schema.BoolAttribute{
- MarkdownDescription: "NAT Overload",
- Computed: true,
- },
- "overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "direction": schema.StringAttribute{
- MarkdownDescription: "NAT Direction",
- Computed: true,
- },
- "direction_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker_object_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- "nat_port_forwards": schema.ListNestedAttribute{
- MarkdownDescription: "NAT Port Forward",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat_pool_name": schema.Int64Attribute{
- MarkdownDescription: "NAT Pool Name",
- Computed: true,
- },
- "nat_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_port": schema.Int64Attribute{
- MarkdownDescription: "Source Port",
- Computed: true,
- },
- "source_port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "translate_port": schema.Int64Attribute{
- MarkdownDescription: "Translate Port",
- Computed: true,
- },
- "translate_port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_ip": schema.StringAttribute{
- MarkdownDescription: "Source IP Address",
- Computed: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "translated_source_ip": schema.StringAttribute{
- MarkdownDescription: "Translated Source IP Address",
- Computed: true,
- },
- "translated_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Protocol",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "static_nats": schema.ListNestedAttribute{
- MarkdownDescription: "Static NAT Rules",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat_pool_name": schema.Int64Attribute{
- MarkdownDescription: "NAT Pool Name",
- Computed: true,
- },
- "nat_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_ip": schema.StringAttribute{
- MarkdownDescription: "Source IP Address",
- Computed: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "translated_source_ip": schema.StringAttribute{
- MarkdownDescription: "Translated Source IP Address",
- Computed: true,
- },
- "translated_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "static_nat_direction": schema.StringAttribute{
- MarkdownDescription: "Static NAT Direction",
- Computed: true,
- },
- "static_nat_direction_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker_object_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- "nat_64_v4_pools": schema.ListNestedAttribute{
- MarkdownDescription: "NAT64 V4 Pool",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: "NAT64 v4 Pool Name",
- Computed: true,
- },
- "name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "range_start": schema.StringAttribute{
- MarkdownDescription: "NAT64 Pool Range Start",
- Computed: true,
- },
- "range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "range_end": schema.StringAttribute{
- MarkdownDescription: "NAT64 Pool Range End",
- Computed: true,
- },
- "range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "overload": schema.BoolAttribute{
- MarkdownDescription: "NAT64 Overload",
- Computed: true,
- },
- "overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "route_leak_from_global_vpns": schema.ListNestedAttribute{
- MarkdownDescription: "Enable route leaking from Global to Service VPN",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_protocol": schema.StringAttribute{
- MarkdownDescription: "Leak Routes of particular protocol from Global to Service VPN",
- Computed: true,
- },
- "route_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "redistributions": schema.ListNestedAttribute{
- MarkdownDescription: "Redistribute Routes to specific Protocol on Service VPN",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Protocol to restributed leaked routes",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "redistribution_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "route_leak_to_global_vpns": schema.ListNestedAttribute{
- MarkdownDescription: "Enable route leaking from Service to Global VPN",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_protocol": schema.StringAttribute{
- MarkdownDescription: "Leak Routes of particular protocol from Service to Global VPN",
- Computed: true,
- },
- "route_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "redistributions": schema.ListNestedAttribute{
- MarkdownDescription: "Redistribute Routes to specific Protocol on Global VPN",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Protocol to restributed leaked routes",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "redistribution_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "route_leak_from_other_services": schema.ListNestedAttribute{
- MarkdownDescription: "Enable route leak from another Service VPN to current Service VPN",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_vpn": schema.Int64Attribute{
- MarkdownDescription: "Source Service VPN from where route are to be leaked",
- Computed: true,
- },
- "source_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_protocol": schema.StringAttribute{
- MarkdownDescription: "Leak Route of particular protocol from Source Service VPN",
- Computed: true,
- },
- "route_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "redistributions": schema.ListNestedAttribute{
- MarkdownDescription: "Redistribute Route to specific Protocol on Current Service VPN",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Protocol to restributed leaked routes",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "redistribution_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "ipv4_import_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: "",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: "Route target",
- Computed: true,
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_export_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: "",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: "Route target",
- Computed: true,
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_import_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: "",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: "Route target",
- Computed: true,
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_export_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: "",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: "Route target",
- Computed: true,
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *ServiceLANVPNProfileParcelDataSource) 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 *ServiceLANVPNProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config ServiceLANVPN
-
- // 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_service_lan_vpn_profile_parcel_test.go b/internal/provider/data_source_sdwan_service_lan_vpn_profile_parcel_test.go
deleted file mode 100644
index 0542eb154..000000000
--- a/internal/provider/data_source_sdwan_service_lan_vpn_profile_parcel_test.go
+++ /dev/null
@@ -1,219 +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 TestAccDataSourceSdwanServiceLANVPNProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "config_description", "VPN1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "omp_admin_distance_ipv4", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "omp_admin_distance_ipv6", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "enable_sdwan_remote_access", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "primary_dns_address_ipv4", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "secondary_dns_address_ipv4", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "host_mappings.0.host_name", "HOSTMAPPING1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv6_static_routes.0.prefix", "2001:0:0:1::0/12"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "services.0.service_type", "FW"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "services.0.tracking", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.service", "SIG"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "gre_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "gre_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "gre_routes.0.vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipsec_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipsec_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.nat_pool_name", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.prefix_length", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.range_start", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.range_end", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.overload", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.nat_pool_name", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.source_port", "122"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.translate_port", "330"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.translated_source_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.protocol", "TCP"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.nat_pool_name", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.translated_source_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.static_nat_direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.name", "NATPOOL1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.range_start", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.range_end", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.overload", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv4_import_route_targets.0.route_target", "1.1.1.3:200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv4_export_route_targets.0.route_target", "1.1.1.3:200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv6_import_route_targets.0.route_target", "1.1.1.3:200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_lan_vpn_profile_parcel.test", "ipv6_export_route_targets.0.route_target", "1.1.1.3:200"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanServiceLANVPNPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceLANVPNProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanServiceLANVPNPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanServiceLANVPNProfileParcelConfig() string {
- config := `resource "sdwan_service_lan_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` vpn = 1` + "\n"
- config += ` config_description = "VPN1"` + "\n"
- config += ` omp_admin_distance_ipv4 = 1` + "\n"
- config += ` omp_admin_distance_ipv6 = 1` + "\n"
- config += ` enable_sdwan_remote_access = false` + "\n"
- config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
- config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
- config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
- config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
- config += ` host_mappings = [{` + "\n"
- config += ` host_name = "HOSTMAPPING1"` + "\n"
- config += ` list_of_ips = ["1.2.3.4"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_static_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_static_routes = [{` + "\n"
- config += ` prefix = "2001:0:0:1::0/12"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` services = [{` + "\n"
- config += ` service_type = "FW"` + "\n"
- config += ` ipv4_addresses = ["1.2.3.4"]` + "\n"
- config += ` tracking = true` + "\n"
- config += ` }]` + "\n"
- config += ` service_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` service = "SIG"` + "\n"
- config += ` vpn = 0` + "\n"
- config += ` }]` + "\n"
- config += ` gre_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` interface = ["gre01"]` + "\n"
- config += ` vpn = 0` + "\n"
- config += ` }]` + "\n"
- config += ` ipsec_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` interface = ["ipsec01"]` + "\n"
- config += ` }]` + "\n"
- config += ` nat_pools = [{` + "\n"
- config += ` nat_pool_name = 1` + "\n"
- config += ` prefix_length = 3` + "\n"
- config += ` range_start = "1.2.3.4"` + "\n"
- config += ` range_end = "2.3.4.5"` + "\n"
- config += ` overload = true` + "\n"
- config += ` direction = "inside"` + "\n"
- config += ` }]` + "\n"
- config += ` nat_port_forwards = [{` + "\n"
- config += ` nat_pool_name = 2` + "\n"
- config += ` source_port = 122` + "\n"
- config += ` translate_port = 330` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translated_source_ip = "2.3.4.5"` + "\n"
- config += ` protocol = "TCP"` + "\n"
- config += ` }]` + "\n"
- config += ` static_nats = [{` + "\n"
- config += ` nat_pool_name = 3` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translated_source_ip = "2.3.4.5"` + "\n"
- config += ` static_nat_direction = "inside"` + "\n"
- config += ` }]` + "\n"
- config += ` nat_64_v4_pools = [{` + "\n"
- config += ` name = "NATPOOL1"` + "\n"
- config += ` range_start = "1.2.3.4"` + "\n"
- config += ` range_end = "2.3.4.5"` + "\n"
- config += ` overload = false` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_import_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_export_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_import_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_export_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_service_lan_vpn_profile_parcel" "test" {
- id = sdwan_service_lan_vpn_profile_parcel.test.id
- feature_profile_id = sdwan_service_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_object_tracker_feature.go b/internal/provider/data_source_sdwan_service_object_tracker_feature.go
new file mode 100644
index 000000000..7a58fbbbf
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_object_tracker_feature.go
@@ -0,0 +1,166 @@
+// 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 = &ServiceObjectTrackerProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceObjectTrackerProfileParcelDataSource{}
+)
+
+func NewServiceObjectTrackerProfileParcelDataSource() datasource.DataSource {
+ return &ServiceObjectTrackerProfileParcelDataSource{}
+}
+
+type ServiceObjectTrackerProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceObjectTrackerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_object_tracker_feature"
+}
+
+func (d *ServiceObjectTrackerProfileParcelDataSource) 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 Service Object Tracker Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "object_tracker_id": schema.Int64Attribute{
+ MarkdownDescription: "Object tracker ID",
+ Computed: true,
+ },
+ "object_tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "object_tracker_type": schema.StringAttribute{
+ MarkdownDescription: "objectTrackerType:Interface SIG Route",
+ Computed: true,
+ },
+ "interface": schema.StringAttribute{
+ MarkdownDescription: "interface name",
+ Computed: true,
+ },
+ "interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_ip": schema.StringAttribute{
+ MarkdownDescription: "IP address",
+ Computed: true,
+ },
+ "route_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_mask": schema.StringAttribute{
+ MarkdownDescription: "IP mask",
+ Computed: true,
+ },
+ "route_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "VPN",
+ Computed: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceObjectTrackerProfileParcelDataSource) 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 *ServiceObjectTrackerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceObjectTracker
+
+ // 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_service_object_tracker_feature_test.go b/internal/provider/data_source_sdwan_service_object_tracker_feature_test.go
new file mode 100644
index 000000000..1c0a7832c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_object_tracker_feature_test.go
@@ -0,0 +1,83 @@
+// 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 TestAccDataSourceSdwanServiceObjectTrackerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_object_tracker_feature.test", "object_tracker_type", "Interface"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_object_tracker_feature.test", "interface", "GigabitEthernet1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceObjectTrackerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceObjectTrackerProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceObjectTrackerPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceObjectTrackerProfileParcelConfig() string {
+ config := `resource "sdwan_service_object_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` object_tracker_id = 10` + "\n"
+ config += ` object_tracker_type = "Interface"` + "\n"
+ config += ` interface = "GigabitEthernet1"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_object_tracker_feature" "test" {
+ id = sdwan_service_object_tracker_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_object_tracker_group_feature.go b/internal/provider/data_source_sdwan_service_object_tracker_group_feature.go
new file mode 100644
index 000000000..df1890b73
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_object_tracker_group_feature.go
@@ -0,0 +1,150 @@
+// 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 = &ServiceObjectTrackerGroupProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceObjectTrackerGroupProfileParcelDataSource{}
+)
+
+func NewServiceObjectTrackerGroupProfileParcelDataSource() datasource.DataSource {
+ return &ServiceObjectTrackerGroupProfileParcelDataSource{}
+}
+
+type ServiceObjectTrackerGroupProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceObjectTrackerGroupProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_object_tracker_group_feature"
+}
+
+func (d *ServiceObjectTrackerGroupProfileParcelDataSource) 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 Service Object Tracker Group Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "object_tracker_id": schema.Int64Attribute{
+ MarkdownDescription: "Object ID",
+ Computed: true,
+ },
+ "object_tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_elements": schema.ListNestedAttribute{
+ MarkdownDescription: "Group Tracks ID Refs",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "object_tracker_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "reachable": schema.StringAttribute{
+ MarkdownDescription: "tracker ref list criteria boolean and or",
+ Computed: true,
+ },
+ "reachable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceObjectTrackerGroupProfileParcelDataSource) 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 *ServiceObjectTrackerGroupProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceObjectTrackerGroup
+
+ // 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_service_object_tracker_group_feature_test.go b/internal/provider/data_source_sdwan_service_object_tracker_group_feature_test.go
new file mode 100644
index 000000000..429c65da8
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_object_tracker_group_feature_test.go
@@ -0,0 +1,103 @@
+// 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 TestAccDataSourceSdwanServiceObjectTrackerGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_object_tracker_group_feature.test", "reachable", "or"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceObjectTrackerGroupPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceObjectTrackerGroupProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceObjectTrackerGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_object_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "My Example"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ object_tracker_id = 11
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+}
+
+resource "sdwan_service_object_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "My Example"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ object_tracker_id = 12
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceObjectTrackerGroupProfileParcelConfig() string {
+ config := `resource "sdwan_service_object_tracker_group_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` object_tracker_id = 10` + "\n"
+ config += ` tracker_elements = [{` + "\n"
+ config += ` object_tracker_id = sdwan_service_object_tracker_feature.test-1.id` + "\n"
+ config += ` }, {` + "\n"
+ config += ` object_tracker_id = sdwan_service_object_tracker_feature.test-2.id` + "\n"
+ config += ` }]` + "\n"
+ config += ` reachable = "or"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_object_tracker_group_feature" "test" {
+ id = sdwan_service_object_tracker_group_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_route_policy_feature.go b/internal/provider/data_source_sdwan_service_route_policy_feature.go
new file mode 100644
index 000000000..0db93e5e1
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_route_policy_feature.go
@@ -0,0 +1,281 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &ServiceRoutePolicyProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceRoutePolicyProfileParcelDataSource{}
+)
+
+func NewServiceRoutePolicyProfileParcelDataSource() datasource.DataSource {
+ return &ServiceRoutePolicyProfileParcelDataSource{}
+}
+
+type ServiceRoutePolicyProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceRoutePolicyProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_route_policy_feature"
+}
+
+func (d *ServiceRoutePolicyProfileParcelDataSource) 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 Service Route Policy Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: "Default Action",
+ Computed: true,
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: "Route Policy List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: "Sequence Id",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Sequence Name",
+ Computed: true,
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: "Base Action",
+ Computed: true,
+ },
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "protocol such as IPV4, IPV6, or BOTH",
+ Computed: true,
+ },
+ "match_entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Define match conditions",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "standard_community_list_criteria": schema.StringAttribute{
+ MarkdownDescription: "Select a condition such as OR, AND or EXACT",
+ Computed: true,
+ },
+ "standard_community_lists": schema.ListNestedAttribute{
+ MarkdownDescription: "Select a standard community list",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "expanded_community_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "extended_community_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "bgp_local_preference": schema.Int64Attribute{
+ MarkdownDescription: "BGP Local Preference",
+ Computed: true,
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: "Select Metric",
+ Computed: true,
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: "Select OMP Tag",
+ Computed: true,
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: "Select OSPF Tag",
+ Computed: true,
+ },
+ "ipv4_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv6_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv6_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "actions": schema.ListNestedAttribute{
+ MarkdownDescription: "Define list of actions",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_prepend": schema.SetAttribute{
+ MarkdownDescription: "",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "community_additive": schema.BoolAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "community": schema.SetAttribute{
+ MarkdownDescription: "",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_preference": schema.Int64Attribute{
+ MarkdownDescription: "Set Local Preference",
+ Computed: true,
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: "Set Metric",
+ Computed: true,
+ },
+ "metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set Metric Type",
+ Computed: true,
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: "Set OMP Tag",
+ Computed: true,
+ },
+ "origin": schema.StringAttribute{
+ MarkdownDescription: "Set Origin",
+ Computed: true,
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF Tag",
+ Computed: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: "Set Weight",
+ Computed: true,
+ },
+ "ipv4_next_hop": schema.StringAttribute{
+ MarkdownDescription: "Set Ipv4 Next Hop",
+ Computed: true,
+ },
+ "ipv6_next_hop": schema.StringAttribute{
+ MarkdownDescription: "Set Ipv6 Next Hop",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ServiceRoutePolicyProfileParcelDataSource) 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 *ServiceRoutePolicyProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceRoutePolicy
+
+ // 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_service_route_policy_feature_test.go b/internal/provider/data_source_sdwan_service_route_policy_feature_test.go
new file mode 100644
index 000000000..96c80f77f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_route_policy_feature_test.go
@@ -0,0 +1,111 @@
+// 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 TestAccDataSourceSdwanServiceRoutePolicyProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "default_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.base_action", "reject"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.protocol", "IPV4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.community_additive", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.local_preference", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.metric", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.omp_tag", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.origin", "EGP"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.ospf_tag", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.weight", "2200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_route_policy_feature.test", "sequences.0.actions.0.ipv4_next_hop", "10.0.0.1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceRoutePolicyPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceRoutePolicyProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceRoutePolicyPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceRoutePolicyProfileParcelConfig() string {
+ config := `resource "sdwan_service_route_policy_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` default_action = "accept"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "reject"` + "\n"
+ config += ` protocol = "IPV4"` + "\n"
+ config += ` actions = [{` + "\n"
+ config += ` as_path_prepend = [65521]` + "\n"
+ config += ` community_additive = false` + "\n"
+ config += ` community = ["internet"]` + "\n"
+ config += ` local_preference = 100` + "\n"
+ config += ` metric = 20` + "\n"
+ config += ` metric_type = "type1"` + "\n"
+ config += ` omp_tag = 200` + "\n"
+ config += ` origin = "EGP"` + "\n"
+ config += ` ospf_tag = 1200` + "\n"
+ config += ` weight = 2200` + "\n"
+ config += ` ipv4_next_hop = "10.0.0.1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_route_policy_feature" "test" {
+ id = sdwan_service_route_policy_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_routing_bgp_feature.go b/internal/provider/data_source_sdwan_service_routing_bgp_feature.go
new file mode 100644
index 000000000..64f84391e
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_bgp_feature.go
@@ -0,0 +1,802 @@
+// 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 = &ServiceRoutingBGPProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceRoutingBGPProfileParcelDataSource{}
+)
+
+func NewServiceRoutingBGPProfileParcelDataSource() datasource.DataSource {
+ return &ServiceRoutingBGPProfileParcelDataSource{}
+}
+
+type ServiceRoutingBGPProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceRoutingBGPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_bgp_feature"
+}
+
+func (d *ServiceRoutingBGPProfileParcelDataSource) 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 Service Routing BGP Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "as_number": schema.Int64Attribute{
+ MarkdownDescription: "Set autonomous system number <1..4294967295> or ",
+ Computed: true,
+ },
+ "as_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Configure BGP router identifier",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "propagate_as_path": schema.BoolAttribute{
+ MarkdownDescription: "Propagate AS Path",
+ Computed: true,
+ },
+ "propagate_as_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "propagate_community": schema.BoolAttribute{
+ MarkdownDescription: "Propagate Community",
+ Computed: true,
+ },
+ "propagate_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "external_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: "Set administrative distance for external BGP routes",
+ Computed: true,
+ },
+ "external_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "internal_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: "Set administrative distance for internal BGP routes",
+ Computed: true,
+ },
+ "internal_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: "Set administrative distance for local BGP routes",
+ Computed: true,
+ },
+ "local_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) of keepalive messages sent to its BGP peer",
+ Computed: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
+ Computed: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "always_compare_med": schema.BoolAttribute{
+ MarkdownDescription: "Compare MEDs from all ASs when selecting active BGP paths",
+ Computed: true,
+ },
+ "always_compare_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "deterministic_med": schema.BoolAttribute{
+ MarkdownDescription: "Compare MEDs from all routes from same AS when selecting active BGP paths",
+ Computed: true,
+ },
+ "deterministic_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "missing_med_as_worst": schema.BoolAttribute{
+ MarkdownDescription: "If path has no MED, consider it to be worst path when selecting active BGP paths",
+ Computed: true,
+ },
+ "missing_med_as_worst_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "compare_router_id": schema.BoolAttribute{
+ MarkdownDescription: "Compare router IDs when selecting active BGP paths",
+ Computed: true,
+ },
+ "compare_router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "multipath_relax": schema.BoolAttribute{
+ MarkdownDescription: "Ignore AS for multipath selection",
+ Computed: true,
+ },
+ "multipath_relax_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: "Set BGP IPv4 neighbors",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Set neighbor address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Set description",
+ Computed: true,
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable a BGP neighbor",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: "Set remote autonomous system number",
+ Computed: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: "Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
+ Computed: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) of keepalive messages sent to its BGP peer",
+ Computed: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
+ Computed: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: "Source interface name for BGP neighbor",
+ Computed: true,
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: "Set router to be next hop for routes advertised to neighbor",
+ Computed: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: "Send community attribute",
+ Computed: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: "Send extended community attribute",
+ Computed: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: "Set TTL value for peers that are not directly connected",
+ Computed: true,
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: "Set MD5 password on TCP connection with BGP peer",
+ Computed: true,
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_label": schema.BoolAttribute{
+ MarkdownDescription: "Send label",
+ Computed: true,
+ },
+ "send_label_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: "Override matching AS-number while sending update",
+ Computed: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: "The number of accept as-path with my AS present in it",
+ Computed: true,
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: "Set BGP address family",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: "Set IPv4 unicast address family",
+ Computed: true,
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
+ Computed: true,
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
+ Computed: true,
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
+ Computed: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
+ Computed: true,
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv6_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: "Set BGP IPv6 neighbors",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Set IPv6 neighbor address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Set description",
+ Computed: true,
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable a BGP neighbor",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: "Set remote autonomous system number",
+ Computed: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: "Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
+ Computed: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how often to advertise keepalive messages to BGP peer",
+ Computed: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to wait since receiving a keepalive message to consider BGP peer unavailable",
+ Computed: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: "Source interface name for BGP neighbor",
+ Computed: true,
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: "Set router to be next hop for routes advertised to neighbor",
+ Computed: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: "Send community attribute",
+ Computed: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: "Send extended community attribute",
+ Computed: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: "Set TTL value for peers that are not directly connected",
+ Computed: true,
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: "Set MD5 password on TCP connection with BGP peer",
+ Computed: true,
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: "Override matching AS-number while sending update",
+ Computed: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: "The number of accept as-path with my AS present in it",
+ Computed: true,
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: "Set IPv6 BGP address family",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: "Set IPv6 unicast address family",
+ Computed: true,
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
+ Computed: true,
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
+ Computed: true,
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
+ Computed: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
+ Computed: true,
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Aggregate prefixes in specific range",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: "Set AS set path information",
+ Computed: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: "Filter out more specific routes from updates",
+ Computed: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_networks": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the networks for BGP to advertise",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of parallel IBGP paths for multipath load sharing",
+ Computed: true,
+ },
+ "ipv4_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_originate": schema.BoolAttribute{
+ MarkdownDescription: "BGP Default Information Originate",
+ Computed: true,
+ },
+ "ipv4_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "ipv4_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes into BGP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol to redistribute routes from",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Aggregate prefixes in specific range",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "aggregate_prefix": schema.StringAttribute{
+ MarkdownDescription: "Configure the IPv6 prefixes to aggregate",
+ Computed: true,
+ },
+ "aggregate_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: "Set AS set path information",
+ Computed: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: "Filter out more specific routes from updates",
+ Computed: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_networks": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the networks for BGP to advertise",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_prefix": schema.StringAttribute{
+ MarkdownDescription: "Configure the prefixes for BGP to announce",
+ Computed: true,
+ },
+ "network_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of parallel IBGP paths for multipath load sharing",
+ Computed: true,
+ },
+ "ipv6_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_originate": schema.BoolAttribute{
+ MarkdownDescription: "BGP Default Information Originate",
+ Computed: true,
+ },
+ "ipv6_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv6_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "ipv6_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes into BGP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol to redistribute routes from",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ServiceRoutingBGPProfileParcelDataSource) 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 *ServiceRoutingBGPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceRoutingBGP
+
+ // 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_service_routing_bgp_feature_test.go b/internal/provider/data_source_sdwan_service_routing_bgp_feature_test.go
new file mode 100644
index 000000000..8ca19cddb
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_bgp_feature_test.go
@@ -0,0 +1,233 @@
+// 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 TestAccDataSourceSdwanServiceRoutingBGPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "as_number", "429"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "propagate_as_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "propagate_community", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "external_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "internal_routes_distance", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "local_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "keepalive_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "hold_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "always_compare_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "deterministic_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "missing_med_as_worst", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "compare_router_id", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "multipath_relax", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.description", "neighbor1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.keepalive_time", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.hold_time", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.update_source_interface", "GigabitEthernet0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.next_hop_self", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.ebgp_multihop", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.send_label", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.as_override", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.allowas_in_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.family_type", "ipv4-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address", "2001::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.description", "neighbor2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.keepalive_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.hold_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.update_source_interface", "Loopback1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.next_hop_self", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.ebgp_multihop", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.as_override", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.allowas_in_number", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.family_type", "ipv6-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_networks.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_networks.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_eibgp_maximum_paths", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv4_table_map_filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.aggregate_prefix", "3001::1/128"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_networks.0.network_prefix", "2001:0DB8:0000:000b::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_eibgp_maximum_paths", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_originate", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_bgp_feature.test", "ipv6_table_map_filter", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceRoutingBGPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceRoutingBGPProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceRoutingBGPPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceRoutingBGPProfileParcelConfig() string {
+ config := `resource "sdwan_service_routing_bgp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` as_number = 429` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` propagate_as_path = false` + "\n"
+ config += ` propagate_community = false` + "\n"
+ config += ` external_routes_distance = 20` + "\n"
+ config += ` internal_routes_distance = 200` + "\n"
+ config += ` local_routes_distance = 20` + "\n"
+ config += ` keepalive_time = 60` + "\n"
+ config += ` hold_time = 180` + "\n"
+ config += ` always_compare_med = false` + "\n"
+ config += ` deterministic_med = false` + "\n"
+ config += ` missing_med_as_worst = false` + "\n"
+ config += ` compare_router_id = false` + "\n"
+ config += ` multipath_relax = false` + "\n"
+ config += ` ipv4_neighbors = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` description = "neighbor1"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 40` + "\n"
+ config += ` hold_time = 200` + "\n"
+ config += ` update_source_interface = "GigabitEthernet0"` + "\n"
+ config += ` next_hop_self = false` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 1` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` send_label = true` + "\n"
+ config += ` as_override = false` + "\n"
+ config += ` allowas_in_number = 1` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv4-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_neighbors = [{` + "\n"
+ config += ` address = "2001::1"` + "\n"
+ config += ` description = "neighbor2"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 180` + "\n"
+ config += ` hold_time = 60` + "\n"
+ config += ` update_source_interface = "Loopback1"` + "\n"
+ config += ` next_hop_self = true` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 3` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` as_override = true` + "\n"
+ config += ` allowas_in_number = 3` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv6-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_aggregate_addresses = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_networks = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_eibgp_maximum_paths = 1` + "\n"
+ config += ` ipv4_originate = false` + "\n"
+ config += ` ipv4_table_map_filter = false` + "\n"
+ config += ` ipv6_aggregate_addresses = [{` + "\n"
+ config += ` aggregate_prefix = "3001::1/128"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_networks = [{` + "\n"
+ config += ` network_prefix = "2001:0DB8:0000:000b::/64"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_eibgp_maximum_paths = 2` + "\n"
+ config += ` ipv6_originate = true` + "\n"
+ config += ` ipv6_table_map_filter = false` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_routing_bgp_feature" "test" {
+ id = sdwan_service_routing_bgp_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_routing_ospf_feature.go b/internal/provider/data_source_sdwan_service_routing_ospf_feature.go
new file mode 100644
index 000000000..e539350fd
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_ospf_feature.go
@@ -0,0 +1,438 @@
+// 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 = &ServiceRoutingOSPFProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceRoutingOSPFProfileParcelDataSource{}
+)
+
+func NewServiceRoutingOSPFProfileParcelDataSource() datasource.DataSource {
+ return &ServiceRoutingOSPFProfileParcelDataSource{}
+}
+
+type ServiceRoutingOSPFProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceRoutingOSPFProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_ospf_feature"
+}
+
+func (d *ServiceRoutingOSPFProfileParcelDataSource) 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 Service Routing OSPF Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF router ID to override system IP address",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: "Set reference bandwidth method to assign OSPF cost",
+ Computed: true,
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: "Calculate summary route cost based on RFC 1583",
+ Computed: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: "Distribute default external route into OSPF",
+ Computed: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: "Always advertise default route",
+ Computed: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: "Set metric used to generate default route <0..16777214>",
+ Computed: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set default route type",
+ Computed: true,
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for external routes",
+ Computed: true,
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for inter-area routes",
+ Computed: true,
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for intra-area routes",
+ Computed: true,
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: "Set delay from first change received until performing SPF calculation",
+ Computed: true,
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set initial hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: "Enable NAT DIA for redistributed routes",
+ Computed: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "router_lsas": schema.ListNestedAttribute{
+ MarkdownDescription: "Advertise own router LSA with infinite distance",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "type": schema.StringAttribute{
+ MarkdownDescription: "Set the router LSA advertisement type",
+ Computed: true,
+ },
+ "time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to advertise maximum metric after router starts up",
+ Computed: true,
+ },
+ "time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure OSPF area",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF area number",
+ Computed: true,
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: "set the area type",
+ Computed: true,
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: "Do not inject interarea routes into STUB or NSSA",
+ Computed: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Set OSPF interface parameters",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set interface name",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval between OSPF hello packets",
+ Computed: true,
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval after which neighbor is declared to be down",
+ Computed: true,
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time between retransmitting LSAs",
+ Computed: true,
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost of OSPF interface",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "designated_router_priority": schema.Int64Attribute{
+ MarkdownDescription: "Set router’s priority to be elected as designated router",
+ Computed: true,
+ },
+ "designated_router_priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: "Set the OSPF network type",
+ Computed: true,
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface to advertise its address, but not to actively run OSPF",
+ Computed: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF interface authentication type",
+ Computed: true,
+ },
+ "authentication_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "message_digest_key_id": schema.Int64Attribute{
+ MarkdownDescription: "Set MD5 message digest key",
+ Computed: true,
+ },
+ "message_digest_key_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "message_digest_key": schema.StringAttribute{
+ MarkdownDescription: "Set MD5 authentication key",
+ Computed: true,
+ },
+ "message_digest_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: "Summarize OSPF routes at an area boundary",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost for this range",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: "Do not advertise this range",
+ Computed: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ServiceRoutingOSPFProfileParcelDataSource) 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 *ServiceRoutingOSPFProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceRoutingOSPF
+
+ // 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_service_routing_ospf_feature_test.go b/internal/provider/data_source_sdwan_service_routing_ospf_feature_test.go
new file mode 100644
index 000000000..166fd0f52
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_ospf_feature_test.go
@@ -0,0 +1,156 @@
+// 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 TestAccDataSourceSdwanServiceRoutingOSPFProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "router_lsas.0.type", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "router_lsas.0.time", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.no_summary", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.designated_router_priority", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.authentication_type", "message-digest"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.message_digest_key_id", "7"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceRoutingOSPFPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceRoutingOSPFProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceRoutingOSPFPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceRoutingOSPFProfileParcelConfig() string {
+ config := `resource "sdwan_service_routing_ospf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsas = [{` + "\n"
+ config += ` type = "on-startup"` + "\n"
+ config += ` time = 5` + "\n"
+ config += ` }]` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` no_summary = false` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` designated_router_priority = 1` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "message-digest"` + "\n"
+ config += ` message_digest_key_id = 7` + "\n"
+ config += ` message_digest_key = "sdjfhsghbjdjr"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_routing_ospf_feature" "test" {
+ id = sdwan_service_routing_ospf_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv4_feature.go b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv4_feature.go
new file mode 100644
index 000000000..58e1de255
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv4_feature.go
@@ -0,0 +1,442 @@
+// 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 = &ServiceRoutingOSPFv3IPv4ProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceRoutingOSPFv3IPv4ProfileParcelDataSource{}
+)
+
+func NewServiceRoutingOSPFv3IPv4ProfileParcelDataSource() datasource.DataSource {
+ return &ServiceRoutingOSPFv3IPv4ProfileParcelDataSource{}
+}
+
+type ServiceRoutingOSPFv3IPv4ProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceRoutingOSPFv3IPv4ProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_ospfv3_ipv4_feature"
+}
+
+func (d *ServiceRoutingOSPFv3IPv4ProfileParcelDataSource) 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 Service Routing OSPFv3 IPv4 Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF router ID to override system IP address",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: "Distance",
+ Computed: true,
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for external routes",
+ Computed: true,
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for inter-area routes",
+ Computed: true,
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for intra-area routes",
+ Computed: true,
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: "Set reference bandwidth method to assign OSPF cost",
+ Computed: true,
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: "Calculate summary route cost based on RFC 1583",
+ Computed: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: "Distribute default external route into OSPF disabled",
+ Computed: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: "Always advertise default route",
+ Computed: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: "Set metric used to generate default route <0..16777214>",
+ Computed: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set default route metric type",
+ Computed: true,
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: "Set delay from first change received until performing SPF calculation",
+ Computed: true,
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set initial hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: "Enable NAT DIA for redistributed routes",
+ Computed: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: "Not advertise maximum metric Router LSA policy by default",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to advertise maximum metric after router boot up",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure OSPFv3 IPv4 area",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF area number",
+ Computed: true,
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: "stub area type",
+ Computed: true,
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: "Do not inject inter-area routes",
+ Computed: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: "Always translate type7 LSAs",
+ Computed: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Set OSPF interface parameters",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set interface name",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval between OSPF hello packets",
+ Computed: true,
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval after which neighbor is declared to be down",
+ Computed: true,
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time between retransmitting LSAs",
+ Computed: true,
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost of OSPF interface",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: "Set the OSPF network type",
+ Computed: true,
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface to advertise its address, but not to actively run OSPF",
+ Computed: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: "No Authentication by default",
+ Computed: true,
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ Computed: true,
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSEC key",
+ Computed: true,
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: "Summarize OSPF routes at an area boundary",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost for this range",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: "Do not advertise this range",
+ Computed: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ServiceRoutingOSPFv3IPv4ProfileParcelDataSource) 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 *ServiceRoutingOSPFv3IPv4ProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceRoutingOSPFv3IPv4
+
+ // 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_service_routing_ospfv3_ipv4_feature_test.go b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv4_feature_test.go
new file mode 100644
index 000000000..099427687
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv4_feature_test.go
@@ -0,0 +1,151 @@
+// 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 TestAccDataSourceSdwanServiceRoutingOSPFv3IPv4ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "redistributes.0.protocol", "nat-route"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceRoutingOSPFv3IPv4ProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceRoutingOSPFv3IPv4ProfileParcelConfig() string {
+ config := `resource "sdwan_service_routing_ospfv3_ipv4_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "nat-route"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_routing_ospfv3_ipv4_feature" "test" {
+ id = sdwan_service_routing_ospfv3_ipv4_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv6_feature.go b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv6_feature.go
new file mode 100644
index 000000000..70306c1cf
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv6_feature.go
@@ -0,0 +1,426 @@
+// 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 = &ServiceRoutingOSPFv3IPv6ProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceRoutingOSPFv3IPv6ProfileParcelDataSource{}
+)
+
+func NewServiceRoutingOSPFv3IPv6ProfileParcelDataSource() datasource.DataSource {
+ return &ServiceRoutingOSPFv3IPv6ProfileParcelDataSource{}
+}
+
+type ServiceRoutingOSPFv3IPv6ProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceRoutingOSPFv3IPv6ProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_ospfv3_ipv6_feature"
+}
+
+func (d *ServiceRoutingOSPFv3IPv6ProfileParcelDataSource) 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 Service Routing OSPFv3 IPv6 Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF router ID to override system IP address",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: "Distance",
+ Computed: true,
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for external routes",
+ Computed: true,
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for inter-area routes",
+ Computed: true,
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for intra-area routes",
+ Computed: true,
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: "Set reference bandwidth method to assign OSPF cost",
+ Computed: true,
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: "Calculate summary route cost based on RFC 1583",
+ Computed: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: "Distribute default external route into OSPF disabled",
+ Computed: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: "Always advertise default route",
+ Computed: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: "Set metric used to generate default route <0..16777214>",
+ Computed: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set default route metric type",
+ Computed: true,
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: "Set delay from first change received until performing SPF calculation",
+ Computed: true,
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set initial hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: "Not advertise maximum metric Router LSA policy by default",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to advertise maximum metric after router boot up",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure OSPFv3 IPv6 area",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF area number",
+ Computed: true,
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: "stub area type",
+ Computed: true,
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: "Do not inject inter-area routes",
+ Computed: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: "Always translate type7 LSAs",
+ Computed: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Set OSPF interface parameters",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set interface name",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval between OSPF hello packets",
+ Computed: true,
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval after which neighbor is declared to be down",
+ Computed: true,
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time between retransmitting LSAs",
+ Computed: true,
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost of OSPF interface",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: "Set the OSPF network type",
+ Computed: true,
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface to advertise its address, but not to actively run OSPF",
+ Computed: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: "No Authentication by default",
+ Computed: true,
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ Computed: true,
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSEC key",
+ Computed: true,
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: "Summarize OSPF routes at an area boundary",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: "IPv6 prefix,for example 2001::/64",
+ Computed: true,
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost for this range",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: "Do not advertise this range",
+ Computed: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ServiceRoutingOSPFv3IPv6ProfileParcelDataSource) 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 *ServiceRoutingOSPFv3IPv6ProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceRoutingOSPFv3IPv6
+
+ // 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_service_routing_ospfv3_ipv6_feature_test.go b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv6_feature_test.go
new file mode 100644
index 000000000..e9def76a1
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_routing_ospfv3_ipv6_feature_test.go
@@ -0,0 +1,147 @@
+// 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 TestAccDataSourceSdwanServiceRoutingOSPFv3IPv6ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.prefix", "3002::/96"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceRoutingOSPFv3IPv6ProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceRoutingOSPFv3IPv6ProfileParcelConfig() string {
+ config := `resource "sdwan_service_routing_ospfv3_ipv6_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` prefix = "3002::/96"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_routing_ospfv3_ipv6_feature" "test" {
+ id = sdwan_service_routing_ospfv3_ipv6_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_switchport_feature.go b/internal/provider/data_source_sdwan_service_switchport_feature.go
new file mode 100644
index 000000000..e0f119d42
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_switchport_feature.go
@@ -0,0 +1,334 @@
+// 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 = &ServiceSwitchportProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceSwitchportProfileParcelDataSource{}
+)
+
+func NewServiceSwitchportProfileParcelDataSource() datasource.DataSource {
+ return &ServiceSwitchportProfileParcelDataSource{}
+}
+
+type ServiceSwitchportProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceSwitchportProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_switchport_feature"
+}
+
+func (d *ServiceSwitchportProfileParcelDataSource) 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 Service Switchport Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Interface name: GigabitEthernet0/<>/<> when present",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Set Interface name",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mode": schema.StringAttribute{
+ MarkdownDescription: "Set type of switch port: access/trunk",
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Administrative state",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: "Set interface speed",
+ Computed: true,
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: "Duplex mode",
+ Computed: true,
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "switchport_access_vlan": schema.Int64Attribute{
+ MarkdownDescription: "Set VLAN identifier associated with bridging domain",
+ Computed: true,
+ },
+ "switchport_access_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "switchport_trunk_allowed_vlans": schema.StringAttribute{
+ MarkdownDescription: "Configure VLAN IDs used with the trunk",
+ Computed: true,
+ },
+ "switchport_trunk_allowed_vlans_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "switchport_trunk_native_vlan": schema.Int64Attribute{
+ MarkdownDescription: "Configure VLAN ID used for native VLAN",
+ Computed: true,
+ },
+ "switchport_trunk_native_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "port_control": schema.StringAttribute{
+ MarkdownDescription: "Set Port-Control Mode",
+ Computed: true,
+ },
+ "port_control_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "voice_vlan": schema.Int64Attribute{
+ MarkdownDescription: "Configure Voice Vlan",
+ Computed: true,
+ },
+ "voice_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "pae_enable": schema.BoolAttribute{
+ MarkdownDescription: "Set 802.1x Interface Pae Type",
+ Computed: true,
+ },
+ "pae_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_authentication_bypass": schema.BoolAttribute{
+ MarkdownDescription: "MAC Authentication Bypass",
+ Computed: true,
+ },
+ "mac_authentication_bypass_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "host_mode": schema.StringAttribute{
+ MarkdownDescription: "Set host mode",
+ Computed: true,
+ },
+ "host_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "enable_periodic_reauth": schema.BoolAttribute{
+ MarkdownDescription: "Enable Periodic Reauthentication",
+ Computed: true,
+ },
+ "enable_periodic_reauth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "inactivity": schema.Int64Attribute{
+ MarkdownDescription: "Periodic Reauthentication Inactivity Timeout (in seconds)",
+ Computed: true,
+ },
+ "inactivity_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "reauthentication": schema.Int64Attribute{
+ MarkdownDescription: "Periodic Reauthentication Interval (in seconds)",
+ Computed: true,
+ },
+ "reauthentication_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "control_direction": schema.StringAttribute{
+ MarkdownDescription: "Set uni or bi directional authorization mode",
+ Computed: true,
+ },
+ "control_direction_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "restricted_vlan": schema.Int64Attribute{
+ MarkdownDescription: "Set Restricted VLAN ID",
+ Computed: true,
+ },
+ "restricted_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "guest_vlan": schema.Int64Attribute{
+ MarkdownDescription: "Set vlan to drop non-802.1x enabled clients into if client is not in MAB list",
+ Computed: true,
+ },
+ "guest_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "critical_vlan": schema.Int64Attribute{
+ MarkdownDescription: "Set Critical VLAN",
+ Computed: true,
+ },
+ "critical_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "enable_voice": schema.BoolAttribute{
+ MarkdownDescription: "Enable Critical Voice VLAN",
+ Computed: true,
+ },
+ "enable_voice_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "age_out_time": schema.Int64Attribute{
+ MarkdownDescription: "Set when a MAC table entry ages out (0 to disable, 10-1000000 otherwise)",
+ Computed: true,
+ },
+ "age_out_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "static_mac_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Add static MAC address entries for interface",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "Set MAC address in xxxx.xxxx.xxxx format",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vlan_id": schema.Int64Attribute{
+ MarkdownDescription: "Configure VLAN ID used with the mac and interface",
+ Computed: true,
+ },
+ "vlan_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Interface name: GigabitEthernet0/<>/<>",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *ServiceSwitchportProfileParcelDataSource) 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 *ServiceSwitchportProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceSwitchport
+
+ // 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_service_switchport_feature_test.go b/internal/provider/data_source_sdwan_service_switchport_feature_test.go
new file mode 100644
index 000000000..752be3810
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_switchport_feature_test.go
@@ -0,0 +1,131 @@
+// 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 TestAccDataSourceSdwanServiceSwitchportProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.interface_name", "GigabitEthernet"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.mode", "access"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.speed", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.switchport_access_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.switchport_trunk_allowed_vlans", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.switchport_trunk_native_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.port_control", "auto"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.voice_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.pae_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.mac_authentication_bypass", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.host_mode", "single-host"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.enable_periodic_reauth", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.inactivity", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.reauthentication", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.control_direction", "both"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.restricted_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.guest_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.critical_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "interfaces.0.enable_voice", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "age_out_time", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "static_mac_addresses.0.mac_address", "01:02:03:04:05:06"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "static_mac_addresses.0.vlan_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_switchport_feature.test", "static_mac_addresses.0.interface_name", "GigabitEthernet0/0/0"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceSwitchportPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceSwitchportProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceSwitchportPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceSwitchportProfileParcelConfig() string {
+ config := `resource "sdwan_service_switchport_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` interface_name = "GigabitEthernet"` + "\n"
+ config += ` mode = "access"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` speed = "10"` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` switchport_access_vlan = 1` + "\n"
+ config += ` switchport_trunk_allowed_vlans = "1"` + "\n"
+ config += ` switchport_trunk_native_vlan = 1` + "\n"
+ config += ` port_control = "auto"` + "\n"
+ config += ` voice_vlan = 1` + "\n"
+ config += ` pae_enable = true` + "\n"
+ config += ` mac_authentication_bypass = false` + "\n"
+ config += ` host_mode = "single-host"` + "\n"
+ config += ` enable_periodic_reauth = false` + "\n"
+ config += ` inactivity = 60` + "\n"
+ config += ` reauthentication = 1` + "\n"
+ config += ` control_direction = "both"` + "\n"
+ config += ` restricted_vlan = 1` + "\n"
+ config += ` guest_vlan = 1` + "\n"
+ config += ` critical_vlan = 1` + "\n"
+ config += ` enable_voice = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` age_out_time = 300` + "\n"
+ config += ` static_mac_addresses = [{` + "\n"
+ config += ` mac_address = "01:02:03:04:05:06"` + "\n"
+ config += ` vlan_id = 1` + "\n"
+ config += ` interface_name = "GigabitEthernet0/0/0"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_switchport_feature" "test" {
+ id = sdwan_service_switchport_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_tracker_feature.go b/internal/provider/data_source_sdwan_service_tracker_feature.go
new file mode 100644
index 000000000..931053ae3
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_tracker_feature.go
@@ -0,0 +1,210 @@
+// 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 = &ServiceTrackerProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceTrackerProfileParcelDataSource{}
+)
+
+func NewServiceTrackerProfileParcelDataSource() datasource.DataSource {
+ return &ServiceTrackerProfileParcelDataSource{}
+}
+
+type ServiceTrackerProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceTrackerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_tracker_feature"
+}
+
+func (d *ServiceTrackerProfileParcelDataSource) 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 Service Tracker Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: "Tracker Name",
+ Computed: true,
+ },
+ "tracker_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_api_url": schema.StringAttribute{
+ MarkdownDescription: "API url of endpoint",
+ Computed: true,
+ },
+ "endpoint_api_url_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_dns_name": schema.StringAttribute{
+ MarkdownDescription: "Endpoint DNS Name",
+ Computed: true,
+ },
+ "endpoint_dns_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_ip": schema.StringAttribute{
+ MarkdownDescription: "Endpoint IP",
+ Computed: true,
+ },
+ "endpoint_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "port": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interval": schema.Int64Attribute{
+ MarkdownDescription: "Interval",
+ Computed: true,
+ },
+ "interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: "Multiplier",
+ Computed: true,
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: "Threshold",
+ Computed: true,
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_tracker_type": schema.StringAttribute{
+ MarkdownDescription: "Endpoint Tracker Type",
+ Computed: true,
+ },
+ "endpoint_tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_type": schema.StringAttribute{
+ MarkdownDescription: "Tracker Type",
+ Computed: true,
+ },
+ "tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceTrackerProfileParcelDataSource) 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 *ServiceTrackerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceTracker
+
+ // 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_service_tracker_feature_test.go b/internal/provider/data_source_sdwan_service_tracker_feature_test.go
new file mode 100644
index 000000000..5105b4fa5
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_tracker_feature_test.go
@@ -0,0 +1,99 @@
+// 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 TestAccDataSourceSdwanServiceTrackerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "tracker_name", "TRACKER_2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "endpoint_api_url", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "endpoint_dns_name", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "endpoint_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "protocol", "tcp"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "port", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "threshold", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "endpoint_tracker_type", "static-route"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_feature.test", "tracker_type", "endpoint"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceTrackerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceTrackerProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceTrackerPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceTrackerProfileParcelConfig() string {
+ config := `resource "sdwan_service_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` tracker_name = "TRACKER_2"` + "\n"
+ config += ` endpoint_api_url = "google.com"` + "\n"
+ config += ` endpoint_dns_name = "google.com"` + "\n"
+ config += ` endpoint_ip = "1.2.3.4"` + "\n"
+ config += ` protocol = "tcp"` + "\n"
+ config += ` port = 123` + "\n"
+ config += ` interval = 30` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` threshold = 300` + "\n"
+ config += ` endpoint_tracker_type = "static-route"` + "\n"
+ config += ` tracker_type = "endpoint"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_tracker_feature" "test" {
+ id = sdwan_service_tracker_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_tracker_group_feature.go b/internal/provider/data_source_sdwan_service_tracker_group_feature.go
new file mode 100644
index 000000000..fa64934a6
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_tracker_group_feature.go
@@ -0,0 +1,142 @@
+// 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 = &ServiceTrackerGroupProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &ServiceTrackerGroupProfileParcelDataSource{}
+)
+
+func NewServiceTrackerGroupProfileParcelDataSource() datasource.DataSource {
+ return &ServiceTrackerGroupProfileParcelDataSource{}
+}
+
+type ServiceTrackerGroupProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *ServiceTrackerGroupProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_tracker_group_feature"
+}
+
+func (d *ServiceTrackerGroupProfileParcelDataSource) 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 Service Tracker Group Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "tracker_elements": schema.ListNestedAttribute{
+ MarkdownDescription: "tracker parcel ref list",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "tracker_boolean": schema.StringAttribute{
+ MarkdownDescription: "tracker ref list combine boolean and or",
+ Computed: true,
+ },
+ "tracker_boolean_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *ServiceTrackerGroupProfileParcelDataSource) 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 *ServiceTrackerGroupProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config ServiceTrackerGroup
+
+ // 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_service_tracker_group_feature_test.go b/internal/provider/data_source_sdwan_service_tracker_group_feature_test.go
new file mode 100644
index 000000000..a5f88f176
--- /dev/null
+++ b/internal/provider/data_source_sdwan_service_tracker_group_feature_test.go
@@ -0,0 +1,118 @@
+// 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 TestAccDataSourceSdwanServiceTrackerGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_group_feature.test", "tracker_boolean", "or"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanServiceTrackerGroupPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceTrackerGroupProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanServiceTrackerGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "Terraform test"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ tracker_name = "TRACKER_2"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ protocol = "tcp"
+ port = 123
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "static-route"
+ tracker_type = "endpoint"
+}
+
+resource "sdwan_service_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "Terraform test"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ tracker_name = "TRACKER_2"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ protocol = "tcp"
+ port = 123
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "static-route"
+ tracker_type = "endpoint"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanServiceTrackerGroupProfileParcelConfig() string {
+ config := `resource "sdwan_service_tracker_group_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` tracker_elements = [{` + "\n"
+ config += ` tracker_id = sdwan_service_tracker_feature.test-1.id` + "\n"
+ config += ` }, {` + "\n"
+ config += ` tracker_id = sdwan_service_tracker_feature.test-2.id` + "\n"
+ config += ` }]` + "\n"
+ config += ` tracker_boolean = "or"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_service_tracker_group_feature" "test" {
+ id = sdwan_service_tracker_group_feature.test.id
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_service_tracker_profile_parcel.go b/internal/provider/data_source_sdwan_service_tracker_profile_parcel.go
deleted file mode 100644
index fe8447bb7..000000000
--- a/internal/provider/data_source_sdwan_service_tracker_profile_parcel.go
+++ /dev/null
@@ -1,210 +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/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 = &ServiceTrackerProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &ServiceTrackerProfileParcelDataSource{}
-)
-
-func NewServiceTrackerProfileParcelDataSource() datasource.DataSource {
- return &ServiceTrackerProfileParcelDataSource{}
-}
-
-type ServiceTrackerProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *ServiceTrackerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_tracker_profile_parcel"
-}
-
-func (d *ServiceTrackerProfileParcelDataSource) 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 Service Tracker 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,
- },
- "tracker_name": schema.StringAttribute{
- MarkdownDescription: "Tracker Name",
- Computed: true,
- },
- "tracker_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_api_url": schema.StringAttribute{
- MarkdownDescription: "API url of endpoint",
- Computed: true,
- },
- "endpoint_api_url_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_dns_name": schema.StringAttribute{
- MarkdownDescription: "Endpoint DNS Name",
- Computed: true,
- },
- "endpoint_dns_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_ip": schema.StringAttribute{
- MarkdownDescription: "Endpoint IP",
- Computed: true,
- },
- "endpoint_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "protocol": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "port": schema.Int64Attribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interval": schema.Int64Attribute{
- MarkdownDescription: "Interval",
- Computed: true,
- },
- "interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "multiplier": schema.Int64Attribute{
- MarkdownDescription: "Multiplier",
- Computed: true,
- },
- "multiplier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "threshold": schema.Int64Attribute{
- MarkdownDescription: "Threshold",
- Computed: true,
- },
- "threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_tracker_type": schema.StringAttribute{
- MarkdownDescription: "Endpoint Tracker Type",
- Computed: true,
- },
- "endpoint_tracker_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker_type": schema.StringAttribute{
- MarkdownDescription: "Tracker Type",
- Computed: true,
- },
- "tracker_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *ServiceTrackerProfileParcelDataSource) 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 *ServiceTrackerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config ServiceTracker
-
- // 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_service_tracker_profile_parcel_test.go b/internal/provider/data_source_sdwan_service_tracker_profile_parcel_test.go
deleted file mode 100644
index fe2288d92..000000000
--- a/internal/provider/data_source_sdwan_service_tracker_profile_parcel_test.go
+++ /dev/null
@@ -1,99 +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 TestAccDataSourceSdwanServiceTrackerProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "tracker_name", "TRACKER_2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "endpoint_api_url", "google.com"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "endpoint_dns_name", "google.com"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "endpoint_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "protocol", "tcp"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "port", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "multiplier", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "threshold", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "endpoint_tracker_type", "static-route"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_service_tracker_profile_parcel.test", "tracker_type", "endpoint"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanServiceTrackerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanServiceTrackerProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanServiceTrackerPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanServiceTrackerProfileParcelConfig() string {
- config := `resource "sdwan_service_tracker_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` tracker_name = "TRACKER_2"` + "\n"
- config += ` endpoint_api_url = "google.com"` + "\n"
- config += ` endpoint_dns_name = "google.com"` + "\n"
- config += ` endpoint_ip = "1.2.3.4"` + "\n"
- config += ` protocol = "tcp"` + "\n"
- config += ` port = 123` + "\n"
- config += ` interval = 30` + "\n"
- config += ` multiplier = 3` + "\n"
- config += ` threshold = 300` + "\n"
- config += ` endpoint_tracker_type = "static-route"` + "\n"
- config += ` tracker_type = "endpoint"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_service_tracker_profile_parcel" "test" {
- id = sdwan_service_tracker_profile_parcel.test.id
- feature_profile_id = sdwan_service_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_sig_security_feature_profile.go b/internal/provider/data_source_sdwan_sig_security_feature_profile.go
new file mode 100644
index 000000000..b61f61697
--- /dev/null
+++ b/internal/provider/data_source_sdwan_sig_security_feature_profile.go
@@ -0,0 +1,113 @@
+// 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 = &SIGSecurityFeatureProfileDataSource{}
+ _ datasource.DataSourceWithConfigure = &SIGSecurityFeatureProfileDataSource{}
+)
+
+func NewSIGSecurityFeatureProfileDataSource() datasource.DataSource {
+ return &SIGSecurityFeatureProfileDataSource{}
+}
+
+type SIGSecurityFeatureProfileDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SIGSecurityFeatureProfileDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_sig_security_feature_profile"
+}
+
+func (d *SIGSecurityFeatureProfileDataSource) 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 SIG Security Feature Profile .",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Required: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the sig security feature profile",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Description",
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SIGSecurityFeatureProfileDataSource) 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 *SIGSecurityFeatureProfileDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SIGSecurityFeatureProfile
+
+ // 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.Id.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_sig_security_feature_profile_test.go b/internal/provider/data_source_sdwan_sig_security_feature_profile_test.go
new file mode 100644
index 000000000..279ed9e4d
--- /dev/null
+++ b/internal/provider/data_source_sdwan_sig_security_feature_profile_test.go
@@ -0,0 +1,71 @@
+// 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 TestAccDataSourceSdwanSIGSecurityFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_sig_security_feature_profile.test", "name", "SIG_SECURITY_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_sig_security_feature_profile.test", "description", "My sig security feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSIGSecurityFeatureProfileConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSIGSecurityFeatureProfileConfig() string {
+ config := ""
+ config += `resource "sdwan_sig_security_feature_profile" "test" {` + "\n"
+ config += ` name = "SIG_SECURITY_FP_1"` + "\n"
+ config += ` description = "My sig security feature profile 1"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_sig_security_feature_profile" "test" {
+ id = sdwan_sig_security_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_aaa_feature.go b/internal/provider/data_source_sdwan_system_aaa_feature.go
new file mode 100644
index 000000000..1ed509e40
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_aaa_feature.go
@@ -0,0 +1,434 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemAAAProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemAAAProfileParcelDataSource{}
+)
+
+func NewSystemAAAProfileParcelDataSource() datasource.DataSource {
+ return &SystemAAAProfileParcelDataSource{}
+}
+
+type SystemAAAProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemAAAProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_aaa_feature"
+}
+
+func (d *SystemAAAProfileParcelDataSource) 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 System AAA Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "authentication_group": schema.BoolAttribute{
+ MarkdownDescription: "Authentication configurations parameters",
+ Computed: true,
+ },
+ "authentication_group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "accounting_group": schema.BoolAttribute{
+ MarkdownDescription: "Accounting configurations parameters",
+ Computed: true,
+ },
+ "accounting_group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "server_auth_order": schema.SetAttribute{
+ MarkdownDescription: "ServerGroups priority order",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "users": schema.ListNestedAttribute{
+ MarkdownDescription: "Create local login account",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set the username",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: "Set the user password",
+ Computed: true,
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "privilege": schema.StringAttribute{
+ MarkdownDescription: "Set Privilege Level for this user",
+ Computed: true,
+ },
+ "privilege_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "public_keys": schema.ListNestedAttribute{
+ MarkdownDescription: "List of RSA public-keys per user",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "key_string": schema.StringAttribute{
+ MarkdownDescription: "Set the RSA key string",
+ Computed: true,
+ },
+ "key_type": schema.StringAttribute{
+ MarkdownDescription: "Only RSA is supported",
+ Computed: true,
+ },
+ "key_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "radius_groups": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the Radius serverGroup",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_name": schema.StringAttribute{
+ MarkdownDescription: "Set Radius server Group Name",
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "Set VPN in which Radius server is located",
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Set interface to use to reach Radius server",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "servers": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the Radius server",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Set IP address of Radius server",
+ Computed: true,
+ },
+ "auth_port": schema.Int64Attribute{
+ MarkdownDescription: "Set Authentication port to use to connect to Radius server",
+ Computed: true,
+ },
+ "auth_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "acct_port": schema.Int64Attribute{
+ MarkdownDescription: "Set Accounting port to use to connect to Radius server",
+ Computed: true,
+ },
+ "acct_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "timeout": schema.Int64Attribute{
+ MarkdownDescription: "Configure how long to wait for replies from the Radius server",
+ Computed: true,
+ },
+ "timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "retransmit": schema.Int64Attribute{
+ MarkdownDescription: "Configure how many times to contact this Radius server",
+ Computed: true,
+ },
+ "retransmit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "key": schema.StringAttribute{
+ MarkdownDescription: "Set the Radius server shared key",
+ Computed: true,
+ },
+ "secret_key": schema.StringAttribute{
+ MarkdownDescription: "Set the Radius server shared type 7 encrypted key",
+ Computed: true,
+ },
+ "secret_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "key_enum": schema.StringAttribute{
+ MarkdownDescription: "Type of encyption. To be used for type 6",
+ Computed: true,
+ },
+ "key_type": schema.StringAttribute{
+ MarkdownDescription: "key type",
+ Computed: true,
+ },
+ "key_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "tacacs_groups": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the TACACS serverGroup",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_name": schema.StringAttribute{
+ MarkdownDescription: "Set TACACS server Group Name",
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "Set VPN in which TACACS server is located",
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Set interface to use to reach TACACS server",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "servers": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the TACACS server",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Set IP address of TACACS server",
+ Computed: true,
+ },
+ "port": schema.Int64Attribute{
+ MarkdownDescription: "TACACS Port",
+ Computed: true,
+ },
+ "port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "timeout": schema.Int64Attribute{
+ MarkdownDescription: "Configure how long to wait for replies from the TACACS server",
+ Computed: true,
+ },
+ "timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "key": schema.StringAttribute{
+ MarkdownDescription: "Set the TACACS server shared key",
+ Computed: true,
+ },
+ "secret_key": schema.StringAttribute{
+ MarkdownDescription: "Set the TACACS server shared type 7 encrypted key",
+ Computed: true,
+ },
+ "secret_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "key_enum": schema.StringAttribute{
+ MarkdownDescription: "Type of encyption. To be used for type 6",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "accounting_rules": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the accounting rules",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "rule_id": schema.StringAttribute{
+ MarkdownDescription: "Configure Accounting Rule ID",
+ Computed: true,
+ },
+ "method": schema.StringAttribute{
+ MarkdownDescription: "Configure Accounting Method",
+ Computed: true,
+ },
+ "level": schema.StringAttribute{
+ MarkdownDescription: "Privilege level when method is commands",
+ Computed: true,
+ },
+ "start_stop": schema.BoolAttribute{
+ MarkdownDescription: "Record start and stop without waiting",
+ Computed: true,
+ },
+ "start_stop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "group": schema.SetAttribute{
+ MarkdownDescription: "Use Server-group",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "authorization_console": schema.BoolAttribute{
+ MarkdownDescription: "For enabling console authorization",
+ Computed: true,
+ },
+ "authorization_console_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authorization_config_commands": schema.BoolAttribute{
+ MarkdownDescription: "For configuration mode commands.",
+ Computed: true,
+ },
+ "authorization_config_commands_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authorization_rules": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the Authorization Rules",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "rule_id": schema.StringAttribute{
+ MarkdownDescription: "Configure Authorization Rule ID",
+ Computed: true,
+ },
+ "method": schema.StringAttribute{
+ MarkdownDescription: "Method",
+ Computed: true,
+ },
+ "level": schema.StringAttribute{
+ MarkdownDescription: "Privilege level when method is commands",
+ Computed: true,
+ },
+ "group": schema.SetAttribute{
+ MarkdownDescription: "Use Server-group",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "if_authenticated": schema.BoolAttribute{
+ MarkdownDescription: "Succeed if user has authenticated",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemAAAProfileParcelDataSource) 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 *SystemAAAProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemAAA
+
+ // 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_system_aaa_feature_test.go b/internal/provider/data_source_sdwan_system_aaa_feature_test.go
new file mode 100644
index 000000000..45cea127c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_aaa_feature_test.go
@@ -0,0 +1,169 @@
+// 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 TestAccDataSourceSdwanSystemAAAProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "authentication_group", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "accounting_group", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "users.0.name", "User1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "users.0.privilege", "15"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "users.0.public_keys.0.key_string", "AAAAB3NzaC1yc2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "users.0.public_keys.0.key_type", "ssh-rsa"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.group_name", "RGROUP1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.vpn", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.source_interface", "GigabitEthernet0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.auth_port", "1812"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.acct_port", "1813"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.timeout", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.retransmit", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.secret_key", "cisco123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.key_enum", "7"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "radius_groups.0.servers.0.key_type", "key"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.group_name", "TGROUP1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.vpn", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.source_interface", "GigabitEthernet0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.servers.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.servers.0.port", "49"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.servers.0.timeout", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.servers.0.secret_key", "cisco123"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "tacacs_groups.0.servers.0.key_enum", "7"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "accounting_rules.0.rule_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "accounting_rules.0.method", "commands"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "accounting_rules.0.level", "15"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "accounting_rules.0.start_stop", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "authorization_console", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "authorization_config_commands", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "authorization_rules.0.rule_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "authorization_rules.0.method", "commands"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "authorization_rules.0.level", "15"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_feature.test", "authorization_rules.0.if_authenticated", "true"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemAAAPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemAAAProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemAAAPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemAAAProfileParcelConfig() string {
+ config := `resource "sdwan_system_aaa_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` authentication_group = true` + "\n"
+ config += ` accounting_group = true` + "\n"
+ config += ` server_auth_order = ["local"]` + "\n"
+ config += ` users = [{` + "\n"
+ config += ` name = "User1"` + "\n"
+ config += ` password = "cisco123"` + "\n"
+ config += ` privilege = "15"` + "\n"
+ config += ` public_keys = [{` + "\n"
+ config += ` key_string = "AAAAB3NzaC1yc2"` + "\n"
+ config += ` key_type = "ssh-rsa"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` radius_groups = [{` + "\n"
+ config += ` group_name = "RGROUP1"` + "\n"
+ config += ` vpn = 10` + "\n"
+ config += ` source_interface = "GigabitEthernet0"` + "\n"
+ config += ` servers = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` auth_port = 1812` + "\n"
+ config += ` acct_port = 1813` + "\n"
+ config += ` timeout = 5` + "\n"
+ config += ` retransmit = 3` + "\n"
+ config += ` key = "cisco123"` + "\n"
+ config += ` secret_key = "cisco123"` + "\n"
+ config += ` key_enum = "7"` + "\n"
+ config += ` key_type = "key"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` tacacs_groups = [{` + "\n"
+ config += ` group_name = "TGROUP1"` + "\n"
+ config += ` vpn = 10` + "\n"
+ config += ` source_interface = "GigabitEthernet0"` + "\n"
+ config += ` servers = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` port = 49` + "\n"
+ config += ` timeout = 5` + "\n"
+ config += ` key = "cisco123"` + "\n"
+ config += ` secret_key = "cisco123"` + "\n"
+ config += ` key_enum = "7"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` accounting_rules = [{` + "\n"
+ config += ` rule_id = "1"` + "\n"
+ config += ` method = "commands"` + "\n"
+ config += ` level = "15"` + "\n"
+ config += ` start_stop = true` + "\n"
+ config += ` group = ["RGROUP1"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` authorization_console = true` + "\n"
+ config += ` authorization_config_commands = true` + "\n"
+ config += ` authorization_rules = [{` + "\n"
+ config += ` rule_id = "1"` + "\n"
+ config += ` method = "commands"` + "\n"
+ config += ` level = "15"` + "\n"
+ config += ` group = ["RGROUP1"]` + "\n"
+ config += ` if_authenticated = true` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_aaa_feature" "test" {
+ id = sdwan_system_aaa_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_aaa_profile_parcel.go b/internal/provider/data_source_sdwan_system_aaa_profile_parcel.go
deleted file mode 100644
index a439b9529..000000000
--- a/internal/provider/data_source_sdwan_system_aaa_profile_parcel.go
+++ /dev/null
@@ -1,434 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemAAAProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemAAAProfileParcelDataSource{}
-)
-
-func NewSystemAAAProfileParcelDataSource() datasource.DataSource {
- return &SystemAAAProfileParcelDataSource{}
-}
-
-type SystemAAAProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemAAAProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_aaa_profile_parcel"
-}
-
-func (d *SystemAAAProfileParcelDataSource) 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 System AAA 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,
- },
- "authentication_group": schema.BoolAttribute{
- MarkdownDescription: "Authentication configurations parameters",
- Computed: true,
- },
- "authentication_group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "accounting_group": schema.BoolAttribute{
- MarkdownDescription: "Accounting configurations parameters",
- Computed: true,
- },
- "accounting_group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "server_auth_order": schema.SetAttribute{
- MarkdownDescription: "ServerGroups priority order",
- ElementType: types.StringType,
- Computed: true,
- },
- "users": schema.ListNestedAttribute{
- MarkdownDescription: "Create local login account",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: "Set the username",
- Computed: true,
- },
- "name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "password": schema.StringAttribute{
- MarkdownDescription: "Set the user password",
- Computed: true,
- },
- "password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "privilege": schema.StringAttribute{
- MarkdownDescription: "Set Privilege Level for this user",
- Computed: true,
- },
- "privilege_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "public_keys": schema.ListNestedAttribute{
- MarkdownDescription: "List of RSA public-keys per user",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "key_string": schema.StringAttribute{
- MarkdownDescription: "Set the RSA key string",
- Computed: true,
- },
- "key_type": schema.StringAttribute{
- MarkdownDescription: "Only RSA is supported",
- Computed: true,
- },
- "key_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "radius_groups": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the Radius serverGroup",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_name": schema.StringAttribute{
- MarkdownDescription: "Set Radius server Group Name",
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "Set VPN in which Radius server is located",
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Set interface to use to reach Radius server",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "servers": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the Radius server",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Set IP address of Radius server",
- Computed: true,
- },
- "auth_port": schema.Int64Attribute{
- MarkdownDescription: "Set Authentication port to use to connect to Radius server",
- Computed: true,
- },
- "auth_port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "acct_port": schema.Int64Attribute{
- MarkdownDescription: "Set Accounting port to use to connect to Radius server",
- Computed: true,
- },
- "acct_port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "timeout": schema.Int64Attribute{
- MarkdownDescription: "Configure how long to wait for replies from the Radius server",
- Computed: true,
- },
- "timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "retransmit": schema.Int64Attribute{
- MarkdownDescription: "Configure how many times to contact this Radius server",
- Computed: true,
- },
- "retransmit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "key": schema.StringAttribute{
- MarkdownDescription: "Set the Radius server shared key",
- Computed: true,
- },
- "secret_key": schema.StringAttribute{
- MarkdownDescription: "Set the Radius server shared type 7 encrypted key",
- Computed: true,
- },
- "secret_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "key_enum": schema.StringAttribute{
- MarkdownDescription: "Type of encyption. To be used for type 6",
- Computed: true,
- },
- "key_type": schema.StringAttribute{
- MarkdownDescription: "key type",
- Computed: true,
- },
- "key_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "tacacs_groups": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the TACACS serverGroup",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_name": schema.StringAttribute{
- MarkdownDescription: "Set TACACS server Group Name",
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "Set VPN in which TACACS server is located",
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Set interface to use to reach TACACS server",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "servers": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the TACACS server",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Set IP address of TACACS server",
- Computed: true,
- },
- "port": schema.Int64Attribute{
- MarkdownDescription: "TACACS Port",
- Computed: true,
- },
- "port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "timeout": schema.Int64Attribute{
- MarkdownDescription: "Configure how long to wait for replies from the TACACS server",
- Computed: true,
- },
- "timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "key": schema.StringAttribute{
- MarkdownDescription: "Set the TACACS server shared key",
- Computed: true,
- },
- "secret_key": schema.StringAttribute{
- MarkdownDescription: "Set the TACACS server shared type 7 encrypted key",
- Computed: true,
- },
- "secret_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "key_enum": schema.StringAttribute{
- MarkdownDescription: "Type of encyption. To be used for type 6",
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "accounting_rules": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the accounting rules",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "rule_id": schema.StringAttribute{
- MarkdownDescription: "Configure Accounting Rule ID",
- Computed: true,
- },
- "method": schema.StringAttribute{
- MarkdownDescription: "Configure Accounting Method",
- Computed: true,
- },
- "level": schema.StringAttribute{
- MarkdownDescription: "Privilege level when method is commands",
- Computed: true,
- },
- "start_stop": schema.BoolAttribute{
- MarkdownDescription: "Record start and stop without waiting",
- Computed: true,
- },
- "start_stop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "group": schema.SetAttribute{
- MarkdownDescription: "Use Server-group",
- ElementType: types.StringType,
- Computed: true,
- },
- },
- },
- },
- "authorization_console": schema.BoolAttribute{
- MarkdownDescription: "For enabling console authorization",
- Computed: true,
- },
- "authorization_console_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "authorization_config_commands": schema.BoolAttribute{
- MarkdownDescription: "For configuration mode commands.",
- Computed: true,
- },
- "authorization_config_commands_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "authorization_rules": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the Authorization Rules",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "rule_id": schema.StringAttribute{
- MarkdownDescription: "Configure Authorization Rule ID",
- Computed: true,
- },
- "method": schema.StringAttribute{
- MarkdownDescription: "Method",
- Computed: true,
- },
- "level": schema.StringAttribute{
- MarkdownDescription: "Privilege level when method is commands",
- Computed: true,
- },
- "group": schema.SetAttribute{
- MarkdownDescription: "Use Server-group",
- ElementType: types.StringType,
- Computed: true,
- },
- "if_authenticated": schema.BoolAttribute{
- MarkdownDescription: "Succeed if user has authenticated",
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemAAAProfileParcelDataSource) 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 *SystemAAAProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemAAA
-
- // 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_system_aaa_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_aaa_profile_parcel_test.go
deleted file mode 100644
index 6ae9946ce..000000000
--- a/internal/provider/data_source_sdwan_system_aaa_profile_parcel_test.go
+++ /dev/null
@@ -1,169 +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 TestAccDataSourceSdwanSystemAAAProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "authentication_group", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "accounting_group", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "users.0.name", "User1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "users.0.privilege", "15"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "users.0.public_keys.0.key_string", "AAAAB3NzaC1yc2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "users.0.public_keys.0.key_type", "ssh-rsa"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.group_name", "RGROUP1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.vpn", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.source_interface", "GigabitEthernet0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.auth_port", "1812"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.acct_port", "1813"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.timeout", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.retransmit", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.secret_key", "cisco123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.key_enum", "7"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "radius_groups.0.servers.0.key_type", "key"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.group_name", "TGROUP1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.vpn", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.source_interface", "GigabitEthernet0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.servers.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.servers.0.port", "49"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.servers.0.timeout", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.servers.0.secret_key", "cisco123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "tacacs_groups.0.servers.0.key_enum", "7"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "accounting_rules.0.rule_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "accounting_rules.0.method", "commands"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "accounting_rules.0.level", "15"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "accounting_rules.0.start_stop", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "authorization_console", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "authorization_config_commands", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "authorization_rules.0.rule_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "authorization_rules.0.method", "commands"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "authorization_rules.0.level", "15"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_aaa_profile_parcel.test", "authorization_rules.0.if_authenticated", "true"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemAAAPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemAAAProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemAAAPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemAAAProfileParcelConfig() string {
- config := `resource "sdwan_system_aaa_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` authentication_group = true` + "\n"
- config += ` accounting_group = true` + "\n"
- config += ` server_auth_order = ["local"]` + "\n"
- config += ` users = [{` + "\n"
- config += ` name = "User1"` + "\n"
- config += ` password = "cisco123"` + "\n"
- config += ` privilege = "15"` + "\n"
- config += ` public_keys = [{` + "\n"
- config += ` key_string = "AAAAB3NzaC1yc2"` + "\n"
- config += ` key_type = "ssh-rsa"` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` radius_groups = [{` + "\n"
- config += ` group_name = "RGROUP1"` + "\n"
- config += ` vpn = 10` + "\n"
- config += ` source_interface = "GigabitEthernet0"` + "\n"
- config += ` servers = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` auth_port = 1812` + "\n"
- config += ` acct_port = 1813` + "\n"
- config += ` timeout = 5` + "\n"
- config += ` retransmit = 3` + "\n"
- config += ` key = "cisco123"` + "\n"
- config += ` secret_key = "cisco123"` + "\n"
- config += ` key_enum = "7"` + "\n"
- config += ` key_type = "key"` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` tacacs_groups = [{` + "\n"
- config += ` group_name = "TGROUP1"` + "\n"
- config += ` vpn = 10` + "\n"
- config += ` source_interface = "GigabitEthernet0"` + "\n"
- config += ` servers = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` port = 49` + "\n"
- config += ` timeout = 5` + "\n"
- config += ` key = "cisco123"` + "\n"
- config += ` secret_key = "cisco123"` + "\n"
- config += ` key_enum = "7"` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` accounting_rules = [{` + "\n"
- config += ` rule_id = "1"` + "\n"
- config += ` method = "commands"` + "\n"
- config += ` level = "15"` + "\n"
- config += ` start_stop = true` + "\n"
- config += ` group = ["RGROUP1"]` + "\n"
- config += ` }]` + "\n"
- config += ` authorization_console = true` + "\n"
- config += ` authorization_config_commands = true` + "\n"
- config += ` authorization_rules = [{` + "\n"
- config += ` rule_id = "1"` + "\n"
- config += ` method = "commands"` + "\n"
- config += ` level = "15"` + "\n"
- config += ` group = ["RGROUP1"]` + "\n"
- config += ` if_authenticated = true` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_aaa_profile_parcel" "test" {
- id = sdwan_system_aaa_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_banner_feature.go b/internal/provider/data_source_sdwan_system_banner_feature.go
new file mode 100644
index 000000000..1687c0c54
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_banner_feature.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 = &SystemBannerProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemBannerProfileParcelDataSource{}
+)
+
+func NewSystemBannerProfileParcelDataSource() datasource.DataSource {
+ return &SystemBannerProfileParcelDataSource{}
+}
+
+type SystemBannerProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemBannerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_banner_feature"
+}
+
+func (d *SystemBannerProfileParcelDataSource) 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 System Banner Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "login": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "login_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "motd": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "motd_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemBannerProfileParcelDataSource) 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 *SystemBannerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemBanner
+
+ // 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_system_banner_feature_test.go b/internal/provider/data_source_sdwan_system_banner_feature_test.go
new file mode 100644
index 000000000..5c34cbafa
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_banner_feature_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccDataSourceSdwanSystemBannerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_banner_feature.test", "login", "My login banner"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_banner_feature.test", "motd", "My motd banner"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemBannerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemBannerProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemBannerPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemBannerProfileParcelConfig() string {
+ config := `resource "sdwan_system_banner_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` login = "My login banner"` + "\n"
+ config += ` motd = "My motd banner"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_banner_feature" "test" {
+ id = sdwan_system_banner_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_banner_profile_parcel.go b/internal/provider/data_source_sdwan_system_banner_profile_parcel.go
deleted file mode 100644
index 4bed18e72..000000000
--- a/internal/provider/data_source_sdwan_system_banner_profile_parcel.go
+++ /dev/null
@@ -1,138 +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/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 = &SystemBannerProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemBannerProfileParcelDataSource{}
-)
-
-func NewSystemBannerProfileParcelDataSource() datasource.DataSource {
- return &SystemBannerProfileParcelDataSource{}
-}
-
-type SystemBannerProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemBannerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_banner_profile_parcel"
-}
-
-func (d *SystemBannerProfileParcelDataSource) 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 System Banner 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,
- },
- "login": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "login_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "motd": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "motd_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemBannerProfileParcelDataSource) 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 *SystemBannerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemBanner
-
- // 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_system_banner_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_banner_profile_parcel_test.go
deleted file mode 100644
index 4626fd866..000000000
--- a/internal/provider/data_source_sdwan_system_banner_profile_parcel_test.go
+++ /dev/null
@@ -1,81 +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 TestAccDataSourceSdwanSystemBannerProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_banner_profile_parcel.test", "login", "My login banner"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_banner_profile_parcel.test", "motd", "My motd banner"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemBannerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemBannerProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemBannerPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemBannerProfileParcelConfig() string {
- config := `resource "sdwan_system_banner_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` login = "My login banner"` + "\n"
- config += ` motd = "My motd banner"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_banner_profile_parcel" "test" {
- id = sdwan_system_banner_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_basic_feature.go b/internal/provider/data_source_sdwan_system_basic_feature.go
new file mode 100644
index 000000000..9222aad56
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_basic_feature.go
@@ -0,0 +1,399 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemBasicProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemBasicProfileParcelDataSource{}
+)
+
+func NewSystemBasicProfileParcelDataSource() datasource.DataSource {
+ return &SystemBasicProfileParcelDataSource{}
+}
+
+type SystemBasicProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemBasicProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_basic_feature"
+}
+
+func (d *SystemBasicProfileParcelDataSource) 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 System Basic Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "timezone": schema.StringAttribute{
+ MarkdownDescription: "Set the timezone",
+ Computed: true,
+ },
+ "timezone_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "config_description": schema.StringAttribute{
+ MarkdownDescription: "Set a text description of the device",
+ Computed: true,
+ },
+ "config_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "location": schema.StringAttribute{
+ MarkdownDescription: "Set the location of the device",
+ Computed: true,
+ },
+ "location_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gps_longitude": schema.Float64Attribute{
+ MarkdownDescription: "Set the device physical longitude",
+ Computed: true,
+ },
+ "gps_longitude_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gps_latitude": schema.Float64Attribute{
+ MarkdownDescription: "Set the device physical latitude",
+ Computed: true,
+ },
+ "gps_latitude_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gps_geo_fencing_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable Geo fencing",
+ Computed: true,
+ },
+ "gps_geo_fencing_range": schema.Int64Attribute{
+ MarkdownDescription: "Set the device’s geo fencing range",
+ Computed: true,
+ },
+ "gps_geo_fencing_range_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gps_sms_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable device’s geo fencing SMS",
+ Computed: true,
+ },
+ "gps_sms_mobile_numbers": schema.ListNestedAttribute{
+ MarkdownDescription: "Set device’s geo fencing SMS phone number",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "number": schema.StringAttribute{
+ MarkdownDescription: "Mobile number, ex: 1231234414",
+ Computed: true,
+ },
+ "number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "device_groups": schema.SetAttribute{
+ MarkdownDescription: "Device groups",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "device_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "controller_groups": schema.SetAttribute{
+ MarkdownDescription: "Configure a list of comma-separated controller groups",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "controller_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "overlay_id": schema.Int64Attribute{
+ MarkdownDescription: "Set the Overlay ID",
+ Computed: true,
+ },
+ "overlay_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "port_offset": schema.Int64Attribute{
+ MarkdownDescription: "Set the TLOC port offset when multiple devices are behind a NAT",
+ Computed: true,
+ },
+ "port_offset_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "port_hopping": schema.BoolAttribute{
+ MarkdownDescription: "Enable port hopping",
+ Computed: true,
+ },
+ "port_hopping_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "control_session_pps": schema.Int64Attribute{
+ MarkdownDescription: "Set the policer rate for control sessions",
+ Computed: true,
+ },
+ "control_session_pps_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_transport": schema.BoolAttribute{
+ MarkdownDescription: "Configure tracking of transport",
+ Computed: true,
+ },
+ "track_transport_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_interface_tag": schema.Int64Attribute{
+ MarkdownDescription: "OMP Tag attached to routes based on interface tracking",
+ Computed: true,
+ },
+ "track_interface_tag_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "console_baud_rate": schema.StringAttribute{
+ MarkdownDescription: "Set the console baud rate",
+ Computed: true,
+ },
+ "console_baud_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "max_omp_sessions": schema.Int64Attribute{
+ MarkdownDescription: "Set the maximum number of OMP sessions <1..100> the device can have",
+ Computed: true,
+ },
+ "max_omp_sessions_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "multi_tenant": schema.BoolAttribute{
+ MarkdownDescription: "Device is multi-tenant",
+ Computed: true,
+ },
+ "multi_tenant_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "track_default_gateway": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable default gateway tracking",
+ Computed: true,
+ },
+ "track_default_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "admin_tech_on_failure": schema.BoolAttribute{
+ MarkdownDescription: "Collect admin-tech before reboot due to daemon failure",
+ Computed: true,
+ },
+ "admin_tech_on_failure_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "idle_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Idle CLI timeout in minutes",
+ Computed: true,
+ },
+ "idle_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "on_demand_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable On-demand Tunnel",
+ Computed: true,
+ },
+ "on_demand_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "on_demand_idle_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set the idle timeout for on-demand tunnels",
+ Computed: true,
+ },
+ "on_demand_idle_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "transport_gateway": schema.BoolAttribute{
+ MarkdownDescription: "Enable transport gateway",
+ Computed: true,
+ },
+ "transport_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "enhanced_app_aware_routing": schema.StringAttribute{
+ MarkdownDescription: "Enable SLA Dampening and Enhanced App Routing.",
+ Computed: true,
+ },
+ "enhanced_app_aware_routing_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "site_types": schema.SetAttribute{
+ MarkdownDescription: "Site Type",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "site_types_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "affinity_group_number": schema.Int64Attribute{
+ MarkdownDescription: "Affinity Group Number",
+ Computed: true,
+ },
+ "affinity_group_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "affinity_group_preferences": schema.SetAttribute{
+ MarkdownDescription: "Affinity Group Preference",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "affinity_group_preferences_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "affinity_preference_auto": schema.BoolAttribute{
+ MarkdownDescription: "Affinity Group Preference Auto",
+ Computed: true,
+ },
+ "affinity_preference_auto_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "affinity_per_vrfs": schema.ListNestedAttribute{
+ MarkdownDescription: "Affinity Group Number for VRFs",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "affinity_group_number": schema.Int64Attribute{
+ MarkdownDescription: "Affinity Group Number",
+ Computed: true,
+ },
+ "affinity_group_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vrf_range": schema.StringAttribute{
+ MarkdownDescription: "Range of VRFs",
+ Computed: true,
+ },
+ "vrf_range_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemBasicProfileParcelDataSource) 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 *SystemBasicProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemBasic
+
+ // 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_system_basic_feature_test.go b/internal/provider/data_source_sdwan_system_basic_feature_test.go
new file mode 100644
index 000000000..2ba8fd78c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_basic_feature_test.go
@@ -0,0 +1,143 @@
+// 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 TestAccDataSourceSdwanSystemBasicProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "timezone", "UTC"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "config_description", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "location", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "gps_longitude", "-77"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "gps_latitude", "38"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "gps_geo_fencing_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "gps_geo_fencing_range", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "gps_sms_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "gps_sms_mobile_numbers.0.number", "+11111233"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "overlay_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "port_offset", "19"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "port_hopping", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "control_session_pps", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "track_transport", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "track_interface_tag", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "console_baud_rate", "9600"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "max_omp_sessions", "24"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "multi_tenant", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "track_default_gateway", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "admin_tech_on_failure", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "idle_timeout", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "on_demand_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "on_demand_idle_timeout", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "transport_gateway", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "enhanced_app_aware_routing", "aggressive"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "affinity_group_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "affinity_preference_auto", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "affinity_per_vrfs.0.affinity_group_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_feature.test", "affinity_per_vrfs.0.vrf_range", "123-456"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemBasicPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemBasicProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemBasicPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemBasicProfileParcelConfig() string {
+ config := `resource "sdwan_system_basic_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` timezone = "UTC"` + "\n"
+ config += ` config_description = "example"` + "\n"
+ config += ` location = "example"` + "\n"
+ config += ` gps_longitude = -77` + "\n"
+ config += ` gps_latitude = 38` + "\n"
+ config += ` gps_geo_fencing_enable = true` + "\n"
+ config += ` gps_geo_fencing_range = 100` + "\n"
+ config += ` gps_sms_enable = true` + "\n"
+ config += ` gps_sms_mobile_numbers = [{` + "\n"
+ config += ` number = "+11111233"` + "\n"
+ config += ` }]` + "\n"
+ config += ` device_groups = ["example"]` + "\n"
+ config += ` controller_groups = [1]` + "\n"
+ config += ` overlay_id = 1` + "\n"
+ config += ` port_offset = 19` + "\n"
+ config += ` port_hopping = true` + "\n"
+ config += ` control_session_pps = 300` + "\n"
+ config += ` track_transport = true` + "\n"
+ config += ` track_interface_tag = 2` + "\n"
+ config += ` console_baud_rate = "9600"` + "\n"
+ config += ` max_omp_sessions = 24` + "\n"
+ config += ` multi_tenant = false` + "\n"
+ config += ` track_default_gateway = true` + "\n"
+ config += ` admin_tech_on_failure = true` + "\n"
+ config += ` idle_timeout = 10` + "\n"
+ config += ` on_demand_enable = true` + "\n"
+ config += ` on_demand_idle_timeout = 10` + "\n"
+ config += ` transport_gateway = false` + "\n"
+ config += ` enhanced_app_aware_routing = "aggressive"` + "\n"
+ config += ` site_types = ["type-1"]` + "\n"
+ config += ` affinity_group_number = 1` + "\n"
+ config += ` affinity_group_preferences = [1]` + "\n"
+ config += ` affinity_preference_auto = false` + "\n"
+ config += ` affinity_per_vrfs = [{` + "\n"
+ config += ` affinity_group_number = 1` + "\n"
+ config += ` vrf_range = "123-456"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_basic_feature" "test" {
+ id = sdwan_system_basic_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_basic_profile_parcel.go b/internal/provider/data_source_sdwan_system_basic_profile_parcel.go
deleted file mode 100644
index 69893f3c1..000000000
--- a/internal/provider/data_source_sdwan_system_basic_profile_parcel.go
+++ /dev/null
@@ -1,399 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemBasicProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemBasicProfileParcelDataSource{}
-)
-
-func NewSystemBasicProfileParcelDataSource() datasource.DataSource {
- return &SystemBasicProfileParcelDataSource{}
-}
-
-type SystemBasicProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemBasicProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_basic_profile_parcel"
-}
-
-func (d *SystemBasicProfileParcelDataSource) 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 System Basic 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,
- },
- "timezone": schema.StringAttribute{
- MarkdownDescription: "Set the timezone",
- Computed: true,
- },
- "timezone_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "config_description": schema.StringAttribute{
- MarkdownDescription: "Set a text description of the device",
- Computed: true,
- },
- "config_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "location": schema.StringAttribute{
- MarkdownDescription: "Set the location of the device",
- Computed: true,
- },
- "location_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gps_longitude": schema.Float64Attribute{
- MarkdownDescription: "Set the device physical longitude",
- Computed: true,
- },
- "gps_longitude_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gps_latitude": schema.Float64Attribute{
- MarkdownDescription: "Set the device physical latitude",
- Computed: true,
- },
- "gps_latitude_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gps_geo_fencing_enable": schema.BoolAttribute{
- MarkdownDescription: "Enable Geo fencing",
- Computed: true,
- },
- "gps_geo_fencing_range": schema.Int64Attribute{
- MarkdownDescription: "Set the device’s geo fencing range",
- Computed: true,
- },
- "gps_geo_fencing_range_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gps_sms_enable": schema.BoolAttribute{
- MarkdownDescription: "Enable device’s geo fencing SMS",
- Computed: true,
- },
- "gps_sms_mobile_numbers": schema.ListNestedAttribute{
- MarkdownDescription: "Set device’s geo fencing SMS phone number",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "number": schema.StringAttribute{
- MarkdownDescription: "Mobile number, ex: 1231234414",
- Computed: true,
- },
- "number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "device_groups": schema.SetAttribute{
- MarkdownDescription: "Device groups",
- ElementType: types.StringType,
- Computed: true,
- },
- "device_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "controller_groups": schema.SetAttribute{
- MarkdownDescription: "Configure a list of comma-separated controller groups",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "controller_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "overlay_id": schema.Int64Attribute{
- MarkdownDescription: "Set the Overlay ID",
- Computed: true,
- },
- "overlay_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "port_offset": schema.Int64Attribute{
- MarkdownDescription: "Set the TLOC port offset when multiple devices are behind a NAT",
- Computed: true,
- },
- "port_offset_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "port_hopping": schema.BoolAttribute{
- MarkdownDescription: "Enable port hopping",
- Computed: true,
- },
- "port_hopping_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "control_session_pps": schema.Int64Attribute{
- MarkdownDescription: "Set the policer rate for control sessions",
- Computed: true,
- },
- "control_session_pps_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_transport": schema.BoolAttribute{
- MarkdownDescription: "Configure tracking of transport",
- Computed: true,
- },
- "track_transport_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_interface_tag": schema.Int64Attribute{
- MarkdownDescription: "OMP Tag attached to routes based on interface tracking",
- Computed: true,
- },
- "track_interface_tag_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "console_baud_rate": schema.StringAttribute{
- MarkdownDescription: "Set the console baud rate",
- Computed: true,
- },
- "console_baud_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "max_omp_sessions": schema.Int64Attribute{
- MarkdownDescription: "Set the maximum number of OMP sessions <1..100> the device can have",
- Computed: true,
- },
- "max_omp_sessions_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "multi_tenant": schema.BoolAttribute{
- MarkdownDescription: "Device is multi-tenant",
- Computed: true,
- },
- "multi_tenant_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "track_default_gateway": schema.BoolAttribute{
- MarkdownDescription: "Enable or disable default gateway tracking",
- Computed: true,
- },
- "track_default_gateway_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "admin_tech_on_failure": schema.BoolAttribute{
- MarkdownDescription: "Collect admin-tech before reboot due to daemon failure",
- Computed: true,
- },
- "admin_tech_on_failure_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "idle_timeout": schema.Int64Attribute{
- MarkdownDescription: "Idle CLI timeout in minutes",
- Computed: true,
- },
- "idle_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "on_demand_enable": schema.BoolAttribute{
- MarkdownDescription: "Enable or disable On-demand Tunnel",
- Computed: true,
- },
- "on_demand_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "on_demand_idle_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set the idle timeout for on-demand tunnels",
- Computed: true,
- },
- "on_demand_idle_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "transport_gateway": schema.BoolAttribute{
- MarkdownDescription: "Enable transport gateway",
- Computed: true,
- },
- "transport_gateway_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "enhanced_app_aware_routing": schema.StringAttribute{
- MarkdownDescription: "Enable SLA Dampening and Enhanced App Routing.",
- Computed: true,
- },
- "enhanced_app_aware_routing_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "site_types": schema.SetAttribute{
- MarkdownDescription: "Site Type",
- ElementType: types.StringType,
- Computed: true,
- },
- "site_types_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "affinity_group_number": schema.Int64Attribute{
- MarkdownDescription: "Affinity Group Number",
- Computed: true,
- },
- "affinity_group_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "affinity_group_preferences": schema.SetAttribute{
- MarkdownDescription: "Affinity Group Preference",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "affinity_group_preferences_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "affinity_preference_auto": schema.BoolAttribute{
- MarkdownDescription: "Affinity Group Preference Auto",
- Computed: true,
- },
- "affinity_preference_auto_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "affinity_per_vrfs": schema.ListNestedAttribute{
- MarkdownDescription: "Affinity Group Number for VRFs",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "affinity_group_number": schema.Int64Attribute{
- MarkdownDescription: "Affinity Group Number",
- Computed: true,
- },
- "affinity_group_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vrf_range": schema.StringAttribute{
- MarkdownDescription: "Range of VRFs",
- Computed: true,
- },
- "vrf_range_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemBasicProfileParcelDataSource) 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 *SystemBasicProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemBasic
-
- // 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_system_basic_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_basic_profile_parcel_test.go
deleted file mode 100644
index 0c7dc85e2..000000000
--- a/internal/provider/data_source_sdwan_system_basic_profile_parcel_test.go
+++ /dev/null
@@ -1,143 +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 TestAccDataSourceSdwanSystemBasicProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "timezone", "UTC"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "config_description", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "location", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "gps_longitude", "-77"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "gps_latitude", "38"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "gps_geo_fencing_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "gps_geo_fencing_range", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "gps_sms_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "gps_sms_mobile_numbers.0.number", "+11111233"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "overlay_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "port_offset", "19"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "port_hopping", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "control_session_pps", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "track_transport", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "track_interface_tag", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "console_baud_rate", "9600"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "max_omp_sessions", "24"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "multi_tenant", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "track_default_gateway", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "admin_tech_on_failure", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "idle_timeout", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "on_demand_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "on_demand_idle_timeout", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "transport_gateway", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "enhanced_app_aware_routing", "aggressive"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "affinity_group_number", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "affinity_preference_auto", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "affinity_per_vrfs.0.affinity_group_number", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_basic_profile_parcel.test", "affinity_per_vrfs.0.vrf_range", "123-456"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemBasicPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemBasicProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemBasicPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemBasicProfileParcelConfig() string {
- config := `resource "sdwan_system_basic_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` timezone = "UTC"` + "\n"
- config += ` config_description = "example"` + "\n"
- config += ` location = "example"` + "\n"
- config += ` gps_longitude = -77` + "\n"
- config += ` gps_latitude = 38` + "\n"
- config += ` gps_geo_fencing_enable = true` + "\n"
- config += ` gps_geo_fencing_range = 100` + "\n"
- config += ` gps_sms_enable = true` + "\n"
- config += ` gps_sms_mobile_numbers = [{` + "\n"
- config += ` number = "+11111233"` + "\n"
- config += ` }]` + "\n"
- config += ` device_groups = ["example"]` + "\n"
- config += ` controller_groups = [1]` + "\n"
- config += ` overlay_id = 1` + "\n"
- config += ` port_offset = 19` + "\n"
- config += ` port_hopping = true` + "\n"
- config += ` control_session_pps = 300` + "\n"
- config += ` track_transport = true` + "\n"
- config += ` track_interface_tag = 2` + "\n"
- config += ` console_baud_rate = "9600"` + "\n"
- config += ` max_omp_sessions = 24` + "\n"
- config += ` multi_tenant = false` + "\n"
- config += ` track_default_gateway = true` + "\n"
- config += ` admin_tech_on_failure = true` + "\n"
- config += ` idle_timeout = 10` + "\n"
- config += ` on_demand_enable = true` + "\n"
- config += ` on_demand_idle_timeout = 10` + "\n"
- config += ` transport_gateway = false` + "\n"
- config += ` enhanced_app_aware_routing = "aggressive"` + "\n"
- config += ` site_types = ["type-1"]` + "\n"
- config += ` affinity_group_number = 1` + "\n"
- config += ` affinity_group_preferences = [1]` + "\n"
- config += ` affinity_preference_auto = false` + "\n"
- config += ` affinity_per_vrfs = [{` + "\n"
- config += ` affinity_group_number = 1` + "\n"
- config += ` vrf_range = "123-456"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_basic_profile_parcel" "test" {
- id = sdwan_system_basic_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_bfd_feature.go b/internal/provider/data_source_sdwan_system_bfd_feature.go
new file mode 100644
index 000000000..80f66b25d
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_bfd_feature.go
@@ -0,0 +1,194 @@
+// 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 = &SystemBFDProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemBFDProfileParcelDataSource{}
+)
+
+func NewSystemBFDProfileParcelDataSource() datasource.DataSource {
+ return &SystemBFDProfileParcelDataSource{}
+}
+
+type SystemBFDProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemBFDProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_bfd_feature"
+}
+
+func (d *SystemBFDProfileParcelDataSource) 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 System BFD Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "poll_interval": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "poll_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_dscp": schema.Int64Attribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "default_dscp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "colors": schema.ListNestedAttribute{
+ MarkdownDescription: "Set color that identifies the WAN transport tunnel",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "color": schema.StringAttribute{
+ MarkdownDescription: "Color that identifies the WAN transport tunnel",
+ Computed: true,
+ },
+ "color_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Hello Interval (milliseconds)",
+ Computed: true,
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: "Multiplier",
+ Computed: true,
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "pmtu_discovery": schema.BoolAttribute{
+ MarkdownDescription: "Path MTU Discovery",
+ Computed: true,
+ },
+ "pmtu_discovery_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dscp": schema.Int64Attribute{
+ MarkdownDescription: "BFD Default DSCP value for tloc color",
+ Computed: true,
+ },
+ "dscp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemBFDProfileParcelDataSource) 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 *SystemBFDProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemBFD
+
+ // 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_system_bfd_feature_test.go b/internal/provider/data_source_sdwan_system_bfd_feature_test.go
new file mode 100644
index 000000000..0f5d7aed4
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_bfd_feature_test.go
@@ -0,0 +1,95 @@
+// 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 TestAccDataSourceSdwanSystemBFDProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "poll_interval", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "default_dscp", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "colors.0.color", "3g"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "colors.0.hello_interval", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "colors.0.multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "colors.0.pmtu_discovery", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_feature.test", "colors.0.dscp", "16"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemBFDPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemBFDProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemBFDPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemBFDProfileParcelConfig() string {
+ config := `resource "sdwan_system_bfd_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` poll_interval = 100` + "\n"
+ config += ` default_dscp = 8` + "\n"
+ config += ` colors = [{` + "\n"
+ config += ` color = "3g"` + "\n"
+ config += ` hello_interval = 200` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` pmtu_discovery = true` + "\n"
+ config += ` dscp = 16` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_bfd_feature" "test" {
+ id = sdwan_system_bfd_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_bfd_profile_parcel.go b/internal/provider/data_source_sdwan_system_bfd_profile_parcel.go
deleted file mode 100644
index 3a39c7343..000000000
--- a/internal/provider/data_source_sdwan_system_bfd_profile_parcel.go
+++ /dev/null
@@ -1,194 +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/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 = &SystemBFDProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemBFDProfileParcelDataSource{}
-)
-
-func NewSystemBFDProfileParcelDataSource() datasource.DataSource {
- return &SystemBFDProfileParcelDataSource{}
-}
-
-type SystemBFDProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemBFDProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_bfd_profile_parcel"
-}
-
-func (d *SystemBFDProfileParcelDataSource) 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 System BFD 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,
- },
- "multiplier": schema.Int64Attribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "multiplier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "poll_interval": schema.Int64Attribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "poll_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "default_dscp": schema.Int64Attribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "default_dscp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "colors": schema.ListNestedAttribute{
- MarkdownDescription: "Set color that identifies the WAN transport tunnel",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "color": schema.StringAttribute{
- MarkdownDescription: "Color that identifies the WAN transport tunnel",
- Computed: true,
- },
- "color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "hello_interval": schema.Int64Attribute{
- MarkdownDescription: "Hello Interval (milliseconds)",
- Computed: true,
- },
- "hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "multiplier": schema.Int64Attribute{
- MarkdownDescription: "Multiplier",
- Computed: true,
- },
- "multiplier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "pmtu_discovery": schema.BoolAttribute{
- MarkdownDescription: "Path MTU Discovery",
- Computed: true,
- },
- "pmtu_discovery_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "dscp": schema.Int64Attribute{
- MarkdownDescription: "BFD Default DSCP value for tloc color",
- Computed: true,
- },
- "dscp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemBFDProfileParcelDataSource) 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 *SystemBFDProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemBFD
-
- // 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_system_bfd_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_bfd_profile_parcel_test.go
deleted file mode 100644
index 76677bed6..000000000
--- a/internal/provider/data_source_sdwan_system_bfd_profile_parcel_test.go
+++ /dev/null
@@ -1,95 +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 TestAccDataSourceSdwanSystemBFDProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "multiplier", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "poll_interval", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "default_dscp", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "colors.0.color", "3g"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "colors.0.hello_interval", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "colors.0.multiplier", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "colors.0.pmtu_discovery", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_bfd_profile_parcel.test", "colors.0.dscp", "16"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemBFDPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemBFDProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemBFDPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemBFDProfileParcelConfig() string {
- config := `resource "sdwan_system_bfd_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` multiplier = 3` + "\n"
- config += ` poll_interval = 100` + "\n"
- config += ` default_dscp = 8` + "\n"
- config += ` colors = [{` + "\n"
- config += ` color = "3g"` + "\n"
- config += ` hello_interval = 200` + "\n"
- config += ` multiplier = 3` + "\n"
- config += ` pmtu_discovery = true` + "\n"
- config += ` dscp = 16` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_bfd_profile_parcel" "test" {
- id = sdwan_system_bfd_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_flexible_port_speed_feature.go b/internal/provider/data_source_sdwan_system_flexible_port_speed_feature.go
new file mode 100644
index 000000000..8b0c634cc
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_flexible_port_speed_feature.go
@@ -0,0 +1,130 @@
+// 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 = &SystemFlexiblePortSpeedProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemFlexiblePortSpeedProfileParcelDataSource{}
+)
+
+func NewSystemFlexiblePortSpeedProfileParcelDataSource() datasource.DataSource {
+ return &SystemFlexiblePortSpeedProfileParcelDataSource{}
+}
+
+type SystemFlexiblePortSpeedProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemFlexiblePortSpeedProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_flexible_port_speed_feature"
+}
+
+func (d *SystemFlexiblePortSpeedProfileParcelDataSource) 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 System Flexible Port Speed Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "port_type": schema.StringAttribute{
+ MarkdownDescription: "port Type",
+ Computed: true,
+ },
+ "port_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemFlexiblePortSpeedProfileParcelDataSource) 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 *SystemFlexiblePortSpeedProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemFlexiblePortSpeed
+
+ // 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_system_flexible_port_speed_feature_test.go b/internal/provider/data_source_sdwan_system_flexible_port_speed_feature_test.go
new file mode 100644
index 000000000..e1a083ac3
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_flexible_port_speed_feature_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccDataSourceSdwanSystemFlexiblePortSpeedProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_flexible_port_speed_feature.test", "port_type", "12 ports of 1/10GE + 3 ports 40GE"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemFlexiblePortSpeedProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemFlexiblePortSpeedProfileParcelConfig() string {
+ config := `resource "sdwan_system_flexible_port_speed_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` port_type = "12 ports of 1/10GE + 3 ports 40GE"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_flexible_port_speed_feature" "test" {
+ id = sdwan_system_flexible_port_speed_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_flexible_port_speed_profile_parcel.go b/internal/provider/data_source_sdwan_system_flexible_port_speed_profile_parcel.go
deleted file mode 100644
index 725b7d44d..000000000
--- a/internal/provider/data_source_sdwan_system_flexible_port_speed_profile_parcel.go
+++ /dev/null
@@ -1,130 +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/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 = &SystemFlexiblePortSpeedProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemFlexiblePortSpeedProfileParcelDataSource{}
-)
-
-func NewSystemFlexiblePortSpeedProfileParcelDataSource() datasource.DataSource {
- return &SystemFlexiblePortSpeedProfileParcelDataSource{}
-}
-
-type SystemFlexiblePortSpeedProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemFlexiblePortSpeedProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_flexible_port_speed_profile_parcel"
-}
-
-func (d *SystemFlexiblePortSpeedProfileParcelDataSource) 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 System Flexible Port Speed 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,
- },
- "port_type": schema.StringAttribute{
- MarkdownDescription: "port Type",
- Computed: true,
- },
- "port_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemFlexiblePortSpeedProfileParcelDataSource) 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 *SystemFlexiblePortSpeedProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemFlexiblePortSpeed
-
- // 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_system_flexible_port_speed_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_flexible_port_speed_profile_parcel_test.go
deleted file mode 100644
index 797a9fc9c..000000000
--- a/internal/provider/data_source_sdwan_system_flexible_port_speed_profile_parcel_test.go
+++ /dev/null
@@ -1,79 +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 TestAccDataSourceSdwanSystemFlexiblePortSpeedProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_flexible_port_speed_profile_parcel.test", "port_type", "12 ports of 1/10GE + 3 ports 40GE"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemFlexiblePortSpeedProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemFlexiblePortSpeedProfileParcelConfig() string {
- config := `resource "sdwan_system_flexible_port_speed_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` port_type = "12 ports of 1/10GE + 3 ports 40GE"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_flexible_port_speed_profile_parcel" "test" {
- id = sdwan_system_flexible_port_speed_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_global_feature.go b/internal/provider/data_source_sdwan_system_global_feature.go
new file mode 100644
index 000000000..57144c310
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_global_feature.go
@@ -0,0 +1,306 @@
+// 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 = &SystemGlobalProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemGlobalProfileParcelDataSource{}
+)
+
+func NewSystemGlobalProfileParcelDataSource() datasource.DataSource {
+ return &SystemGlobalProfileParcelDataSource{}
+}
+
+type SystemGlobalProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemGlobalProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_global_feature"
+}
+
+func (d *SystemGlobalProfileParcelDataSource) 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 System Global Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "http_server": schema.BoolAttribute{
+ MarkdownDescription: "Set a HTTP Server",
+ Computed: true,
+ },
+ "http_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "https_server": schema.BoolAttribute{
+ MarkdownDescription: "Set a HTTPS Server",
+ Computed: true,
+ },
+ "https_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ftp_passive": schema.BoolAttribute{
+ MarkdownDescription: "Set Passive FTP",
+ Computed: true,
+ },
+ "ftp_passive_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "domain_lookup": schema.BoolAttribute{
+ MarkdownDescription: "Configure Domain-Lookup",
+ Computed: true,
+ },
+ "domain_lookup_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arp_proxy": schema.BoolAttribute{
+ MarkdownDescription: "Set ARP Proxy",
+ Computed: true,
+ },
+ "arp_proxy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "rsh_rcp": schema.BoolAttribute{
+ MarkdownDescription: "Set RSH/RCP",
+ Computed: true,
+ },
+ "rsh_rcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "line_vty": schema.BoolAttribute{
+ MarkdownDescription: "Configure Telnet (Outbound)",
+ Computed: true,
+ },
+ "line_vty_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cdp": schema.BoolAttribute{
+ MarkdownDescription: "Configure CDP",
+ Computed: true,
+ },
+ "cdp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "lldp": schema.BoolAttribute{
+ MarkdownDescription: "Configure LLDP",
+ Computed: true,
+ },
+ "lldp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Specify interface for source address in all HTTP(S) client connections",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_keepalives_in": schema.BoolAttribute{
+ MarkdownDescription: "Configure tcp-keepalives-in",
+ Computed: true,
+ },
+ "tcp_keepalives_in_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_keepalives_out": schema.BoolAttribute{
+ MarkdownDescription: "Configure tcp-keepalives-out",
+ Computed: true,
+ },
+ "tcp_keepalives_out_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_small_servers": schema.BoolAttribute{
+ MarkdownDescription: "Configure tcp-small-servers",
+ Computed: true,
+ },
+ "tcp_small_servers_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "udp_small_servers": schema.BoolAttribute{
+ MarkdownDescription: "Configure udp-small-servers",
+ Computed: true,
+ },
+ "udp_small_servers_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "console_logging": schema.BoolAttribute{
+ MarkdownDescription: "Configure Console Logging",
+ Computed: true,
+ },
+ "console_logging_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_source_routing": schema.BoolAttribute{
+ MarkdownDescription: "Set Source Route",
+ Computed: true,
+ },
+ "ip_source_routing_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vty_line_logging": schema.BoolAttribute{
+ MarkdownDescription: "Configure VTY Line Logging",
+ Computed: true,
+ },
+ "vty_line_logging_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "snmp_ifindex_persist": schema.BoolAttribute{
+ MarkdownDescription: "Configure SNMP Ifindex Persist",
+ Computed: true,
+ },
+ "snmp_ifindex_persist_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ignore_bootp": schema.BoolAttribute{
+ MarkdownDescription: "Configure Ignore BOOTP",
+ Computed: true,
+ },
+ "ignore_bootp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat64_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT64 UDP session timeout, in seconds",
+ Computed: true,
+ },
+ "nat64_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat64_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT64 TCP session timeout, in seconds",
+ Computed: true,
+ },
+ "nat64_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "http_authentication": schema.StringAttribute{
+ MarkdownDescription: "Set preference for HTTP Authentication",
+ Computed: true,
+ },
+ "http_authentication_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ssh_version": schema.StringAttribute{
+ MarkdownDescription: "Set SSH version",
+ Computed: true,
+ },
+ "ssh_version_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemGlobalProfileParcelDataSource) 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 *SystemGlobalProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemGlobal
+
+ // 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_system_global_feature_test.go b/internal/provider/data_source_sdwan_system_global_feature_test.go
new file mode 100644
index 000000000..a5ae25e35
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_global_feature_test.go
@@ -0,0 +1,123 @@
+// 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 TestAccDataSourceSdwanSystemGlobalProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "http_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "https_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "ftp_passive", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "domain_lookup", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "arp_proxy", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "rsh_rcp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "line_vty", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "cdp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "lldp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "source_interface", "GigabitEthernet0/0/1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "tcp_keepalives_in", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "tcp_keepalives_out", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "tcp_small_servers", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "udp_small_servers", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "console_logging", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "ip_source_routing", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "vty_line_logging", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "snmp_ifindex_persist", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "ignore_bootp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "nat64_udp_timeout", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "nat64_tcp_timeout", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "http_authentication", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_feature.test", "ssh_version", "2"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemGlobalPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemGlobalProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemGlobalPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemGlobalProfileParcelConfig() string {
+ config := `resource "sdwan_system_global_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` http_server = false` + "\n"
+ config += ` https_server = false` + "\n"
+ config += ` ftp_passive = false` + "\n"
+ config += ` domain_lookup = false` + "\n"
+ config += ` arp_proxy = false` + "\n"
+ config += ` rsh_rcp = false` + "\n"
+ config += ` line_vty = false` + "\n"
+ config += ` cdp = true` + "\n"
+ config += ` lldp = true` + "\n"
+ config += ` source_interface = "GigabitEthernet0/0/1"` + "\n"
+ config += ` tcp_keepalives_in = true` + "\n"
+ config += ` tcp_keepalives_out = true` + "\n"
+ config += ` tcp_small_servers = false` + "\n"
+ config += ` udp_small_servers = false` + "\n"
+ config += ` console_logging = true` + "\n"
+ config += ` ip_source_routing = false` + "\n"
+ config += ` vty_line_logging = false` + "\n"
+ config += ` snmp_ifindex_persist = true` + "\n"
+ config += ` ignore_bootp = true` + "\n"
+ config += ` nat64_udp_timeout = 300` + "\n"
+ config += ` nat64_tcp_timeout = 3600` + "\n"
+ config += ` http_authentication = "aaa"` + "\n"
+ config += ` ssh_version = "2"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_global_feature" "test" {
+ id = sdwan_system_global_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_global_profile_parcel.go b/internal/provider/data_source_sdwan_system_global_profile_parcel.go
deleted file mode 100644
index c1c8be7a0..000000000
--- a/internal/provider/data_source_sdwan_system_global_profile_parcel.go
+++ /dev/null
@@ -1,306 +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/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 = &SystemGlobalProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemGlobalProfileParcelDataSource{}
-)
-
-func NewSystemGlobalProfileParcelDataSource() datasource.DataSource {
- return &SystemGlobalProfileParcelDataSource{}
-}
-
-type SystemGlobalProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemGlobalProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_global_profile_parcel"
-}
-
-func (d *SystemGlobalProfileParcelDataSource) 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 System Global 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,
- },
- "http_server": schema.BoolAttribute{
- MarkdownDescription: "Set a HTTP Server",
- Computed: true,
- },
- "http_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "https_server": schema.BoolAttribute{
- MarkdownDescription: "Set a HTTPS Server",
- Computed: true,
- },
- "https_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ftp_passive": schema.BoolAttribute{
- MarkdownDescription: "Set Passive FTP",
- Computed: true,
- },
- "ftp_passive_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "domain_lookup": schema.BoolAttribute{
- MarkdownDescription: "Configure Domain-Lookup",
- Computed: true,
- },
- "domain_lookup_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arp_proxy": schema.BoolAttribute{
- MarkdownDescription: "Set ARP Proxy",
- Computed: true,
- },
- "arp_proxy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "rsh_rcp": schema.BoolAttribute{
- MarkdownDescription: "Set RSH/RCP",
- Computed: true,
- },
- "rsh_rcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "line_vty": schema.BoolAttribute{
- MarkdownDescription: "Configure Telnet (Outbound)",
- Computed: true,
- },
- "line_vty_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "cdp": schema.BoolAttribute{
- MarkdownDescription: "Configure CDP",
- Computed: true,
- },
- "cdp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "lldp": schema.BoolAttribute{
- MarkdownDescription: "Configure LLDP",
- Computed: true,
- },
- "lldp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Specify interface for source address in all HTTP(S) client connections",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_keepalives_in": schema.BoolAttribute{
- MarkdownDescription: "Configure tcp-keepalives-in",
- Computed: true,
- },
- "tcp_keepalives_in_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_keepalives_out": schema.BoolAttribute{
- MarkdownDescription: "Configure tcp-keepalives-out",
- Computed: true,
- },
- "tcp_keepalives_out_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_small_servers": schema.BoolAttribute{
- MarkdownDescription: "Configure tcp-small-servers",
- Computed: true,
- },
- "tcp_small_servers_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "udp_small_servers": schema.BoolAttribute{
- MarkdownDescription: "Configure udp-small-servers",
- Computed: true,
- },
- "udp_small_servers_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "console_logging": schema.BoolAttribute{
- MarkdownDescription: "Configure Console Logging",
- Computed: true,
- },
- "console_logging_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_source_routing": schema.BoolAttribute{
- MarkdownDescription: "Set Source Route",
- Computed: true,
- },
- "ip_source_routing_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vty_line_logging": schema.BoolAttribute{
- MarkdownDescription: "Configure VTY Line Logging",
- Computed: true,
- },
- "vty_line_logging_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "snmp_ifindex_persist": schema.BoolAttribute{
- MarkdownDescription: "Configure SNMP Ifindex Persist",
- Computed: true,
- },
- "snmp_ifindex_persist_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ignore_bootp": schema.BoolAttribute{
- MarkdownDescription: "Configure Ignore BOOTP",
- Computed: true,
- },
- "ignore_bootp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat64_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT64 UDP session timeout, in seconds",
- Computed: true,
- },
- "nat64_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat64_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT64 TCP session timeout, in seconds",
- Computed: true,
- },
- "nat64_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "http_authentication": schema.StringAttribute{
- MarkdownDescription: "Set preference for HTTP Authentication",
- Computed: true,
- },
- "http_authentication_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ssh_version": schema.StringAttribute{
- MarkdownDescription: "Set SSH version",
- Computed: true,
- },
- "ssh_version_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemGlobalProfileParcelDataSource) 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 *SystemGlobalProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemGlobal
-
- // 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_system_global_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_global_profile_parcel_test.go
deleted file mode 100644
index 081c49b79..000000000
--- a/internal/provider/data_source_sdwan_system_global_profile_parcel_test.go
+++ /dev/null
@@ -1,123 +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 TestAccDataSourceSdwanSystemGlobalProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "http_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "https_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "ftp_passive", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "domain_lookup", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "arp_proxy", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "rsh_rcp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "line_vty", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "cdp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "lldp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "source_interface", "GigabitEthernet0/0/1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "tcp_keepalives_in", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "tcp_keepalives_out", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "tcp_small_servers", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "udp_small_servers", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "console_logging", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "ip_source_routing", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "vty_line_logging", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "snmp_ifindex_persist", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "ignore_bootp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "nat64_udp_timeout", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "nat64_tcp_timeout", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "http_authentication", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_global_profile_parcel.test", "ssh_version", "2"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemGlobalPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemGlobalProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemGlobalPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemGlobalProfileParcelConfig() string {
- config := `resource "sdwan_system_global_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` http_server = false` + "\n"
- config += ` https_server = false` + "\n"
- config += ` ftp_passive = false` + "\n"
- config += ` domain_lookup = false` + "\n"
- config += ` arp_proxy = false` + "\n"
- config += ` rsh_rcp = false` + "\n"
- config += ` line_vty = false` + "\n"
- config += ` cdp = true` + "\n"
- config += ` lldp = true` + "\n"
- config += ` source_interface = "GigabitEthernet0/0/1"` + "\n"
- config += ` tcp_keepalives_in = true` + "\n"
- config += ` tcp_keepalives_out = true` + "\n"
- config += ` tcp_small_servers = false` + "\n"
- config += ` udp_small_servers = false` + "\n"
- config += ` console_logging = true` + "\n"
- config += ` ip_source_routing = false` + "\n"
- config += ` vty_line_logging = false` + "\n"
- config += ` snmp_ifindex_persist = true` + "\n"
- config += ` ignore_bootp = true` + "\n"
- config += ` nat64_udp_timeout = 300` + "\n"
- config += ` nat64_tcp_timeout = 3600` + "\n"
- config += ` http_authentication = "aaa"` + "\n"
- config += ` ssh_version = "2"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_global_profile_parcel" "test" {
- id = sdwan_system_global_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_ipv4_device_access_feature.go b/internal/provider/data_source_sdwan_system_ipv4_device_access_feature.go
new file mode 100644
index 000000000..7dbe242ea
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_ipv4_device_access_feature.go
@@ -0,0 +1,182 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemIPv4DeviceAccessProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemIPv4DeviceAccessProfileParcelDataSource{}
+)
+
+func NewSystemIPv4DeviceAccessProfileParcelDataSource() datasource.DataSource {
+ return &SystemIPv4DeviceAccessProfileParcelDataSource{}
+}
+
+type SystemIPv4DeviceAccessProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemIPv4DeviceAccessProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_ipv4_device_access_feature"
+}
+
+func (d *SystemIPv4DeviceAccessProfileParcelDataSource) 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 System IPv4 Device Access Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: "Default Action",
+ Computed: true,
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: "Device Access Control List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: "Sequence Id",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Sequence Name",
+ Computed: true,
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: "Base Action",
+ Computed: true,
+ },
+ "device_access_port": schema.Int64Attribute{
+ MarkdownDescription: "device access protocol",
+ Computed: true,
+ },
+ "destination_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "destination_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: "Destination Data IP Prefix List",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "destination_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_ports": schema.SetAttribute{
+ MarkdownDescription: "Source Port List",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "source_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "source_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: "Source Data IP Prefix List",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "source_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemIPv4DeviceAccessProfileParcelDataSource) 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 *SystemIPv4DeviceAccessProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemIPv4DeviceAccess
+
+ // 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_system_ipv4_device_access_feature_test.go b/internal/provider/data_source_sdwan_system_ipv4_device_access_feature_test.go
new file mode 100644
index 000000000..261245647
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_ipv4_device_access_feature_test.go
@@ -0,0 +1,90 @@
+// 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 TestAccDataSourceSdwanSystemIPv4DeviceAccessProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_feature.test", "default_action", "drop"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_feature.test", "sequences.0.base_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_feature.test", "sequences.0.device_access_port", "161"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemIPv4DeviceAccessProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemIPv4DeviceAccessProfileParcelConfig() string {
+ config := `resource "sdwan_system_ipv4_device_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` default_action = "drop"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "accept"` + "\n"
+ config += ` device_access_port = 161` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_ipv4_device_access_feature" "test" {
+ id = sdwan_system_ipv4_device_access_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_ipv4_device_access_profile_parcel.go b/internal/provider/data_source_sdwan_system_ipv4_device_access_profile_parcel.go
deleted file mode 100644
index 54728fc5c..000000000
--- a/internal/provider/data_source_sdwan_system_ipv4_device_access_profile_parcel.go
+++ /dev/null
@@ -1,182 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemIPv4DeviceAccessProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemIPv4DeviceAccessProfileParcelDataSource{}
-)
-
-func NewSystemIPv4DeviceAccessProfileParcelDataSource() datasource.DataSource {
- return &SystemIPv4DeviceAccessProfileParcelDataSource{}
-}
-
-type SystemIPv4DeviceAccessProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemIPv4DeviceAccessProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_ipv4_device_access_profile_parcel"
-}
-
-func (d *SystemIPv4DeviceAccessProfileParcelDataSource) 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 System IPv4 Device Access 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,
- },
- "default_action": schema.StringAttribute{
- MarkdownDescription: "Default Action",
- Computed: true,
- },
- "sequences": schema.ListNestedAttribute{
- MarkdownDescription: "Device Access Control List",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.Int64Attribute{
- MarkdownDescription: "Sequence Id",
- Computed: true,
- },
- "name": schema.StringAttribute{
- MarkdownDescription: "Sequence Name",
- Computed: true,
- },
- "base_action": schema.StringAttribute{
- MarkdownDescription: "Base Action",
- Computed: true,
- },
- "device_access_port": schema.Int64Attribute{
- MarkdownDescription: "device access protocol",
- Computed: true,
- },
- "destination_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "destination_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: "Destination Data IP Prefix List",
- ElementType: types.StringType,
- Computed: true,
- },
- "destination_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_ports": schema.SetAttribute{
- MarkdownDescription: "Source Port List",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "source_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "source_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: "Source Data IP Prefix List",
- ElementType: types.StringType,
- Computed: true,
- },
- "source_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemIPv4DeviceAccessProfileParcelDataSource) 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 *SystemIPv4DeviceAccessProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemIPv4DeviceAccess
-
- // 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_system_ipv4_device_access_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_ipv4_device_access_profile_parcel_test.go
deleted file mode 100644
index 5ecb98cff..000000000
--- a/internal/provider/data_source_sdwan_system_ipv4_device_access_profile_parcel_test.go
+++ /dev/null
@@ -1,90 +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 TestAccDataSourceSdwanSystemIPv4DeviceAccessProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_profile_parcel.test", "default_action", "drop"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.name", "SEQ_1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.base_action", "accept"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.device_access_port", "161"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemIPv4DeviceAccessProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemIPv4DeviceAccessProfileParcelConfig() string {
- config := `resource "sdwan_system_ipv4_device_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` default_action = "drop"` + "\n"
- config += ` sequences = [{` + "\n"
- config += ` id = 1` + "\n"
- config += ` name = "SEQ_1"` + "\n"
- config += ` base_action = "accept"` + "\n"
- config += ` device_access_port = 161` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_ipv4_device_access_profile_parcel" "test" {
- id = sdwan_system_ipv4_device_access_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_ipv6_device_access_feature.go b/internal/provider/data_source_sdwan_system_ipv6_device_access_feature.go
new file mode 100644
index 000000000..2a7196aef
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_ipv6_device_access_feature.go
@@ -0,0 +1,182 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemIPv6DeviceAccessProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemIPv6DeviceAccessProfileParcelDataSource{}
+)
+
+func NewSystemIPv6DeviceAccessProfileParcelDataSource() datasource.DataSource {
+ return &SystemIPv6DeviceAccessProfileParcelDataSource{}
+}
+
+type SystemIPv6DeviceAccessProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemIPv6DeviceAccessProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_ipv6_device_access_feature"
+}
+
+func (d *SystemIPv6DeviceAccessProfileParcelDataSource) 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 System IPv6 Device Access Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: "Default Action",
+ Computed: true,
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: "Device Access Control List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: "Sequence Id",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Sequence Name",
+ Computed: true,
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: "Base Action",
+ Computed: true,
+ },
+ "device_access_port": schema.Int64Attribute{
+ MarkdownDescription: "device access protocol",
+ Computed: true,
+ },
+ "destination_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "destination_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: "Destination Data IP Prefix List",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "destination_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_ports": schema.SetAttribute{
+ MarkdownDescription: "Source Port List",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "source_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "source_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: "Source Data IP Prefix List",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "source_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemIPv6DeviceAccessProfileParcelDataSource) 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 *SystemIPv6DeviceAccessProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemIPv6DeviceAccess
+
+ // 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_system_ipv6_device_access_feature_test.go b/internal/provider/data_source_sdwan_system_ipv6_device_access_feature_test.go
new file mode 100644
index 000000000..cf92ca171
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_ipv6_device_access_feature_test.go
@@ -0,0 +1,90 @@
+// 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 TestAccDataSourceSdwanSystemIPv6DeviceAccessProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_feature.test", "default_action", "drop"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_feature.test", "sequences.0.base_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_feature.test", "sequences.0.device_access_port", "22"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemIPv6DeviceAccessProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemIPv6DeviceAccessProfileParcelConfig() string {
+ config := `resource "sdwan_system_ipv6_device_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` default_action = "drop"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "accept"` + "\n"
+ config += ` device_access_port = 22` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_ipv6_device_access_feature" "test" {
+ id = sdwan_system_ipv6_device_access_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_ipv6_device_access_profile_parcel.go b/internal/provider/data_source_sdwan_system_ipv6_device_access_profile_parcel.go
deleted file mode 100644
index 91ccfc96a..000000000
--- a/internal/provider/data_source_sdwan_system_ipv6_device_access_profile_parcel.go
+++ /dev/null
@@ -1,182 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemIPv6DeviceAccessProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemIPv6DeviceAccessProfileParcelDataSource{}
-)
-
-func NewSystemIPv6DeviceAccessProfileParcelDataSource() datasource.DataSource {
- return &SystemIPv6DeviceAccessProfileParcelDataSource{}
-}
-
-type SystemIPv6DeviceAccessProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemIPv6DeviceAccessProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_ipv6_device_access_profile_parcel"
-}
-
-func (d *SystemIPv6DeviceAccessProfileParcelDataSource) 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 System IPv6 Device Access 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,
- },
- "default_action": schema.StringAttribute{
- MarkdownDescription: "Default Action",
- Computed: true,
- },
- "sequences": schema.ListNestedAttribute{
- MarkdownDescription: "Device Access Control List",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.Int64Attribute{
- MarkdownDescription: "Sequence Id",
- Computed: true,
- },
- "name": schema.StringAttribute{
- MarkdownDescription: "Sequence Name",
- Computed: true,
- },
- "base_action": schema.StringAttribute{
- MarkdownDescription: "Base Action",
- Computed: true,
- },
- "device_access_port": schema.Int64Attribute{
- MarkdownDescription: "device access protocol",
- Computed: true,
- },
- "destination_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "destination_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: "Destination Data IP Prefix List",
- ElementType: types.StringType,
- Computed: true,
- },
- "destination_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_ports": schema.SetAttribute{
- MarkdownDescription: "Source Port List",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "source_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "source_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: "Source Data IP Prefix List",
- ElementType: types.StringType,
- Computed: true,
- },
- "source_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemIPv6DeviceAccessProfileParcelDataSource) 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 *SystemIPv6DeviceAccessProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemIPv6DeviceAccess
-
- // 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_system_ipv6_device_access_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_ipv6_device_access_profile_parcel_test.go
deleted file mode 100644
index b273b20aa..000000000
--- a/internal/provider/data_source_sdwan_system_ipv6_device_access_profile_parcel_test.go
+++ /dev/null
@@ -1,90 +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 TestAccDataSourceSdwanSystemIPv6DeviceAccessProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_profile_parcel.test", "default_action", "drop"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.name", "SEQ_1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.base_action", "accept"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.device_access_port", "22"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemIPv6DeviceAccessProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemIPv6DeviceAccessProfileParcelConfig() string {
- config := `resource "sdwan_system_ipv6_device_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` default_action = "drop"` + "\n"
- config += ` sequences = [{` + "\n"
- config += ` id = 1` + "\n"
- config += ` name = "SEQ_1"` + "\n"
- config += ` base_action = "accept"` + "\n"
- config += ` device_access_port = 22` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_ipv6_device_access_profile_parcel" "test" {
- id = sdwan_system_ipv6_device_access_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_logging_feature.go b/internal/provider/data_source_sdwan_system_logging_feature.go
new file mode 100644
index 000000000..58a65a32d
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_logging_feature.go
@@ -0,0 +1,308 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemLoggingProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemLoggingProfileParcelDataSource{}
+)
+
+func NewSystemLoggingProfileParcelDataSource() datasource.DataSource {
+ return &SystemLoggingProfileParcelDataSource{}
+}
+
+type SystemLoggingProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemLoggingProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_logging_feature"
+}
+
+func (d *SystemLoggingProfileParcelDataSource) 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 System Logging Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "disk_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable logging to local disk",
+ Computed: true,
+ },
+ "disk_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "disk_file_size": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum size of file before it is rotated",
+ Computed: true,
+ },
+ "disk_file_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "disk_file_rotate": schema.Int64Attribute{
+ MarkdownDescription: "Set number of syslog files to create before discarding oldest files",
+ Computed: true,
+ },
+ "disk_file_rotate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_profiles": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure a TLS profile",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "profile": schema.StringAttribute{
+ MarkdownDescription: "Specify the name of the TLS profile",
+ Computed: true,
+ },
+ "profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_version": schema.StringAttribute{
+ MarkdownDescription: "TLS Version",
+ Computed: true,
+ },
+ "tls_version_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cipher_suites": schema.SetAttribute{
+ MarkdownDescription: "Syslog secure server ciphersuites",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "cipher_suites_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_servers": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable logging to remote server",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "hostname_ip": schema.StringAttribute{
+ MarkdownDescription: "Set hostname or IPv4 address of server",
+ Computed: true,
+ },
+ "hostname_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "Set hostname or IPv4 address of server",
+ Computed: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Set interface to use to reach syslog server",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "priority": schema.StringAttribute{
+ MarkdownDescription: "Set logging level for messages logged to server",
+ Computed: true,
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable TLS Profile",
+ Computed: true,
+ },
+ "tls_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_properties_custom_profile": schema.BoolAttribute{
+ MarkdownDescription: "Define custom profile",
+ Computed: true,
+ },
+ "tls_properties_custom_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_properties_profile": schema.StringAttribute{
+ MarkdownDescription: "Configure a TLS profile",
+ Computed: true,
+ },
+ "tls_properties_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_servers": schema.ListNestedAttribute{
+ MarkdownDescription: "Enable logging to remote ipv6 server",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "hostname_ip": schema.StringAttribute{
+ MarkdownDescription: "Set IPv6 hostname or IPv6 address of server",
+ Computed: true,
+ },
+ "hostname_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "Set hostname or IPv4 address of server",
+ Computed: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Set interface to use to reach syslog server",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "priority": schema.StringAttribute{
+ MarkdownDescription: "Set logging level for messages logged to server",
+ Computed: true,
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable TLS Profile",
+ Computed: true,
+ },
+ "tls_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_properties_custom_profile": schema.BoolAttribute{
+ MarkdownDescription: "Define custom profile",
+ Computed: true,
+ },
+ "tls_properties_custom_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tls_properties_profile": schema.StringAttribute{
+ MarkdownDescription: "Configure a TLS profile",
+ Computed: true,
+ },
+ "tls_properties_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemLoggingProfileParcelDataSource) 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 *SystemLoggingProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemLogging
+
+ // 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_system_logging_feature_test.go b/internal/provider/data_source_sdwan_system_logging_feature_test.go
new file mode 100644
index 000000000..554a464cf
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_logging_feature_test.go
@@ -0,0 +1,123 @@
+// 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 TestAccDataSourceSdwanSystemLoggingProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "disk_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "disk_file_size", "9"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "disk_file_rotate", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "tls_profiles.0.profile", "test"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "tls_profiles.0.tls_version", "TLSv1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv4_servers.0.hostname_ip", "1.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv4_servers.0.vpn", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv4_servers.0.source_interface", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv4_servers.0.priority", "informational"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv4_servers.0.tls_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv4_servers.0.tls_properties_custom_profile", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv4_servers.0.tls_properties_profile", "test"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv6_servers.0.hostname_ip", "1.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv6_servers.0.vpn", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv6_servers.0.source_interface", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv6_servers.0.priority", "informational"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv6_servers.0.tls_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv6_servers.0.tls_properties_custom_profile", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_feature.test", "ipv6_servers.0.tls_properties_profile", "test"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemLoggingPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemLoggingProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemLoggingPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemLoggingProfileParcelConfig() string {
+ config := `resource "sdwan_system_logging_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` disk_enable = true` + "\n"
+ config += ` disk_file_size = 9` + "\n"
+ config += ` disk_file_rotate = 10` + "\n"
+ config += ` tls_profiles = [{` + "\n"
+ config += ` profile = "test"` + "\n"
+ config += ` tls_version = "TLSv1.1"` + "\n"
+ config += ` cipher_suites = ["aes-128-cbc-sha"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_servers = [{` + "\n"
+ config += ` hostname_ip = "1.1.1.1"` + "\n"
+ config += ` vpn = 512` + "\n"
+ config += ` source_interface = "GigabitEthernet1"` + "\n"
+ config += ` priority = "informational"` + "\n"
+ config += ` tls_enable = true` + "\n"
+ config += ` tls_properties_custom_profile = true` + "\n"
+ config += ` tls_properties_profile = "test"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_servers = [{` + "\n"
+ config += ` hostname_ip = "1.1.1.1"` + "\n"
+ config += ` vpn = 512` + "\n"
+ config += ` source_interface = "GigabitEthernet1"` + "\n"
+ config += ` priority = "informational"` + "\n"
+ config += ` tls_enable = true` + "\n"
+ config += ` tls_properties_custom_profile = true` + "\n"
+ config += ` tls_properties_profile = "test"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_logging_feature" "test" {
+ id = sdwan_system_logging_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_logging_profile_parcel.go b/internal/provider/data_source_sdwan_system_logging_profile_parcel.go
deleted file mode 100644
index d24855cc7..000000000
--- a/internal/provider/data_source_sdwan_system_logging_profile_parcel.go
+++ /dev/null
@@ -1,308 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemLoggingProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemLoggingProfileParcelDataSource{}
-)
-
-func NewSystemLoggingProfileParcelDataSource() datasource.DataSource {
- return &SystemLoggingProfileParcelDataSource{}
-}
-
-type SystemLoggingProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemLoggingProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_logging_profile_parcel"
-}
-
-func (d *SystemLoggingProfileParcelDataSource) 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 System Logging 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,
- },
- "disk_enable": schema.BoolAttribute{
- MarkdownDescription: "Enable logging to local disk",
- Computed: true,
- },
- "disk_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "disk_file_size": schema.Int64Attribute{
- MarkdownDescription: "Set maximum size of file before it is rotated",
- Computed: true,
- },
- "disk_file_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "disk_file_rotate": schema.Int64Attribute{
- MarkdownDescription: "Set number of syslog files to create before discarding oldest files",
- Computed: true,
- },
- "disk_file_rotate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_profiles": schema.ListNestedAttribute{
- MarkdownDescription: "Configure a TLS profile",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "profile": schema.StringAttribute{
- MarkdownDescription: "Specify the name of the TLS profile",
- Computed: true,
- },
- "profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_version": schema.StringAttribute{
- MarkdownDescription: "TLS Version",
- Computed: true,
- },
- "tls_version_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "cipher_suites": schema.SetAttribute{
- MarkdownDescription: "Syslog secure server ciphersuites",
- ElementType: types.StringType,
- Computed: true,
- },
- "cipher_suites_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_servers": schema.ListNestedAttribute{
- MarkdownDescription: "Enable logging to remote server",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "hostname_ip": schema.StringAttribute{
- MarkdownDescription: "Set hostname or IPv4 address of server",
- Computed: true,
- },
- "hostname_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "Set hostname or IPv4 address of server",
- Computed: true,
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Set interface to use to reach syslog server",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "priority": schema.StringAttribute{
- MarkdownDescription: "Set logging level for messages logged to server",
- Computed: true,
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_enable": schema.BoolAttribute{
- MarkdownDescription: "Enable TLS Profile",
- Computed: true,
- },
- "tls_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_properties_custom_profile": schema.BoolAttribute{
- MarkdownDescription: "Define custom profile",
- Computed: true,
- },
- "tls_properties_custom_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_properties_profile": schema.StringAttribute{
- MarkdownDescription: "Configure a TLS profile",
- Computed: true,
- },
- "tls_properties_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_servers": schema.ListNestedAttribute{
- MarkdownDescription: "Enable logging to remote ipv6 server",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "hostname_ip": schema.StringAttribute{
- MarkdownDescription: "Set IPv6 hostname or IPv6 address of server",
- Computed: true,
- },
- "hostname_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "Set hostname or IPv4 address of server",
- Computed: true,
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Set interface to use to reach syslog server",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "priority": schema.StringAttribute{
- MarkdownDescription: "Set logging level for messages logged to server",
- Computed: true,
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_enable": schema.BoolAttribute{
- MarkdownDescription: "Enable TLS Profile",
- Computed: true,
- },
- "tls_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_properties_custom_profile": schema.BoolAttribute{
- MarkdownDescription: "Define custom profile",
- Computed: true,
- },
- "tls_properties_custom_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tls_properties_profile": schema.StringAttribute{
- MarkdownDescription: "Configure a TLS profile",
- Computed: true,
- },
- "tls_properties_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemLoggingProfileParcelDataSource) 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 *SystemLoggingProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemLogging
-
- // 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_system_logging_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_logging_profile_parcel_test.go
deleted file mode 100644
index 68e191b5d..000000000
--- a/internal/provider/data_source_sdwan_system_logging_profile_parcel_test.go
+++ /dev/null
@@ -1,123 +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 TestAccDataSourceSdwanSystemLoggingProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "disk_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "disk_file_size", "9"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "disk_file_rotate", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "tls_profiles.0.profile", "test"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "tls_profiles.0.tls_version", "TLSv1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.hostname_ip", "1.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.vpn", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.source_interface", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.priority", "informational"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.tls_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.tls_properties_custom_profile", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.tls_properties_profile", "test"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.hostname_ip", "1.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.vpn", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.source_interface", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.priority", "informational"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.tls_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.tls_properties_custom_profile", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.tls_properties_profile", "test"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemLoggingPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemLoggingProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemLoggingPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemLoggingProfileParcelConfig() string {
- config := `resource "sdwan_system_logging_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` disk_enable = true` + "\n"
- config += ` disk_file_size = 9` + "\n"
- config += ` disk_file_rotate = 10` + "\n"
- config += ` tls_profiles = [{` + "\n"
- config += ` profile = "test"` + "\n"
- config += ` tls_version = "TLSv1.1"` + "\n"
- config += ` cipher_suites = ["aes-128-cbc-sha"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_servers = [{` + "\n"
- config += ` hostname_ip = "1.1.1.1"` + "\n"
- config += ` vpn = 512` + "\n"
- config += ` source_interface = "GigabitEthernet1"` + "\n"
- config += ` priority = "informational"` + "\n"
- config += ` tls_enable = true` + "\n"
- config += ` tls_properties_custom_profile = true` + "\n"
- config += ` tls_properties_profile = "test"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_servers = [{` + "\n"
- config += ` hostname_ip = "1.1.1.1"` + "\n"
- config += ` vpn = 512` + "\n"
- config += ` source_interface = "GigabitEthernet1"` + "\n"
- config += ` priority = "informational"` + "\n"
- config += ` tls_enable = true` + "\n"
- config += ` tls_properties_custom_profile = true` + "\n"
- config += ` tls_properties_profile = "test"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_logging_profile_parcel" "test" {
- id = sdwan_system_logging_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_mrf_feature.go b/internal/provider/data_source_sdwan_system_mrf_feature.go
new file mode 100644
index 000000000..039e4c0d8
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_mrf_feature.go
@@ -0,0 +1,150 @@
+// 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 = &SystemMRFProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemMRFProfileParcelDataSource{}
+)
+
+func NewSystemMRFProfileParcelDataSource() datasource.DataSource {
+ return &SystemMRFProfileParcelDataSource{}
+}
+
+type SystemMRFProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemMRFProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_mrf_feature"
+}
+
+func (d *SystemMRFProfileParcelDataSource) 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 System MRF Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "region_id": schema.Int64Attribute{
+ MarkdownDescription: "Set region ID",
+ Computed: true,
+ },
+ "secondary_region_id": schema.Int64Attribute{
+ MarkdownDescription: "Set secondary region ID",
+ Computed: true,
+ },
+ "secondary_region_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "role": schema.StringAttribute{
+ MarkdownDescription: "Set the role for router",
+ Computed: true,
+ },
+ "role_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "enable_migration_to_mrf": schema.StringAttribute{
+ MarkdownDescription: "Enable migration mode to Multi-Region Fabric",
+ Computed: true,
+ },
+ "migration_bgp_community": schema.Int64Attribute{
+ MarkdownDescription: "Set BGP community during migration from BGP-core based network",
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemMRFProfileParcelDataSource) 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 *SystemMRFProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemMRF
+
+ // 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_system_mrf_feature_test.go b/internal/provider/data_source_sdwan_system_mrf_feature_test.go
new file mode 100644
index 000000000..78fc08ef8
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_mrf_feature_test.go
@@ -0,0 +1,87 @@
+// 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 TestAccDataSourceSdwanSystemMRFProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_feature.test", "region_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_feature.test", "secondary_region_id", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_feature.test", "role", "edge-router"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_feature.test", "enable_migration_to_mrf", "enabled"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_feature.test", "migration_bgp_community", "100"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemMRFPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemMRFProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemMRFPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemMRFProfileParcelConfig() string {
+ config := `resource "sdwan_system_mrf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` region_id = 1` + "\n"
+ config += ` secondary_region_id = 2` + "\n"
+ config += ` role = "edge-router"` + "\n"
+ config += ` enable_migration_to_mrf = "enabled"` + "\n"
+ config += ` migration_bgp_community = 100` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_mrf_feature" "test" {
+ id = sdwan_system_mrf_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_mrf_profile_parcel.go b/internal/provider/data_source_sdwan_system_mrf_profile_parcel.go
deleted file mode 100644
index 81c28c54e..000000000
--- a/internal/provider/data_source_sdwan_system_mrf_profile_parcel.go
+++ /dev/null
@@ -1,150 +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/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 = &SystemMRFProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemMRFProfileParcelDataSource{}
-)
-
-func NewSystemMRFProfileParcelDataSource() datasource.DataSource {
- return &SystemMRFProfileParcelDataSource{}
-}
-
-type SystemMRFProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemMRFProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_mrf_profile_parcel"
-}
-
-func (d *SystemMRFProfileParcelDataSource) 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 System MRF 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,
- },
- "region_id": schema.Int64Attribute{
- MarkdownDescription: "Set region ID",
- Computed: true,
- },
- "secondary_region_id": schema.Int64Attribute{
- MarkdownDescription: "Set secondary region ID",
- Computed: true,
- },
- "secondary_region_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "role": schema.StringAttribute{
- MarkdownDescription: "Set the role for router",
- Computed: true,
- },
- "role_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "enable_migration_to_mrf": schema.StringAttribute{
- MarkdownDescription: "Enable migration mode to Multi-Region Fabric",
- Computed: true,
- },
- "migration_bgp_community": schema.Int64Attribute{
- MarkdownDescription: "Set BGP community during migration from BGP-core based network",
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemMRFProfileParcelDataSource) 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 *SystemMRFProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemMRF
-
- // 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_system_mrf_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_mrf_profile_parcel_test.go
deleted file mode 100644
index d3a2e5bc9..000000000
--- a/internal/provider/data_source_sdwan_system_mrf_profile_parcel_test.go
+++ /dev/null
@@ -1,87 +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 TestAccDataSourceSdwanSystemMRFProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_profile_parcel.test", "region_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_profile_parcel.test", "secondary_region_id", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_profile_parcel.test", "role", "edge-router"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_profile_parcel.test", "enable_migration_to_mrf", "enabled"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_mrf_profile_parcel.test", "migration_bgp_community", "100"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemMRFPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemMRFProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemMRFPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemMRFProfileParcelConfig() string {
- config := `resource "sdwan_system_mrf_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` region_id = 1` + "\n"
- config += ` secondary_region_id = 2` + "\n"
- config += ` role = "edge-router"` + "\n"
- config += ` enable_migration_to_mrf = "enabled"` + "\n"
- config += ` migration_bgp_community = 100` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_mrf_profile_parcel" "test" {
- id = sdwan_system_mrf_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_ntp_feature.go b/internal/provider/data_source_sdwan_system_ntp_feature.go
new file mode 100644
index 000000000..d11a552ac
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_ntp_feature.go
@@ -0,0 +1,236 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemNTPProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemNTPProfileParcelDataSource{}
+)
+
+func NewSystemNTPProfileParcelDataSource() datasource.DataSource {
+ return &SystemNTPProfileParcelDataSource{}
+}
+
+type SystemNTPProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemNTPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_ntp_feature"
+}
+
+func (d *SystemNTPProfileParcelDataSource) 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 System NTP Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "servers": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure NTP servers",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "hostname_ip_address": schema.StringAttribute{
+ MarkdownDescription: "Set hostname or IP address of server",
+ Computed: true,
+ },
+ "hostname_ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_key": schema.Int64Attribute{
+ MarkdownDescription: "Set authentication key for the server",
+ Computed: true,
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "Set VPN in which NTP server is located",
+ Computed: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ntp_version": schema.Int64Attribute{
+ MarkdownDescription: "Set NTP version",
+ Computed: true,
+ },
+ "ntp_version_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Set interface to use to reach NTP server",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "prefer_this_ntp_server": schema.BoolAttribute{
+ MarkdownDescription: "Prefer this NTP server",
+ Computed: true,
+ },
+ "prefer_this_ntp_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "authentication_keys": schema.ListNestedAttribute{
+ MarkdownDescription: "Set MD5 authentication key",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "key_id": schema.Int64Attribute{
+ MarkdownDescription: "MD5 authentication key ID",
+ Computed: true,
+ },
+ "key_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "md5_value": schema.StringAttribute{
+ MarkdownDescription: "Enter cleartext or AES-encrypted MD5 authentication key",
+ Computed: true,
+ },
+ "md5_value_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "trusted_keys": schema.SetAttribute{
+ MarkdownDescription: "Designate authentication key as trustworthy",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "trusted_keys_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authoritative_ntp_server": schema.BoolAttribute{
+ MarkdownDescription: "Enable device as NTP Leader",
+ Computed: true,
+ },
+ "authoritative_ntp_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "stratum": schema.Int64Attribute{
+ MarkdownDescription: "Enable device as NTP Leader",
+ Computed: true,
+ },
+ "stratum_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Enable device as NTP Leader",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemNTPProfileParcelDataSource) 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 *SystemNTPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemNTP
+
+ // 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_system_ntp_feature_test.go b/internal/provider/data_source_sdwan_system_ntp_feature_test.go
new file mode 100644
index 000000000..b47f7127e
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_ntp_feature_test.go
@@ -0,0 +1,104 @@
+// 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 TestAccDataSourceSdwanSystemNTPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "servers.0.hostname_ip_address", "1.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "servers.0.authentication_key", "41673"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "servers.0.vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "servers.0.ntp_version", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "servers.0.source_interface", "Ethernet"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "servers.0.prefer_this_ntp_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "authentication_keys.0.key_id", "49737"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "authentication_keys.0.md5_value", "$CRYPT_CLUSTER"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "authoritative_ntp_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "stratum", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_feature.test", "source_interface", "ATM"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemNTPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemNTPProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemNTPPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemNTPProfileParcelConfig() string {
+ config := `resource "sdwan_system_ntp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` servers = [{` + "\n"
+ config += ` hostname_ip_address = "1.1.1.1"` + "\n"
+ config += ` authentication_key = 41673` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` ntp_version = 4` + "\n"
+ config += ` source_interface = "Ethernet"` + "\n"
+ config += ` prefer_this_ntp_server = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` authentication_keys = [{` + "\n"
+ config += ` key_id = 49737` + "\n"
+ config += ` md5_value = "$CRYPT_CLUSTER"` + "\n"
+ config += ` }]` + "\n"
+ config += ` trusted_keys = [49737]` + "\n"
+ config += ` authoritative_ntp_server = false` + "\n"
+ config += ` stratum = 1` + "\n"
+ config += ` source_interface = "ATM"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_ntp_feature" "test" {
+ id = sdwan_system_ntp_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_ntp_profile_parcel.go b/internal/provider/data_source_sdwan_system_ntp_profile_parcel.go
deleted file mode 100644
index 26259c330..000000000
--- a/internal/provider/data_source_sdwan_system_ntp_profile_parcel.go
+++ /dev/null
@@ -1,236 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemNTPProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemNTPProfileParcelDataSource{}
-)
-
-func NewSystemNTPProfileParcelDataSource() datasource.DataSource {
- return &SystemNTPProfileParcelDataSource{}
-}
-
-type SystemNTPProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemNTPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_ntp_profile_parcel"
-}
-
-func (d *SystemNTPProfileParcelDataSource) 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 System NTP 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,
- },
- "servers": schema.ListNestedAttribute{
- MarkdownDescription: "Configure NTP servers",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "hostname_ip_address": schema.StringAttribute{
- MarkdownDescription: "Set hostname or IP address of server",
- Computed: true,
- },
- "hostname_ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "authentication_key": schema.Int64Attribute{
- MarkdownDescription: "Set authentication key for the server",
- Computed: true,
- },
- "authentication_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "Set VPN in which NTP server is located",
- Computed: true,
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ntp_version": schema.Int64Attribute{
- MarkdownDescription: "Set NTP version",
- Computed: true,
- },
- "ntp_version_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Set interface to use to reach NTP server",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "prefer_this_ntp_server": schema.BoolAttribute{
- MarkdownDescription: "Prefer this NTP server",
- Computed: true,
- },
- "prefer_this_ntp_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "authentication_keys": schema.ListNestedAttribute{
- MarkdownDescription: "Set MD5 authentication key",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "key_id": schema.Int64Attribute{
- MarkdownDescription: "MD5 authentication key ID",
- Computed: true,
- },
- "key_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "md5_value": schema.StringAttribute{
- MarkdownDescription: "Enter cleartext or AES-encrypted MD5 authentication key",
- Computed: true,
- },
- "md5_value_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "trusted_keys": schema.SetAttribute{
- MarkdownDescription: "Designate authentication key as trustworthy",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "trusted_keys_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "authoritative_ntp_server": schema.BoolAttribute{
- MarkdownDescription: "Enable device as NTP Leader",
- Computed: true,
- },
- "authoritative_ntp_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "stratum": schema.Int64Attribute{
- MarkdownDescription: "Enable device as NTP Leader",
- Computed: true,
- },
- "stratum_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Enable device as NTP Leader",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemNTPProfileParcelDataSource) 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 *SystemNTPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemNTP
-
- // 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_system_ntp_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_ntp_profile_parcel_test.go
deleted file mode 100644
index 6ff60b26d..000000000
--- a/internal/provider/data_source_sdwan_system_ntp_profile_parcel_test.go
+++ /dev/null
@@ -1,104 +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 TestAccDataSourceSdwanSystemNTPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "servers.0.hostname_ip_address", "1.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "servers.0.authentication_key", "41673"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "servers.0.vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "servers.0.ntp_version", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "servers.0.source_interface", "Ethernet"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "servers.0.prefer_this_ntp_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "authentication_keys.0.key_id", "49737"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "authentication_keys.0.md5_value", "$CRYPT_CLUSTER"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "authoritative_ntp_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "stratum", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_ntp_profile_parcel.test", "source_interface", "ATM"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemNTPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemNTPProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemNTPPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemNTPProfileParcelConfig() string {
- config := `resource "sdwan_system_ntp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` servers = [{` + "\n"
- config += ` hostname_ip_address = "1.1.1.1"` + "\n"
- config += ` authentication_key = 41673` + "\n"
- config += ` vpn = 1` + "\n"
- config += ` ntp_version = 4` + "\n"
- config += ` source_interface = "Ethernet"` + "\n"
- config += ` prefer_this_ntp_server = false` + "\n"
- config += ` }]` + "\n"
- config += ` authentication_keys = [{` + "\n"
- config += ` key_id = 49737` + "\n"
- config += ` md5_value = "$CRYPT_CLUSTER"` + "\n"
- config += ` }]` + "\n"
- config += ` trusted_keys = [49737]` + "\n"
- config += ` authoritative_ntp_server = false` + "\n"
- config += ` stratum = 1` + "\n"
- config += ` source_interface = "ATM"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_ntp_profile_parcel" "test" {
- id = sdwan_system_ntp_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_omp_feature.go b/internal/provider/data_source_sdwan_system_omp_feature.go
new file mode 100644
index 000000000..26f36f19c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_omp_feature.go
@@ -0,0 +1,356 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemOMPProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemOMPProfileParcelDataSource{}
+)
+
+func NewSystemOMPProfileParcelDataSource() datasource.DataSource {
+ return &SystemOMPProfileParcelDataSource{}
+}
+
+type SystemOMPProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemOMPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_omp_feature"
+}
+
+func (d *SystemOMPProfileParcelDataSource) 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 System OMP Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "graceful_restart": schema.BoolAttribute{
+ MarkdownDescription: "Graceful Restart for OMP",
+ Computed: true,
+ },
+ "graceful_restart_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "overlay_as": schema.Int64Attribute{
+ MarkdownDescription: "Overlay AS Number",
+ Computed: true,
+ },
+ "overlay_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "paths_advertised_per_prefix": schema.Int64Attribute{
+ MarkdownDescription: "Number of Paths Advertised per Prefix",
+ Computed: true,
+ },
+ "paths_advertised_per_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ecmp_limit": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of OMP paths to install in cEdge route table",
+ Computed: true,
+ },
+ "ecmp_limit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Shutdown",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "omp_admin_distance_ipv4": schema.Int64Attribute{
+ MarkdownDescription: "OMP Admin Distance IPv4",
+ Computed: true,
+ },
+ "omp_admin_distance_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "omp_admin_distance_ipv6": schema.Int64Attribute{
+ MarkdownDescription: "OMP Admin Distance IPv6",
+ Computed: true,
+ },
+ "omp_admin_distance_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertisement_interval": schema.Int64Attribute{
+ MarkdownDescription: "Advertisement Interval (seconds)",
+ Computed: true,
+ },
+ "advertisement_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "graceful_restart_timer": schema.Int64Attribute{
+ MarkdownDescription: "Graceful Restart Timer (seconds)",
+ Computed: true,
+ },
+ "graceful_restart_timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "eor_timer": schema.Int64Attribute{
+ MarkdownDescription: "EOR Timer",
+ Computed: true,
+ },
+ "eor_timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "holdtime": schema.Int64Attribute{
+ MarkdownDescription: "Hold Time (seconds)",
+ Computed: true,
+ },
+ "holdtime_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_bgp": schema.BoolAttribute{
+ MarkdownDescription: "BGP",
+ Computed: true,
+ },
+ "advertise_ipv4_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_ospf": schema.BoolAttribute{
+ MarkdownDescription: "OSPF",
+ Computed: true,
+ },
+ "advertise_ipv4_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_ospf_v3": schema.BoolAttribute{
+ MarkdownDescription: "OSPFV3",
+ Computed: true,
+ },
+ "advertise_ipv4_ospf_v3_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_connected": schema.BoolAttribute{
+ MarkdownDescription: "Connected",
+ Computed: true,
+ },
+ "advertise_ipv4_connected_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_static": schema.BoolAttribute{
+ MarkdownDescription: "Static",
+ Computed: true,
+ },
+ "advertise_ipv4_static_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_eigrp": schema.BoolAttribute{
+ MarkdownDescription: "EIGRP",
+ Computed: true,
+ },
+ "advertise_ipv4_eigrp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_lisp": schema.BoolAttribute{
+ MarkdownDescription: "LISP",
+ Computed: true,
+ },
+ "advertise_ipv4_lisp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv4_isis": schema.BoolAttribute{
+ MarkdownDescription: "ISIS",
+ Computed: true,
+ },
+ "advertise_ipv4_isis_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv6_bgp": schema.BoolAttribute{
+ MarkdownDescription: "BGP",
+ Computed: true,
+ },
+ "advertise_ipv6_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv6_ospf": schema.BoolAttribute{
+ MarkdownDescription: "OSPF",
+ Computed: true,
+ },
+ "advertise_ipv6_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv6_connected": schema.BoolAttribute{
+ MarkdownDescription: "Connected",
+ Computed: true,
+ },
+ "advertise_ipv6_connected_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv6_static": schema.BoolAttribute{
+ MarkdownDescription: "Static",
+ Computed: true,
+ },
+ "advertise_ipv6_static_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv6_eigrp": schema.BoolAttribute{
+ MarkdownDescription: "EIGRP",
+ Computed: true,
+ },
+ "advertise_ipv6_eigrp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv6_lisp": schema.BoolAttribute{
+ MarkdownDescription: "LISP",
+ Computed: true,
+ },
+ "advertise_ipv6_lisp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "advertise_ipv6_isis": schema.BoolAttribute{
+ MarkdownDescription: "ISIS",
+ Computed: true,
+ },
+ "advertise_ipv6_isis_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ignore_region_path_length": schema.BoolAttribute{
+ MarkdownDescription: "Treat hierarchical and direct (secondary region) paths equally",
+ Computed: true,
+ },
+ "ignore_region_path_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "transport_gateway": schema.StringAttribute{
+ MarkdownDescription: "Transport Gateway Path Behavior",
+ Computed: true,
+ },
+ "transport_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "site_types": schema.SetAttribute{
+ MarkdownDescription: "Site Types",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "site_types_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemOMPProfileParcelDataSource) 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 *SystemOMPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemOMP
+
+ // 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_system_omp_feature_test.go b/internal/provider/data_source_sdwan_system_omp_feature_test.go
new file mode 100644
index 000000000..0ff7921a0
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_omp_feature_test.go
@@ -0,0 +1,134 @@
+// 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 TestAccDataSourceSdwanSystemOMPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "graceful_restart", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "overlay_as", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "paths_advertised_per_prefix", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "ecmp_limit", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "omp_admin_distance_ipv4", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "omp_admin_distance_ipv6", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertisement_interval", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "graceful_restart_timer", "43200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "eor_timer", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "holdtime", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_ospf_v3", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_connected", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_static", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_eigrp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_lisp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv4_isis", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv6_bgp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv6_ospf", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv6_connected", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv6_static", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv6_eigrp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv6_lisp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "advertise_ipv6_isis", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "ignore_region_path_length", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_feature.test", "transport_gateway", "prefer"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemOMPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemOMPProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemOMPPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemOMPProfileParcelConfig() string {
+ config := `resource "sdwan_system_omp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` graceful_restart = true` + "\n"
+ config += ` overlay_as = 10` + "\n"
+ config += ` paths_advertised_per_prefix = 4` + "\n"
+ config += ` ecmp_limit = 4` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` omp_admin_distance_ipv4 = 10` + "\n"
+ config += ` omp_admin_distance_ipv6 = 20` + "\n"
+ config += ` advertisement_interval = 1` + "\n"
+ config += ` graceful_restart_timer = 43200` + "\n"
+ config += ` eor_timer = 300` + "\n"
+ config += ` holdtime = 60` + "\n"
+ config += ` advertise_ipv4_bgp = false` + "\n"
+ config += ` advertise_ipv4_ospf = false` + "\n"
+ config += ` advertise_ipv4_ospf_v3 = false` + "\n"
+ config += ` advertise_ipv4_connected = false` + "\n"
+ config += ` advertise_ipv4_static = false` + "\n"
+ config += ` advertise_ipv4_eigrp = false` + "\n"
+ config += ` advertise_ipv4_lisp = false` + "\n"
+ config += ` advertise_ipv4_isis = false` + "\n"
+ config += ` advertise_ipv6_bgp = true` + "\n"
+ config += ` advertise_ipv6_ospf = true` + "\n"
+ config += ` advertise_ipv6_connected = true` + "\n"
+ config += ` advertise_ipv6_static = true` + "\n"
+ config += ` advertise_ipv6_eigrp = true` + "\n"
+ config += ` advertise_ipv6_lisp = true` + "\n"
+ config += ` advertise_ipv6_isis = true` + "\n"
+ config += ` ignore_region_path_length = false` + "\n"
+ config += ` transport_gateway = "prefer"` + "\n"
+ config += ` site_types = ["type-1"]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_omp_feature" "test" {
+ id = sdwan_system_omp_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_omp_profile_parcel.go b/internal/provider/data_source_sdwan_system_omp_profile_parcel.go
deleted file mode 100644
index 4cb7bb91a..000000000
--- a/internal/provider/data_source_sdwan_system_omp_profile_parcel.go
+++ /dev/null
@@ -1,356 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemOMPProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemOMPProfileParcelDataSource{}
-)
-
-func NewSystemOMPProfileParcelDataSource() datasource.DataSource {
- return &SystemOMPProfileParcelDataSource{}
-}
-
-type SystemOMPProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemOMPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_omp_profile_parcel"
-}
-
-func (d *SystemOMPProfileParcelDataSource) 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 System OMP 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,
- },
- "graceful_restart": schema.BoolAttribute{
- MarkdownDescription: "Graceful Restart for OMP",
- Computed: true,
- },
- "graceful_restart_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "overlay_as": schema.Int64Attribute{
- MarkdownDescription: "Overlay AS Number",
- Computed: true,
- },
- "overlay_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "paths_advertised_per_prefix": schema.Int64Attribute{
- MarkdownDescription: "Number of Paths Advertised per Prefix",
- Computed: true,
- },
- "paths_advertised_per_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ecmp_limit": schema.Int64Attribute{
- MarkdownDescription: "Set maximum number of OMP paths to install in cEdge route table",
- Computed: true,
- },
- "ecmp_limit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Shutdown",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "omp_admin_distance_ipv4": schema.Int64Attribute{
- MarkdownDescription: "OMP Admin Distance IPv4",
- Computed: true,
- },
- "omp_admin_distance_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "omp_admin_distance_ipv6": schema.Int64Attribute{
- MarkdownDescription: "OMP Admin Distance IPv6",
- Computed: true,
- },
- "omp_admin_distance_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertisement_interval": schema.Int64Attribute{
- MarkdownDescription: "Advertisement Interval (seconds)",
- Computed: true,
- },
- "advertisement_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "graceful_restart_timer": schema.Int64Attribute{
- MarkdownDescription: "Graceful Restart Timer (seconds)",
- Computed: true,
- },
- "graceful_restart_timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "eor_timer": schema.Int64Attribute{
- MarkdownDescription: "EOR Timer",
- Computed: true,
- },
- "eor_timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "holdtime": schema.Int64Attribute{
- MarkdownDescription: "Hold Time (seconds)",
- Computed: true,
- },
- "holdtime_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_bgp": schema.BoolAttribute{
- MarkdownDescription: "BGP",
- Computed: true,
- },
- "advertise_ipv4_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_ospf": schema.BoolAttribute{
- MarkdownDescription: "OSPF",
- Computed: true,
- },
- "advertise_ipv4_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_ospf_v3": schema.BoolAttribute{
- MarkdownDescription: "OSPFV3",
- Computed: true,
- },
- "advertise_ipv4_ospf_v3_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_connected": schema.BoolAttribute{
- MarkdownDescription: "Connected",
- Computed: true,
- },
- "advertise_ipv4_connected_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_static": schema.BoolAttribute{
- MarkdownDescription: "Static",
- Computed: true,
- },
- "advertise_ipv4_static_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_eigrp": schema.BoolAttribute{
- MarkdownDescription: "EIGRP",
- Computed: true,
- },
- "advertise_ipv4_eigrp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_lisp": schema.BoolAttribute{
- MarkdownDescription: "LISP",
- Computed: true,
- },
- "advertise_ipv4_lisp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv4_isis": schema.BoolAttribute{
- MarkdownDescription: "ISIS",
- Computed: true,
- },
- "advertise_ipv4_isis_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv6_bgp": schema.BoolAttribute{
- MarkdownDescription: "BGP",
- Computed: true,
- },
- "advertise_ipv6_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv6_ospf": schema.BoolAttribute{
- MarkdownDescription: "OSPF",
- Computed: true,
- },
- "advertise_ipv6_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv6_connected": schema.BoolAttribute{
- MarkdownDescription: "Connected",
- Computed: true,
- },
- "advertise_ipv6_connected_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv6_static": schema.BoolAttribute{
- MarkdownDescription: "Static",
- Computed: true,
- },
- "advertise_ipv6_static_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv6_eigrp": schema.BoolAttribute{
- MarkdownDescription: "EIGRP",
- Computed: true,
- },
- "advertise_ipv6_eigrp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv6_lisp": schema.BoolAttribute{
- MarkdownDescription: "LISP",
- Computed: true,
- },
- "advertise_ipv6_lisp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "advertise_ipv6_isis": schema.BoolAttribute{
- MarkdownDescription: "ISIS",
- Computed: true,
- },
- "advertise_ipv6_isis_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ignore_region_path_length": schema.BoolAttribute{
- MarkdownDescription: "Treat hierarchical and direct (secondary region) paths equally",
- Computed: true,
- },
- "ignore_region_path_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "transport_gateway": schema.StringAttribute{
- MarkdownDescription: "Transport Gateway Path Behavior",
- Computed: true,
- },
- "transport_gateway_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "site_types": schema.SetAttribute{
- MarkdownDescription: "Site Types",
- ElementType: types.StringType,
- Computed: true,
- },
- "site_types_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemOMPProfileParcelDataSource) 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 *SystemOMPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemOMP
-
- // 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_system_omp_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_omp_profile_parcel_test.go
deleted file mode 100644
index 707f8f0ee..000000000
--- a/internal/provider/data_source_sdwan_system_omp_profile_parcel_test.go
+++ /dev/null
@@ -1,134 +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 TestAccDataSourceSdwanSystemOMPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "graceful_restart", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "overlay_as", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "paths_advertised_per_prefix", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "ecmp_limit", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "omp_admin_distance_ipv4", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "omp_admin_distance_ipv6", "20"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertisement_interval", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "graceful_restart_timer", "43200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "eor_timer", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "holdtime", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_ospf_v3", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_connected", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_static", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_eigrp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_lisp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv4_isis", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv6_bgp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv6_ospf", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv6_connected", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv6_static", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv6_eigrp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv6_lisp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "advertise_ipv6_isis", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "ignore_region_path_length", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_omp_profile_parcel.test", "transport_gateway", "prefer"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemOMPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemOMPProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemOMPPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemOMPProfileParcelConfig() string {
- config := `resource "sdwan_system_omp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` graceful_restart = true` + "\n"
- config += ` overlay_as = 10` + "\n"
- config += ` paths_advertised_per_prefix = 4` + "\n"
- config += ` ecmp_limit = 4` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` omp_admin_distance_ipv4 = 10` + "\n"
- config += ` omp_admin_distance_ipv6 = 20` + "\n"
- config += ` advertisement_interval = 1` + "\n"
- config += ` graceful_restart_timer = 43200` + "\n"
- config += ` eor_timer = 300` + "\n"
- config += ` holdtime = 60` + "\n"
- config += ` advertise_ipv4_bgp = false` + "\n"
- config += ` advertise_ipv4_ospf = false` + "\n"
- config += ` advertise_ipv4_ospf_v3 = false` + "\n"
- config += ` advertise_ipv4_connected = false` + "\n"
- config += ` advertise_ipv4_static = false` + "\n"
- config += ` advertise_ipv4_eigrp = false` + "\n"
- config += ` advertise_ipv4_lisp = false` + "\n"
- config += ` advertise_ipv4_isis = false` + "\n"
- config += ` advertise_ipv6_bgp = true` + "\n"
- config += ` advertise_ipv6_ospf = true` + "\n"
- config += ` advertise_ipv6_connected = true` + "\n"
- config += ` advertise_ipv6_static = true` + "\n"
- config += ` advertise_ipv6_eigrp = true` + "\n"
- config += ` advertise_ipv6_lisp = true` + "\n"
- config += ` advertise_ipv6_isis = true` + "\n"
- config += ` ignore_region_path_length = false` + "\n"
- config += ` transport_gateway = "prefer"` + "\n"
- config += ` site_types = ["type-1"]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_omp_profile_parcel" "test" {
- id = sdwan_system_omp_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_performance_monitoring_feature.go b/internal/provider/data_source_sdwan_system_performance_monitoring_feature.go
new file mode 100644
index 000000000..60039fcbd
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_performance_monitoring_feature.go
@@ -0,0 +1,148 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemPerformanceMonitoringProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemPerformanceMonitoringProfileParcelDataSource{}
+)
+
+func NewSystemPerformanceMonitoringProfileParcelDataSource() datasource.DataSource {
+ return &SystemPerformanceMonitoringProfileParcelDataSource{}
+}
+
+type SystemPerformanceMonitoringProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemPerformanceMonitoringProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_performance_monitoring_feature"
+}
+
+func (d *SystemPerformanceMonitoringProfileParcelDataSource) 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 System Performance Monitoring Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "app_perf_monitor_enabled": schema.BoolAttribute{
+ MarkdownDescription: "Application performance monitoring enable or disable",
+ Computed: true,
+ },
+ "app_perf_monitor_app_group": schema.SetAttribute{
+ MarkdownDescription: "Application groups to be monitored",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "monitoring_config_enabled": schema.BoolAttribute{
+ MarkdownDescription: "UMTS monitoring enable or disable",
+ Computed: true,
+ },
+ "monitoring_config_interval": schema.StringAttribute{
+ MarkdownDescription: "UMTS monitoring interval(Minutes)",
+ Computed: true,
+ },
+ "event_driven_config_enabled": schema.BoolAttribute{
+ MarkdownDescription: "UMTS event driven monitoring enable or disable",
+ Computed: true,
+ },
+ "event_driven_events": schema.SetAttribute{
+ MarkdownDescription: "UMTS events",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemPerformanceMonitoringProfileParcelDataSource) 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 *SystemPerformanceMonitoringProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemPerformanceMonitoring
+
+ // 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_system_performance_monitoring_feature_test.go b/internal/provider/data_source_sdwan_system_performance_monitoring_feature_test.go
new file mode 100644
index 000000000..0b14ff649
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_performance_monitoring_feature_test.go
@@ -0,0 +1,87 @@
+// 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 TestAccDataSourceSdwanSystemPerformanceMonitoringProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_feature.test", "app_perf_monitor_enabled", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_feature.test", "monitoring_config_enabled", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_feature.test", "monitoring_config_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_feature.test", "event_driven_config_enabled", "true"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemPerformanceMonitoringProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemPerformanceMonitoringProfileParcelConfig() string {
+ config := `resource "sdwan_system_performance_monitoring_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` app_perf_monitor_enabled = true` + "\n"
+ config += ` app_perf_monitor_app_group = ["amazon-group"]` + "\n"
+ config += ` monitoring_config_enabled = true` + "\n"
+ config += ` monitoring_config_interval = "30"` + "\n"
+ config += ` event_driven_config_enabled = true` + "\n"
+ config += ` event_driven_events = ["SLA_CHANGE"]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_performance_monitoring_feature" "test" {
+ id = sdwan_system_performance_monitoring_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_performance_monitoring_profile_parcel.go b/internal/provider/data_source_sdwan_system_performance_monitoring_profile_parcel.go
deleted file mode 100644
index 28d4ab4d8..000000000
--- a/internal/provider/data_source_sdwan_system_performance_monitoring_profile_parcel.go
+++ /dev/null
@@ -1,148 +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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemPerformanceMonitoringProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemPerformanceMonitoringProfileParcelDataSource{}
-)
-
-func NewSystemPerformanceMonitoringProfileParcelDataSource() datasource.DataSource {
- return &SystemPerformanceMonitoringProfileParcelDataSource{}
-}
-
-type SystemPerformanceMonitoringProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemPerformanceMonitoringProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_performance_monitoring_profile_parcel"
-}
-
-func (d *SystemPerformanceMonitoringProfileParcelDataSource) 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 System Performance Monitoring 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,
- },
- "app_perf_monitor_enabled": schema.BoolAttribute{
- MarkdownDescription: "Application performance monitoring enable or disable",
- Computed: true,
- },
- "app_perf_monitor_app_group": schema.SetAttribute{
- MarkdownDescription: "Application groups to be monitored",
- ElementType: types.StringType,
- Computed: true,
- },
- "monitoring_config_enabled": schema.BoolAttribute{
- MarkdownDescription: "UMTS monitoring enable or disable",
- Computed: true,
- },
- "monitoring_config_interval": schema.StringAttribute{
- MarkdownDescription: "UMTS monitoring interval(Minutes)",
- Computed: true,
- },
- "event_driven_config_enabled": schema.BoolAttribute{
- MarkdownDescription: "UMTS event driven monitoring enable or disable",
- Computed: true,
- },
- "event_driven_events": schema.SetAttribute{
- MarkdownDescription: "UMTS events",
- ElementType: types.StringType,
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemPerformanceMonitoringProfileParcelDataSource) 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 *SystemPerformanceMonitoringProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemPerformanceMonitoring
-
- // 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_system_performance_monitoring_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_performance_monitoring_profile_parcel_test.go
deleted file mode 100644
index c32c79339..000000000
--- a/internal/provider/data_source_sdwan_system_performance_monitoring_profile_parcel_test.go
+++ /dev/null
@@ -1,87 +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 TestAccDataSourceSdwanSystemPerformanceMonitoringProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_profile_parcel.test", "app_perf_monitor_enabled", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_profile_parcel.test", "monitoring_config_enabled", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_profile_parcel.test", "monitoring_config_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_performance_monitoring_profile_parcel.test", "event_driven_config_enabled", "true"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemPerformanceMonitoringProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemPerformanceMonitoringProfileParcelConfig() string {
- config := `resource "sdwan_system_performance_monitoring_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` app_perf_monitor_enabled = true` + "\n"
- config += ` app_perf_monitor_app_group = ["amazon-group"]` + "\n"
- config += ` monitoring_config_enabled = true` + "\n"
- config += ` monitoring_config_interval = "30"` + "\n"
- config += ` event_driven_config_enabled = true` + "\n"
- config += ` event_driven_events = ["SLA_CHANGE"]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_performance_monitoring_profile_parcel" "test" {
- id = sdwan_system_performance_monitoring_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_remote_access_feature.go b/internal/provider/data_source_sdwan_system_remote_access_feature.go
new file mode 100644
index 000000000..7229fb671
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_remote_access_feature.go
@@ -0,0 +1,282 @@
+// 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 = &SystemRemoteAccessProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemRemoteAccessProfileParcelDataSource{}
+)
+
+func NewSystemRemoteAccessProfileParcelDataSource() datasource.DataSource {
+ return &SystemRemoteAccessProfileParcelDataSource{}
+}
+
+type SystemRemoteAccessProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemRemoteAccessProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_remote_access_feature"
+}
+
+func (d *SystemRemoteAccessProfileParcelDataSource) 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 System Remote Access Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "connection_type_ssl": schema.BoolAttribute{
+ MarkdownDescription: "Enabled SSL VPN",
+ Computed: true,
+ },
+ "any_connect_eap_authentication_type": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_pool_size": schema.Int64Attribute{
+ MarkdownDescription: "IPv4 Pool Size",
+ Computed: true,
+ },
+ "ipv4_pool_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_pool_size": schema.Int64Attribute{
+ MarkdownDescription: "IPv6 Pool Size",
+ Computed: true,
+ },
+ "ipv6_pool_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "enable_certificate_list_check": schema.BoolAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "enable_certificate_list_check_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "psk_authentication_type": schema.StringAttribute{
+ MarkdownDescription: "PSK Selection",
+ Computed: true,
+ },
+ "psk_authentication_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "psk_authentication_pre_shared_key": schema.StringAttribute{
+ MarkdownDescription: "PSK Pre Shared Key",
+ Computed: true,
+ },
+ "psk_authentication_pre_shared_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "radius_group_name": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "radius_group_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "aaa_specify_name_policy_name": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "aaa_specify_name_policy_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "aaa_specify_name_policy_password": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "aaa_specify_name_policy_password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "aaa_derive_name_from_peer_identity": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "aaa_derive_name_from_peer_identity_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "aaa_derive_name_from_peer_domain": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "aaa_derive_name_from_peer_domain_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "aaa_enable_accounting": schema.BoolAttribute{
+ MarkdownDescription: "Enable Accounting",
+ Computed: true,
+ },
+ "aaa_enable_accounting_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ikev2_local_ike_identity_type": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ikev2_local_ike_identity_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ikev2_local_ike_identity_value": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ikev2_local_ike_identity_value_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ikev2_security_association_lifetime": schema.Int64Attribute{
+ MarkdownDescription: "Security Association Lifetime in Seconds",
+ Computed: true,
+ },
+ "ikev2_security_association_lifetime_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ikev2_anti_dos_threshold": schema.Int64Attribute{
+ MarkdownDescription: "Anti-DOS Threshold",
+ Computed: true,
+ },
+ "ikev2_anti_dos_threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_enable_anti_replay": schema.BoolAttribute{
+ MarkdownDescription: "Enable Anti-Replay",
+ Computed: true,
+ },
+ "ipsec_enable_anti_replay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_anti_replay_window_size": schema.Int64Attribute{
+ MarkdownDescription: "security Association Lifetime",
+ Computed: true,
+ },
+ "ipsec_anti_replay_window_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_security_association_lifetime": schema.Int64Attribute{
+ MarkdownDescription: "Security Association Lifetime in Seconds",
+ Computed: true,
+ },
+ "ipsec_security_association_lifetime_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_enable_perfect_foward_secrecy": schema.BoolAttribute{
+ MarkdownDescription: "security Association Lifetime",
+ Computed: true,
+ },
+ "ipsec_enable_perfect_foward_secrecy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *SystemRemoteAccessProfileParcelDataSource) 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 *SystemRemoteAccessProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemRemoteAccess
+
+ // 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_system_remote_access_feature_test.go b/internal/provider/data_source_sdwan_system_remote_access_feature_test.go
new file mode 100644
index 000000000..88a93664f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_remote_access_feature_test.go
@@ -0,0 +1,109 @@
+// 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 TestAccDataSourceSdwanSystemRemoteAccessProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "connection_type_ssl", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "any_connect_eap_authentication_type", "user"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ipv4_pool_size", "50"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ipv6_pool_size", "1024"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "enable_certificate_list_check", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "psk_authentication_type", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "radius_group_name", "radius-1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "aaa_derive_name_from_peer_identity", "MyPassword"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "aaa_enable_accounting", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ikev2_local_ike_identity_type", "EMAIL"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ikev2_local_ike_identity_value", "abc@xyz.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ikev2_security_association_lifetime", "86400"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ikev2_anti_dos_threshold", "99"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ipsec_enable_anti_replay", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ipsec_security_association_lifetime", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_feature.test", "ipsec_enable_perfect_foward_secrecy", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemRemoteAccessProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemRemoteAccessProfileParcelConfig() string {
+ config := `resource "sdwan_system_remote_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` connection_type_ssl = false` + "\n"
+ config += ` any_connect_eap_authentication_type = "user"` + "\n"
+ config += ` ipv4_pool_size = 50` + "\n"
+ config += ` ipv6_pool_size = 1024` + "\n"
+ config += ` enable_certificate_list_check = false` + "\n"
+ config += ` psk_authentication_type = "aaa"` + "\n"
+ config += ` radius_group_name = "radius-1"` + "\n"
+ config += ` aaa_derive_name_from_peer_identity = "MyPassword"` + "\n"
+ config += ` aaa_enable_accounting = false` + "\n"
+ config += ` ikev2_local_ike_identity_type = "EMAIL"` + "\n"
+ config += ` ikev2_local_ike_identity_value = "abc@xyz.com"` + "\n"
+ config += ` ikev2_security_association_lifetime = 86400` + "\n"
+ config += ` ikev2_anti_dos_threshold = 99` + "\n"
+ config += ` ipsec_enable_anti_replay = false` + "\n"
+ config += ` ipsec_security_association_lifetime = 3600` + "\n"
+ config += ` ipsec_enable_perfect_foward_secrecy = false` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_remote_access_feature" "test" {
+ id = sdwan_system_remote_access_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_remote_access_profile_parcel.go b/internal/provider/data_source_sdwan_system_remote_access_profile_parcel.go
deleted file mode 100644
index 4750a1627..000000000
--- a/internal/provider/data_source_sdwan_system_remote_access_profile_parcel.go
+++ /dev/null
@@ -1,282 +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/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 = &SystemRemoteAccessProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemRemoteAccessProfileParcelDataSource{}
-)
-
-func NewSystemRemoteAccessProfileParcelDataSource() datasource.DataSource {
- return &SystemRemoteAccessProfileParcelDataSource{}
-}
-
-type SystemRemoteAccessProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemRemoteAccessProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_remote_access_profile_parcel"
-}
-
-func (d *SystemRemoteAccessProfileParcelDataSource) 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 System Remote Access 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,
- },
- "connection_type_ssl": schema.BoolAttribute{
- MarkdownDescription: "Enabled SSL VPN",
- Computed: true,
- },
- "any_connect_eap_authentication_type": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_pool_size": schema.Int64Attribute{
- MarkdownDescription: "IPv4 Pool Size",
- Computed: true,
- },
- "ipv4_pool_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_pool_size": schema.Int64Attribute{
- MarkdownDescription: "IPv6 Pool Size",
- Computed: true,
- },
- "ipv6_pool_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "enable_certificate_list_check": schema.BoolAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "enable_certificate_list_check_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "psk_authentication_type": schema.StringAttribute{
- MarkdownDescription: "PSK Selection",
- Computed: true,
- },
- "psk_authentication_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "psk_authentication_pre_shared_key": schema.StringAttribute{
- MarkdownDescription: "PSK Pre Shared Key",
- Computed: true,
- },
- "psk_authentication_pre_shared_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "radius_group_name": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "radius_group_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "aaa_specify_name_policy_name": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "aaa_specify_name_policy_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "aaa_specify_name_policy_password": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "aaa_specify_name_policy_password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "aaa_derive_name_from_peer_identity": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "aaa_derive_name_from_peer_identity_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "aaa_derive_name_from_peer_domain": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "aaa_derive_name_from_peer_domain_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "aaa_enable_accounting": schema.BoolAttribute{
- MarkdownDescription: "Enable Accounting",
- Computed: true,
- },
- "aaa_enable_accounting_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ikev2_local_ike_identity_type": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ikev2_local_ike_identity_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ikev2_local_ike_identity_value": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ikev2_local_ike_identity_value_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ikev2_security_association_lifetime": schema.Int64Attribute{
- MarkdownDescription: "Security Association Lifetime in Seconds",
- Computed: true,
- },
- "ikev2_security_association_lifetime_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ikev2_anti_dos_threshold": schema.Int64Attribute{
- MarkdownDescription: "Anti-DOS Threshold",
- Computed: true,
- },
- "ikev2_anti_dos_threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_enable_anti_replay": schema.BoolAttribute{
- MarkdownDescription: "Enable Anti-Replay",
- Computed: true,
- },
- "ipsec_enable_anti_replay_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_anti_replay_window_size": schema.Int64Attribute{
- MarkdownDescription: "security Association Lifetime",
- Computed: true,
- },
- "ipsec_anti_replay_window_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_security_association_lifetime": schema.Int64Attribute{
- MarkdownDescription: "Security Association Lifetime in Seconds",
- Computed: true,
- },
- "ipsec_security_association_lifetime_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_enable_perfect_foward_secrecy": schema.BoolAttribute{
- MarkdownDescription: "security Association Lifetime",
- Computed: true,
- },
- "ipsec_enable_perfect_foward_secrecy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *SystemRemoteAccessProfileParcelDataSource) 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 *SystemRemoteAccessProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemRemoteAccess
-
- // 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_system_remote_access_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_remote_access_profile_parcel_test.go
deleted file mode 100644
index 678690099..000000000
--- a/internal/provider/data_source_sdwan_system_remote_access_profile_parcel_test.go
+++ /dev/null
@@ -1,113 +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 TestAccDataSourceSdwanSystemRemoteAccessProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "connection_type_ssl", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_authentication_type", "user"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipv4_pool_size", "50"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipv6_pool_size", "1024"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "enable_certificate_list_check", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "psk_authentication_type", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "psk_authentication_pre_shared_key", "Cisco123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "radius_group_name", "radius-1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "aaa_derive_name_from_peer_identity", "MyPassword"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "aaa_enable_accounting", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_type", "EMAIL"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_value", "abc@xyz.com"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ikev2_security_association_lifetime", "86400"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ikev2_anti_dos_threshold", "99"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipsec_enable_anti_replay", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipsec_anti_replay_window_size", "64"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipsec_security_association_lifetime", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipsec_enable_perfect_foward_secrecy", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemRemoteAccessProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemRemoteAccessProfileParcelConfig() string {
- config := `resource "sdwan_system_remote_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` connection_type_ssl = false` + "\n"
- config += ` any_connect_eap_authentication_type = "user"` + "\n"
- config += ` ipv4_pool_size = 50` + "\n"
- config += ` ipv6_pool_size = 1024` + "\n"
- config += ` enable_certificate_list_check = false` + "\n"
- config += ` psk_authentication_type = "aaa"` + "\n"
- config += ` psk_authentication_pre_shared_key = "Cisco123"` + "\n"
- config += ` radius_group_name = "radius-1"` + "\n"
- config += ` aaa_derive_name_from_peer_identity = "MyPassword"` + "\n"
- config += ` aaa_enable_accounting = false` + "\n"
- config += ` ikev2_local_ike_identity_type = "EMAIL"` + "\n"
- config += ` ikev2_local_ike_identity_value = "abc@xyz.com"` + "\n"
- config += ` ikev2_security_association_lifetime = 86400` + "\n"
- config += ` ikev2_anti_dos_threshold = 99` + "\n"
- config += ` ipsec_enable_anti_replay = false` + "\n"
- config += ` ipsec_anti_replay_window_size = 64` + "\n"
- config += ` ipsec_security_association_lifetime = 3600` + "\n"
- config += ` ipsec_enable_perfect_foward_secrecy = false` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_remote_access_profile_parcel" "test" {
- id = sdwan_system_remote_access_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_security_feature.go b/internal/provider/data_source_sdwan_system_security_feature.go
new file mode 100644
index 000000000..94ff8bb63
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_security_feature.go
@@ -0,0 +1,304 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &SystemSecurityProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemSecurityProfileParcelDataSource{}
+)
+
+func NewSystemSecurityProfileParcelDataSource() datasource.DataSource {
+ return &SystemSecurityProfileParcelDataSource{}
+}
+
+type SystemSecurityProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemSecurityProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_security_feature"
+}
+
+func (d *SystemSecurityProfileParcelDataSource) 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 System Security Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "rekey": schema.Int64Attribute{
+ MarkdownDescription: "Set how often to change the AES key for DTLS connections",
+ Computed: true,
+ },
+ "rekey_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "anti_replay_window": schema.StringAttribute{
+ MarkdownDescription: "Set the sliding replay window size",
+ Computed: true,
+ },
+ "anti_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "extended_anti_replay_window": schema.Int64Attribute{
+ MarkdownDescription: "Extended Anti-Replay Window",
+ Computed: true,
+ },
+ "extended_anti_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_pairwise_keying": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable IPsec pairwise-keying",
+ Computed: true,
+ },
+ "ipsec_pairwise_keying_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "integrity_type": schema.SetAttribute{
+ MarkdownDescription: "Set the authentication type for DTLS connections",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "integrity_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "keychains": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure a Keychain",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "key_chain_name": schema.StringAttribute{
+ MarkdownDescription: "Specify the name of the Keychain",
+ Computed: true,
+ },
+ "key_id": schema.Int64Attribute{
+ MarkdownDescription: "Specify the Key ID",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "keys": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure a Key",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: "Select the Key ID",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Select the chain name",
+ Computed: true,
+ },
+ "send_id": schema.Int64Attribute{
+ MarkdownDescription: "Specify the Send ID",
+ Computed: true,
+ },
+ "send_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "receiver_id": schema.Int64Attribute{
+ MarkdownDescription: "Specify the Receiver ID",
+ Computed: true,
+ },
+ "receiver_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "include_tcp_options": schema.BoolAttribute{
+ MarkdownDescription: "Configure Include TCP Options",
+ Computed: true,
+ },
+ "include_tcp_options_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "accept_ao_mismatch": schema.BoolAttribute{
+ MarkdownDescription: "Configure Accept AO Mismatch",
+ Computed: true,
+ },
+ "accept_ao_mismatch_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "crypto_algorithm": schema.StringAttribute{
+ MarkdownDescription: "Crypto Algorithm",
+ Computed: true,
+ },
+ "key_string": schema.StringAttribute{
+ MarkdownDescription: "Specify the Key String",
+ Computed: true,
+ },
+ "key_string_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_life_time_local": schema.BoolAttribute{
+ MarkdownDescription: "Configure Send lifetime Local",
+ Computed: true,
+ },
+ "send_life_time_local_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_life_time_start_epoch": schema.Int64Attribute{
+ MarkdownDescription: "Configure Key lifetime start time",
+ Computed: true,
+ },
+ "send_life_time_infinite": schema.BoolAttribute{
+ MarkdownDescription: "Infinite lifetime",
+ Computed: true,
+ },
+ "send_life_time_infinite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_life_time_duration": schema.Int64Attribute{
+ MarkdownDescription: "Send lifetime Duration (seconds)",
+ Computed: true,
+ },
+ "send_life_time_duration_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_life_time_exact": schema.Int64Attribute{
+ MarkdownDescription: "Configure Key lifetime end time",
+ Computed: true,
+ },
+ "accept_life_time_local": schema.BoolAttribute{
+ MarkdownDescription: "Configure Send lifetime Local",
+ Computed: true,
+ },
+ "accept_life_time_local_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "accept_life_time_start_epoch": schema.Int64Attribute{
+ MarkdownDescription: "Configure Key lifetime start time",
+ Computed: true,
+ },
+ "accept_life_time_infinite": schema.BoolAttribute{
+ MarkdownDescription: "Infinite lifetime",
+ Computed: true,
+ },
+ "accept_life_time_infinite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "accept_life_time_duration": schema.Int64Attribute{
+ MarkdownDescription: "Send lifetime Duration (seconds)",
+ Computed: true,
+ },
+ "accept_life_time_duration_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "accept_life_time_exact": schema.Int64Attribute{
+ MarkdownDescription: "Configure Key lifetime end time",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemSecurityProfileParcelDataSource) 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 *SystemSecurityProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemSecurity
+
+ // 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_system_security_feature_test.go b/internal/provider/data_source_sdwan_system_security_feature_test.go
new file mode 100644
index 000000000..8c769dff4
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_security_feature_test.go
@@ -0,0 +1,121 @@
+// 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 TestAccDataSourceSdwanSystemSecurityProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "rekey", "86400"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "anti_replay_window", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "extended_anti_replay_window", "256"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "ipsec_pairwise_keying", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keychains.0.key_chain_name", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keychains.0.key_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.id", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.name", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.send_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.receiver_id", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.include_tcp_options", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.accept_ao_mismatch", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.crypto_algorithm", "aes-128-cmac"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.send_life_time_local", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.send_life_time_start_epoch", "1659284400"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.send_life_time_infinite", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.accept_life_time_local", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.accept_life_time_start_epoch", "1659284400"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_feature.test", "keys.0.accept_life_time_infinite", "true"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemSecurityPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemSecurityProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemSecurityPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemSecurityProfileParcelConfig() string {
+ config := `resource "sdwan_system_security_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` rekey = 86400` + "\n"
+ config += ` anti_replay_window = "512"` + "\n"
+ config += ` extended_anti_replay_window = 256` + "\n"
+ config += ` ipsec_pairwise_keying = false` + "\n"
+ config += ` integrity_type = ["esp"]` + "\n"
+ config += ` keychains = [{` + "\n"
+ config += ` key_chain_name = "aaa"` + "\n"
+ config += ` key_id = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` keys = [{` + "\n"
+ config += ` id = 0` + "\n"
+ config += ` name = "aaa"` + "\n"
+ config += ` send_id = 1` + "\n"
+ config += ` receiver_id = 2` + "\n"
+ config += ` include_tcp_options = false` + "\n"
+ config += ` accept_ao_mismatch = false` + "\n"
+ config += ` crypto_algorithm = "aes-128-cmac"` + "\n"
+ config += ` key_string = "abcabc"` + "\n"
+ config += ` send_life_time_local = true` + "\n"
+ config += ` send_life_time_start_epoch = 1659284400` + "\n"
+ config += ` send_life_time_infinite = true` + "\n"
+ config += ` accept_life_time_local = true` + "\n"
+ config += ` accept_life_time_start_epoch = 1659284400` + "\n"
+ config += ` accept_life_time_infinite = true` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_security_feature" "test" {
+ id = sdwan_system_security_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_security_profile_parcel.go b/internal/provider/data_source_sdwan_system_security_profile_parcel.go
deleted file mode 100644
index 067a13b96..000000000
--- a/internal/provider/data_source_sdwan_system_security_profile_parcel.go
+++ /dev/null
@@ -1,304 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &SystemSecurityProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemSecurityProfileParcelDataSource{}
-)
-
-func NewSystemSecurityProfileParcelDataSource() datasource.DataSource {
- return &SystemSecurityProfileParcelDataSource{}
-}
-
-type SystemSecurityProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemSecurityProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_security_profile_parcel"
-}
-
-func (d *SystemSecurityProfileParcelDataSource) 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 System Security 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,
- },
- "rekey": schema.Int64Attribute{
- MarkdownDescription: "Set how often to change the AES key for DTLS connections",
- Computed: true,
- },
- "rekey_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "anti_replay_window": schema.StringAttribute{
- MarkdownDescription: "Set the sliding replay window size",
- Computed: true,
- },
- "anti_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "extended_anti_replay_window": schema.Int64Attribute{
- MarkdownDescription: "Extended Anti-Replay Window",
- Computed: true,
- },
- "extended_anti_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_pairwise_keying": schema.BoolAttribute{
- MarkdownDescription: "Enable or disable IPsec pairwise-keying",
- Computed: true,
- },
- "ipsec_pairwise_keying_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "integrity_type": schema.SetAttribute{
- MarkdownDescription: "Set the authentication type for DTLS connections",
- ElementType: types.StringType,
- Computed: true,
- },
- "integrity_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "keychains": schema.ListNestedAttribute{
- MarkdownDescription: "Configure a Keychain",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "key_chain_name": schema.StringAttribute{
- MarkdownDescription: "Specify the name of the Keychain",
- Computed: true,
- },
- "key_id": schema.Int64Attribute{
- MarkdownDescription: "Specify the Key ID",
- Computed: true,
- },
- },
- },
- },
- "keys": schema.ListNestedAttribute{
- MarkdownDescription: "Configure a Key",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.Int64Attribute{
- MarkdownDescription: "Select the Key ID",
- Computed: true,
- },
- "name": schema.StringAttribute{
- MarkdownDescription: "Select the chain name",
- Computed: true,
- },
- "send_id": schema.Int64Attribute{
- MarkdownDescription: "Specify the Send ID",
- Computed: true,
- },
- "send_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "receiver_id": schema.Int64Attribute{
- MarkdownDescription: "Specify the Receiver ID",
- Computed: true,
- },
- "receiver_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "include_tcp_options": schema.BoolAttribute{
- MarkdownDescription: "Configure Include TCP Options",
- Computed: true,
- },
- "include_tcp_options_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "accept_ao_mismatch": schema.BoolAttribute{
- MarkdownDescription: "Configure Accept AO Mismatch",
- Computed: true,
- },
- "accept_ao_mismatch_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "crypto_algorithm": schema.StringAttribute{
- MarkdownDescription: "Crypto Algorithm",
- Computed: true,
- },
- "key_string": schema.StringAttribute{
- MarkdownDescription: "Specify the Key String",
- Computed: true,
- },
- "key_string_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_life_time_local": schema.BoolAttribute{
- MarkdownDescription: "Configure Send lifetime Local",
- Computed: true,
- },
- "send_life_time_local_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_life_time_start_epoch": schema.Int64Attribute{
- MarkdownDescription: "Configure Key lifetime start time",
- Computed: true,
- },
- "send_life_time_infinite": schema.BoolAttribute{
- MarkdownDescription: "Infinite lifetime",
- Computed: true,
- },
- "send_life_time_infinite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_life_time_duration": schema.Int64Attribute{
- MarkdownDescription: "Send lifetime Duration (seconds)",
- Computed: true,
- },
- "send_life_time_duration_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_life_time_exact": schema.Int64Attribute{
- MarkdownDescription: "Configure Key lifetime end time",
- Computed: true,
- },
- "accept_life_time_local": schema.BoolAttribute{
- MarkdownDescription: "Configure Send lifetime Local",
- Computed: true,
- },
- "accept_life_time_local_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "accept_life_time_start_epoch": schema.Int64Attribute{
- MarkdownDescription: "Configure Key lifetime start time",
- Computed: true,
- },
- "accept_life_time_infinite": schema.BoolAttribute{
- MarkdownDescription: "Infinite lifetime",
- Computed: true,
- },
- "accept_life_time_infinite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "accept_life_time_duration": schema.Int64Attribute{
- MarkdownDescription: "Send lifetime Duration (seconds)",
- Computed: true,
- },
- "accept_life_time_duration_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "accept_life_time_exact": schema.Int64Attribute{
- MarkdownDescription: "Configure Key lifetime end time",
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemSecurityProfileParcelDataSource) 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 *SystemSecurityProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemSecurity
-
- // 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_system_security_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_security_profile_parcel_test.go
deleted file mode 100644
index e435729af..000000000
--- a/internal/provider/data_source_sdwan_system_security_profile_parcel_test.go
+++ /dev/null
@@ -1,121 +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 TestAccDataSourceSdwanSystemSecurityProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "rekey", "86400"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "anti_replay_window", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "extended_anti_replay_window", "256"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "ipsec_pairwise_keying", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keychains.0.key_chain_name", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keychains.0.key_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.id", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.name", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.send_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.receiver_id", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.include_tcp_options", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.accept_ao_mismatch", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.crypto_algorithm", "aes-128-cmac"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.send_life_time_local", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.send_life_time_start_epoch", "1659284400"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.send_life_time_infinite", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.accept_life_time_local", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.accept_life_time_start_epoch", "1659284400"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_security_profile_parcel.test", "keys.0.accept_life_time_infinite", "true"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemSecurityPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemSecurityProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemSecurityPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemSecurityProfileParcelConfig() string {
- config := `resource "sdwan_system_security_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` rekey = 86400` + "\n"
- config += ` anti_replay_window = "512"` + "\n"
- config += ` extended_anti_replay_window = 256` + "\n"
- config += ` ipsec_pairwise_keying = false` + "\n"
- config += ` integrity_type = ["esp"]` + "\n"
- config += ` keychains = [{` + "\n"
- config += ` key_chain_name = "aaa"` + "\n"
- config += ` key_id = 1` + "\n"
- config += ` }]` + "\n"
- config += ` keys = [{` + "\n"
- config += ` id = 0` + "\n"
- config += ` name = "aaa"` + "\n"
- config += ` send_id = 1` + "\n"
- config += ` receiver_id = 2` + "\n"
- config += ` include_tcp_options = false` + "\n"
- config += ` accept_ao_mismatch = false` + "\n"
- config += ` crypto_algorithm = "aes-128-cmac"` + "\n"
- config += ` key_string = "abcabc"` + "\n"
- config += ` send_life_time_local = true` + "\n"
- config += ` send_life_time_start_epoch = 1659284400` + "\n"
- config += ` send_life_time_infinite = true` + "\n"
- config += ` accept_life_time_local = true` + "\n"
- config += ` accept_life_time_start_epoch = 1659284400` + "\n"
- config += ` accept_life_time_infinite = true` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_security_profile_parcel" "test" {
- id = sdwan_system_security_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_snmp_feature.go b/internal/provider/data_source_sdwan_system_snmp_feature.go
new file mode 100644
index 000000000..54049c2c9
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_snmp_feature.go
@@ -0,0 +1,342 @@
+// 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 = &SystemSNMPProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &SystemSNMPProfileParcelDataSource{}
+)
+
+func NewSystemSNMPProfileParcelDataSource() datasource.DataSource {
+ return &SystemSNMPProfileParcelDataSource{}
+}
+
+type SystemSNMPProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *SystemSNMPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_snmp_feature"
+}
+
+func (d *SystemSNMPProfileParcelDataSource) 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 System SNMP Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable SNMP",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "contact_person": schema.StringAttribute{
+ MarkdownDescription: "Set the contact for this managed node",
+ Computed: true,
+ },
+ "contact_person_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "location_of_device": schema.StringAttribute{
+ MarkdownDescription: "Set the physical location of this managed node",
+ Computed: true,
+ },
+ "location_of_device_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "views": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure a view record",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set the name of the SNMP view",
+ Computed: true,
+ },
+ "oids": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure SNMP object identifier",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "Configure identifier of subtree of MIB objects",
+ Computed: true,
+ },
+ "id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "exclude": schema.BoolAttribute{
+ MarkdownDescription: "Exclude the OID",
+ Computed: true,
+ },
+ "exclude_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "communities": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure SNMP community",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set name of the SNMP community",
+ Computed: true,
+ },
+ "user_label": schema.StringAttribute{
+ MarkdownDescription: "Set user label of the SNMP community",
+ Computed: true,
+ },
+ "view": schema.StringAttribute{
+ MarkdownDescription: "Set name of the SNMP view",
+ Computed: true,
+ },
+ "view_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authorization": schema.StringAttribute{
+ MarkdownDescription: "Configure access permissions",
+ Computed: true,
+ },
+ "authorization_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "groups": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure an SNMP group",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Name of the SNMP group",
+ Computed: true,
+ },
+ "security_level": schema.StringAttribute{
+ MarkdownDescription: "Configure security level",
+ Computed: true,
+ },
+ "view": schema.StringAttribute{
+ MarkdownDescription: "Name of the SNMP view",
+ Computed: true,
+ },
+ "view_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "users": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure an SNMP user",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Name of the SNMP user",
+ Computed: true,
+ },
+ "authentication_protocol": schema.StringAttribute{
+ MarkdownDescription: "Configure authentication protocol",
+ Computed: true,
+ },
+ "authentication_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_password": schema.StringAttribute{
+ MarkdownDescription: "Specify authentication protocol password",
+ Computed: true,
+ },
+ "authentication_password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "privacy_protocol": schema.StringAttribute{
+ MarkdownDescription: "Configure privacy protocol",
+ Computed: true,
+ },
+ "privacy_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "privacy_password": schema.StringAttribute{
+ MarkdownDescription: "Specify privacy protocol password",
+ Computed: true,
+ },
+ "privacy_password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "group": schema.StringAttribute{
+ MarkdownDescription: "Name of the SNMP group",
+ Computed: true,
+ },
+ "group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "trap_target_servers": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure SNMP server to receive SNMP traps",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "vpn_id": schema.Int64Attribute{
+ MarkdownDescription: "Set VPN in which SNMP server is located",
+ Computed: true,
+ },
+ "vpn_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip": schema.StringAttribute{
+ MarkdownDescription: "Set IPv4/IPv6 address of SNMP server",
+ Computed: true,
+ },
+ "ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "port": schema.Int64Attribute{
+ MarkdownDescription: "Set UDP port number to connect to SNMP server",
+ Computed: true,
+ },
+ "port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "user_label": schema.StringAttribute{
+ MarkdownDescription: "Set user label of the SNMP community",
+ Computed: true,
+ },
+ "user": schema.StringAttribute{
+ MarkdownDescription: "Set name of the SNMP user",
+ Computed: true,
+ },
+ "user_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: "Source interface for outgoing SNMP traps",
+ Computed: true,
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *SystemSNMPProfileParcelDataSource) 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 *SystemSNMPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config SystemSNMP
+
+ // 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_system_snmp_feature_test.go b/internal/provider/data_source_sdwan_system_snmp_feature_test.go
new file mode 100644
index 000000000..55d3a1fe8
--- /dev/null
+++ b/internal/provider/data_source_sdwan_system_snmp_feature_test.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 (
+ "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 TestAccDataSourceSdwanSystemSNMPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "contact_person", "wixie.cisco"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "location_of_device", "SHANGHAI"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "views.0.name", "VIEW1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "views.0.oids.0.id", "1.3.6.1.4.1.9.9.394"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "views.0.oids.0.exclude", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "communities.0.user_label", "COMMUNITY1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "communities.0.view", "VIEW1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "communities.0.authorization", "read-only"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "groups.0.name", "GROUP1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "groups.0.security_level", "auth-priv"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "groups.0.view", "VIEW1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "users.0.name", "USER1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "users.0.authentication_protocol", "sha"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "users.0.authentication_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "users.0.privacy_protocol", "aes-256-cfb-128"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "users.0.privacy_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "users.0.group", "GROUP1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "trap_target_servers.0.vpn_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "trap_target_servers.0.ip", "10.75.221.156"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "trap_target_servers.0.port", "161"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "trap_target_servers.0.user_label", "TARGET1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "trap_target_servers.0.user", "USER1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_feature.test", "trap_target_servers.0.source_interface", "GigabitEthernet1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanSystemSNMPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemSNMPProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanSystemSNMPPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanSystemSNMPProfileParcelConfig() string {
+ config := `resource "sdwan_system_snmp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` contact_person = "wixie.cisco"` + "\n"
+ config += ` location_of_device = "SHANGHAI"` + "\n"
+ config += ` views = [{` + "\n"
+ config += ` name = "VIEW1"` + "\n"
+ config += ` oids = [{` + "\n"
+ config += ` id = "1.3.6.1.4.1.9.9.394"` + "\n"
+ config += ` exclude = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` communities = [{` + "\n"
+ config += ` name = "example"` + "\n"
+ config += ` user_label = "COMMUNITY1"` + "\n"
+ config += ` view = "VIEW1"` + "\n"
+ config += ` authorization = "read-only"` + "\n"
+ config += ` }]` + "\n"
+ config += ` groups = [{` + "\n"
+ config += ` name = "GROUP1"` + "\n"
+ config += ` security_level = "auth-priv"` + "\n"
+ config += ` view = "VIEW1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` users = [{` + "\n"
+ config += ` name = "USER1"` + "\n"
+ config += ` authentication_protocol = "sha"` + "\n"
+ config += ` authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
+ config += ` privacy_protocol = "aes-256-cfb-128"` + "\n"
+ config += ` privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
+ config += ` group = "GROUP1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` trap_target_servers = [{` + "\n"
+ config += ` vpn_id = 1` + "\n"
+ config += ` ip = "10.75.221.156"` + "\n"
+ config += ` port = 161` + "\n"
+ config += ` user_label = "TARGET1"` + "\n"
+ config += ` user = "USER1"` + "\n"
+ config += ` source_interface = "GigabitEthernet1"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_system_snmp_feature" "test" {
+ id = sdwan_system_snmp_feature.test.id
+ feature_profile_id = sdwan_system_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_system_snmp_profile_parcel.go b/internal/provider/data_source_sdwan_system_snmp_profile_parcel.go
deleted file mode 100644
index cd9d52ab1..000000000
--- a/internal/provider/data_source_sdwan_system_snmp_profile_parcel.go
+++ /dev/null
@@ -1,342 +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/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 = &SystemSNMPProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &SystemSNMPProfileParcelDataSource{}
-)
-
-func NewSystemSNMPProfileParcelDataSource() datasource.DataSource {
- return &SystemSNMPProfileParcelDataSource{}
-}
-
-type SystemSNMPProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *SystemSNMPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_snmp_profile_parcel"
-}
-
-func (d *SystemSNMPProfileParcelDataSource) 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 System SNMP 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,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Enable or disable SNMP",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "contact_person": schema.StringAttribute{
- MarkdownDescription: "Set the contact for this managed node",
- Computed: true,
- },
- "contact_person_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "location_of_device": schema.StringAttribute{
- MarkdownDescription: "Set the physical location of this managed node",
- Computed: true,
- },
- "location_of_device_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "views": schema.ListNestedAttribute{
- MarkdownDescription: "Configure a view record",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: "Set the name of the SNMP view",
- Computed: true,
- },
- "oids": schema.ListNestedAttribute{
- MarkdownDescription: "Configure SNMP object identifier",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.StringAttribute{
- MarkdownDescription: "Configure identifier of subtree of MIB objects",
- Computed: true,
- },
- "id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "exclude": schema.BoolAttribute{
- MarkdownDescription: "Exclude the OID",
- Computed: true,
- },
- "exclude_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "communities": schema.ListNestedAttribute{
- MarkdownDescription: "Configure SNMP community",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: "Set name of the SNMP community",
- Computed: true,
- },
- "user_label": schema.StringAttribute{
- MarkdownDescription: "Set user label of the SNMP community",
- Computed: true,
- },
- "view": schema.StringAttribute{
- MarkdownDescription: "Set name of the SNMP view",
- Computed: true,
- },
- "view_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "authorization": schema.StringAttribute{
- MarkdownDescription: "Configure access permissions",
- Computed: true,
- },
- "authorization_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "groups": schema.ListNestedAttribute{
- MarkdownDescription: "Configure an SNMP group",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: "Name of the SNMP group",
- Computed: true,
- },
- "security_level": schema.StringAttribute{
- MarkdownDescription: "Configure security level",
- Computed: true,
- },
- "view": schema.StringAttribute{
- MarkdownDescription: "Name of the SNMP view",
- Computed: true,
- },
- "view_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "users": schema.ListNestedAttribute{
- MarkdownDescription: "Configure an SNMP user",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: "Name of the SNMP user",
- Computed: true,
- },
- "authentication_protocol": schema.StringAttribute{
- MarkdownDescription: "Configure authentication protocol",
- Computed: true,
- },
- "authentication_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "authentication_password": schema.StringAttribute{
- MarkdownDescription: "Specify authentication protocol password",
- Computed: true,
- },
- "authentication_password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "privacy_protocol": schema.StringAttribute{
- MarkdownDescription: "Configure privacy protocol",
- Computed: true,
- },
- "privacy_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "privacy_password": schema.StringAttribute{
- MarkdownDescription: "Specify privacy protocol password",
- Computed: true,
- },
- "privacy_password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "group": schema.StringAttribute{
- MarkdownDescription: "Name of the SNMP group",
- Computed: true,
- },
- "group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "trap_target_servers": schema.ListNestedAttribute{
- MarkdownDescription: "Configure SNMP server to receive SNMP traps",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "vpn_id": schema.Int64Attribute{
- MarkdownDescription: "Set VPN in which SNMP server is located",
- Computed: true,
- },
- "vpn_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip": schema.StringAttribute{
- MarkdownDescription: "Set IPv4/IPv6 address of SNMP server",
- Computed: true,
- },
- "ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "port": schema.Int64Attribute{
- MarkdownDescription: "Set UDP port number to connect to SNMP server",
- Computed: true,
- },
- "port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "user_label": schema.StringAttribute{
- MarkdownDescription: "Set user label of the SNMP community",
- Computed: true,
- },
- "user": schema.StringAttribute{
- MarkdownDescription: "Set name of the SNMP user",
- Computed: true,
- },
- "user_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: "Source interface for outgoing SNMP traps",
- Computed: true,
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *SystemSNMPProfileParcelDataSource) 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 *SystemSNMPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config SystemSNMP
-
- // 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_system_snmp_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_snmp_profile_parcel_test.go
deleted file mode 100644
index 56a475352..000000000
--- a/internal/provider/data_source_sdwan_system_snmp_profile_parcel_test.go
+++ /dev/null
@@ -1,138 +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 TestAccDataSourceSdwanSystemSNMPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "contact_person", "wixie.cisco"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "location_of_device", "SHANGHAI"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "views.0.name", "VIEW1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "views.0.oids.0.id", "1.3.6.1.4.1.9.9.394"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "views.0.oids.0.exclude", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "communities.0.user_label", "COMMUNITY1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "communities.0.view", "VIEW1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "communities.0.authorization", "read-only"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "groups.0.name", "GROUP1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "groups.0.security_level", "auth-priv"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "groups.0.view", "VIEW1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "users.0.name", "USER1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "users.0.authentication_protocol", "sha"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "users.0.authentication_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "users.0.privacy_protocol", "aes-256-cfb-128"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "users.0.privacy_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "users.0.group", "GROUP1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.vpn_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.ip", "10.75.221.156"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.port", "161"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.user_label", "TARGET1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.user", "USER1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.source_interface", "GigabitEthernet1"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanSystemSNMPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanSystemSNMPProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanSystemSNMPPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanSystemSNMPProfileParcelConfig() string {
- config := `resource "sdwan_system_snmp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` contact_person = "wixie.cisco"` + "\n"
- config += ` location_of_device = "SHANGHAI"` + "\n"
- config += ` views = [{` + "\n"
- config += ` name = "VIEW1"` + "\n"
- config += ` oids = [{` + "\n"
- config += ` id = "1.3.6.1.4.1.9.9.394"` + "\n"
- config += ` exclude = false` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` communities = [{` + "\n"
- config += ` name = "example"` + "\n"
- config += ` user_label = "COMMUNITY1"` + "\n"
- config += ` view = "VIEW1"` + "\n"
- config += ` authorization = "read-only"` + "\n"
- config += ` }]` + "\n"
- config += ` groups = [{` + "\n"
- config += ` name = "GROUP1"` + "\n"
- config += ` security_level = "auth-priv"` + "\n"
- config += ` view = "VIEW1"` + "\n"
- config += ` }]` + "\n"
- config += ` users = [{` + "\n"
- config += ` name = "USER1"` + "\n"
- config += ` authentication_protocol = "sha"` + "\n"
- config += ` authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
- config += ` privacy_protocol = "aes-256-cfb-128"` + "\n"
- config += ` privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
- config += ` group = "GROUP1"` + "\n"
- config += ` }]` + "\n"
- config += ` trap_target_servers = [{` + "\n"
- config += ` vpn_id = 1` + "\n"
- config += ` ip = "10.75.221.156"` + "\n"
- config += ` port = 161` + "\n"
- config += ` user_label = "TARGET1"` + "\n"
- config += ` user = "USER1"` + "\n"
- config += ` source_interface = "GigabitEthernet1"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_system_snmp_profile_parcel" "test" {
- id = sdwan_system_snmp_profile_parcel.test.id
- feature_profile_id = sdwan_system_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_traffic_data_policy_definition.go b/internal/provider/data_source_sdwan_traffic_data_policy_definition.go
index 1857e4ddf..9a9efec48 100644
--- a/internal/provider/data_source_sdwan_traffic_data_policy_definition.go
+++ b/internal/provider/data_source_sdwan_traffic_data_policy_definition.go
@@ -132,6 +132,10 @@ func (d *TrafficDataPolicyDefinitionDataSource) Schema(ctx context.Context, req
MarkdownDescription: "DNS Application list version",
Computed: true,
},
+ "icmp_message": schema.StringAttribute{
+ MarkdownDescription: "ICMP Message",
+ Computed: true,
+ },
"dns": schema.StringAttribute{
MarkdownDescription: "DNS request or response",
Computed: true,
@@ -240,7 +244,7 @@ func (d *TrafficDataPolicyDefinitionDataSource) Schema(ctx context.Context, req
MarkdownDescription: "Loss correction packet duplication",
Computed: true,
},
- "loss_correction_fec_threshold": schema.Int64Attribute{
+ "loss_correction_fec_threshold": schema.StringAttribute{
MarkdownDescription: "Loss correction FEC threshold",
Computed: true,
},
diff --git a/internal/provider/data_source_sdwan_transport_gps_feature.go b/internal/provider/data_source_sdwan_transport_gps_feature.go
new file mode 100644
index 000000000..056d8823e
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_gps_feature.go
@@ -0,0 +1,170 @@
+// 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 = &TransportGPSProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportGPSProfileParcelDataSource{}
+)
+
+func NewTransportGPSProfileParcelDataSource() datasource.DataSource {
+ return &TransportGPSProfileParcelDataSource{}
+}
+
+type TransportGPSProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportGPSProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_gps_feature"
+}
+
+func (d *TransportGPSProfileParcelDataSource) 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 Transport GPS Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "gps_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable/disable GPS",
+ Computed: true,
+ },
+ "gps_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gps_mode": schema.StringAttribute{
+ MarkdownDescription: "Select GPS mode",
+ Computed: true,
+ },
+ "gps_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nmea_enable": schema.BoolAttribute{
+ MarkdownDescription: "Enable/disable NMEA data",
+ Computed: true,
+ },
+ "nmea_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nmea_source_address": schema.StringAttribute{
+ MarkdownDescription: "Source address",
+ Computed: true,
+ },
+ "nmea_source_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nmea_destination_address": schema.StringAttribute{
+ MarkdownDescription: "Destination address",
+ Computed: true,
+ },
+ "nmea_destination_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nmea_destination_port": schema.Int64Attribute{
+ MarkdownDescription: "Destination port",
+ Computed: true,
+ },
+ "nmea_destination_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportGPSProfileParcelDataSource) 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 *TransportGPSProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportGPS
+
+ // 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_transport_gps_feature_test.go b/internal/provider/data_source_sdwan_transport_gps_feature_test.go
new file mode 100644
index 000000000..7c8f71602
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_gps_feature_test.go
@@ -0,0 +1,89 @@
+// 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 TestAccDataSourceSdwanTransportGPSProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_gps_feature.test", "gps_enable", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_gps_feature.test", "gps_mode", "ms-based"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_gps_feature.test", "nmea_enable", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_gps_feature.test", "nmea_source_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_gps_feature.test", "nmea_destination_address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_gps_feature.test", "nmea_destination_port", "22"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportGPSPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportGPSProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportGPSPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportGPSProfileParcelConfig() string {
+ config := `resource "sdwan_transport_gps_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` gps_enable = false` + "\n"
+ config += ` gps_mode = "ms-based"` + "\n"
+ config += ` nmea_enable = false` + "\n"
+ config += ` nmea_source_address = "1.2.3.4"` + "\n"
+ config += ` nmea_destination_address = "2.3.4.5"` + "\n"
+ config += ` nmea_destination_port = 22` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_gps_feature" "test" {
+ id = sdwan_transport_gps_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_ipv6_tracker_feature.go b/internal/provider/data_source_sdwan_transport_ipv6_tracker_feature.go
new file mode 100644
index 000000000..fbbb4ffb0
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_ipv6_tracker_feature.go
@@ -0,0 +1,194 @@
+// 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 = &TransportIPv6TrackerProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportIPv6TrackerProfileParcelDataSource{}
+)
+
+func NewTransportIPv6TrackerProfileParcelDataSource() datasource.DataSource {
+ return &TransportIPv6TrackerProfileParcelDataSource{}
+}
+
+type TransportIPv6TrackerProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportIPv6TrackerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_ipv6_tracker_feature"
+}
+
+func (d *TransportIPv6TrackerProfileParcelDataSource) 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 Transport IPv6 Tracker Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: "Tracker Name",
+ Computed: true,
+ },
+ "tracker_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_api_url": schema.StringAttribute{
+ MarkdownDescription: "API url of endpoint",
+ Computed: true,
+ },
+ "endpoint_api_url_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_dns_name": schema.StringAttribute{
+ MarkdownDescription: "Endpoint DNS Name",
+ Computed: true,
+ },
+ "endpoint_dns_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_ip": schema.StringAttribute{
+ MarkdownDescription: "Endpoint IP",
+ Computed: true,
+ },
+ "endpoint_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interval": schema.Int64Attribute{
+ MarkdownDescription: "Interval",
+ Computed: true,
+ },
+ "interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: "Multiplier",
+ Computed: true,
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: "Threshold",
+ Computed: true,
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_tracker_type": schema.StringAttribute{
+ MarkdownDescription: "Endpoint Tracker Type",
+ Computed: true,
+ },
+ "endpoint_tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_type": schema.StringAttribute{
+ MarkdownDescription: "Tracker Type",
+ Computed: true,
+ },
+ "tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportIPv6TrackerProfileParcelDataSource) 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 *TransportIPv6TrackerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportIPv6Tracker
+
+ // 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_transport_ipv6_tracker_feature_test.go b/internal/provider/data_source_sdwan_transport_ipv6_tracker_feature_test.go
new file mode 100644
index 000000000..5bd1be52f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_ipv6_tracker_feature_test.go
@@ -0,0 +1,95 @@
+// 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 TestAccDataSourceSdwanTransportIPv6TrackerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "tracker_name", "TRACKER_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "endpoint_api_url", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "endpoint_dns_name", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "endpoint_ip", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "threshold", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "endpoint_tracker_type", "ipv6-interface"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_feature.test", "tracker_type", "endpoint"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportIPv6TrackerProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportIPv6TrackerProfileParcelConfig() string {
+ config := `resource "sdwan_transport_ipv6_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` tracker_name = "TRACKER_1"` + "\n"
+ config += ` endpoint_api_url = "google.com"` + "\n"
+ config += ` endpoint_dns_name = "google.com"` + "\n"
+ config += ` endpoint_ip = "2001:0:0:1::0"` + "\n"
+ config += ` interval = 30` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` threshold = 300` + "\n"
+ config += ` endpoint_tracker_type = "ipv6-interface"` + "\n"
+ config += ` tracker_type = "endpoint"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_ipv6_tracker_feature" "test" {
+ id = sdwan_transport_ipv6_tracker_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_ipv6_tracker_group_feature.go b/internal/provider/data_source_sdwan_transport_ipv6_tracker_group_feature.go
new file mode 100644
index 000000000..675630d2f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_ipv6_tracker_group_feature.go
@@ -0,0 +1,150 @@
+// 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 = &TransportIPv6TrackerGroupProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportIPv6TrackerGroupProfileParcelDataSource{}
+)
+
+func NewTransportIPv6TrackerGroupProfileParcelDataSource() datasource.DataSource {
+ return &TransportIPv6TrackerGroupProfileParcelDataSource{}
+}
+
+type TransportIPv6TrackerGroupProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportIPv6TrackerGroupProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_ipv6_tracker_group_feature"
+}
+
+func (d *TransportIPv6TrackerGroupProfileParcelDataSource) 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 Transport IPv6 Tracker Group Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: "Tracker Name",
+ Computed: true,
+ },
+ "tracker_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_elements": schema.ListNestedAttribute{
+ MarkdownDescription: "trackers ref list",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "tracker_boolean": schema.StringAttribute{
+ MarkdownDescription: "tracker ref list combine boolean and or",
+ Computed: true,
+ },
+ "tracker_boolean_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportIPv6TrackerGroupProfileParcelDataSource) 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 *TransportIPv6TrackerGroupProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportIPv6TrackerGroup
+
+ // 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_transport_ipv6_tracker_group_feature_test.go b/internal/provider/data_source_sdwan_transport_ipv6_tracker_group_feature_test.go
new file mode 100644
index 000000000..0188d8959
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_ipv6_tracker_group_feature_test.go
@@ -0,0 +1,116 @@
+// 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 TestAccDataSourceSdwanTransportIPv6TrackerGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_group_feature.test", "tracker_name", "TRACKER_GROUP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_group_feature.test", "tracker_boolean", "or"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportIPv6TrackerGroupPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportIPv6TrackerGroupProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportIPv6TrackerGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_ipv6_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+}
+
+resource "sdwan_transport_ipv6_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportIPv6TrackerGroupProfileParcelConfig() string {
+ config := `resource "sdwan_transport_ipv6_tracker_group_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` tracker_name = "TRACKER_GROUP_1"` + "\n"
+ config += ` tracker_elements = [{` + "\n"
+ config += ` tracker_id = sdwan_transport_ipv6_tracker_feature.test-1.id` + "\n"
+ config += ` }, {` + "\n"
+ config += ` tracker_id = sdwan_transport_ipv6_tracker_feature.test-2.id` + "\n"
+ config += ` }]` + "\n"
+ config += ` tracker_boolean = "or"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_ipv6_tracker_group_feature" "test" {
+ id = sdwan_transport_ipv6_tracker_group_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_ipv6_tracker_profile_parcel.go b/internal/provider/data_source_sdwan_transport_ipv6_tracker_profile_parcel.go
deleted file mode 100644
index 256503e55..000000000
--- a/internal/provider/data_source_sdwan_transport_ipv6_tracker_profile_parcel.go
+++ /dev/null
@@ -1,194 +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/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 = &TransportIPv6TrackerProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportIPv6TrackerProfileParcelDataSource{}
-)
-
-func NewTransportIPv6TrackerProfileParcelDataSource() datasource.DataSource {
- return &TransportIPv6TrackerProfileParcelDataSource{}
-}
-
-type TransportIPv6TrackerProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportIPv6TrackerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_ipv6_tracker_profile_parcel"
-}
-
-func (d *TransportIPv6TrackerProfileParcelDataSource) 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 Transport IPv6 Tracker 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,
- },
- "tracker_name": schema.StringAttribute{
- MarkdownDescription: "Tracker Name",
- Computed: true,
- },
- "tracker_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_api_url": schema.StringAttribute{
- MarkdownDescription: "API url of endpoint",
- Computed: true,
- },
- "endpoint_api_url_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_dns_name": schema.StringAttribute{
- MarkdownDescription: "Endpoint DNS Name",
- Computed: true,
- },
- "endpoint_dns_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_ip": schema.StringAttribute{
- MarkdownDescription: "Endpoint IP",
- Computed: true,
- },
- "endpoint_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interval": schema.Int64Attribute{
- MarkdownDescription: "Interval",
- Computed: true,
- },
- "interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "multiplier": schema.Int64Attribute{
- MarkdownDescription: "Multiplier",
- Computed: true,
- },
- "multiplier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "threshold": schema.Int64Attribute{
- MarkdownDescription: "Threshold",
- Computed: true,
- },
- "threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "endpoint_tracker_type": schema.StringAttribute{
- MarkdownDescription: "Endpoint Tracker Type",
- Computed: true,
- },
- "endpoint_tracker_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker_type": schema.StringAttribute{
- MarkdownDescription: "Tracker Type",
- Computed: true,
- },
- "tracker_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *TransportIPv6TrackerProfileParcelDataSource) 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 *TransportIPv6TrackerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportIPv6Tracker
-
- // 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_transport_ipv6_tracker_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_ipv6_tracker_profile_parcel_test.go
deleted file mode 100644
index 65cd15ce4..000000000
--- a/internal/provider/data_source_sdwan_transport_ipv6_tracker_profile_parcel_test.go
+++ /dev/null
@@ -1,95 +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 TestAccDataSourceSdwanTransportIPv6TrackerProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "tracker_name", "TRACKER_1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_api_url", "google.com"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_dns_name", "google.com"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_ip", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "multiplier", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "threshold", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_tracker_type", "ipv6-interface"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_ipv6_tracker_profile_parcel.test", "tracker_type", "endpoint"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportIPv6TrackerProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportIPv6TrackerProfileParcelConfig() string {
- config := `resource "sdwan_transport_ipv6_tracker_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` tracker_name = "TRACKER_1"` + "\n"
- config += ` endpoint_api_url = "google.com"` + "\n"
- config += ` endpoint_dns_name = "google.com"` + "\n"
- config += ` endpoint_ip = "2001:0:0:1::0"` + "\n"
- config += ` interval = 30` + "\n"
- config += ` multiplier = 3` + "\n"
- config += ` threshold = 300` + "\n"
- config += ` endpoint_tracker_type = "ipv6-interface"` + "\n"
- config += ` tracker_type = "endpoint"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_ipv6_tracker_profile_parcel" "test" {
- id = sdwan_transport_ipv6_tracker_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_feature.go b/internal/provider/data_source_sdwan_transport_management_vpn_feature.go
new file mode 100644
index 000000000..8fe8e50b2
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_management_vpn_feature.go
@@ -0,0 +1,304 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &TransportManagementVPNProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportManagementVPNProfileParcelDataSource{}
+)
+
+func NewTransportManagementVPNProfileParcelDataSource() datasource.DataSource {
+ return &TransportManagementVPNProfileParcelDataSource{}
+}
+
+type TransportManagementVPNProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportManagementVPNProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_feature"
+}
+
+func (d *TransportManagementVPNProfileParcelDataSource) 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 Transport Management VPN Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "vpn_description": schema.StringAttribute{
+ MarkdownDescription: "Name",
+ Computed: true,
+ },
+ "vpn_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "primary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: "Primary DNS Address (IPv4)",
+ Computed: true,
+ },
+ "primary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: "Secondary DNS Address (IPv4)",
+ Computed: true,
+ },
+ "secondary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "primary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: "Primary DNS Address (IPv6)",
+ Computed: true,
+ },
+ "primary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: "Secondary DNS Address (IPv6)",
+ Computed: true,
+ },
+ "secondary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "new_host_mappings": schema.ListNestedAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "host_name": schema.StringAttribute{
+ MarkdownDescription: "Hostname",
+ Computed: true,
+ },
+ "host_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "list_of_ip_addresses": schema.SetAttribute{
+ MarkdownDescription: "List of IP",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "list_of_ip_addresses_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Static Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gateway": schema.StringAttribute{
+ MarkdownDescription: "Gateway",
+ Computed: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Route Gateway Next Hop",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Static Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: "Prefix",
+ Computed: true,
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gateway": schema.StringAttribute{
+ MarkdownDescription: "Gateway",
+ Computed: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Route Gateway Next Hop",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "null0": schema.BoolAttribute{
+ MarkdownDescription: "IPv6 Route Gateway Next Hop",
+ Computed: true,
+ },
+ "nat": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Nat",
+ Computed: true,
+ },
+ "nat_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *TransportManagementVPNProfileParcelDataSource) 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 *TransportManagementVPNProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportManagementVPN
+
+ // 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_transport_management_vpn_feature_test.go b/internal/provider/data_source_sdwan_transport_management_vpn_feature_test.go
new file mode 100644
index 000000000..1664a4e83
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_management_vpn_feature_test.go
@@ -0,0 +1,119 @@
+// 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 TestAccDataSourceSdwanTransportManagementVPNProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "vpn_description", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "primary_dns_address_ipv4", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "secondary_dns_address_ipv4", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "new_host_mappings.0.host_name", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.gateway", "nextHop"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.prefix", "2002::/16"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.gateway", "next_hop"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportManagementVPNPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportManagementVPNProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportManagementVPNPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportManagementVPNProfileParcelConfig() string {
+ config := `resource "sdwan_transport_management_vpn_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` vpn_description = "example"` + "\n"
+ config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
+ config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
+ config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
+ config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
+ config += ` new_host_mappings = [{` + "\n"
+ config += ` host_name = "example"` + "\n"
+ config += ` list_of_ip_addresses = ["1.2.3.4"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_static_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` gateway = "nextHop"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_static_routes = [{` + "\n"
+ config += ` prefix = "2002::/16"` + "\n"
+ config += ` gateway = "next_hop"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "2001:0:0:1::1"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_management_vpn_feature" "test" {
+ id = sdwan_transport_management_vpn_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature.go b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..ee9484333
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature.go
@@ -0,0 +1,364 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &TransportManagementVPNInterfaceEthernetProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportManagementVPNInterfaceEthernetProfileParcelDataSource{}
+)
+
+func NewTransportManagementVPNInterfaceEthernetProfileParcelDataSource() datasource.DataSource {
+ return &TransportManagementVPNInterfaceEthernetProfileParcelDataSource{}
+}
+
+type TransportManagementVPNInterfaceEthernetProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_interface_ethernet_feature"
+}
+
+func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) 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 Transport Management VPN Interface Ethernet Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "transport_management_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Transport Management VPN Feature ID",
+ Required: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_configuration_type": schema.StringAttribute{
+ MarkdownDescription: "IPv4 Configuration Type",
+ Computed: true,
+ },
+ "ipv4_dhcp_distance": schema.Int64Attribute{
+ MarkdownDescription: "DHCP Distance",
+ Computed: true,
+ },
+ "ipv4_dhcp_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Secondary IpV4 Addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IpV4 Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helper": schema.SetAttribute{
+ MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "ipv4_dhcp_helper_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_iperf_server": schema.StringAttribute{
+ MarkdownDescription: "Iperf server for auto bandwidth detect",
+ Computed: true,
+ },
+ "ipv4_iperf_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_auto_detect_bandwidth": schema.BoolAttribute{
+ MarkdownDescription: "Interface auto detect bandwidth",
+ Computed: true,
+ },
+ "ipv4_auto_detect_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_configuration_type": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Configuration Type",
+ Computed: true,
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: "Enable DHCPv6",
+ Computed: true,
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address Secondary",
+ Computed: true,
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arp_entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure ARP entries",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "IPV4 Address",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC Address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: "Duplex mode",
+ Computed: true,
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC Address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU",
+ Computed: true,
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: "Set interface speed",
+ Computed: true,
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
+ Computed: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "autonegotiate": schema.BoolAttribute{
+ MarkdownDescription: "Link autonegotiation",
+ Computed: true,
+ },
+ "autonegotiate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "media_type": schema.StringAttribute{
+ MarkdownDescription: "Media type",
+ Computed: true,
+ },
+ "media_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "load_interval": schema.Int64Attribute{
+ MarkdownDescription: "Interval for interface load calculation",
+ Computed: true,
+ },
+ "load_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
+ Computed: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "IP Directed-Broadcast",
+ Computed: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) 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 *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportManagementVPNInterfaceEthernet
+
+ // 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_transport_management_vpn_interface_ethernet_feature_test.go b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature_test.go
new file mode 100644
index 000000000..679bbfd06
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_feature_test.go
@@ -0,0 +1,141 @@
+// 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 TestAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_description", "Transport Management VPN Interface Ethernet"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_iperf_server", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_auto_detect_bandwidth", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_address", "2001:0:0:1::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "tcp_mss", "505"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "speed", "2500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "autonegotiate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "media_type", "rj45"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "load_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "icmp_redirect_disable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_management_vpn_feature" "test" {
+ name = "TF_TEST_VPN"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig() string {
+ config := `resource "sdwan_transport_management_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_management_vpn_feature_id = sdwan_transport_management_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` interface_description = "Transport Management VPN Interface Ethernet"` + "\n"
+ config += ` ipv4_configuration_type = "static"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` ipv4_iperf_server = "example"` + "\n"
+ config += ` ipv4_auto_detect_bandwidth = false` + "\n"
+ config += ` ipv6_configuration_type = "static"` + "\n"
+ config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
+ config += ` arp_entries = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 505` + "\n"
+ config += ` speed = "2500"` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` autonegotiate = false` + "\n"
+ config += ` media_type = "rj45"` + "\n"
+ config += ` load_interval = 30` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_management_vpn_interface_ethernet_feature" "test" {
+ id = sdwan_transport_management_vpn_interface_ethernet_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ transport_management_vpn_feature_id = sdwan_transport_management_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index c9d6b38f6..000000000
--- a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,364 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &TransportManagementVPNInterfaceEthernetProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportManagementVPNInterfaceEthernetProfileParcelDataSource{}
-)
-
-func NewTransportManagementVPNInterfaceEthernetProfileParcelDataSource() datasource.DataSource {
- return &TransportManagementVPNInterfaceEthernetProfileParcelDataSource{}
-}
-
-type TransportManagementVPNInterfaceEthernetProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_interface_ethernet_profile_parcel"
-}
-
-func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) 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 Transport Management VPN Interface Ethernet 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,
- },
- "transport_management_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Transport Management VPN Profile Parcel ID",
- Required: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_configuration_type": schema.StringAttribute{
- MarkdownDescription: "IPv4 Configuration Type",
- Computed: true,
- },
- "ipv4_dhcp_distance": schema.Int64Attribute{
- MarkdownDescription: "DHCP Distance",
- Computed: true,
- },
- "ipv4_dhcp_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Secondary IpV4 Addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IpV4 Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
- ElementType: types.StringType,
- Computed: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_iperf_server": schema.StringAttribute{
- MarkdownDescription: "Iperf server for auto bandwidth detect",
- Computed: true,
- },
- "ipv4_iperf_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_auto_detect_bandwidth": schema.BoolAttribute{
- MarkdownDescription: "Interface auto detect bandwidth",
- Computed: true,
- },
- "ipv4_auto_detect_bandwidth_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_configuration_type": schema.StringAttribute{
- MarkdownDescription: "IPv6 Configuration Type",
- Computed: true,
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: "Enable DHCPv6",
- Computed: true,
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address Secondary",
- Computed: true,
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arp_entries": schema.ListNestedAttribute{
- MarkdownDescription: "Configure ARP entries",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: "IPV4 Address",
- Computed: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC Address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "duplex": schema.StringAttribute{
- MarkdownDescription: "Duplex mode",
- Computed: true,
- },
- "duplex_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC Address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU",
- Computed: true,
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "speed": schema.StringAttribute{
- MarkdownDescription: "Set interface speed",
- Computed: true,
- },
- "speed_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
- Computed: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "autonegotiate": schema.BoolAttribute{
- MarkdownDescription: "Link autonegotiation",
- Computed: true,
- },
- "autonegotiate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "media_type": schema.StringAttribute{
- MarkdownDescription: "Media type",
- Computed: true,
- },
- "media_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "load_interval": schema.Int64Attribute{
- MarkdownDescription: "Interval for interface load calculation",
- Computed: true,
- },
- "load_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
- Computed: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: "IP Directed-Broadcast",
- Computed: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) 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 *TransportManagementVPNInterfaceEthernetProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportManagementVPNInterfaceEthernet
-
- // 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_transport_management_vpn_interface_ethernet_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_profile_parcel_test.go
deleted file mode 100644
index a231b6dd8..000000000
--- a/internal/provider/data_source_sdwan_transport_management_vpn_interface_ethernet_profile_parcel_test.go
+++ /dev/null
@@ -1,141 +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 TestAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "interface_name", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "interface_description", "Transport Management VPN Interface Ethernet"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_iperf_server", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_auto_detect_bandwidth", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv6_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv6_address", "2001:0:0:1::/64"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "arp_entries.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "arp_entries.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "duplex", "full"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "tcp_mss", "505"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "speed", "2500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "autonegotiate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "media_type", "rj45"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "load_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "icmp_redirect_disable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_management_vpn_profile_parcel" "test" {
- name = "TF_TEST_VPN"
- feature_profile_id = sdwan_transport_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig() string {
- config := `resource "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_management_vpn_profile_parcel_id = sdwan_transport_management_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` interface_description = "Transport Management VPN Interface Ethernet"` + "\n"
- config += ` ipv4_configuration_type = "static"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` ipv4_iperf_server = "example"` + "\n"
- config += ` ipv4_auto_detect_bandwidth = false` + "\n"
- config += ` ipv6_configuration_type = "static"` + "\n"
- config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
- config += ` arp_entries = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` duplex = "full"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 505` + "\n"
- config += ` speed = "2500"` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` autonegotiate = false` + "\n"
- config += ` media_type = "rj45"` + "\n"
- config += ` load_interval = 30` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "test" {
- id = sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- transport_management_vpn_profile_parcel_id = sdwan_transport_management_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_management_vpn_profile_parcel.go b/internal/provider/data_source_sdwan_transport_management_vpn_profile_parcel.go
deleted file mode 100644
index 910d08d0f..000000000
--- a/internal/provider/data_source_sdwan_transport_management_vpn_profile_parcel.go
+++ /dev/null
@@ -1,304 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &TransportManagementVPNProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportManagementVPNProfileParcelDataSource{}
-)
-
-func NewTransportManagementVPNProfileParcelDataSource() datasource.DataSource {
- return &TransportManagementVPNProfileParcelDataSource{}
-}
-
-type TransportManagementVPNProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportManagementVPNProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_profile_parcel"
-}
-
-func (d *TransportManagementVPNProfileParcelDataSource) 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 Transport Management VPN 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,
- },
- "vpn_description": schema.StringAttribute{
- MarkdownDescription: "Name",
- Computed: true,
- },
- "vpn_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "primary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: "Primary DNS Address (IPv4)",
- Computed: true,
- },
- "primary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: "Secondary DNS Address (IPv4)",
- Computed: true,
- },
- "secondary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "primary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: "Primary DNS Address (IPv6)",
- Computed: true,
- },
- "primary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: "Secondary DNS Address (IPv6)",
- Computed: true,
- },
- "secondary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "new_host_mappings": schema.ListNestedAttribute{
- MarkdownDescription: "",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "host_name": schema.StringAttribute{
- MarkdownDescription: "Hostname",
- Computed: true,
- },
- "host_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "list_of_ip_addresses": schema.SetAttribute{
- MarkdownDescription: "List of IP",
- ElementType: types.StringType,
- Computed: true,
- },
- "list_of_ip_addresses_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Static Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gateway": schema.StringAttribute{
- MarkdownDescription: "Gateway",
- Computed: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Route Gateway Next Hop",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Static Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: "Prefix",
- Computed: true,
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gateway": schema.StringAttribute{
- MarkdownDescription: "Gateway",
- Computed: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Route Gateway Next Hop",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: "IPv6 Route Gateway Next Hop",
- Computed: true,
- },
- "nat": schema.StringAttribute{
- MarkdownDescription: "IPv6 Nat",
- Computed: true,
- },
- "nat_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *TransportManagementVPNProfileParcelDataSource) 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 *TransportManagementVPNProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportManagementVPN
-
- // 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_transport_management_vpn_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_management_vpn_profile_parcel_test.go
deleted file mode 100644
index ada8ae8db..000000000
--- a/internal/provider/data_source_sdwan_transport_management_vpn_profile_parcel_test.go
+++ /dev/null
@@ -1,121 +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 TestAccDataSourceSdwanTransportManagementVPNProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "vpn_description", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "primary_dns_address_ipv4", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "secondary_dns_address_ipv4", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "new_host_mappings.0.host_name", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.gateway", "nextHop"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.prefix", "2002::/16"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.gateway", "next_hop"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportManagementVPNPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportManagementVPNProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportManagementVPNPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportManagementVPNProfileParcelConfig() string {
- config := `resource "sdwan_transport_management_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` vpn_description = "example"` + "\n"
- config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
- config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
- config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
- config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
- config += ` new_host_mappings = [{` + "\n"
- config += ` host_name = "example"` + "\n"
- config += ` list_of_ip_addresses = ["1.2.3.4"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_static_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` gateway = "nextHop"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_static_routes = [{` + "\n"
- config += ` prefix = "2002::/16"` + "\n"
- config += ` gateway = "next_hop"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "2001:0:0:1::1"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_management_vpn_profile_parcel" "test" {
- id = sdwan_transport_management_vpn_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_route_policy_feature.go b/internal/provider/data_source_sdwan_transport_route_policy_feature.go
new file mode 100644
index 000000000..76752bd0f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_route_policy_feature.go
@@ -0,0 +1,281 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &TransportRoutePolicyProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportRoutePolicyProfileParcelDataSource{}
+)
+
+func NewTransportRoutePolicyProfileParcelDataSource() datasource.DataSource {
+ return &TransportRoutePolicyProfileParcelDataSource{}
+}
+
+type TransportRoutePolicyProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportRoutePolicyProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_route_policy_feature"
+}
+
+func (d *TransportRoutePolicyProfileParcelDataSource) 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 Transport Route Policy Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: "Default Action",
+ Computed: true,
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: "Route Policy List",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: "Sequence Id",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Sequence Name",
+ Computed: true,
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: "Base Action",
+ Computed: true,
+ },
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "protocol such as IPV4, IPV6, or BOTH",
+ Computed: true,
+ },
+ "match_entries": schema.ListNestedAttribute{
+ MarkdownDescription: "Define match conditions",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "standard_community_list_criteria": schema.StringAttribute{
+ MarkdownDescription: "Select a condition such as OR, AND or EXACT",
+ Computed: true,
+ },
+ "standard_community_lists": schema.ListNestedAttribute{
+ MarkdownDescription: "Select a standard community list",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "expanded_community_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "extended_community_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "bgp_local_preference": schema.Int64Attribute{
+ MarkdownDescription: "BGP Local Preference",
+ Computed: true,
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: "Select Metric",
+ Computed: true,
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: "Select OMP Tag",
+ Computed: true,
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: "Select OSPF Tag",
+ Computed: true,
+ },
+ "ipv4_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv6_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv6_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "actions": schema.ListNestedAttribute{
+ MarkdownDescription: "Define list of actions",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_prepend": schema.SetAttribute{
+ MarkdownDescription: "",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "community_additive": schema.BoolAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "community": schema.SetAttribute{
+ MarkdownDescription: "",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_preference": schema.Int64Attribute{
+ MarkdownDescription: "Set Local Preference",
+ Computed: true,
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: "Set Metric",
+ Computed: true,
+ },
+ "metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set Metric Type",
+ Computed: true,
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: "Set OMP Tag",
+ Computed: true,
+ },
+ "origin": schema.StringAttribute{
+ MarkdownDescription: "Set Origin",
+ Computed: true,
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF Tag",
+ Computed: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: "Set Weight",
+ Computed: true,
+ },
+ "ipv4_next_hop": schema.StringAttribute{
+ MarkdownDescription: "Set Ipv4 Next Hop",
+ Computed: true,
+ },
+ "ipv6_next_hop": schema.StringAttribute{
+ MarkdownDescription: "Set Ipv6 Next Hop",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *TransportRoutePolicyProfileParcelDataSource) 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 *TransportRoutePolicyProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportRoutePolicy
+
+ // 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_transport_route_policy_feature_test.go b/internal/provider/data_source_sdwan_transport_route_policy_feature_test.go
new file mode 100644
index 000000000..7adbe32b6
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_route_policy_feature_test.go
@@ -0,0 +1,111 @@
+// 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 TestAccDataSourceSdwanTransportRoutePolicyProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "default_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.base_action", "reject"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.protocol", "IPV4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.community_additive", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.local_preference", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.metric", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.omp_tag", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.origin", "EGP"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.ospf_tag", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.weight", "2200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.ipv4_next_hop", "10.0.0.1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportRoutePolicyPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportRoutePolicyProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportRoutePolicyPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportRoutePolicyProfileParcelConfig() string {
+ config := `resource "sdwan_transport_route_policy_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` default_action = "accept"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "reject"` + "\n"
+ config += ` protocol = "IPV4"` + "\n"
+ config += ` actions = [{` + "\n"
+ config += ` as_path_prepend = [65521]` + "\n"
+ config += ` community_additive = false` + "\n"
+ config += ` community = ["internet"]` + "\n"
+ config += ` local_preference = 100` + "\n"
+ config += ` metric = 20` + "\n"
+ config += ` metric_type = "type1"` + "\n"
+ config += ` omp_tag = 200` + "\n"
+ config += ` origin = "EGP"` + "\n"
+ config += ` ospf_tag = 1200` + "\n"
+ config += ` weight = 2200` + "\n"
+ config += ` ipv4_next_hop = "10.0.0.1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_route_policy_feature" "test" {
+ id = sdwan_transport_route_policy_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_routing_bgp_feature.go b/internal/provider/data_source_sdwan_transport_routing_bgp_feature.go
new file mode 100644
index 000000000..b11fa0515
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_bgp_feature.go
@@ -0,0 +1,822 @@
+// 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 = &TransportRoutingBGPProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportRoutingBGPProfileParcelDataSource{}
+)
+
+func NewTransportRoutingBGPProfileParcelDataSource() datasource.DataSource {
+ return &TransportRoutingBGPProfileParcelDataSource{}
+}
+
+type TransportRoutingBGPProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportRoutingBGPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_bgp_feature"
+}
+
+func (d *TransportRoutingBGPProfileParcelDataSource) 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 Transport Routing BGP Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "as_number": schema.Int64Attribute{
+ MarkdownDescription: "Set autonomous system number <1..4294967295> or ",
+ Computed: true,
+ },
+ "as_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Configure BGP router identifier",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "propagate_as_path": schema.BoolAttribute{
+ MarkdownDescription: "Propagate AS Path",
+ Computed: true,
+ },
+ "propagate_as_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "propagate_community": schema.BoolAttribute{
+ MarkdownDescription: "Propagate Community",
+ Computed: true,
+ },
+ "propagate_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "external_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: "Set administrative distance for external BGP routes",
+ Computed: true,
+ },
+ "external_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "internal_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: "Set administrative distance for internal BGP routes",
+ Computed: true,
+ },
+ "internal_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: "Set administrative distance for local BGP routes",
+ Computed: true,
+ },
+ "local_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) of keepalive messages sent to its BGP peer",
+ Computed: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
+ Computed: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "always_compare_med": schema.BoolAttribute{
+ MarkdownDescription: "Compare MEDs from all ASs when selecting active BGP paths",
+ Computed: true,
+ },
+ "always_compare_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "deterministic_med": schema.BoolAttribute{
+ MarkdownDescription: "Compare MEDs from all routes from same AS when selecting active BGP paths",
+ Computed: true,
+ },
+ "deterministic_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "missing_med_as_worst": schema.BoolAttribute{
+ MarkdownDescription: "If path has no MED, consider it to be worst path when selecting active BGP paths",
+ Computed: true,
+ },
+ "missing_med_as_worst_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "compare_router_id": schema.BoolAttribute{
+ MarkdownDescription: "Compare router IDs when selecting active BGP paths",
+ Computed: true,
+ },
+ "compare_router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "multipath_relax": schema.BoolAttribute{
+ MarkdownDescription: "Ignore AS for multipath selection",
+ Computed: true,
+ },
+ "multipath_relax_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: "Set BGP IPv4 neighbors",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Set neighbor address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Set description",
+ Computed: true,
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable a BGP neighbor",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: "Set remote autonomous system number",
+ Computed: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: "Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
+ Computed: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how often to advertise keepalive messages to BGP peer",
+ Computed: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to wait since receiving a keepalive message to consider BGP peer unavailable",
+ Computed: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: "Source interface name for BGP neighbor",
+ Computed: true,
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: "Set router to be next hop for routes advertised to neighbor",
+ Computed: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: "Send community attribute",
+ Computed: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: "Send extended community attribute",
+ Computed: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: "Set TTL value for peers that are not directly connected",
+ Computed: true,
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: "Set MD5 password on TCP connection with BGP peer",
+ Computed: true,
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_label": schema.BoolAttribute{
+ MarkdownDescription: "Send label",
+ Computed: true,
+ },
+ "explicit_null": schema.BoolAttribute{
+ MarkdownDescription: "Send explicit null label",
+ Computed: true,
+ },
+ "explicit_null_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: "Override matching AS-number while sending update",
+ Computed: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: "The number of accept as-path with my AS present in it",
+ Computed: true,
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: "Set BGP address family",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: "Set IPv4 unicast address family",
+ Computed: true,
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
+ Computed: true,
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
+ Computed: true,
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
+ Computed: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
+ Computed: true,
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv6_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: "Set BGP IPv6 neighbors",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Set IPv6 neighbor address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "Set description",
+ Computed: true,
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Enable or disable a BGP neighbor",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: "Set remote autonomous system number",
+ Computed: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: "Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
+ Computed: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) of keepalive messages sent to its BGP peer",
+ Computed: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
+ Computed: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: "Source interface name for BGP neighbor",
+ Computed: true,
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: "Set router to be next hop for routes advertised to neighbor",
+ Computed: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: "Send community attribute",
+ Computed: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: "Send extended community attribute",
+ Computed: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: "Set TTL value for peers that are not directly connected",
+ Computed: true,
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: "Set MD5 password on TCP connection with BGP peer",
+ Computed: true,
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: "Override matching AS-number while sending update",
+ Computed: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: "The number of accept as-path with my AS present in it",
+ Computed: true,
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: "Set IPv6 BGP address family",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: "Set IPv6 unicast address family",
+ Computed: true,
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
+ Computed: true,
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
+ Computed: true,
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
+ Computed: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
+ Computed: true,
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Aggregate prefixes in specific range",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: "Set AS set path information",
+ Computed: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: "Filter out more specific routes from updates",
+ Computed: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_networks": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the networks for BGP to advertise",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of parallel IBGP paths for multipath load sharing",
+ Computed: true,
+ },
+ "ipv4_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_originate": schema.BoolAttribute{
+ MarkdownDescription: "BGP Default Information Originate",
+ Computed: true,
+ },
+ "ipv4_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "ipv4_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes into BGP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol to redistribute routes from",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Aggregate prefixes in specific range",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "aggregate_prefix": schema.StringAttribute{
+ MarkdownDescription: "Configure the IPv6 prefixes to aggregate",
+ Computed: true,
+ },
+ "aggregate_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: "Set AS set path information",
+ Computed: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: "Filter out more specific routes from updates",
+ Computed: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_networks": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure the networks for BGP to advertise",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_prefix": schema.StringAttribute{
+ MarkdownDescription: "Configure the prefixes for BGP to announce",
+ Computed: true,
+ },
+ "network_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum number of parallel IBGP paths for multipath load sharing",
+ Computed: true,
+ },
+ "ipv6_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_originate": schema.BoolAttribute{
+ MarkdownDescription: "BGP Default Information Originate",
+ Computed: true,
+ },
+ "ipv6_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv6_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "ipv6_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes into BGP",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol to redistribute routes from",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "mpls_interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "MPLS BGP Interface",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Interface Name",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *TransportRoutingBGPProfileParcelDataSource) 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 *TransportRoutingBGPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportRoutingBGP
+
+ // 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_transport_routing_bgp_feature_test.go b/internal/provider/data_source_sdwan_transport_routing_bgp_feature_test.go
new file mode 100644
index 000000000..fb942cb0f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_bgp_feature_test.go
@@ -0,0 +1,239 @@
+// 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 TestAccDataSourceSdwanTransportRoutingBGPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "as_number", "429"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "propagate_as_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "propagate_community", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "external_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "internal_routes_distance", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "local_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "keepalive_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "hold_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "always_compare_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "deterministic_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "missing_med_as_worst", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "compare_router_id", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "multipath_relax", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.description", "neighbor1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.keepalive_time", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.hold_time", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.update_source_interface", "GigabitEthernet0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.next_hop_self", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.ebgp_multihop", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.send_label", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.explicit_null", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.as_override", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.allowas_in_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.family_type", "ipv4-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address", "2001::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.description", "neighbor2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.keepalive_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.hold_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.update_source_interface", "Loopback1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.next_hop_self", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.ebgp_multihop", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.as_override", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.allowas_in_number", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.family_type", "ipv6-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_networks.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_networks.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_eibgp_maximum_paths", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv4_table_map_filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.aggregate_prefix", "3001::1/128"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_networks.0.network_prefix", "2001:0DB8:0000:000b::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_eibgp_maximum_paths", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_originate", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "ipv6_table_map_filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_feature.test", "mpls_interfaces.0.interface_name", "GigabitEthernet1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportRoutingBGPProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportRoutingBGPProfileParcelConfig() string {
+ config := `resource "sdwan_transport_routing_bgp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` as_number = 429` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` propagate_as_path = false` + "\n"
+ config += ` propagate_community = false` + "\n"
+ config += ` external_routes_distance = 20` + "\n"
+ config += ` internal_routes_distance = 200` + "\n"
+ config += ` local_routes_distance = 20` + "\n"
+ config += ` keepalive_time = 60` + "\n"
+ config += ` hold_time = 180` + "\n"
+ config += ` always_compare_med = false` + "\n"
+ config += ` deterministic_med = false` + "\n"
+ config += ` missing_med_as_worst = false` + "\n"
+ config += ` compare_router_id = false` + "\n"
+ config += ` multipath_relax = false` + "\n"
+ config += ` ipv4_neighbors = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` description = "neighbor1"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 40` + "\n"
+ config += ` hold_time = 200` + "\n"
+ config += ` update_source_interface = "GigabitEthernet0"` + "\n"
+ config += ` next_hop_self = false` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 1` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` send_label = true` + "\n"
+ config += ` explicit_null = false` + "\n"
+ config += ` as_override = false` + "\n"
+ config += ` allowas_in_number = 1` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv4-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_neighbors = [{` + "\n"
+ config += ` address = "2001::1"` + "\n"
+ config += ` description = "neighbor2"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 180` + "\n"
+ config += ` hold_time = 60` + "\n"
+ config += ` update_source_interface = "Loopback1"` + "\n"
+ config += ` next_hop_self = true` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 3` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` as_override = true` + "\n"
+ config += ` allowas_in_number = 3` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv6-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_aggregate_addresses = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_networks = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_eibgp_maximum_paths = 1` + "\n"
+ config += ` ipv4_originate = false` + "\n"
+ config += ` ipv4_table_map_filter = false` + "\n"
+ config += ` ipv6_aggregate_addresses = [{` + "\n"
+ config += ` aggregate_prefix = "3001::1/128"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_networks = [{` + "\n"
+ config += ` network_prefix = "2001:0DB8:0000:000b::/64"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_eibgp_maximum_paths = 2` + "\n"
+ config += ` ipv6_originate = true` + "\n"
+ config += ` ipv6_table_map_filter = false` + "\n"
+ config += ` mpls_interfaces = [{` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_routing_bgp_feature" "test" {
+ id = sdwan_transport_routing_bgp_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_routing_bgp_profile_parcel.go b/internal/provider/data_source_sdwan_transport_routing_bgp_profile_parcel.go
deleted file mode 100644
index 5a5299c3d..000000000
--- a/internal/provider/data_source_sdwan_transport_routing_bgp_profile_parcel.go
+++ /dev/null
@@ -1,822 +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/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 = &TransportRoutingBGPProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportRoutingBGPProfileParcelDataSource{}
-)
-
-func NewTransportRoutingBGPProfileParcelDataSource() datasource.DataSource {
- return &TransportRoutingBGPProfileParcelDataSource{}
-}
-
-type TransportRoutingBGPProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportRoutingBGPProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_routing_bgp_profile_parcel"
-}
-
-func (d *TransportRoutingBGPProfileParcelDataSource) 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 Transport Routing BGP 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,
- },
- "as_number": schema.Int64Attribute{
- MarkdownDescription: "Set autonomous system number <1..4294967295> or ",
- Computed: true,
- },
- "as_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "router_id": schema.StringAttribute{
- MarkdownDescription: "Configure BGP router identifier",
- Computed: true,
- },
- "router_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "propagate_as_path": schema.BoolAttribute{
- MarkdownDescription: "Propagate AS Path",
- Computed: true,
- },
- "propagate_as_path_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "propagate_community": schema.BoolAttribute{
- MarkdownDescription: "Propagate Community",
- Computed: true,
- },
- "propagate_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "external_routes_distance": schema.Int64Attribute{
- MarkdownDescription: "Set administrative distance for external BGP routes",
- Computed: true,
- },
- "external_routes_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "internal_routes_distance": schema.Int64Attribute{
- MarkdownDescription: "Set administrative distance for internal BGP routes",
- Computed: true,
- },
- "internal_routes_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "local_routes_distance": schema.Int64Attribute{
- MarkdownDescription: "Set administrative distance for local BGP routes",
- Computed: true,
- },
- "local_routes_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "keepalive_time": schema.Int64Attribute{
- MarkdownDescription: "Interval (seconds) of keepalive messages sent to its BGP peer",
- Computed: true,
- },
- "keepalive_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "hold_time": schema.Int64Attribute{
- MarkdownDescription: "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
- Computed: true,
- },
- "hold_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "always_compare_med": schema.BoolAttribute{
- MarkdownDescription: "Compare MEDs from all ASs when selecting active BGP paths",
- Computed: true,
- },
- "always_compare_med_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "deterministic_med": schema.BoolAttribute{
- MarkdownDescription: "Compare MEDs from all routes from same AS when selecting active BGP paths",
- Computed: true,
- },
- "deterministic_med_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "missing_med_as_worst": schema.BoolAttribute{
- MarkdownDescription: "If path has no MED, consider it to be worst path when selecting active BGP paths",
- Computed: true,
- },
- "missing_med_as_worst_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "compare_router_id": schema.BoolAttribute{
- MarkdownDescription: "Compare router IDs when selecting active BGP paths",
- Computed: true,
- },
- "compare_router_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "multipath_relax": schema.BoolAttribute{
- MarkdownDescription: "Ignore AS for multipath selection",
- Computed: true,
- },
- "multipath_relax_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_neighbors": schema.ListNestedAttribute{
- MarkdownDescription: "Set BGP IPv4 neighbors",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Set neighbor address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "description": schema.StringAttribute{
- MarkdownDescription: "Set description",
- Computed: true,
- },
- "description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Enable or disable a BGP neighbor",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "remote_as": schema.Int64Attribute{
- MarkdownDescription: "Set remote autonomous system number",
- Computed: true,
- },
- "remote_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "local_as": schema.Int64Attribute{
- MarkdownDescription: "Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
- Computed: true,
- },
- "local_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "keepalive_time": schema.Int64Attribute{
- MarkdownDescription: "Set how often to advertise keepalive messages to BGP peer",
- Computed: true,
- },
- "keepalive_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "hold_time": schema.Int64Attribute{
- MarkdownDescription: "Set how long to wait since receiving a keepalive message to consider BGP peer unavailable",
- Computed: true,
- },
- "hold_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "update_source_interface": schema.StringAttribute{
- MarkdownDescription: "Source interface name for BGP neighbor",
- Computed: true,
- },
- "update_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "next_hop_self": schema.BoolAttribute{
- MarkdownDescription: "Set router to be next hop for routes advertised to neighbor",
- Computed: true,
- },
- "next_hop_self_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_community": schema.BoolAttribute{
- MarkdownDescription: "Send community attribute",
- Computed: true,
- },
- "send_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_extended_community": schema.BoolAttribute{
- MarkdownDescription: "Send extended community attribute",
- Computed: true,
- },
- "send_extended_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ebgp_multihop": schema.Int64Attribute{
- MarkdownDescription: "Set TTL value for peers that are not directly connected",
- Computed: true,
- },
- "ebgp_multihop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "password": schema.StringAttribute{
- MarkdownDescription: "Set MD5 password on TCP connection with BGP peer",
- Computed: true,
- },
- "password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_label": schema.BoolAttribute{
- MarkdownDescription: "Send label",
- Computed: true,
- },
- "explicit_null": schema.BoolAttribute{
- MarkdownDescription: "Send explicit null label",
- Computed: true,
- },
- "explicit_null_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "as_override": schema.BoolAttribute{
- MarkdownDescription: "Override matching AS-number while sending update",
- Computed: true,
- },
- "as_override_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "allowas_in_number": schema.Int64Attribute{
- MarkdownDescription: "The number of accept as-path with my AS present in it",
- Computed: true,
- },
- "allowas_in_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "address_families": schema.ListNestedAttribute{
- MarkdownDescription: "Set BGP address family",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "family_type": schema.StringAttribute{
- MarkdownDescription: "Set IPv4 unicast address family",
- Computed: true,
- },
- "max_number_of_prefixes": schema.Int64Attribute{
- MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
- Computed: true,
- },
- "max_number_of_prefixes_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "threshold": schema.Int64Attribute{
- MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
- Computed: true,
- },
- "threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "policy_type": schema.StringAttribute{
- MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
- Computed: true,
- },
- "restart_interval": schema.Int64Attribute{
- MarkdownDescription: "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
- Computed: true,
- },
- "restart_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "in_route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "out_route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "ipv6_neighbors": schema.ListNestedAttribute{
- MarkdownDescription: "Set BGP IPv6 neighbors",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Set IPv6 neighbor address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "description": schema.StringAttribute{
- MarkdownDescription: "Set description",
- Computed: true,
- },
- "description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Enable or disable a BGP neighbor",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "remote_as": schema.Int64Attribute{
- MarkdownDescription: "Set remote autonomous system number",
- Computed: true,
- },
- "remote_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "local_as": schema.Int64Attribute{
- MarkdownDescription: "Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.",
- Computed: true,
- },
- "local_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "keepalive_time": schema.Int64Attribute{
- MarkdownDescription: "Interval (seconds) of keepalive messages sent to its BGP peer",
- Computed: true,
- },
- "keepalive_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "hold_time": schema.Int64Attribute{
- MarkdownDescription: "Interval (seconds) not receiving a keepalive message declares a BGP peer down",
- Computed: true,
- },
- "hold_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "update_source_interface": schema.StringAttribute{
- MarkdownDescription: "Source interface name for BGP neighbor",
- Computed: true,
- },
- "update_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "next_hop_self": schema.BoolAttribute{
- MarkdownDescription: "Set router to be next hop for routes advertised to neighbor",
- Computed: true,
- },
- "next_hop_self_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_community": schema.BoolAttribute{
- MarkdownDescription: "Send community attribute",
- Computed: true,
- },
- "send_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "send_extended_community": schema.BoolAttribute{
- MarkdownDescription: "Send extended community attribute",
- Computed: true,
- },
- "send_extended_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ebgp_multihop": schema.Int64Attribute{
- MarkdownDescription: "Set TTL value for peers that are not directly connected",
- Computed: true,
- },
- "ebgp_multihop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "password": schema.StringAttribute{
- MarkdownDescription: "Set MD5 password on TCP connection with BGP peer",
- Computed: true,
- },
- "password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "as_override": schema.BoolAttribute{
- MarkdownDescription: "Override matching AS-number while sending update",
- Computed: true,
- },
- "as_override_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "allowas_in_number": schema.Int64Attribute{
- MarkdownDescription: "The number of accept as-path with my AS present in it",
- Computed: true,
- },
- "allowas_in_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "address_families": schema.ListNestedAttribute{
- MarkdownDescription: "Set IPv6 BGP address family",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "family_type": schema.StringAttribute{
- MarkdownDescription: "Set IPv6 unicast address family",
- Computed: true,
- },
- "max_number_of_prefixes": schema.Int64Attribute{
- MarkdownDescription: "Set maximum number of prefixes accepted from BGP peer",
- Computed: true,
- },
- "max_number_of_prefixes_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "threshold": schema.Int64Attribute{
- MarkdownDescription: "Set threshold(1 to 100) at which to generate a warning message",
- Computed: true,
- },
- "threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "policy_type": schema.StringAttribute{
- MarkdownDescription: "Neighbor received maximum prefix policy is disabled.",
- Computed: true,
- },
- "restart_interval": schema.Int64Attribute{
- MarkdownDescription: "Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded",
- Computed: true,
- },
- "restart_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "in_route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "out_route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- },
- },
- },
- "ipv4_aggregate_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Aggregate prefixes in specific range",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "as_set_path": schema.BoolAttribute{
- MarkdownDescription: "Set AS set path information",
- Computed: true,
- },
- "as_set_path_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "summary_only": schema.BoolAttribute{
- MarkdownDescription: "Filter out more specific routes from updates",
- Computed: true,
- },
- "summary_only_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_networks": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the networks for BGP to advertise",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_eibgp_maximum_paths": schema.Int64Attribute{
- MarkdownDescription: "Set maximum number of parallel IBGP paths for multipath load sharing",
- Computed: true,
- },
- "ipv4_eibgp_maximum_paths_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_originate": schema.BoolAttribute{
- MarkdownDescription: "BGP Default Information Originate",
- Computed: true,
- },
- "ipv4_originate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_table_map_route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_table_map_filter": schema.BoolAttribute{
- MarkdownDescription: "Table map filtered or not",
- Computed: true,
- },
- "ipv4_table_map_filter_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_redistributes": schema.ListNestedAttribute{
- MarkdownDescription: "Redistribute routes into BGP",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Set the protocol to redistribute routes from",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- "ipv6_aggregate_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Aggregate prefixes in specific range",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "aggregate_prefix": schema.StringAttribute{
- MarkdownDescription: "Configure the IPv6 prefixes to aggregate",
- Computed: true,
- },
- "aggregate_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "as_set_path": schema.BoolAttribute{
- MarkdownDescription: "Set AS set path information",
- Computed: true,
- },
- "as_set_path_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "summary_only": schema.BoolAttribute{
- MarkdownDescription: "Filter out more specific routes from updates",
- Computed: true,
- },
- "summary_only_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_networks": schema.ListNestedAttribute{
- MarkdownDescription: "Configure the networks for BGP to advertise",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_prefix": schema.StringAttribute{
- MarkdownDescription: "Configure the prefixes for BGP to announce",
- Computed: true,
- },
- "network_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_eibgp_maximum_paths": schema.Int64Attribute{
- MarkdownDescription: "Set maximum number of parallel IBGP paths for multipath load sharing",
- Computed: true,
- },
- "ipv6_eibgp_maximum_paths_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_originate": schema.BoolAttribute{
- MarkdownDescription: "BGP Default Information Originate",
- Computed: true,
- },
- "ipv6_originate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_table_map_route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv6_table_map_filter": schema.BoolAttribute{
- MarkdownDescription: "Table map filtered or not",
- Computed: true,
- },
- "ipv6_table_map_filter_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_redistributes": schema.ListNestedAttribute{
- MarkdownDescription: "Redistribute routes into BGP",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: "Set the protocol to redistribute routes from",
- Computed: true,
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- },
- },
- },
- "mpls_interfaces": schema.ListNestedAttribute{
- MarkdownDescription: "MPLS BGP Interface",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "Interface Name",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *TransportRoutingBGPProfileParcelDataSource) 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 *TransportRoutingBGPProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportRoutingBGP
-
- // 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_transport_routing_bgp_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_routing_bgp_profile_parcel_test.go
deleted file mode 100644
index 3b46ea685..000000000
--- a/internal/provider/data_source_sdwan_transport_routing_bgp_profile_parcel_test.go
+++ /dev/null
@@ -1,239 +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 TestAccDataSourceSdwanTransportRoutingBGPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "as_number", "429"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "router_id", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "propagate_as_path", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "propagate_community", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "external_routes_distance", "20"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "internal_routes_distance", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "local_routes_distance", "20"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "keepalive_time", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "hold_time", "180"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "always_compare_med", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "deterministic_med", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "missing_med_as_worst", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "compare_router_id", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "multipath_relax", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.description", "neighbor1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.remote_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.local_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.keepalive_time", "40"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.hold_time", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.update_source_interface", "GigabitEthernet0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.next_hop_self", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.send_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.send_extended_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.ebgp_multihop", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.send_label", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.explicit_null", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.as_override", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.allowas_in_number", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.family_type", "ipv4-unicast"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.threshold", "75"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.policy_type", "restart"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.restart_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address", "2001::1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.description", "neighbor2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.remote_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.local_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.keepalive_time", "180"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.hold_time", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.update_source_interface", "Loopback1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.next_hop_self", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.send_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.send_extended_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.ebgp_multihop", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.as_override", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.allowas_in_number", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.family_type", "ipv6-unicast"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.threshold", "75"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.policy_type", "restart"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.restart_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.network_address", "10.10.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.subnet_mask", "255.255.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.as_set_path", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.summary_only", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_networks.0.network_address", "10.10.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_networks.0.subnet_mask", "255.255.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_eibgp_maximum_paths", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_originate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_table_map_filter", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_aggregate_addresses.0.aggregate_prefix", "3001::1/128"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_aggregate_addresses.0.as_set_path", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_aggregate_addresses.0.summary_only", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_networks.0.network_prefix", "2001:0DB8:0000:000b::/64"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_eibgp_maximum_paths", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_originate", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_table_map_filter", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_bgp_profile_parcel.test", "mpls_interfaces.0.interface_name", "GigabitEthernet1"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportRoutingBGPProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportRoutingBGPProfileParcelConfig() string {
- config := `resource "sdwan_transport_routing_bgp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` as_number = 429` + "\n"
- config += ` router_id = "1.2.3.4"` + "\n"
- config += ` propagate_as_path = false` + "\n"
- config += ` propagate_community = false` + "\n"
- config += ` external_routes_distance = 20` + "\n"
- config += ` internal_routes_distance = 200` + "\n"
- config += ` local_routes_distance = 20` + "\n"
- config += ` keepalive_time = 60` + "\n"
- config += ` hold_time = 180` + "\n"
- config += ` always_compare_med = false` + "\n"
- config += ` deterministic_med = false` + "\n"
- config += ` missing_med_as_worst = false` + "\n"
- config += ` compare_router_id = false` + "\n"
- config += ` multipath_relax = false` + "\n"
- config += ` ipv4_neighbors = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` description = "neighbor1"` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` remote_as = 200` + "\n"
- config += ` local_as = 200` + "\n"
- config += ` keepalive_time = 40` + "\n"
- config += ` hold_time = 200` + "\n"
- config += ` update_source_interface = "GigabitEthernet0"` + "\n"
- config += ` next_hop_self = false` + "\n"
- config += ` send_community = true` + "\n"
- config += ` send_extended_community = true` + "\n"
- config += ` ebgp_multihop = 1` + "\n"
- config += ` password = "myPassword"` + "\n"
- config += ` send_label = true` + "\n"
- config += ` explicit_null = false` + "\n"
- config += ` as_override = false` + "\n"
- config += ` allowas_in_number = 1` + "\n"
- config += ` address_families = [{` + "\n"
- config += ` family_type = "ipv4-unicast"` + "\n"
- config += ` max_number_of_prefixes = 2000` + "\n"
- config += ` threshold = 75` + "\n"
- config += ` policy_type = "restart"` + "\n"
- config += ` restart_interval = 30` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_neighbors = [{` + "\n"
- config += ` address = "2001::1"` + "\n"
- config += ` description = "neighbor2"` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` remote_as = 200` + "\n"
- config += ` local_as = 200` + "\n"
- config += ` keepalive_time = 180` + "\n"
- config += ` hold_time = 60` + "\n"
- config += ` update_source_interface = "Loopback1"` + "\n"
- config += ` next_hop_self = true` + "\n"
- config += ` send_community = true` + "\n"
- config += ` send_extended_community = true` + "\n"
- config += ` ebgp_multihop = 3` + "\n"
- config += ` password = "myPassword"` + "\n"
- config += ` as_override = true` + "\n"
- config += ` allowas_in_number = 3` + "\n"
- config += ` address_families = [{` + "\n"
- config += ` family_type = "ipv6-unicast"` + "\n"
- config += ` max_number_of_prefixes = 2000` + "\n"
- config += ` threshold = 75` + "\n"
- config += ` policy_type = "restart"` + "\n"
- config += ` restart_interval = 30` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_aggregate_addresses = [{` + "\n"
- config += ` network_address = "10.10.0.0"` + "\n"
- config += ` subnet_mask = "255.255.0.0"` + "\n"
- config += ` as_set_path = false` + "\n"
- config += ` summary_only = false` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_networks = [{` + "\n"
- config += ` network_address = "10.10.0.0"` + "\n"
- config += ` subnet_mask = "255.255.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_eibgp_maximum_paths = 1` + "\n"
- config += ` ipv4_originate = false` + "\n"
- config += ` ipv4_table_map_filter = false` + "\n"
- config += ` ipv6_aggregate_addresses = [{` + "\n"
- config += ` aggregate_prefix = "3001::1/128"` + "\n"
- config += ` as_set_path = false` + "\n"
- config += ` summary_only = false` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_networks = [{` + "\n"
- config += ` network_prefix = "2001:0DB8:0000:000b::/64"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_eibgp_maximum_paths = 2` + "\n"
- config += ` ipv6_originate = true` + "\n"
- config += ` ipv6_table_map_filter = false` + "\n"
- config += ` mpls_interfaces = [{` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_routing_bgp_profile_parcel" "test" {
- id = sdwan_transport_routing_bgp_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_routing_ospf_feature.go b/internal/provider/data_source_sdwan_transport_routing_ospf_feature.go
new file mode 100644
index 000000000..32b981edd
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_ospf_feature.go
@@ -0,0 +1,438 @@
+// 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 = &TransportRoutingOSPFProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportRoutingOSPFProfileParcelDataSource{}
+)
+
+func NewTransportRoutingOSPFProfileParcelDataSource() datasource.DataSource {
+ return &TransportRoutingOSPFProfileParcelDataSource{}
+}
+
+type TransportRoutingOSPFProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportRoutingOSPFProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_ospf_feature"
+}
+
+func (d *TransportRoutingOSPFProfileParcelDataSource) 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 Transport Routing OSPF Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF router ID to override system IP address",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: "Set reference bandwidth method to assign OSPF cost",
+ Computed: true,
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: "Calculate summary route cost based on RFC 1583",
+ Computed: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: "Distribute default external route into OSPF",
+ Computed: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: "Always advertise default route",
+ Computed: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: "Set metric used to generate default route <0..16777214>",
+ Computed: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set default route type",
+ Computed: true,
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for external routes",
+ Computed: true,
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for inter-area routes",
+ Computed: true,
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for intra-area routes",
+ Computed: true,
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: "Set delay from first change received until performing SPF calculation",
+ Computed: true,
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set initial hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: "Enable NAT DIA for redistributed routes",
+ Computed: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "router_lsas": schema.ListNestedAttribute{
+ MarkdownDescription: "Advertise own router LSA with infinite distance",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "type": schema.StringAttribute{
+ MarkdownDescription: "Set the router LSA advertisement type",
+ Computed: true,
+ },
+ "time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to advertise maximum metric after router starts up",
+ Computed: true,
+ },
+ "time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure OSPF area",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF area number",
+ Computed: true,
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: "set the area type",
+ Computed: true,
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: "Do not inject interarea routes into STUB or NSSA",
+ Computed: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Set OSPF interface parameters",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set interface name",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval between OSPF hello packets",
+ Computed: true,
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval after which neighbor is declared to be down",
+ Computed: true,
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time between retransmitting LSAs",
+ Computed: true,
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost of OSPF interface",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "designated_router_priority": schema.Int64Attribute{
+ MarkdownDescription: "Set router’s priority to be elected as designated router",
+ Computed: true,
+ },
+ "designated_router_priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: "Set the OSPF network type",
+ Computed: true,
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface to advertise its address, but not to actively run OSPF",
+ Computed: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF interface authentication type",
+ Computed: true,
+ },
+ "authentication_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "message_digest_key_id": schema.Int64Attribute{
+ MarkdownDescription: "Set MD5 message digest key",
+ Computed: true,
+ },
+ "message_digest_key_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "message_digest_key": schema.StringAttribute{
+ MarkdownDescription: "Set MD5 authentication key",
+ Computed: true,
+ },
+ "message_digest_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: "Summarize OSPF routes at an area boundary",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost for this range",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: "Do not advertise this range",
+ Computed: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *TransportRoutingOSPFProfileParcelDataSource) 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 *TransportRoutingOSPFProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportRoutingOSPF
+
+ // 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_transport_routing_ospf_feature_test.go b/internal/provider/data_source_sdwan_transport_routing_ospf_feature_test.go
new file mode 100644
index 000000000..2fdffbb09
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_ospf_feature_test.go
@@ -0,0 +1,156 @@
+// 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 TestAccDataSourceSdwanTransportRoutingOSPFProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "router_lsas.0.type", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "router_lsas.0.time", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.no_summary", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.designated_router_priority", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.authentication_type", "message-digest"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.message_digest_key_id", "7"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportRoutingOSPFPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportRoutingOSPFProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportRoutingOSPFPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportRoutingOSPFProfileParcelConfig() string {
+ config := `resource "sdwan_transport_routing_ospf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsas = [{` + "\n"
+ config += ` type = "on-startup"` + "\n"
+ config += ` time = 5` + "\n"
+ config += ` }]` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` no_summary = false` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` designated_router_priority = 1` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "message-digest"` + "\n"
+ config += ` message_digest_key_id = 7` + "\n"
+ config += ` message_digest_key = "sdjfhsghbjdjr"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_routing_ospf_feature" "test" {
+ id = sdwan_transport_routing_ospf_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv4_feature.go b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv4_feature.go
new file mode 100644
index 000000000..e78207f32
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv4_feature.go
@@ -0,0 +1,442 @@
+// 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 = &TransportRoutingOSPFv3IPv4ProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportRoutingOSPFv3IPv4ProfileParcelDataSource{}
+)
+
+func NewTransportRoutingOSPFv3IPv4ProfileParcelDataSource() datasource.DataSource {
+ return &TransportRoutingOSPFv3IPv4ProfileParcelDataSource{}
+}
+
+type TransportRoutingOSPFv3IPv4ProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportRoutingOSPFv3IPv4ProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_ospfv3_ipv4_feature"
+}
+
+func (d *TransportRoutingOSPFv3IPv4ProfileParcelDataSource) 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 Transport Routing OSPFv3 IPv4 Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF router ID to override system IP address",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: "Distance",
+ Computed: true,
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for external routes",
+ Computed: true,
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for inter-area routes",
+ Computed: true,
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for intra-area routes",
+ Computed: true,
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: "Set reference bandwidth method to assign OSPF cost",
+ Computed: true,
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: "Calculate summary route cost based on RFC 1583",
+ Computed: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: "Distribute default external route into OSPF disabled",
+ Computed: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: "Always advertise default route",
+ Computed: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: "Set metric used to generate default route <0..16777214>",
+ Computed: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set default route metric type",
+ Computed: true,
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: "Set delay from first change received until performing SPF calculation",
+ Computed: true,
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set initial hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: "Enable NAT DIA for redistributed routes",
+ Computed: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: "Not advertise maximum metric Router LSA policy by default",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to advertise maximum metric after router boot up",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure OSPFv3 IPv4 area",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF area number",
+ Computed: true,
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: "stub area type",
+ Computed: true,
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: "Do not inject inter-area routes",
+ Computed: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: "Always translate type7 LSAs",
+ Computed: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Set OSPF interface parameters",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set interface name",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval between OSPF hello packets",
+ Computed: true,
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval after which neighbor is declared to be down",
+ Computed: true,
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time between retransmitting LSAs",
+ Computed: true,
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost of OSPF interface",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: "Set the OSPF network type",
+ Computed: true,
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface to advertise its address, but not to actively run OSPF",
+ Computed: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: "No Authentication by default",
+ Computed: true,
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ Computed: true,
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSEC key",
+ Computed: true,
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: "Summarize OSPF routes at an area boundary",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost for this range",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: "Do not advertise this range",
+ Computed: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *TransportRoutingOSPFv3IPv4ProfileParcelDataSource) 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 *TransportRoutingOSPFv3IPv4ProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportRoutingOSPFv3IPv4
+
+ // 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_transport_routing_ospfv3_ipv4_feature_test.go b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv4_feature_test.go
new file mode 100644
index 000000000..898abb3c4
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv4_feature_test.go
@@ -0,0 +1,151 @@
+// 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 TestAccDataSourceSdwanTransportRoutingOSPFv3IPv4ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "redistributes.0.protocol", "nat-route"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportRoutingOSPFv3IPv4ProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportRoutingOSPFv3IPv4ProfileParcelConfig() string {
+ config := `resource "sdwan_transport_routing_ospfv3_ipv4_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "nat-route"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_routing_ospfv3_ipv4_feature" "test" {
+ id = sdwan_transport_routing_ospfv3_ipv4_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv6_feature.go b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv6_feature.go
new file mode 100644
index 000000000..0996ad42d
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv6_feature.go
@@ -0,0 +1,426 @@
+// 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 = &TransportRoutingOSPFv3IPv6ProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportRoutingOSPFv3IPv6ProfileParcelDataSource{}
+)
+
+func NewTransportRoutingOSPFv3IPv6ProfileParcelDataSource() datasource.DataSource {
+ return &TransportRoutingOSPFv3IPv6ProfileParcelDataSource{}
+}
+
+type TransportRoutingOSPFv3IPv6ProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportRoutingOSPFv3IPv6ProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_ospfv3_ipv6_feature"
+}
+
+func (d *TransportRoutingOSPFv3IPv6ProfileParcelDataSource) 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 Transport Routing OSPFv3 IPv6 Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF router ID to override system IP address",
+ Computed: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: "Distance",
+ Computed: true,
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for external routes",
+ Computed: true,
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for inter-area routes",
+ Computed: true,
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: "Set distance for intra-area routes",
+ Computed: true,
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: "Set reference bandwidth method to assign OSPF cost",
+ Computed: true,
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: "Calculate summary route cost based on RFC 1583",
+ Computed: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: "Distribute default external route into OSPF disabled",
+ Computed: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: "Always advertise default route",
+ Computed: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: "Set metric used to generate default route <0..16777214>",
+ Computed: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: "Set default route metric type",
+ Computed: true,
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: "Set delay from first change received until performing SPF calculation",
+ Computed: true,
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set initial hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: "Set maximum hold time between consecutive SPF calculations",
+ Computed: true,
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: "Table map filtered or not",
+ Computed: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: "Redistribute routes",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: "Set the protocol",
+ Computed: true,
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: "Not advertise maximum metric Router LSA policy by default",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: "Set how long to advertise maximum metric after router boot up",
+ Computed: true,
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure OSPFv3 IPv6 area",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF area number",
+ Computed: true,
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: "stub area type",
+ Computed: true,
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: "Do not inject inter-area routes",
+ Computed: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: "Always translate type7 LSAs",
+ Computed: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: "Set OSPF interface parameters",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Set interface name",
+ Computed: true,
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval between OSPF hello packets",
+ Computed: true,
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set interval after which neighbor is declared to be down",
+ Computed: true,
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time between retransmitting LSAs",
+ Computed: true,
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost of OSPF interface",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: "Set the OSPF network type",
+ Computed: true,
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface to advertise its address, but not to actively run OSPF",
+ Computed: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: "No Authentication by default",
+ Computed: true,
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSec SPI, range 256..4294967295",
+ Computed: true,
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: "Set OSPF interface authentication IPSEC key",
+ Computed: true,
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: "Summarize OSPF routes at an area boundary",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: "IPv6 prefix,for example 2001::/64",
+ Computed: true,
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: "Set cost for this range",
+ Computed: true,
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: "Do not advertise this range",
+ Computed: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *TransportRoutingOSPFv3IPv6ProfileParcelDataSource) 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 *TransportRoutingOSPFv3IPv6ProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportRoutingOSPFv3IPv6
+
+ // 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_transport_routing_ospfv3_ipv6_feature_test.go b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv6_feature_test.go
new file mode 100644
index 000000000..43ce765d4
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_routing_ospfv3_ipv6_feature_test.go
@@ -0,0 +1,147 @@
+// 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 TestAccDataSourceSdwanTransportRoutingOSPFv3IPv6ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.prefix", "3002::/96"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportRoutingOSPFv3IPv6ProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportRoutingOSPFv3IPv6ProfileParcelConfig() string {
+ config := `resource "sdwan_transport_routing_ospfv3_ipv6_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` prefix = "3002::/96"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_routing_ospfv3_ipv6_feature" "test" {
+ id = sdwan_transport_routing_ospfv3_ipv6_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_tracker_feature.go b/internal/provider/data_source_sdwan_transport_tracker_feature.go
new file mode 100644
index 000000000..2dd28fb81
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_tracker_feature.go
@@ -0,0 +1,194 @@
+// 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 = &TransportTrackerProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportTrackerProfileParcelDataSource{}
+)
+
+func NewTransportTrackerProfileParcelDataSource() datasource.DataSource {
+ return &TransportTrackerProfileParcelDataSource{}
+}
+
+type TransportTrackerProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportTrackerProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_tracker_feature"
+}
+
+func (d *TransportTrackerProfileParcelDataSource) 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 Transport Tracker Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: "Tracker Name",
+ Computed: true,
+ },
+ "tracker_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_api_url": schema.StringAttribute{
+ MarkdownDescription: "API url of endpoint",
+ Computed: true,
+ },
+ "endpoint_api_url_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_dns_name": schema.StringAttribute{
+ MarkdownDescription: "Endpoint DNS Name",
+ Computed: true,
+ },
+ "endpoint_dns_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_ip": schema.StringAttribute{
+ MarkdownDescription: "Endpoint IP",
+ Computed: true,
+ },
+ "endpoint_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interval": schema.Int64Attribute{
+ MarkdownDescription: "Interval",
+ Computed: true,
+ },
+ "interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: "Multiplier",
+ Computed: true,
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: "Threshold",
+ Computed: true,
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "endpoint_tracker_type": schema.StringAttribute{
+ MarkdownDescription: "Endpoint Tracker Type",
+ Computed: true,
+ },
+ "endpoint_tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_type": schema.StringAttribute{
+ MarkdownDescription: "Tracker Type",
+ Computed: true,
+ },
+ "tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportTrackerProfileParcelDataSource) 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 *TransportTrackerProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportTracker
+
+ // 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_transport_tracker_feature_test.go b/internal/provider/data_source_sdwan_transport_tracker_feature_test.go
new file mode 100644
index 000000000..1601f2da2
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_tracker_feature_test.go
@@ -0,0 +1,95 @@
+// 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 TestAccDataSourceSdwanTransportTrackerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "tracker_name", "TRACKER_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "endpoint_api_url", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "endpoint_dns_name", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "endpoint_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "threshold", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "endpoint_tracker_type", "interface"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_feature.test", "tracker_type", "endpoint"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportTrackerPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportTrackerProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportTrackerPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportTrackerProfileParcelConfig() string {
+ config := `resource "sdwan_transport_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` tracker_name = "TRACKER_1"` + "\n"
+ config += ` endpoint_api_url = "google.com"` + "\n"
+ config += ` endpoint_dns_name = "google.com"` + "\n"
+ config += ` endpoint_ip = "1.2.3.4"` + "\n"
+ config += ` interval = 30` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` threshold = 300` + "\n"
+ config += ` endpoint_tracker_type = "interface"` + "\n"
+ config += ` tracker_type = "endpoint"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_tracker_feature" "test" {
+ id = sdwan_transport_tracker_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_tracker_group_feature.go b/internal/provider/data_source_sdwan_transport_tracker_group_feature.go
new file mode 100644
index 000000000..cd8dc8493
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_tracker_group_feature.go
@@ -0,0 +1,142 @@
+// 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 = &TransportTrackerGroupProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportTrackerGroupProfileParcelDataSource{}
+)
+
+func NewTransportTrackerGroupProfileParcelDataSource() datasource.DataSource {
+ return &TransportTrackerGroupProfileParcelDataSource{}
+}
+
+type TransportTrackerGroupProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportTrackerGroupProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_tracker_group_feature"
+}
+
+func (d *TransportTrackerGroupProfileParcelDataSource) 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 Transport Tracker Group Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "tracker_elements": schema.ListNestedAttribute{
+ MarkdownDescription: "tracker parcel ref list",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "tracker_boolean": schema.StringAttribute{
+ MarkdownDescription: "tracker ref list combine boolean and or",
+ Computed: true,
+ },
+ "tracker_boolean_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportTrackerGroupProfileParcelDataSource) 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 *TransportTrackerGroupProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportTrackerGroup
+
+ // 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_transport_tracker_group_feature_test.go b/internal/provider/data_source_sdwan_transport_tracker_group_feature_test.go
new file mode 100644
index 000000000..8d5c6aa84
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_tracker_group_feature_test.go
@@ -0,0 +1,114 @@
+// 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 TestAccDataSourceSdwanTransportTrackerGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_tracker_group_feature.test", "tracker_boolean", "or"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportTrackerGroupPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportTrackerGroupProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportTrackerGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "interface"
+ tracker_type = "endpoint"
+}
+
+resource "sdwan_transport_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "1.2.3.4"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "interface"
+ tracker_type = "endpoint"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportTrackerGroupProfileParcelConfig() string {
+ config := `resource "sdwan_transport_tracker_group_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` tracker_elements = [{` + "\n"
+ config += ` tracker_id = sdwan_transport_tracker_feature.test-1.id` + "\n"
+ config += ` }, {` + "\n"
+ config += ` tracker_id = sdwan_transport_tracker_feature.test-2.id` + "\n"
+ config += ` }]` + "\n"
+ config += ` tracker_boolean = "or"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_tracker_group_feature" "test" {
+ id = sdwan_transport_tracker_group_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_feature.go b/internal/provider/data_source_sdwan_transport_wan_vpn_feature.go
new file mode 100644
index 000000000..c7c562568
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_feature.go
@@ -0,0 +1,356 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &TransportWANVPNProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportWANVPNProfileParcelDataSource{}
+)
+
+func NewTransportWANVPNProfileParcelDataSource() datasource.DataSource {
+ return &TransportWANVPNProfileParcelDataSource{}
+}
+
+type TransportWANVPNProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportWANVPNProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_feature"
+}
+
+func (d *TransportWANVPNProfileParcelDataSource) 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 Transport WAN VPN Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: "VPN",
+ Computed: true,
+ },
+ "enhance_ecmp_keying": schema.BoolAttribute{
+ MarkdownDescription: "Enhance ECMP Keying",
+ Computed: true,
+ },
+ "enhance_ecmp_keying_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "primary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: "Primary DNS Address (IPv4)",
+ Computed: true,
+ },
+ "primary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: "Secondary DNS Address (IPv4)",
+ Computed: true,
+ },
+ "secondary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "primary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: "Primary DNS Address (IPv6)",
+ Computed: true,
+ },
+ "primary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "secondary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: "Secondary DNS Address (IPv6)",
+ Computed: true,
+ },
+ "secondary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "new_host_mappings": schema.ListNestedAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "host_name": schema.StringAttribute{
+ MarkdownDescription: "Hostname",
+ Computed: true,
+ },
+ "host_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "list_of_ip_addresses": schema.SetAttribute{
+ MarkdownDescription: "List of IP",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "list_of_ip_addresses_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Static Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gateway": schema.StringAttribute{
+ MarkdownDescription: "Gateway",
+ Computed: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv4 Route Gateway Next Hop",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Static Route",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: "Prefix",
+ Computed: true,
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: "IPv6 Route Gateway Next Hop",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: "Administrative distance",
+ Computed: true,
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "null0": schema.BoolAttribute{
+ MarkdownDescription: "IPv6 Route Gateway Next Hop",
+ Computed: true,
+ },
+ "nat": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Nat",
+ Computed: true,
+ },
+ "nat_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "services": schema.ListNestedAttribute{
+ MarkdownDescription: "Service",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "service_type": schema.StringAttribute{
+ MarkdownDescription: "Service Type",
+ Computed: true,
+ },
+ },
+ },
+ },
+ "nat_64_v4_pools": schema.ListNestedAttribute{
+ MarkdownDescription: "NAT64 V4 Pool",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "nat64_v4_pool_name": schema.StringAttribute{
+ MarkdownDescription: "NAT64 v4 Pool Name",
+ Computed: true,
+ },
+ "nat64_v4_pool_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat64_v4_pool_range_start": schema.StringAttribute{
+ MarkdownDescription: "NAT64 Pool Range Start",
+ Computed: true,
+ },
+ "nat64_v4_pool_range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat64_v4_pool_range_end": schema.StringAttribute{
+ MarkdownDescription: "NAT64 Pool Range End",
+ Computed: true,
+ },
+ "nat64_v4_pool_range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat64_v4_pool_overload": schema.BoolAttribute{
+ MarkdownDescription: "NAT64 Overload",
+ Computed: true,
+ },
+ "nat64_v4_pool_overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *TransportWANVPNProfileParcelDataSource) 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 *TransportWANVPNProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportWANVPN
+
+ // 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_transport_wan_vpn_feature_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_feature_test.go
new file mode 100644
index 000000000..67afa31be
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_feature_test.go
@@ -0,0 +1,133 @@
+// 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 TestAccDataSourceSdwanTransportWANVPNProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "vpn", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "enhance_ecmp_keying", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "primary_dns_address_ipv4", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "secondary_dns_address_ipv4", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "new_host_mappings.0.host_name", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv4_static_routes.0.gateway", "nextHop"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv6_static_routes.0.prefix", "2002::/16"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "services.0.service_type", "TE"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "nat_64_v4_pools.0.nat64_v4_pool_name", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "nat_64_v4_pools.0.nat64_v4_pool_range_start", "203.0.113.50"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "nat_64_v4_pools.0.nat64_v4_pool_range_end", "203.0.113.100"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_feature.test", "nat_64_v4_pools.0.nat64_v4_pool_overload", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportWANVPNPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportWANVPNPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportWANVPNProfileParcelConfig() string {
+ config := `resource "sdwan_transport_wan_vpn_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` vpn = 0` + "\n"
+ config += ` enhance_ecmp_keying = true` + "\n"
+ config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
+ config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
+ config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
+ config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
+ config += ` new_host_mappings = [{` + "\n"
+ config += ` host_name = "example"` + "\n"
+ config += ` list_of_ip_addresses = ["1.2.3.4"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_static_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` gateway = "nextHop"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_static_routes = [{` + "\n"
+ config += ` prefix = "2002::/16"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "2001:0:0:1::0"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` services = [{` + "\n"
+ config += ` service_type = "TE"` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_64_v4_pools = [{` + "\n"
+ config += ` nat64_v4_pool_name = "example"` + "\n"
+ config += ` nat64_v4_pool_range_start = "203.0.113.50"` + "\n"
+ config += ` nat64_v4_pool_range_end = "203.0.113.100"` + "\n"
+ config += ` nat64_v4_pool_overload = false` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_wan_vpn_feature" "test" {
+ id = sdwan_transport_wan_vpn_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_feature.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_feature.go
new file mode 100644
index 000000000..bc8a7edb1
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_feature.go
@@ -0,0 +1,669 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &TransportWANVPNInterfaceCellularProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceCellularProfileParcelDataSource{}
+)
+
+func NewTransportWANVPNInterfaceCellularProfileParcelDataSource() datasource.DataSource {
+ return &TransportWANVPNInterfaceCellularProfileParcelDataSource{}
+}
+
+type TransportWANVPNInterfaceCellularProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportWANVPNInterfaceCellularProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_cellular_feature"
+}
+
+func (d *TransportWANVPNInterfaceCellularProfileParcelDataSource) 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 Transport WAN VPN Interface Cellular Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Transport WAN VPN Feature ID",
+ Required: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_dhcp_helper": schema.SetAttribute{
+ MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "ipv4_dhcp_helper_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "service_provider": schema.StringAttribute{
+ MarkdownDescription: "Service Provider Name",
+ Computed: true,
+ },
+ "service_provider_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "bandwidth_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Interface upstream bandwidth capacity, in kbps",
+ Computed: true,
+ },
+ "bandwidth_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "bandwidth_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Interface downstream bandwidth capacity, in kbps",
+ Computed: true,
+ },
+ "bandwidth_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface": schema.BoolAttribute{
+ MarkdownDescription: "Tunnel Interface on/off",
+ Computed: true,
+ },
+ "per_tunnel_qos": schema.BoolAttribute{
+ MarkdownDescription: "Per-tunnel Qos",
+ Computed: true,
+ },
+ "per_tunnel_qos_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_qos_mode": schema.StringAttribute{
+ MarkdownDescription: "Set tunnel QoS mode",
+ Computed: true,
+ },
+ "tunnel_qos_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_bandwidth_percent": schema.Int64Attribute{
+ MarkdownDescription: "Tunnels Bandwidth Percent",
+ Computed: true,
+ },
+ "tunnel_bandwidth_percent_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
+ MarkdownDescription: "Bind loopback tunnel interface to a physical interface",
+ Computed: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_carrier": schema.StringAttribute{
+ MarkdownDescription: "Set carrier for TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_carrier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_color": schema.StringAttribute{
+ MarkdownDescription: "Set color for TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_color_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time period of control hello packets <100..600000> milli seconds",
+ Computed: true,
+ },
+ "tunnel_interface_hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_hello_tolerance": schema.Int64Attribute{
+ MarkdownDescription: "Set tolerance of control hello packets <12..6000> seconds",
+ Computed: true,
+ },
+ "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
+ MarkdownDescription: "Set TLOC as last resort",
+ Computed: true,
+ },
+ "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_color_restrict": schema.BoolAttribute{
+ MarkdownDescription: "Restrict this TLOC behavior",
+ Computed: true,
+ },
+ "tunnel_interface_color_restrict_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_groups": schema.Int64Attribute{
+ MarkdownDescription: "List of groups",
+ Computed: true,
+ },
+ "tunnel_interface_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_border": schema.BoolAttribute{
+ MarkdownDescription: "Set TLOC as border TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_border_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_max_control_connections": schema.Int64Attribute{
+ MarkdownDescription: "Maximum Control Connections",
+ Computed: true,
+ },
+ "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time period of nat refresh packets <1...60> seconds",
+ Computed: true,
+ },
+ "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
+ MarkdownDescription: "Put this wan interface in STUN mode only",
+ Computed: true,
+ },
+ "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
+ MarkdownDescription: "Exclude the following controller groups defined in this list.",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
+ MarkdownDescription: "Set interface preference for control connection to vManage <0..8>",
+ Computed: true,
+ },
+ "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_port_hop": schema.BoolAttribute{
+ MarkdownDescription: "Disallow port hopping on the tunnel interface",
+ Computed: true,
+ },
+ "tunnel_interface_port_hop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface as a low-bandwidth circuit",
+ Computed: true,
+ },
+ "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "Tunnel TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
+ Computed: true,
+ },
+ "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_network_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "Accept and respond to network-prefix-directed broadcasts",
+ Computed: true,
+ },
+ "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_all": schema.BoolAttribute{
+ MarkdownDescription: "Allow all traffic. Overrides all other allow-service options if allow-service all is set",
+ Computed: true,
+ },
+ "tunnel_interface_allow_all_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_bgp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/deny BGP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_dhcp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny DHCP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ntp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny NTP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ssh": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny SSH",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_dns": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny DNS",
+ Computed: true,
+ },
+ "tunnel_interface_allow_dns_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_icmp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny ICMP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_https": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny HTTPS",
+ Computed: true,
+ },
+ "tunnel_interface_allow_https_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ospf": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny OSPF",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_stun": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny STUN",
+ Computed: true,
+ },
+ "tunnel_interface_allow_stun_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_snmp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny SNMP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_netconf": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny NETCONF",
+ Computed: true,
+ },
+ "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_bfd": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny BFD",
+ Computed: true,
+ },
+ "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_encapsulations": schema.ListNestedAttribute{
+ MarkdownDescription: "Encapsulation for TLOC",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: "Encapsulation",
+ Computed: true,
+ },
+ "preference": schema.Int64Attribute{
+ MarkdownDescription: "Set preference for TLOC",
+ Computed: true,
+ },
+ "preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: "Set weight for TLOC",
+ Computed: true,
+ },
+ "weight_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "nat_ipv4": schema.BoolAttribute{
+ MarkdownDescription: "Network Address Translation on this interface",
+ Computed: true,
+ },
+ "nat_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT UDP session timeout, in minutes",
+ Computed: true,
+ },
+ "nat_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT TCP session timeout, in minutes",
+ Computed: true,
+ },
+ "nat_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive": schema.BoolAttribute{
+ MarkdownDescription: "Adaptive QoS",
+ Computed: true,
+ },
+ "qos_adaptive_period": schema.Int64Attribute{
+ MarkdownDescription: "Adapt Period(Minutes)",
+ Computed: true,
+ },
+ "qos_adaptive_period_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
+ MarkdownDescription: "Shaping Rate Upstream",
+ Computed: true,
+ },
+ "qos_adaptive_min_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Upstream min bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_min_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_max_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Upstream max bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_max_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_default_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Adaptive QoS default upstream bandwidth (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_default_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
+ MarkdownDescription: "Shaping Rate Downstream",
+ Computed: true,
+ },
+ "qos_adaptive_min_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Downstream min bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_min_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_max_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Downstream max bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_max_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_default_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Adaptive QoS default downstream bandwidth (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_default_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: "Shaping Rate (Kbps)",
+ Computed: true,
+ },
+ "qos_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure ARP entries",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "IP V4 Address",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC Address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes",
+ Computed: true,
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tloc_extension": schema.StringAttribute{
+ MarkdownDescription: "Extends a local TLOC to a remote node only for vpn 0",
+ Computed: true,
+ },
+ "tloc_extension_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker": schema.StringAttribute{
+ MarkdownDescription: "Enable tracker for this interface",
+ Computed: true,
+ },
+ "tracker_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "IP Directed-Broadcast",
+ Computed: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportWANVPNInterfaceCellularProfileParcelDataSource) 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 *TransportWANVPNInterfaceCellularProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportWANVPNInterfaceCellular
+
+ // 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_transport_wan_vpn_interface_cellular_feature_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_feature_test.go
new file mode 100644
index 000000000..9ebbe102f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_feature_test.go
@@ -0,0 +1,251 @@
+// 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 TestAccDataSourceSdwanTransportWANVPNInterfaceCellularProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "interface_name", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "interface_description", "WAN"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "service_provider", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "bandwidth_upstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "bandwidth_downstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "per_tunnel_qos", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_qos_mode", "hub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_bandwidth_percent", "82"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_bind_loopback_tunnel", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_carrier", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_color", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_hello_interval", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_hello_tolerance", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_last_resort_circuit", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_color_restrict", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_groups", "42949672"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_border", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_max_control_connections", "62"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_nat_refresh_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_vbond_as_stun_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_vmanage_connection_preference", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_port_hop", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_low_bandwidth_link", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_network_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_all", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_dhcp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_ntp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_ssh", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_dns", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_icmp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_https", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_stun", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_snmp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_netconf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_bfd", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_encapsulations.0.weight", "250"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "nat_ipv4", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "nat_udp_timeout", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "nat_tcp_timeout", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tcp_mss", "505"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tloc_extension", "tloc"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "tracker", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceCellularProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportWANVPNInterfaceCellularProfileParcelConfig() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_cellular_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` interface_description = "WAN"` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` service_provider = "example"` + "\n"
+ config += ` bandwidth_upstream = 21474836` + "\n"
+ config += ` bandwidth_downstream = 21474836` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += ` per_tunnel_qos = true` + "\n"
+ config += ` tunnel_qos_mode = "hub"` + "\n"
+ config += ` tunnel_bandwidth_percent = 82` + "\n"
+ config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
+ config += ` tunnel_interface_carrier = "default"` + "\n"
+ config += ` tunnel_interface_color = "default"` + "\n"
+ config += ` tunnel_interface_hello_interval = 1000` + "\n"
+ config += ` tunnel_interface_hello_tolerance = 12` + "\n"
+ config += ` tunnel_interface_last_resort_circuit = false` + "\n"
+ config += ` tunnel_interface_color_restrict = true` + "\n"
+ config += ` tunnel_interface_groups = 42949672` + "\n"
+ config += ` tunnel_interface_border = false` + "\n"
+ config += ` tunnel_interface_max_control_connections = 62` + "\n"
+ config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
+ config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
+ config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
+ config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
+ config += ` tunnel_interface_port_hop = true` + "\n"
+ config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
+ config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
+ config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
+ config += ` tunnel_interface_network_broadcast = false` + "\n"
+ config += ` tunnel_interface_allow_all = false` + "\n"
+ config += ` tunnel_interface_allow_bgp = false` + "\n"
+ config += ` tunnel_interface_allow_dhcp = true` + "\n"
+ config += ` tunnel_interface_allow_ntp = false` + "\n"
+ config += ` tunnel_interface_allow_ssh = false` + "\n"
+ config += ` tunnel_interface_allow_dns = true` + "\n"
+ config += ` tunnel_interface_allow_icmp = true` + "\n"
+ config += ` tunnel_interface_allow_https = true` + "\n"
+ config += ` tunnel_interface_allow_ospf = false` + "\n"
+ config += ` tunnel_interface_allow_stun = false` + "\n"
+ config += ` tunnel_interface_allow_snmp = false` + "\n"
+ config += ` tunnel_interface_allow_netconf = false` + "\n"
+ config += ` tunnel_interface_allow_bfd = false` + "\n"
+ config += ` tunnel_interface_encapsulations = [{` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = 4294967` + "\n"
+ config += ` weight = 250` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_ipv4 = true` + "\n"
+ config += ` nat_udp_timeout = 1` + "\n"
+ config += ` nat_tcp_timeout = 60` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 505` + "\n"
+ config += ` tloc_extension = "tloc"` + "\n"
+ config += ` tracker = "example"` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_wan_vpn_interface_cellular_feature" "test" {
+ id = sdwan_transport_wan_vpn_interface_cellular_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go
deleted file mode 100644
index f724e3a54..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go
+++ /dev/null
@@ -1,669 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &TransportWANVPNInterfaceCellularProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceCellularProfileParcelDataSource{}
-)
-
-func NewTransportWANVPNInterfaceCellularProfileParcelDataSource() datasource.DataSource {
- return &TransportWANVPNInterfaceCellularProfileParcelDataSource{}
-}
-
-type TransportWANVPNInterfaceCellularProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportWANVPNInterfaceCellularProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_cellular_profile_parcel"
-}
-
-func (d *TransportWANVPNInterfaceCellularProfileParcelDataSource) 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 Transport WAN VPN Interface Cellular 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Transport WAN VPN Profile Parcel ID",
- Required: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
- ElementType: types.StringType,
- Computed: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "service_provider": schema.StringAttribute{
- MarkdownDescription: "Service Provider Name",
- Computed: true,
- },
- "service_provider_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "bandwidth_upstream": schema.Int64Attribute{
- MarkdownDescription: "Interface upstream bandwidth capacity, in kbps",
- Computed: true,
- },
- "bandwidth_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "bandwidth_downstream": schema.Int64Attribute{
- MarkdownDescription: "Interface downstream bandwidth capacity, in kbps",
- Computed: true,
- },
- "bandwidth_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface": schema.BoolAttribute{
- MarkdownDescription: "Tunnel Interface on/off",
- Computed: true,
- },
- "per_tunnel_qos": schema.BoolAttribute{
- MarkdownDescription: "Per-tunnel Qos",
- Computed: true,
- },
- "per_tunnel_qos_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_qos_mode": schema.StringAttribute{
- MarkdownDescription: "Set tunnel QoS mode",
- Computed: true,
- },
- "tunnel_qos_mode_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_bandwidth_percent": schema.Int64Attribute{
- MarkdownDescription: "Tunnels Bandwidth Percent",
- Computed: true,
- },
- "tunnel_bandwidth_percent_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
- MarkdownDescription: "Bind loopback tunnel interface to a physical interface",
- Computed: true,
- },
- "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_carrier": schema.StringAttribute{
- MarkdownDescription: "Set carrier for TLOC",
- Computed: true,
- },
- "tunnel_interface_carrier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_color": schema.StringAttribute{
- MarkdownDescription: "Set color for TLOC",
- Computed: true,
- },
- "tunnel_interface_color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_hello_interval": schema.Int64Attribute{
- MarkdownDescription: "Set time period of control hello packets <100..600000> milli seconds",
- Computed: true,
- },
- "tunnel_interface_hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_hello_tolerance": schema.Int64Attribute{
- MarkdownDescription: "Set tolerance of control hello packets <12..6000> seconds",
- Computed: true,
- },
- "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
- MarkdownDescription: "Set TLOC as last resort",
- Computed: true,
- },
- "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_color_restrict": schema.BoolAttribute{
- MarkdownDescription: "Restrict this TLOC behavior",
- Computed: true,
- },
- "tunnel_interface_color_restrict_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_groups": schema.Int64Attribute{
- MarkdownDescription: "List of groups",
- Computed: true,
- },
- "tunnel_interface_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_border": schema.BoolAttribute{
- MarkdownDescription: "Set TLOC as border TLOC",
- Computed: true,
- },
- "tunnel_interface_border_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_max_control_connections": schema.Int64Attribute{
- MarkdownDescription: "Maximum Control Connections",
- Computed: true,
- },
- "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
- MarkdownDescription: "Set time period of nat refresh packets <1...60> seconds",
- Computed: true,
- },
- "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
- MarkdownDescription: "Put this wan interface in STUN mode only",
- Computed: true,
- },
- "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
- MarkdownDescription: "Exclude the following controller groups defined in this list.",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
- MarkdownDescription: "Set interface preference for control connection to vManage <0..8>",
- Computed: true,
- },
- "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_port_hop": schema.BoolAttribute{
- MarkdownDescription: "Disallow port hopping on the tunnel interface",
- Computed: true,
- },
- "tunnel_interface_port_hop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
- MarkdownDescription: "Set the interface as a low-bandwidth circuit",
- Computed: true,
- },
- "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "Tunnel TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
- Computed: true,
- },
- "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_network_broadcast": schema.BoolAttribute{
- MarkdownDescription: "Accept and respond to network-prefix-directed broadcasts",
- Computed: true,
- },
- "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_all": schema.BoolAttribute{
- MarkdownDescription: "Allow all traffic. Overrides all other allow-service options if allow-service all is set",
- Computed: true,
- },
- "tunnel_interface_allow_all_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_bgp": schema.BoolAttribute{
- MarkdownDescription: "Allow/deny BGP",
- Computed: true,
- },
- "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_dhcp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny DHCP",
- Computed: true,
- },
- "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ntp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny NTP",
- Computed: true,
- },
- "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ssh": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny SSH",
- Computed: true,
- },
- "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_dns": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny DNS",
- Computed: true,
- },
- "tunnel_interface_allow_dns_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_icmp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny ICMP",
- Computed: true,
- },
- "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_https": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny HTTPS",
- Computed: true,
- },
- "tunnel_interface_allow_https_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ospf": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny OSPF",
- Computed: true,
- },
- "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_stun": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny STUN",
- Computed: true,
- },
- "tunnel_interface_allow_stun_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_snmp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny SNMP",
- Computed: true,
- },
- "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_netconf": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny NETCONF",
- Computed: true,
- },
- "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_bfd": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny BFD",
- Computed: true,
- },
- "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_encapsulations": schema.ListNestedAttribute{
- MarkdownDescription: "Encapsulation for TLOC",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: "Encapsulation",
- Computed: true,
- },
- "preference": schema.Int64Attribute{
- MarkdownDescription: "Set preference for TLOC",
- Computed: true,
- },
- "preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "weight": schema.Int64Attribute{
- MarkdownDescription: "Set weight for TLOC",
- Computed: true,
- },
- "weight_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "nat_ipv4": schema.BoolAttribute{
- MarkdownDescription: "Network Address Translation on this interface",
- Computed: true,
- },
- "nat_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT UDP session timeout, in minutes",
- Computed: true,
- },
- "nat_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT TCP session timeout, in minutes",
- Computed: true,
- },
- "nat_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive": schema.BoolAttribute{
- MarkdownDescription: "Adaptive QoS",
- Computed: true,
- },
- "qos_adaptive_period": schema.Int64Attribute{
- MarkdownDescription: "Adapt Period(Minutes)",
- Computed: true,
- },
- "qos_adaptive_period_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
- MarkdownDescription: "Shaping Rate Upstream",
- Computed: true,
- },
- "qos_adaptive_min_upstream": schema.Int64Attribute{
- MarkdownDescription: "Upstream min bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_min_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_max_upstream": schema.Int64Attribute{
- MarkdownDescription: "Upstream max bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_max_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_default_upstream": schema.Int64Attribute{
- MarkdownDescription: "Adaptive QoS default upstream bandwidth (kbps)",
- Computed: true,
- },
- "qos_adaptive_default_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
- MarkdownDescription: "Shaping Rate Downstream",
- Computed: true,
- },
- "qos_adaptive_min_downstream": schema.Int64Attribute{
- MarkdownDescription: "Downstream min bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_min_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_max_downstream": schema.Int64Attribute{
- MarkdownDescription: "Downstream max bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_max_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_default_downstream": schema.Int64Attribute{
- MarkdownDescription: "Adaptive QoS default downstream bandwidth (kbps)",
- Computed: true,
- },
- "qos_adaptive_default_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: "Shaping Rate (Kbps)",
- Computed: true,
- },
- "qos_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: "Configure ARP entries",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: "IP V4 Address",
- Computed: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC Address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes",
- Computed: true,
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tloc_extension": schema.StringAttribute{
- MarkdownDescription: "Extends a local TLOC to a remote node only for vpn 0",
- Computed: true,
- },
- "tloc_extension_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker": schema.StringAttribute{
- MarkdownDescription: "Enable tracker for this interface",
- Computed: true,
- },
- "tracker_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: "IP Directed-Broadcast",
- Computed: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *TransportWANVPNInterfaceCellularProfileParcelDataSource) 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 *TransportWANVPNInterfaceCellularProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportWANVPNInterfaceCellular
-
- // 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_transport_wan_vpn_interface_cellular_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_profile_parcel_test.go
deleted file mode 100644
index 6789fc269..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_cellular_profile_parcel_test.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 (
- "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 TestAccDataSourceSdwanTransportWANVPNInterfaceCellularProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "interface_name", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "interface_description", "WAN"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "service_provider", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "bandwidth_upstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "bandwidth_downstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "per_tunnel_qos", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_qos_mode", "hub"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_bandwidth_percent", "82"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_bind_loopback_tunnel", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_carrier", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_color", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_hello_interval", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_hello_tolerance", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_last_resort_circuit", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_color_restrict", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_groups", "42949672"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_border", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_max_control_connections", "62"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_nat_refresh_interval", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_vbond_as_stun_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_vmanage_connection_preference", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_port_hop", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_low_bandwidth_link", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_network_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_all", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_dhcp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_ntp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_ssh", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_dns", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_icmp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_https", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_stun", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_snmp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_netconf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_bfd", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_encapsulations.0.weight", "250"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "nat_ipv4", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "nat_udp_timeout", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "nat_tcp_timeout", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tcp_mss", "505"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tloc_extension", "tloc"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tracker", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceCellularProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportWANVPNInterfaceCellularProfileParcelConfig() string {
- config := `resource "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` interface_description = "WAN"` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` service_provider = "example"` + "\n"
- config += ` bandwidth_upstream = 21474836` + "\n"
- config += ` bandwidth_downstream = 21474836` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += ` per_tunnel_qos = true` + "\n"
- config += ` tunnel_qos_mode = "hub"` + "\n"
- config += ` tunnel_bandwidth_percent = 82` + "\n"
- config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
- config += ` tunnel_interface_carrier = "default"` + "\n"
- config += ` tunnel_interface_color = "default"` + "\n"
- config += ` tunnel_interface_hello_interval = 1000` + "\n"
- config += ` tunnel_interface_hello_tolerance = 12` + "\n"
- config += ` tunnel_interface_last_resort_circuit = false` + "\n"
- config += ` tunnel_interface_color_restrict = true` + "\n"
- config += ` tunnel_interface_groups = 42949672` + "\n"
- config += ` tunnel_interface_border = false` + "\n"
- config += ` tunnel_interface_max_control_connections = 62` + "\n"
- config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
- config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
- config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
- config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
- config += ` tunnel_interface_port_hop = true` + "\n"
- config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
- config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
- config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
- config += ` tunnel_interface_network_broadcast = false` + "\n"
- config += ` tunnel_interface_allow_all = false` + "\n"
- config += ` tunnel_interface_allow_bgp = false` + "\n"
- config += ` tunnel_interface_allow_dhcp = true` + "\n"
- config += ` tunnel_interface_allow_ntp = false` + "\n"
- config += ` tunnel_interface_allow_ssh = false` + "\n"
- config += ` tunnel_interface_allow_dns = true` + "\n"
- config += ` tunnel_interface_allow_icmp = true` + "\n"
- config += ` tunnel_interface_allow_https = true` + "\n"
- config += ` tunnel_interface_allow_ospf = false` + "\n"
- config += ` tunnel_interface_allow_stun = false` + "\n"
- config += ` tunnel_interface_allow_snmp = false` + "\n"
- config += ` tunnel_interface_allow_netconf = false` + "\n"
- config += ` tunnel_interface_allow_bfd = false` + "\n"
- config += ` tunnel_interface_encapsulations = [{` + "\n"
- config += ` encapsulation = "gre"` + "\n"
- config += ` preference = 4294967` + "\n"
- config += ` weight = 250` + "\n"
- config += ` }]` + "\n"
- config += ` nat_ipv4 = true` + "\n"
- config += ` nat_udp_timeout = 1` + "\n"
- config += ` nat_tcp_timeout = 60` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 505` + "\n"
- config += ` tloc_extension = "tloc"` + "\n"
- config += ` tracker = "example"` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "test" {
- id = sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..b7824d23d
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature.go
@@ -0,0 +1,1021 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &TransportWANVPNInterfaceEthernetProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceEthernetProfileParcelDataSource{}
+)
+
+func NewTransportWANVPNInterfaceEthernetProfileParcelDataSource() datasource.DataSource {
+ return &TransportWANVPNInterfaceEthernetProfileParcelDataSource{}
+}
+
+type TransportWANVPNInterfaceEthernetProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ethernet_feature"
+}
+
+func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) 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 Transport WAN VPN Interface Ethernet Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Transport WAN VPN Feature ID",
+ Required: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_configuration_type": schema.StringAttribute{
+ MarkdownDescription: "IPv4 Configuration Type",
+ Computed: true,
+ },
+ "ipv4_dhcp_distance": schema.Int64Attribute{
+ MarkdownDescription: "DHCP Distance",
+ Computed: true,
+ },
+ "ipv4_dhcp_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "IP Address",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Secondary IpV4 Addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IpV4 Address",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "Subnet Mask",
+ Computed: true,
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helper": schema.SetAttribute{
+ MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
+ ElementType: types.StringType,
+ Computed: true,
+ },
+ "ipv4_dhcp_helper_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_configuration_type": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Configuration Type",
+ Computed: true,
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: "Enable DHCPv6",
+ Computed: true,
+ },
+ "ipv6_dhcp_secondary_address": schema.ListNestedAttribute{
+ MarkdownDescription: "secondary IPv6 addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address Secondary",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address Secondary",
+ Computed: true,
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: "Static secondary IPv6 addresses",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: "IPv6 Address Secondary",
+ Computed: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "iperf_server": schema.StringAttribute{
+ MarkdownDescription: "Iperf server for auto bandwidth detect",
+ Computed: true,
+ },
+ "iperf_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "block_non_source_ip": schema.BoolAttribute{
+ MarkdownDescription: "Block packets originating from IP address that is not from this source",
+ Computed: true,
+ },
+ "block_non_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "service_provider": schema.StringAttribute{
+ MarkdownDescription: "Service Provider Name",
+ Computed: true,
+ },
+ "service_provider_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "bandwidth_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Interface upstream bandwidth capacity, in kbps",
+ Computed: true,
+ },
+ "bandwidth_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "bandwidth_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Interface downstream bandwidth capacity, in kbps",
+ Computed: true,
+ },
+ "bandwidth_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "auto_detect_bandwidth": schema.BoolAttribute{
+ MarkdownDescription: "Interface auto detect bandwidth",
+ Computed: true,
+ },
+ "auto_detect_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface": schema.BoolAttribute{
+ MarkdownDescription: "Tunnel Interface on/off",
+ Computed: true,
+ },
+ "per_tunnel_qos": schema.BoolAttribute{
+ MarkdownDescription: "Per-tunnel Qos",
+ Computed: true,
+ },
+ "per_tunnel_qos_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_qos_mode": schema.StringAttribute{
+ MarkdownDescription: "Set tunnel QoS mode",
+ Computed: true,
+ },
+ "tunnel_qos_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_bandwidth_percent": schema.Int64Attribute{
+ MarkdownDescription: "Tunnels Bandwidth Percent",
+ Computed: true,
+ },
+ "tunnel_bandwidth_percent_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
+ MarkdownDescription: "Bind loopback tunnel interface to a physical interface",
+ Computed: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_carrier": schema.StringAttribute{
+ MarkdownDescription: "Set carrier for TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_carrier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_color": schema.StringAttribute{
+ MarkdownDescription: "Set color for TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_color_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time period of control hello packets <100..600000> milli seconds",
+ Computed: true,
+ },
+ "tunnel_interface_hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_hello_tolerance": schema.Int64Attribute{
+ MarkdownDescription: "Set tolerance of control hello packets <12..6000> seconds",
+ Computed: true,
+ },
+ "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
+ MarkdownDescription: "Set TLOC as last resort",
+ Computed: true,
+ },
+ "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_gre_tunnel_destination_ip": schema.StringAttribute{
+ MarkdownDescription: "GRE tunnel destination IP",
+ Computed: true,
+ },
+ "tunnel_interface_gre_tunnel_destination_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_color_restrict": schema.BoolAttribute{
+ MarkdownDescription: "Restrict this TLOC behavior",
+ Computed: true,
+ },
+ "tunnel_interface_color_restrict_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_groups": schema.Int64Attribute{
+ MarkdownDescription: "List of groups",
+ Computed: true,
+ },
+ "tunnel_interface_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_border": schema.BoolAttribute{
+ MarkdownDescription: "Set TLOC as border TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_border_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_max_control_connections": schema.Int64Attribute{
+ MarkdownDescription: "Maximum Control Connections",
+ Computed: true,
+ },
+ "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time period of nat refresh packets <1...60> seconds",
+ Computed: true,
+ },
+ "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
+ MarkdownDescription: "Put this wan interface in STUN mode only",
+ Computed: true,
+ },
+ "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
+ MarkdownDescription: "Exclude the following controller groups defined in this list.",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
+ MarkdownDescription: "Set interface preference for control connection to vManage <0..8>",
+ Computed: true,
+ },
+ "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_port_hop": schema.BoolAttribute{
+ MarkdownDescription: "Disallow port hopping on the tunnel interface",
+ Computed: true,
+ },
+ "tunnel_interface_port_hop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface as a low-bandwidth circuit",
+ Computed: true,
+ },
+ "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "Tunnel TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
+ Computed: true,
+ },
+ "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_cts_sgt_propagation": schema.BoolAttribute{
+ MarkdownDescription: "CTS SGT Propagation configuration",
+ Computed: true,
+ },
+ "tunnel_interface_cts_sgt_propagation_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_network_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "Accept and respond to network-prefix-directed broadcasts",
+ Computed: true,
+ },
+ "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_all": schema.BoolAttribute{
+ MarkdownDescription: "Allow all traffic. Overrides all other allow-service options if allow-service all is set",
+ Computed: true,
+ },
+ "tunnel_interface_allow_all_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_bgp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/deny BGP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_dhcp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny DHCP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ntp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny NTP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ssh": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny SSH",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_dns": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny DNS",
+ Computed: true,
+ },
+ "tunnel_interface_allow_dns_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_icmp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny ICMP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_https": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny HTTPS",
+ Computed: true,
+ },
+ "tunnel_interface_allow_https_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ospf": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny OSPF",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_stun": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny STUN",
+ Computed: true,
+ },
+ "tunnel_interface_allow_stun_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_snmp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny SNMP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_netconf": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny NETCONF",
+ Computed: true,
+ },
+ "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_bfd": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny BFD",
+ Computed: true,
+ },
+ "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_encapsulations": schema.ListNestedAttribute{
+ MarkdownDescription: "Encapsulation for TLOC",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: "Encapsulation",
+ Computed: true,
+ },
+ "preference": schema.Int64Attribute{
+ MarkdownDescription: "Set preference for TLOC",
+ Computed: true,
+ },
+ "preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: "Set weight for TLOC",
+ Computed: true,
+ },
+ "weight_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "nat_ipv4": schema.BoolAttribute{
+ MarkdownDescription: "enable Network Address Translation on this interface",
+ Computed: true,
+ },
+ "nat_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_type": schema.StringAttribute{
+ MarkdownDescription: "NAT Type",
+ Computed: true,
+ },
+ "nat_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_range_start": schema.StringAttribute{
+ MarkdownDescription: "NAT Pool Range Start",
+ Computed: true,
+ },
+ "nat_range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_range_end": schema.StringAttribute{
+ MarkdownDescription: "NAT Pool Range End",
+ Computed: true,
+ },
+ "nat_range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: "NAT Pool Prefix Length",
+ Computed: true,
+ },
+ "nat_prefix_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_overload": schema.BoolAttribute{
+ MarkdownDescription: "NAT Overload",
+ Computed: true,
+ },
+ "nat_overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_loopback": schema.StringAttribute{
+ MarkdownDescription: "NAT Inside Source Loopback Interface",
+ Computed: true,
+ },
+ "nat_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT UDP session timeout, in minutes",
+ Computed: true,
+ },
+ "nat_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Set NAT TCP session timeout, in minutes",
+ Computed: true,
+ },
+ "nat_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "new_static_nats": schema.ListNestedAttribute{
+ MarkdownDescription: "static NAT",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: "Source IP address to be translated",
+ Computed: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "translated_ip": schema.StringAttribute{
+ MarkdownDescription: "Statically translated source IP address",
+ Computed: true,
+ },
+ "translated_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "direction": schema.StringAttribute{
+ MarkdownDescription: "Direction of static NAT translation",
+ Computed: true,
+ },
+ "source_vpn": schema.Int64Attribute{
+ MarkdownDescription: "Source VPN ID",
+ Computed: true,
+ },
+ "source_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "nat_ipv6": schema.BoolAttribute{
+ MarkdownDescription: "enable Network Address Translation ipv6 on this interface",
+ Computed: true,
+ },
+ "nat_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "nat64": schema.BoolAttribute{
+ MarkdownDescription: "NAT64 on this interface",
+ Computed: true,
+ },
+ "nat66": schema.BoolAttribute{
+ MarkdownDescription: "NAT66 on this interface",
+ Computed: true,
+ },
+ "static_nat66": schema.ListNestedAttribute{
+ MarkdownDescription: "static NAT66",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_prefix": schema.StringAttribute{
+ MarkdownDescription: "Source Prefix",
+ Computed: true,
+ },
+ "source_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "translated_source_prefix": schema.StringAttribute{
+ MarkdownDescription: "Translated Source Prefix",
+ Computed: true,
+ },
+ "translated_source_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "source_vpn_id": schema.Int64Attribute{
+ MarkdownDescription: "Source VPN ID",
+ Computed: true,
+ },
+ "source_vpn_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "qos_adaptive": schema.BoolAttribute{
+ MarkdownDescription: "Adaptive QoS",
+ Computed: true,
+ },
+ "qos_adaptive_period": schema.Int64Attribute{
+ MarkdownDescription: "Adapt Period(Minutes)",
+ Computed: true,
+ },
+ "qos_adaptive_period_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
+ MarkdownDescription: "Shaping Rate Upstream",
+ Computed: true,
+ },
+ "qos_adaptive_min_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Upstream min bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_min_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_max_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Upstream max bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_max_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_default_upstream": schema.Int64Attribute{
+ MarkdownDescription: "Adaptive QoS default upstream bandwidth (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_default_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
+ MarkdownDescription: "Shaping Rate Downstream",
+ Computed: true,
+ },
+ "qos_adaptive_min_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Downstream min bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_min_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_max_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Downstream max bandwidth limit (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_max_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_adaptive_default_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Adaptive QoS default downstream bandwidth (kbps)",
+ Computed: true,
+ },
+ "qos_adaptive_default_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "qos_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: "Shaping Rate (Kbps)",
+ Computed: true,
+ },
+ "qos_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: "Configure ARP entries",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: "IP V4 Address",
+ Computed: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC Address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
+ Computed: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: "Duplex mode",
+ Computed: true,
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: "MAC Address",
+ Computed: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes",
+ Computed: true,
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: "Set interface speed",
+ Computed: true,
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
+ Computed: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "autonegotiate": schema.BoolAttribute{
+ MarkdownDescription: "Link autonegotiation",
+ Computed: true,
+ },
+ "autonegotiate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "media_type": schema.StringAttribute{
+ MarkdownDescription: "Media type",
+ Computed: true,
+ },
+ "media_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tloc_extension": schema.StringAttribute{
+ MarkdownDescription: "Extends a local TLOC to a remote node only for vpn 0",
+ Computed: true,
+ },
+ "tloc_extension_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "gre_tunnel_source_ip": schema.StringAttribute{
+ MarkdownDescription: "GRE tunnel source IP",
+ Computed: true,
+ },
+ "gre_tunnel_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "xconnect": schema.StringAttribute{
+ MarkdownDescription: "Extend remote TLOC over a GRE tunnel to a local WAN interface",
+ Computed: true,
+ },
+ "xconnect_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "load_interval": schema.Int64Attribute{
+ MarkdownDescription: "Interval for interface load calculation",
+ Computed: true,
+ },
+ "load_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker": schema.StringAttribute{
+ MarkdownDescription: "Enable tracker for this interface",
+ Computed: true,
+ },
+ "tracker_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "IP Directed-Broadcast",
+ Computed: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) 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 *TransportWANVPNInterfaceEthernetProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportWANVPNInterfaceEthernet
+
+ // 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_transport_wan_vpn_interface_ethernet_feature_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go
new file mode 100644
index 000000000..1b684b260
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go
@@ -0,0 +1,321 @@
+// 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 TestAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_description", "WAN"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "iperf_server", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "block_non_source_ip", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "service_provider", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "bandwidth_upstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "bandwidth_downstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "auto_detect_bandwidth", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "per_tunnel_qos", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_qos_mode", "hub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_bandwidth_percent", "82"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_bind_loopback_tunnel", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_carrier", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_color", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_hello_interval", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_hello_tolerance", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_last_resort_circuit", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_gre_tunnel_destination_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_color_restrict", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_groups", "42949672"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_border", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_max_control_connections", "62"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_nat_refresh_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_vbond_as_stun_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_vmanage_connection_preference", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_port_hop", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_low_bandwidth_link", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_cts_sgt_propagation", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_network_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_all", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_dhcp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_ntp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_ssh", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_dns", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_icmp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_https", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_stun", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_snmp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_netconf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_bfd", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_encapsulations.0.weight", "250"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_ipv4", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_type", "interface"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_udp_timeout", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_tcp_timeout", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.translated_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.source_vpn", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_ipv6", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat64", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat66", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "static_nat66.0.source_prefix", "2001:0db8:85a3::/48"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "static_nat66.0.translated_source_prefix", "abcd:1234:5678::/48"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "static_nat66.0.source_vpn_id", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "icmp_redirect_disable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tcp_mss", "505"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "speed", "2500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "autonegotiate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "media_type", "rj45"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tloc_extension", "tloc"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "gre_tunnel_source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "xconnect", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "load_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tracker", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` interface_description = "WAN"` + "\n"
+ config += ` ipv4_configuration_type = "static"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` ipv6_configuration_type = "static"` + "\n"
+ config += ` iperf_server = "example"` + "\n"
+ config += ` block_non_source_ip = false` + "\n"
+ config += ` service_provider = "example"` + "\n"
+ config += ` bandwidth_upstream = 21474836` + "\n"
+ config += ` bandwidth_downstream = 21474836` + "\n"
+ config += ` auto_detect_bandwidth = false` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += ` per_tunnel_qos = true` + "\n"
+ config += ` tunnel_qos_mode = "hub"` + "\n"
+ config += ` tunnel_bandwidth_percent = 82` + "\n"
+ config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
+ config += ` tunnel_interface_carrier = "default"` + "\n"
+ config += ` tunnel_interface_color = "default"` + "\n"
+ config += ` tunnel_interface_hello_interval = 1000` + "\n"
+ config += ` tunnel_interface_hello_tolerance = 12` + "\n"
+ config += ` tunnel_interface_last_resort_circuit = false` + "\n"
+ config += ` tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"` + "\n"
+ config += ` tunnel_interface_color_restrict = true` + "\n"
+ config += ` tunnel_interface_groups = 42949672` + "\n"
+ config += ` tunnel_interface_border = false` + "\n"
+ config += ` tunnel_interface_max_control_connections = 62` + "\n"
+ config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
+ config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
+ config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
+ config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
+ config += ` tunnel_interface_port_hop = true` + "\n"
+ config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
+ config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
+ config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
+ config += ` tunnel_interface_cts_sgt_propagation = false` + "\n"
+ config += ` tunnel_interface_network_broadcast = false` + "\n"
+ config += ` tunnel_interface_allow_all = false` + "\n"
+ config += ` tunnel_interface_allow_bgp = false` + "\n"
+ config += ` tunnel_interface_allow_dhcp = true` + "\n"
+ config += ` tunnel_interface_allow_ntp = false` + "\n"
+ config += ` tunnel_interface_allow_ssh = false` + "\n"
+ config += ` tunnel_interface_allow_dns = true` + "\n"
+ config += ` tunnel_interface_allow_icmp = true` + "\n"
+ config += ` tunnel_interface_allow_https = true` + "\n"
+ config += ` tunnel_interface_allow_ospf = false` + "\n"
+ config += ` tunnel_interface_allow_stun = false` + "\n"
+ config += ` tunnel_interface_allow_snmp = false` + "\n"
+ config += ` tunnel_interface_allow_netconf = false` + "\n"
+ config += ` tunnel_interface_allow_bfd = false` + "\n"
+ config += ` tunnel_interface_encapsulations = [{` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = 4294967` + "\n"
+ config += ` weight = 250` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_ipv4 = true` + "\n"
+ config += ` nat_type = "interface"` + "\n"
+ config += ` nat_udp_timeout = 1` + "\n"
+ config += ` nat_tcp_timeout = 60` + "\n"
+ config += ` new_static_nats = [{` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translated_ip = "2.3.4.5"` + "\n"
+ config += ` direction = "inside"` + "\n"
+ config += ` source_vpn = 3` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_ipv6 = true` + "\n"
+ config += ` nat64 = false` + "\n"
+ config += ` nat66 = true` + "\n"
+ config += ` static_nat66 = [{` + "\n"
+ config += ` source_prefix = "2001:0db8:85a3::/48"` + "\n"
+ config += ` translated_source_prefix = "abcd:1234:5678::/48"` + "\n"
+ config += ` source_vpn_id = 4` + "\n"
+ config += ` }]` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 505` + "\n"
+ config += ` speed = "2500"` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` autonegotiate = false` + "\n"
+ config += ` media_type = "rj45"` + "\n"
+ config += ` tloc_extension = "tloc"` + "\n"
+ config += ` gre_tunnel_source_ip = "1.2.3.4"` + "\n"
+ config += ` xconnect = "example"` + "\n"
+ config += ` load_interval = 30` + "\n"
+ config += ` tracker = "example"` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_wan_vpn_interface_ethernet_feature" "test" {
+ id = sdwan_transport_wan_vpn_interface_ethernet_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index 2ada5958f..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,1021 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &TransportWANVPNInterfaceEthernetProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceEthernetProfileParcelDataSource{}
-)
-
-func NewTransportWANVPNInterfaceEthernetProfileParcelDataSource() datasource.DataSource {
- return &TransportWANVPNInterfaceEthernetProfileParcelDataSource{}
-}
-
-type TransportWANVPNInterfaceEthernetProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ethernet_profile_parcel"
-}
-
-func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) 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 Transport WAN VPN Interface Ethernet 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Transport WAN VPN Profile Parcel ID",
- Required: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_configuration_type": schema.StringAttribute{
- MarkdownDescription: "IPv4 Configuration Type",
- Computed: true,
- },
- "ipv4_dhcp_distance": schema.Int64Attribute{
- MarkdownDescription: "DHCP Distance",
- Computed: true,
- },
- "ipv4_dhcp_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Secondary IpV4 Addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IpV4 Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: "List of DHCP IPv4 helper addresses (min 1, max 8)",
- ElementType: types.StringType,
- Computed: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_configuration_type": schema.StringAttribute{
- MarkdownDescription: "IPv6 Configuration Type",
- Computed: true,
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: "Enable DHCPv6",
- Computed: true,
- },
- "ipv6_dhcp_secondary_address": schema.ListNestedAttribute{
- MarkdownDescription: "secondary IPv6 addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address Secondary",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address Secondary",
- Computed: true,
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: "Static secondary IPv6 addresses",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "IPv6 Address Secondary",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "iperf_server": schema.StringAttribute{
- MarkdownDescription: "Iperf server for auto bandwidth detect",
- Computed: true,
- },
- "iperf_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "block_non_source_ip": schema.BoolAttribute{
- MarkdownDescription: "Block packets originating from IP address that is not from this source",
- Computed: true,
- },
- "block_non_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "service_provider": schema.StringAttribute{
- MarkdownDescription: "Service Provider Name",
- Computed: true,
- },
- "service_provider_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "bandwidth_upstream": schema.Int64Attribute{
- MarkdownDescription: "Interface upstream bandwidth capacity, in kbps",
- Computed: true,
- },
- "bandwidth_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "bandwidth_downstream": schema.Int64Attribute{
- MarkdownDescription: "Interface downstream bandwidth capacity, in kbps",
- Computed: true,
- },
- "bandwidth_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "auto_detect_bandwidth": schema.BoolAttribute{
- MarkdownDescription: "Interface auto detect bandwidth",
- Computed: true,
- },
- "auto_detect_bandwidth_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface": schema.BoolAttribute{
- MarkdownDescription: "Tunnel Interface on/off",
- Computed: true,
- },
- "per_tunnel_qos": schema.BoolAttribute{
- MarkdownDescription: "Per-tunnel Qos",
- Computed: true,
- },
- "per_tunnel_qos_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_qos_mode": schema.StringAttribute{
- MarkdownDescription: "Set tunnel QoS mode",
- Computed: true,
- },
- "tunnel_qos_mode_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_bandwidth_percent": schema.Int64Attribute{
- MarkdownDescription: "Tunnels Bandwidth Percent",
- Computed: true,
- },
- "tunnel_bandwidth_percent_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
- MarkdownDescription: "Bind loopback tunnel interface to a physical interface",
- Computed: true,
- },
- "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_carrier": schema.StringAttribute{
- MarkdownDescription: "Set carrier for TLOC",
- Computed: true,
- },
- "tunnel_interface_carrier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_color": schema.StringAttribute{
- MarkdownDescription: "Set color for TLOC",
- Computed: true,
- },
- "tunnel_interface_color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_hello_interval": schema.Int64Attribute{
- MarkdownDescription: "Set time period of control hello packets <100..600000> milli seconds",
- Computed: true,
- },
- "tunnel_interface_hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_hello_tolerance": schema.Int64Attribute{
- MarkdownDescription: "Set tolerance of control hello packets <12..6000> seconds",
- Computed: true,
- },
- "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
- MarkdownDescription: "Set TLOC as last resort",
- Computed: true,
- },
- "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_gre_tunnel_destination_ip": schema.StringAttribute{
- MarkdownDescription: "GRE tunnel destination IP",
- Computed: true,
- },
- "tunnel_interface_gre_tunnel_destination_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_color_restrict": schema.BoolAttribute{
- MarkdownDescription: "Restrict this TLOC behavior",
- Computed: true,
- },
- "tunnel_interface_color_restrict_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_groups": schema.Int64Attribute{
- MarkdownDescription: "List of groups",
- Computed: true,
- },
- "tunnel_interface_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_border": schema.BoolAttribute{
- MarkdownDescription: "Set TLOC as border TLOC",
- Computed: true,
- },
- "tunnel_interface_border_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_max_control_connections": schema.Int64Attribute{
- MarkdownDescription: "Maximum Control Connections",
- Computed: true,
- },
- "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
- MarkdownDescription: "Set time period of nat refresh packets <1...60> seconds",
- Computed: true,
- },
- "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
- MarkdownDescription: "Put this wan interface in STUN mode only",
- Computed: true,
- },
- "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
- MarkdownDescription: "Exclude the following controller groups defined in this list.",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
- MarkdownDescription: "Set interface preference for control connection to vManage <0..8>",
- Computed: true,
- },
- "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_port_hop": schema.BoolAttribute{
- MarkdownDescription: "Disallow port hopping on the tunnel interface",
- Computed: true,
- },
- "tunnel_interface_port_hop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
- MarkdownDescription: "Set the interface as a low-bandwidth circuit",
- Computed: true,
- },
- "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "Tunnel TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
- Computed: true,
- },
- "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_cts_sgt_propagation": schema.BoolAttribute{
- MarkdownDescription: "CTS SGT Propagation configuration",
- Computed: true,
- },
- "tunnel_interface_cts_sgt_propagation_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_network_broadcast": schema.BoolAttribute{
- MarkdownDescription: "Accept and respond to network-prefix-directed broadcasts",
- Computed: true,
- },
- "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_all": schema.BoolAttribute{
- MarkdownDescription: "Allow all traffic. Overrides all other allow-service options if allow-service all is set",
- Computed: true,
- },
- "tunnel_interface_allow_all_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_bgp": schema.BoolAttribute{
- MarkdownDescription: "Allow/deny BGP",
- Computed: true,
- },
- "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_dhcp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny DHCP",
- Computed: true,
- },
- "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ntp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny NTP",
- Computed: true,
- },
- "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ssh": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny SSH",
- Computed: true,
- },
- "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_dns": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny DNS",
- Computed: true,
- },
- "tunnel_interface_allow_dns_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_icmp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny ICMP",
- Computed: true,
- },
- "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_https": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny HTTPS",
- Computed: true,
- },
- "tunnel_interface_allow_https_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ospf": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny OSPF",
- Computed: true,
- },
- "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_stun": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny STUN",
- Computed: true,
- },
- "tunnel_interface_allow_stun_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_snmp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny SNMP",
- Computed: true,
- },
- "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_netconf": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny NETCONF",
- Computed: true,
- },
- "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_bfd": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny BFD",
- Computed: true,
- },
- "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_encapsulations": schema.ListNestedAttribute{
- MarkdownDescription: "Encapsulation for TLOC",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: "Encapsulation",
- Computed: true,
- },
- "preference": schema.Int64Attribute{
- MarkdownDescription: "Set preference for TLOC",
- Computed: true,
- },
- "preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "weight": schema.Int64Attribute{
- MarkdownDescription: "Set weight for TLOC",
- Computed: true,
- },
- "weight_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "nat_ipv4": schema.BoolAttribute{
- MarkdownDescription: "enable Network Address Translation on this interface",
- Computed: true,
- },
- "nat_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_type": schema.StringAttribute{
- MarkdownDescription: "NAT Type",
- Computed: true,
- },
- "nat_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_range_start": schema.StringAttribute{
- MarkdownDescription: "NAT Pool Range Start",
- Computed: true,
- },
- "nat_range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_range_end": schema.StringAttribute{
- MarkdownDescription: "NAT Pool Range End",
- Computed: true,
- },
- "nat_range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_prefix_length": schema.Int64Attribute{
- MarkdownDescription: "NAT Pool Prefix Length",
- Computed: true,
- },
- "nat_prefix_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_overload": schema.BoolAttribute{
- MarkdownDescription: "NAT Overload",
- Computed: true,
- },
- "nat_overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_loopback": schema.StringAttribute{
- MarkdownDescription: "NAT Inside Source Loopback Interface",
- Computed: true,
- },
- "nat_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT UDP session timeout, in minutes",
- Computed: true,
- },
- "nat_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Set NAT TCP session timeout, in minutes",
- Computed: true,
- },
- "nat_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "new_static_nats": schema.ListNestedAttribute{
- MarkdownDescription: "static NAT",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_ip": schema.StringAttribute{
- MarkdownDescription: "Source IP address to be translated",
- Computed: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "translated_ip": schema.StringAttribute{
- MarkdownDescription: "Statically translated source IP address",
- Computed: true,
- },
- "translated_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "direction": schema.StringAttribute{
- MarkdownDescription: "Direction of static NAT translation",
- Computed: true,
- },
- "source_vpn": schema.Int64Attribute{
- MarkdownDescription: "Source VPN ID",
- Computed: true,
- },
- "source_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "nat_ipv6": schema.BoolAttribute{
- MarkdownDescription: "enable Network Address Translation ipv6 on this interface",
- Computed: true,
- },
- "nat_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat64": schema.BoolAttribute{
- MarkdownDescription: "NAT64 on this interface",
- Computed: true,
- },
- "nat66": schema.BoolAttribute{
- MarkdownDescription: "NAT66 on this interface",
- Computed: true,
- },
- "static_nat66": schema.ListNestedAttribute{
- MarkdownDescription: "static NAT66",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_prefix": schema.StringAttribute{
- MarkdownDescription: "Source Prefix",
- Computed: true,
- },
- "source_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "translated_source_prefix": schema.StringAttribute{
- MarkdownDescription: "Translated Source Prefix",
- Computed: true,
- },
- "translated_source_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "source_vpn_id": schema.Int64Attribute{
- MarkdownDescription: "Source VPN ID",
- Computed: true,
- },
- "source_vpn_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "qos_adaptive": schema.BoolAttribute{
- MarkdownDescription: "Adaptive QoS",
- Computed: true,
- },
- "qos_adaptive_period": schema.Int64Attribute{
- MarkdownDescription: "Adapt Period(Minutes)",
- Computed: true,
- },
- "qos_adaptive_period_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
- MarkdownDescription: "Shaping Rate Upstream",
- Computed: true,
- },
- "qos_adaptive_min_upstream": schema.Int64Attribute{
- MarkdownDescription: "Upstream min bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_min_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_max_upstream": schema.Int64Attribute{
- MarkdownDescription: "Upstream max bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_max_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_default_upstream": schema.Int64Attribute{
- MarkdownDescription: "Adaptive QoS default upstream bandwidth (kbps)",
- Computed: true,
- },
- "qos_adaptive_default_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
- MarkdownDescription: "Shaping Rate Downstream",
- Computed: true,
- },
- "qos_adaptive_min_downstream": schema.Int64Attribute{
- MarkdownDescription: "Downstream min bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_min_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_max_downstream": schema.Int64Attribute{
- MarkdownDescription: "Downstream max bandwidth limit (kbps)",
- Computed: true,
- },
- "qos_adaptive_max_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_adaptive_default_downstream": schema.Int64Attribute{
- MarkdownDescription: "Adaptive QoS default downstream bandwidth (kbps)",
- Computed: true,
- },
- "qos_adaptive_default_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "qos_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: "Shaping Rate (Kbps)",
- Computed: true,
- },
- "qos_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: "Configure ARP entries",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: "IP V4 Address",
- Computed: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC Address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: "ICMP/ICMPv6 Redirect Disable",
- Computed: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "duplex": schema.StringAttribute{
- MarkdownDescription: "Duplex mode",
- Computed: true,
- },
- "duplex_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: "MAC Address",
- Computed: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes",
- Computed: true,
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "speed": schema.StringAttribute{
- MarkdownDescription: "Set interface speed",
- Computed: true,
- },
- "speed_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: "Timeout value for dynamically learned ARP entries, <0..2678400> seconds",
- Computed: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "autonegotiate": schema.BoolAttribute{
- MarkdownDescription: "Link autonegotiation",
- Computed: true,
- },
- "autonegotiate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "media_type": schema.StringAttribute{
- MarkdownDescription: "Media type",
- Computed: true,
- },
- "media_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tloc_extension": schema.StringAttribute{
- MarkdownDescription: "Extends a local TLOC to a remote node only for vpn 0",
- Computed: true,
- },
- "tloc_extension_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gre_tunnel_source_ip": schema.StringAttribute{
- MarkdownDescription: "GRE tunnel source IP",
- Computed: true,
- },
- "gre_tunnel_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "xconnect": schema.StringAttribute{
- MarkdownDescription: "Extend remote TLOC over a GRE tunnel to a local WAN interface",
- Computed: true,
- },
- "xconnect_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "load_interval": schema.Int64Attribute{
- MarkdownDescription: "Interval for interface load calculation",
- Computed: true,
- },
- "load_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker": schema.StringAttribute{
- MarkdownDescription: "Enable tracker for this interface",
- Computed: true,
- },
- "tracker_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: "IP Directed-Broadcast",
- Computed: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *TransportWANVPNInterfaceEthernetProfileParcelDataSource) 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 *TransportWANVPNInterfaceEthernetProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportWANVPNInterfaceEthernet
-
- // 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_transport_wan_vpn_interface_ethernet_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel_test.go
deleted file mode 100644
index 321089d7e..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel_test.go
+++ /dev/null
@@ -1,322 +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 TestAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "interface_name", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "interface_description", "WAN"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv6_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "iperf_server", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "block_non_source_ip", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "service_provider", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "bandwidth_upstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "bandwidth_downstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "auto_detect_bandwidth", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "per_tunnel_qos", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_qos_mode", "hub"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_bandwidth_percent", "82"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_bind_loopback_tunnel", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_carrier", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_color", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_hello_interval", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_hello_tolerance", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_last_resort_circuit", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_gre_tunnel_destination_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_color_restrict", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_groups", "42949672"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_border", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_max_control_connections", "62"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_nat_refresh_interval", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_vbond_as_stun_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_vmanage_connection_preference", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_port_hop", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_low_bandwidth_link", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_cts_sgt_propagation", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_network_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_all", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_dhcp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_ntp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_ssh", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_dns", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_icmp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_https", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_stun", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_snmp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_netconf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_bfd", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_encapsulations.0.weight", "250"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_ipv4", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_type", "interface"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_udp_timeout", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_tcp_timeout", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.translated_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.source_vpn", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_ipv6", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat64", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat66", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "static_nat66.0.source_prefix", "2001:0db8:85a3::/48"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "static_nat66.0.translated_source_prefix", "abcd:1234:5678::/48"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "static_nat66.0.source_vpn_id", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "icmp_redirect_disable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "duplex", "full"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tcp_mss", "505"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "speed", "2500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "autonegotiate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "media_type", "rj45"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tloc_extension", "tloc"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "gre_tunnel_source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "xconnect", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "load_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tracker", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig() string {
- config := `resource "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` interface_description = "WAN"` + "\n"
- config += ` ipv4_configuration_type = "static"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` ipv6_configuration_type = "static"` + "\n"
- config += ` iperf_server = "example"` + "\n"
- config += ` block_non_source_ip = false` + "\n"
- config += ` service_provider = "example"` + "\n"
- config += ` bandwidth_upstream = 21474836` + "\n"
- config += ` bandwidth_downstream = 21474836` + "\n"
- config += ` auto_detect_bandwidth = false` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += ` per_tunnel_qos = true` + "\n"
- config += ` tunnel_qos_mode = "hub"` + "\n"
- config += ` tunnel_bandwidth_percent = 82` + "\n"
- config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
- config += ` tunnel_interface_carrier = "default"` + "\n"
- config += ` tunnel_interface_color = "default"` + "\n"
- config += ` tunnel_interface_hello_interval = 1000` + "\n"
- config += ` tunnel_interface_hello_tolerance = 12` + "\n"
- config += ` tunnel_interface_last_resort_circuit = false` + "\n"
- config += ` tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"` + "\n"
- config += ` tunnel_interface_color_restrict = true` + "\n"
- config += ` tunnel_interface_groups = 42949672` + "\n"
- config += ` tunnel_interface_border = false` + "\n"
- config += ` tunnel_interface_max_control_connections = 62` + "\n"
- config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
- config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
- config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
- config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
- config += ` tunnel_interface_port_hop = true` + "\n"
- config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
- config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
- config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
- config += ` tunnel_interface_cts_sgt_propagation = false` + "\n"
- config += ` tunnel_interface_network_broadcast = false` + "\n"
- config += ` tunnel_interface_allow_all = false` + "\n"
- config += ` tunnel_interface_allow_bgp = false` + "\n"
- config += ` tunnel_interface_allow_dhcp = true` + "\n"
- config += ` tunnel_interface_allow_ntp = false` + "\n"
- config += ` tunnel_interface_allow_ssh = false` + "\n"
- config += ` tunnel_interface_allow_dns = true` + "\n"
- config += ` tunnel_interface_allow_icmp = true` + "\n"
- config += ` tunnel_interface_allow_https = true` + "\n"
- config += ` tunnel_interface_allow_ospf = false` + "\n"
- config += ` tunnel_interface_allow_stun = false` + "\n"
- config += ` tunnel_interface_allow_snmp = false` + "\n"
- config += ` tunnel_interface_allow_netconf = false` + "\n"
- config += ` tunnel_interface_allow_bfd = false` + "\n"
- config += ` tunnel_interface_encapsulations = [{` + "\n"
- config += ` encapsulation = "gre"` + "\n"
- config += ` preference = 4294967` + "\n"
- config += ` weight = 250` + "\n"
- config += ` }]` + "\n"
- config += ` nat_ipv4 = true` + "\n"
- config += ` nat_type = "interface"` + "\n"
- config += ` nat_udp_timeout = 1` + "\n"
- config += ` nat_tcp_timeout = 60` + "\n"
- config += ` new_static_nats = [{` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translated_ip = "2.3.4.5"` + "\n"
- config += ` direction = "inside"` + "\n"
- config += ` source_vpn = 3` + "\n"
- config += ` }]` + "\n"
- config += ` nat_ipv6 = true` + "\n"
- config += ` nat64 = false` + "\n"
- config += ` nat66 = true` + "\n"
- config += ` static_nat66 = [{` + "\n"
- config += ` source_prefix = "2001:0db8:85a3::/48"` + "\n"
- config += ` translated_source_prefix = "abcd:1234:5678::/48"` + "\n"
- config += ` source_vpn_id = 4` + "\n"
- config += ` }]` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += ` duplex = "full"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 505` + "\n"
- config += ` speed = "2500"` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` autonegotiate = false` + "\n"
- config += ` media_type = "rj45"` + "\n"
- config += ` tloc_extension = "tloc"` + "\n"
- config += ` gre_tunnel_source_ip = "1.2.3.4"` + "\n"
- config += ` xconnect = "example"` + "\n"
- config += ` load_interval = 30` + "\n"
- config += ` tracker = "example"` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "test" {
- id = sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_feature.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_feature.go
new file mode 100644
index 000000000..a41b7daf0
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_feature.go
@@ -0,0 +1,238 @@
+// 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 = &TransportWANVPNInterfaceGREProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceGREProfileParcelDataSource{}
+)
+
+func NewTransportWANVPNInterfaceGREProfileParcelDataSource() datasource.DataSource {
+ return &TransportWANVPNInterfaceGREProfileParcelDataSource{}
+}
+
+type TransportWANVPNInterfaceGREProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportWANVPNInterfaceGREProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_gre_feature"
+}
+
+func (d *TransportWANVPNInterfaceGREProfileParcelDataSource) 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 Transport WAN VPN Interface GRE Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Transport WAN VPN Feature ID",
+ Required: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Interface name (1..255)",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "Interface description",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Administrative state",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "Tunnel source IP Address",
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name",
+ Computed: true,
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_interface_loopback": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name",
+ Computed: true,
+ },
+ "tunnel_source_interface_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_route_via_loopback": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name, can't be Loopback interface",
+ Computed: true,
+ },
+ "tunnel_route_via_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "Tunnel destination IP Address",
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU <576..9976>, in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
+ Computed: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: "Enable Application Tunnel Type",
+ Computed: true,
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportWANVPNInterfaceGREProfileParcelDataSource) 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 *TransportWANVPNInterfaceGREProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportWANVPNInterfaceGRE
+
+ // 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_transport_wan_vpn_interface_gre_feature_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_feature_test.go
new file mode 100644
index 000000000..3c6ddf6a3
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_feature_test.go
@@ -0,0 +1,153 @@
+// 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 TestAccDataSourceSdwanTransportWANVPNInterfaceGREProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_feature.test", "interface_description", "gre1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_feature.test", "tunnel_source_ipv4_address", "78.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_feature.test", "application_tunnel_type", "none"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceGREProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportWANVPNInterfaceGREProfileParcelConfig() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_gre_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "gre1"` + "\n"
+ config += ` interface_description = "gre1"` + "\n"
+ config += ` ipv4_address = "70.1.1.1"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_wan_vpn_interface_gre_feature" "test" {
+ id = sdwan_transport_wan_vpn_interface_gre_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go
deleted file mode 100644
index 06a41b8d1..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go
+++ /dev/null
@@ -1,238 +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/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 = &TransportWANVPNInterfaceGREProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceGREProfileParcelDataSource{}
-)
-
-func NewTransportWANVPNInterfaceGREProfileParcelDataSource() datasource.DataSource {
- return &TransportWANVPNInterfaceGREProfileParcelDataSource{}
-}
-
-type TransportWANVPNInterfaceGREProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportWANVPNInterfaceGREProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_gre_profile_parcel"
-}
-
-func (d *TransportWANVPNInterfaceGREProfileParcelDataSource) 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 Transport WAN VPN Interface GRE 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Transport WAN VPN Profile Parcel ID",
- Required: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "Interface name (1..255)",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "Interface description",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Administrative state",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "Tunnel source IP Address",
- Computed: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name",
- Computed: true,
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_interface_loopback": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name",
- Computed: true,
- },
- "tunnel_source_interface_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_route_via_loopback": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name, can't be Loopback interface",
- Computed: true,
- },
- "tunnel_route_via_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "Tunnel destination IP Address",
- Computed: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU <576..9976>, in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
- Computed: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: "Enable Application Tunnel Type",
- Computed: true,
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *TransportWANVPNInterfaceGREProfileParcelDataSource) 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 *TransportWANVPNInterfaceGREProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportWANVPNInterfaceGRE
-
- // 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_transport_wan_vpn_interface_gre_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_profile_parcel_test.go
deleted file mode 100644
index d9accad38..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_gre_profile_parcel_test.go
+++ /dev/null
@@ -1,158 +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 TestAccDataSourceSdwanTransportWANVPNInterfaceGREProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "interface_name", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "interface_description", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "ipv4_address", "70.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "tunnel_source_ipv4_address", "78.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "tunnel_destination_ipv4_address", "79.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "application_tunnel_type", "none"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceGREProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportWANVPNInterfaceGREProfileParcelConfig() string {
- config := `resource "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "gre1"` + "\n"
- config += ` interface_description = "gre1"` + "\n"
- config += ` ipv4_address = "70.1.1.1"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
- config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "test" {
- id = sdwan_transport_wan_vpn_interface_gre_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_feature.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_feature.go
new file mode 100644
index 000000000..5e1619731
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_feature.go
@@ -0,0 +1,362 @@
+// 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 = &TransportWANVPNInterfaceIPSECProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceIPSECProfileParcelDataSource{}
+)
+
+func NewTransportWANVPNInterfaceIPSECProfileParcelDataSource() datasource.DataSource {
+ return &TransportWANVPNInterfaceIPSECProfileParcelDataSource{}
+}
+
+type TransportWANVPNInterfaceIPSECProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportWANVPNInterfaceIPSECProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ipsec_feature"
+}
+
+func (d *TransportWANVPNInterfaceIPSECProfileParcelDataSource) 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 Transport WAN VPN Interface IPSEC Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Transport WAN VPN Feature ID",
+ Required: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Interface name: IPsec when present",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Administrative state",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: "Interface description",
+ Computed: true,
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
+ Computed: true,
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: "Enable Application Tunnel Type",
+ Computed: true,
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
+ Computed: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU <68..9216>, in bytes",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dpd_interval": schema.Int64Attribute{
+ MarkdownDescription: "IKE keepalive interval (seconds)",
+ Computed: true,
+ },
+ "dpd_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "dpd_retries": schema.Int64Attribute{
+ MarkdownDescription: "IKE keepalive retries",
+ Computed: true,
+ },
+ "dpd_retries_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_preshared_key": schema.StringAttribute{
+ MarkdownDescription: "Use preshared key to authenticate IKE peer",
+ Computed: true,
+ },
+ "ike_preshared_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_version": schema.Int64Attribute{
+ MarkdownDescription: "IKE Version <1..2>",
+ Computed: true,
+ },
+ "ike_integrity_protocol": schema.StringAttribute{
+ MarkdownDescription: "IKE integrity protocol",
+ Computed: true,
+ },
+ "ike_integrity_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: "IKE rekey interval <60..86400> seconds",
+ Computed: true,
+ },
+ "ike_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: "IKE identity the IKE preshared secret belongs to",
+ Computed: true,
+ },
+ "ike_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_diffie_hellman_group": schema.StringAttribute{
+ MarkdownDescription: "IKE Diffie Hellman Groups",
+ Computed: true,
+ },
+ "ike_diffie_hellman_group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_id_local_end_point": schema.StringAttribute{
+ MarkdownDescription: "IKE ID for the local endpoint. Input IPv4 address, domain name, or email address",
+ Computed: true,
+ },
+ "ike_id_local_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ike_id_remote_end_point": schema.StringAttribute{
+ MarkdownDescription: "IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address",
+ Computed: true,
+ },
+ "ike_id_remote_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: "IPsec rekey interval <300..1209600> seconds",
+ Computed: true,
+ },
+ "ipsec_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_replay_window": schema.Int64Attribute{
+ MarkdownDescription: "Replay window size 32..8192 (must be a power of 2)",
+ Computed: true,
+ },
+ "ipsec_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipsec_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: "IPsec(ESP) encryption and integrity protocol",
+ Computed: true,
+ },
+ "ipsec_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "perfect_forward_secrecy": schema.StringAttribute{
+ MarkdownDescription: "IPsec perfect forward secrecy settings",
+ Computed: true,
+ },
+ "perfect_forward_secrecy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: "Enable tracker for this interface",
+ Computed: true,
+ },
+ "tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_route_via": schema.StringAttribute{
+ MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
+ Computed: true,
+ },
+ "tunnel_route_via_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportWANVPNInterfaceIPSECProfileParcelDataSource) 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 *TransportWANVPNInterfaceIPSECProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportWANVPNInterfaceIPSEC
+
+ // 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_transport_wan_vpn_interface_ipsec_feature_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_feature_test.go
new file mode 100644
index 000000000..bd8e2f52c
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_feature_test.go
@@ -0,0 +1,183 @@
+// 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 TestAccDataSourceSdwanTransportWANVPNInterfaceIPSECProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "interface_description", "ipsec987"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "dpd_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "dpd_retries", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_version", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_integrity_protocol", "main"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_rekey_interval", "14400"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_ciphersuite", "aes256-cbc-sha1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_diffie_hellman_group", "16"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_id_local_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_id_remote_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ipsec_rekey_interval", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ipsec_replay_window", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ipsec_ciphersuite", "aes256-gcm"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "perfect_forward_secrecy", "group-16"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_feature.test", "tunnel_route_via", "2222"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_ipsec_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "ipsec987"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_description = "ipsec987"` + "\n"
+ config += ` ipv4_address = "9.7.5.4"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
+ config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
+ config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` dpd_interval = 10` + "\n"
+ config += ` dpd_retries = 3` + "\n"
+ config += ` ike_preshared_key = "123"` + "\n"
+ config += ` ike_version = 1` + "\n"
+ config += ` ike_integrity_protocol = "main"` + "\n"
+ config += ` ike_rekey_interval = 14400` + "\n"
+ config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
+ config += ` ike_diffie_hellman_group = "16"` + "\n"
+ config += ` ike_id_local_end_point = "xxx"` + "\n"
+ config += ` ike_id_remote_end_point = "xxx"` + "\n"
+ config += ` ipsec_rekey_interval = 3600` + "\n"
+ config += ` ipsec_replay_window = 512` + "\n"
+ config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
+ config += ` perfect_forward_secrecy = "group-16"` + "\n"
+ config += ` tunnel_route_via = "2222"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_wan_vpn_interface_ipsec_feature" "test" {
+ id = sdwan_transport_wan_vpn_interface_ipsec_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go
deleted file mode 100644
index ff0c57fbc..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go
+++ /dev/null
@@ -1,362 +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/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 = &TransportWANVPNInterfaceIPSECProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceIPSECProfileParcelDataSource{}
-)
-
-func NewTransportWANVPNInterfaceIPSECProfileParcelDataSource() datasource.DataSource {
- return &TransportWANVPNInterfaceIPSECProfileParcelDataSource{}
-}
-
-type TransportWANVPNInterfaceIPSECProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportWANVPNInterfaceIPSECProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ipsec_profile_parcel"
-}
-
-func (d *TransportWANVPNInterfaceIPSECProfileParcelDataSource) 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 Transport WAN VPN Interface IPSEC 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Transport WAN VPN Profile Parcel ID",
- Required: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "Interface name: IPsec when present",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Administrative state",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: "Interface description",
- Computed: true,
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
- Computed: true,
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: "Enable Application Tunnel Type",
- Computed: true,
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
- Computed: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU <68..9216>, in bytes",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "dpd_interval": schema.Int64Attribute{
- MarkdownDescription: "IKE keepalive interval (seconds)",
- Computed: true,
- },
- "dpd_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "dpd_retries": schema.Int64Attribute{
- MarkdownDescription: "IKE keepalive retries",
- Computed: true,
- },
- "dpd_retries_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_preshared_key": schema.StringAttribute{
- MarkdownDescription: "Use preshared key to authenticate IKE peer",
- Computed: true,
- },
- "ike_preshared_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_version": schema.Int64Attribute{
- MarkdownDescription: "IKE Version <1..2>",
- Computed: true,
- },
- "ike_integrity_protocol": schema.StringAttribute{
- MarkdownDescription: "IKE integrity protocol",
- Computed: true,
- },
- "ike_integrity_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: "IKE rekey interval <60..86400> seconds",
- Computed: true,
- },
- "ike_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_ciphersuite": schema.StringAttribute{
- MarkdownDescription: "IKE identity the IKE preshared secret belongs to",
- Computed: true,
- },
- "ike_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_diffie_hellman_group": schema.StringAttribute{
- MarkdownDescription: "IKE Diffie Hellman Groups",
- Computed: true,
- },
- "ike_diffie_hellman_group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_id_local_end_point": schema.StringAttribute{
- MarkdownDescription: "IKE ID for the local endpoint. Input IPv4 address, domain name, or email address",
- Computed: true,
- },
- "ike_id_local_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ike_id_remote_end_point": schema.StringAttribute{
- MarkdownDescription: "IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address",
- Computed: true,
- },
- "ike_id_remote_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: "IPsec rekey interval <300..1209600> seconds",
- Computed: true,
- },
- "ipsec_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_replay_window": schema.Int64Attribute{
- MarkdownDescription: "Replay window size 32..8192 (must be a power of 2)",
- Computed: true,
- },
- "ipsec_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipsec_ciphersuite": schema.StringAttribute{
- MarkdownDescription: "IPsec(ESP) encryption and integrity protocol",
- Computed: true,
- },
- "ipsec_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "perfect_forward_secrecy": schema.StringAttribute{
- MarkdownDescription: "IPsec perfect forward secrecy settings",
- Computed: true,
- },
- "perfect_forward_secrecy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tracker_id": schema.StringAttribute{
- MarkdownDescription: "Enable tracker for this interface",
- Computed: true,
- },
- "tracker_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_route_via": schema.StringAttribute{
- MarkdownDescription: "<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid",
- Computed: true,
- },
- "tunnel_route_via_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *TransportWANVPNInterfaceIPSECProfileParcelDataSource) 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 *TransportWANVPNInterfaceIPSECProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportWANVPNInterfaceIPSEC
-
- // 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_transport_wan_vpn_interface_ipsec_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel_test.go
deleted file mode 100644
index f10231281..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel_test.go
+++ /dev/null
@@ -1,194 +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 TestAccDataSourceSdwanTransportWANVPNInterfaceIPSECProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "interface_name", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "interface_description", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipv4_address", "9.7.5.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_address", "1.3.5.88"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_interface", "GigabitEthernet8"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_address", "2.55.67.99"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "application_tunnel_type", "none"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "dpd_interval", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "dpd_retries", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_preshared_key", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_version", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_integrity_protocol", "main"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_rekey_interval", "14400"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_ciphersuite", "aes256-cbc-sha1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_diffie_hellman_group", "16"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_id_local_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_id_remote_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipsec_rekey_interval", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipsec_replay_window", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipsec_ciphersuite", "aes256-gcm"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "perfect_forward_secrecy", "group-16"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_route_via", "2222"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig() string {
- config := `resource "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "ipsec987"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_description = "ipsec987"` + "\n"
- config += ` ipv4_address = "9.7.5.4"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
- config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
- config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
- config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` dpd_interval = 10` + "\n"
- config += ` dpd_retries = 3` + "\n"
- config += ` ike_preshared_key = "123"` + "\n"
- config += ` ike_version = 1` + "\n"
- config += ` ike_integrity_protocol = "main"` + "\n"
- config += ` ike_rekey_interval = 14400` + "\n"
- config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
- config += ` ike_diffie_hellman_group = "16"` + "\n"
- config += ` ike_id_local_end_point = "xxx"` + "\n"
- config += ` ike_id_remote_end_point = "xxx"` + "\n"
- config += ` ipsec_rekey_interval = 3600` + "\n"
- config += ` ipsec_replay_window = 512` + "\n"
- config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
- config += ` perfect_forward_secrecy = "group-16"` + "\n"
- config += ` tunnel_route_via = "2222"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "test" {
- id = sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go
new file mode 100644
index 000000000..03ee2412a
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go
@@ -0,0 +1,552 @@
+// 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-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 the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource{}
+ _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource{}
+)
+
+func NewTransportWANVPNInterfaceT1E1SerialProfileParcelDataSource() datasource.DataSource {
+ return &TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource{}
+}
+
+type TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource struct {
+ client *sdwan.Client
+}
+
+func (d *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_t1_e1_serial_feature"
+}
+
+func (d *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) 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 Transport WAN VPN Interface T1 E1 Serial Feature.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Required: true,
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Computed: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: "Feature Profile ID",
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: "Transport WAN VPN Feature ID",
+ Required: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: "Administrative state",
+ Computed: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: "Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T",
+ Computed: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: "",
+ Computed: true,
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: "Assign IPv6 address",
+ Computed: true,
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "bandwidth": schema.Int64Attribute{
+ MarkdownDescription: "Interface bandwidth capacity, in kbps",
+ Computed: true,
+ },
+ "bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "bandwidth_downstream": schema.Int64Attribute{
+ MarkdownDescription: "Interface downstream bandwidth capacity, in kbps",
+ Computed: true,
+ },
+ "bandwidth_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "clock_rate": schema.StringAttribute{
+ MarkdownDescription: "Set preference for interface Clock speed",
+ Computed: true,
+ },
+ "clock_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: "Configure Encapsulation for interface",
+ Computed: true,
+ },
+ "encapsulation_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface": schema.BoolAttribute{
+ MarkdownDescription: "Tunnel Interface",
+ Computed: true,
+ },
+ "per_tunnel_qos": schema.BoolAttribute{
+ MarkdownDescription: "Per-tunnel Qos",
+ Computed: true,
+ },
+ "per_tunnel_qos_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "per_tunnel_qos_aggregator": schema.BoolAttribute{
+ MarkdownDescription: "Per-tunnel QoS Aggregator",
+ Computed: true,
+ },
+ "per_tunnel_qos_aggregator_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_qos_mode": schema.StringAttribute{
+ MarkdownDescription: "Set tunnel QoS mode",
+ Computed: true,
+ },
+ "tunnel_qos_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_color": schema.StringAttribute{
+ MarkdownDescription: "Set color for TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_color_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_restrict": schema.BoolAttribute{
+ MarkdownDescription: "Restrict this TLOC behavior",
+ Computed: true,
+ },
+ "tunnel_interface_restrict_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_groups": schema.Int64Attribute{
+ MarkdownDescription: "List of groups",
+ Computed: true,
+ },
+ "tunnel_interface_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_border": schema.BoolAttribute{
+ MarkdownDescription: "Set TLOC as border TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_border_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_max_control_connections": schema.Int64Attribute{
+ MarkdownDescription: "Set the maximum number of control connections for this TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
+ MarkdownDescription: "Put this wan interface in STUN mode only",
+ Computed: true,
+ },
+ "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
+ MarkdownDescription: "Exclude the following controller groups defined in this list",
+ ElementType: types.Int64Type,
+ Computed: true,
+ },
+ "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
+ MarkdownDescription: "Set interface preference for control connection to vManage <0..8>",
+ Computed: true,
+ },
+ "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_port_hop": schema.BoolAttribute{
+ MarkdownDescription: "Disallow port hopping on the tunnel interface",
+ Computed: true,
+ },
+ "tunnel_interface_port_hop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
+ MarkdownDescription: "Set the interface as a low-bandwidth circuit",
+ Computed: true,
+ },
+ "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "Tunnel TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
+ Computed: true,
+ },
+ "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_clear_network_broadcast": schema.BoolAttribute{
+ MarkdownDescription: "Accept and respond to network-prefix-directed broadcasts)",
+ Computed: true,
+ },
+ "tunnel_interface_clear_network_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_carrier": schema.StringAttribute{
+ MarkdownDescription: "Set carrier for TLOC",
+ Computed: true,
+ },
+ "tunnel_interface_carrier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
+ MarkdownDescription: "Bind loopback tunnel interface to a physical interface",
+ Computed: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
+ MarkdownDescription: "Set TLOC as last resort",
+ Computed: true,
+ },
+ "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time period of nat refresh packets <1...60> seconds",
+ Computed: true,
+ },
+ "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_hello_interval": schema.Int64Attribute{
+ MarkdownDescription: "Set time period of control hello packets <100..600000> milli seconds",
+ Computed: true,
+ },
+ "tunnel_interface_hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_hello_tolerance": schema.Int64Attribute{
+ MarkdownDescription: "Set tolerance of control hello packets <12..6000> seconds",
+ Computed: true,
+ },
+ "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_all": schema.BoolAttribute{
+ MarkdownDescription: "Allow all traffic. Overrides all other allow-service options if allow-service all is set",
+ Computed: true,
+ },
+ "tunnel_interface_allow_all_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_bgp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/deny BGP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_dhcp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny DHCP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_dns": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny DNS",
+ Computed: true,
+ },
+ "tunnel_interface_allow_dns_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_icmp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny ICMP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_netconf": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny NETCONF",
+ Computed: true,
+ },
+ "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ntp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny NTP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ospf": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny OSPF",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_ssh": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny SSH",
+ Computed: true,
+ },
+ "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_stun": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny STUN",
+ Computed: true,
+ },
+ "tunnel_interface_allow_stun_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_https": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny Https",
+ Computed: true,
+ },
+ "tunnel_interface_allow_https_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_snmp": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny SNMP",
+ Computed: true,
+ },
+ "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_allow_bfd": schema.BoolAttribute{
+ MarkdownDescription: "Allow/Deny BFD",
+ Computed: true,
+ },
+ "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tunnel_interface_encapsulations": schema.ListNestedAttribute{
+ MarkdownDescription: "Encapsulation for TLOC",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: "Encapsulation",
+ Computed: true,
+ },
+ "preference": schema.Int64Attribute{
+ MarkdownDescription: "Set preference for TLOC",
+ Computed: true,
+ },
+ "preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: "Set weight for TLOC",
+ Computed: true,
+ },
+ "weight_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "qos_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: "1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps",
+ Computed: true,
+ },
+ "qos_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: "TCP MSS on SYN packets, in bytes",
+ Computed: true,
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "mtu": schema.Int64Attribute{
+ MarkdownDescription: "Interface MTU <68...2000>, in bytes",
+ Computed: true,
+ },
+ "mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: "Set ip mtu",
+ Computed: true,
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ "tloc_extension": schema.StringAttribute{
+ MarkdownDescription: "Extends a local TLOC to a remote node only for vpn 0",
+ Computed: true,
+ },
+ "tloc_extension_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Computed: true,
+ },
+ },
+ }
+}
+
+func (d *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config TransportWANVPNInterfaceT1E1Serial
+
+ // 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_transport_wan_vpn_interface_t1_e1_serial_feature_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature_test.go
new file mode 100644
index 000000000..8b61d349f
--- /dev/null
+++ b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature_test.go
@@ -0,0 +1,239 @@
+// 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 TestAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ipv6_address", "2001:0:0:1::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "bandwidth", "123456"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "bandwidth_downstream", "123456"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "clock_rate", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "encapsulation", "ppp"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "per_tunnel_qos", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "per_tunnel_qos_aggregator", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_qos_mode", "hub"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_color", "mpls"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_restrict", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_groups", "42949672"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_border", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_max_control_connections", "62"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_vbond_as_stun_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_vmanage_connection_preference", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_port_hop", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_low_bandwidth_link", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_clear_network_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_carrier", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_bind_loopback_tunnel", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_last_resort_circuit", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_nat_refresh_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_hello_interval", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_hello_tolerance", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_all", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_dhcp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_dns", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_icmp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_netconf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_ntp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_ssh", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_stun", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_https", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_snmp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_bfd", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_encapsulations.0.weight", "250"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tloc_extension", "tloc"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "Serial0"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
+ config += ` bandwidth = 123456` + "\n"
+ config += ` bandwidth_downstream = 123456` + "\n"
+ config += ` clock_rate = "1200"` + "\n"
+ config += ` encapsulation = "ppp"` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += ` per_tunnel_qos = true` + "\n"
+ config += ` per_tunnel_qos_aggregator = false` + "\n"
+ config += ` tunnel_qos_mode = "hub"` + "\n"
+ config += ` tunnel_interface_color = "mpls"` + "\n"
+ config += ` tunnel_interface_restrict = true` + "\n"
+ config += ` tunnel_interface_groups = 42949672` + "\n"
+ config += ` tunnel_interface_border = false` + "\n"
+ config += ` tunnel_interface_max_control_connections = 62` + "\n"
+ config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
+ config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
+ config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
+ config += ` tunnel_interface_port_hop = true` + "\n"
+ config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
+ config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
+ config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
+ config += ` tunnel_interface_clear_network_broadcast = false` + "\n"
+ config += ` tunnel_interface_carrier = "default"` + "\n"
+ config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
+ config += ` tunnel_interface_last_resort_circuit = false` + "\n"
+ config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
+ config += ` tunnel_interface_hello_interval = 1000` + "\n"
+ config += ` tunnel_interface_hello_tolerance = 12` + "\n"
+ config += ` tunnel_interface_allow_all = false` + "\n"
+ config += ` tunnel_interface_allow_bgp = false` + "\n"
+ config += ` tunnel_interface_allow_dhcp = true` + "\n"
+ config += ` tunnel_interface_allow_dns = true` + "\n"
+ config += ` tunnel_interface_allow_icmp = true` + "\n"
+ config += ` tunnel_interface_allow_netconf = false` + "\n"
+ config += ` tunnel_interface_allow_ntp = false` + "\n"
+ config += ` tunnel_interface_allow_ospf = false` + "\n"
+ config += ` tunnel_interface_allow_ssh = false` + "\n"
+ config += ` tunnel_interface_allow_stun = false` + "\n"
+ config += ` tunnel_interface_allow_https = true` + "\n"
+ config += ` tunnel_interface_allow_snmp = false` + "\n"
+ config += ` tunnel_interface_allow_bfd = false` + "\n"
+ config += ` tunnel_interface_encapsulations = [{` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = 4294967` + "\n"
+ config += ` weight = 250` + "\n"
+ config += ` }]` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` mtu = 1500` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` tloc_extension = "tloc"` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "test" {
+ id = sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test.id
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go
deleted file mode 100644
index 9b22eefd5..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go
+++ /dev/null
@@ -1,552 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource{}
-)
-
-func NewTransportWANVPNInterfaceT1E1SerialProfileParcelDataSource() datasource.DataSource {
- return &TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource{}
-}
-
-type TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_t1_e1_serial_profile_parcel"
-}
-
-func (d *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) 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 Transport WAN VPN Interface T1 E1 Serial 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: "Transport WAN VPN Profile Parcel ID",
- Required: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: "Administrative state",
- Computed: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: "Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T",
- Computed: true,
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: "",
- Computed: true,
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: "Assign IPv6 address",
- Computed: true,
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "bandwidth": schema.Int64Attribute{
- MarkdownDescription: "Interface bandwidth capacity, in kbps",
- Computed: true,
- },
- "bandwidth_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "bandwidth_downstream": schema.Int64Attribute{
- MarkdownDescription: "Interface downstream bandwidth capacity, in kbps",
- Computed: true,
- },
- "bandwidth_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "clock_rate": schema.StringAttribute{
- MarkdownDescription: "Set preference for interface Clock speed",
- Computed: true,
- },
- "clock_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: "Configure Encapsulation for interface",
- Computed: true,
- },
- "encapsulation_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface": schema.BoolAttribute{
- MarkdownDescription: "Tunnel Interface",
- Computed: true,
- },
- "per_tunnel_qos": schema.BoolAttribute{
- MarkdownDescription: "Per-tunnel Qos",
- Computed: true,
- },
- "per_tunnel_qos_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "per_tunnel_qos_aggregator": schema.BoolAttribute{
- MarkdownDescription: "Per-tunnel QoS Aggregator",
- Computed: true,
- },
- "per_tunnel_qos_aggregator_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_qos_mode": schema.StringAttribute{
- MarkdownDescription: "Set tunnel QoS mode",
- Computed: true,
- },
- "tunnel_qos_mode_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_color": schema.StringAttribute{
- MarkdownDescription: "Set color for TLOC",
- Computed: true,
- },
- "tunnel_interface_color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_restrict": schema.BoolAttribute{
- MarkdownDescription: "Restrict this TLOC behavior",
- Computed: true,
- },
- "tunnel_interface_restrict_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_groups": schema.Int64Attribute{
- MarkdownDescription: "List of groups",
- Computed: true,
- },
- "tunnel_interface_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_border": schema.BoolAttribute{
- MarkdownDescription: "Set TLOC as border TLOC",
- Computed: true,
- },
- "tunnel_interface_border_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_max_control_connections": schema.Int64Attribute{
- MarkdownDescription: "Set the maximum number of control connections for this TLOC",
- Computed: true,
- },
- "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
- MarkdownDescription: "Put this wan interface in STUN mode only",
- Computed: true,
- },
- "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
- MarkdownDescription: "Exclude the following controller groups defined in this list",
- ElementType: types.Int64Type,
- Computed: true,
- },
- "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
- MarkdownDescription: "Set interface preference for control connection to vManage <0..8>",
- Computed: true,
- },
- "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_port_hop": schema.BoolAttribute{
- MarkdownDescription: "Disallow port hopping on the tunnel interface",
- Computed: true,
- },
- "tunnel_interface_port_hop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
- MarkdownDescription: "Set the interface as a low-bandwidth circuit",
- Computed: true,
- },
- "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "Tunnel TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: "Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)",
- Computed: true,
- },
- "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_clear_network_broadcast": schema.BoolAttribute{
- MarkdownDescription: "Accept and respond to network-prefix-directed broadcasts)",
- Computed: true,
- },
- "tunnel_interface_clear_network_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_carrier": schema.StringAttribute{
- MarkdownDescription: "Set carrier for TLOC",
- Computed: true,
- },
- "tunnel_interface_carrier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
- MarkdownDescription: "Bind loopback tunnel interface to a physical interface",
- Computed: true,
- },
- "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
- MarkdownDescription: "Set TLOC as last resort",
- Computed: true,
- },
- "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
- MarkdownDescription: "Set time period of nat refresh packets <1...60> seconds",
- Computed: true,
- },
- "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_hello_interval": schema.Int64Attribute{
- MarkdownDescription: "Set time period of control hello packets <100..600000> milli seconds",
- Computed: true,
- },
- "tunnel_interface_hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_hello_tolerance": schema.Int64Attribute{
- MarkdownDescription: "Set tolerance of control hello packets <12..6000> seconds",
- Computed: true,
- },
- "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_all": schema.BoolAttribute{
- MarkdownDescription: "Allow all traffic. Overrides all other allow-service options if allow-service all is set",
- Computed: true,
- },
- "tunnel_interface_allow_all_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_bgp": schema.BoolAttribute{
- MarkdownDescription: "Allow/deny BGP",
- Computed: true,
- },
- "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_dhcp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny DHCP",
- Computed: true,
- },
- "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_dns": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny DNS",
- Computed: true,
- },
- "tunnel_interface_allow_dns_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_icmp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny ICMP",
- Computed: true,
- },
- "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_netconf": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny NETCONF",
- Computed: true,
- },
- "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ntp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny NTP",
- Computed: true,
- },
- "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ospf": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny OSPF",
- Computed: true,
- },
- "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_ssh": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny SSH",
- Computed: true,
- },
- "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_stun": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny STUN",
- Computed: true,
- },
- "tunnel_interface_allow_stun_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_https": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny Https",
- Computed: true,
- },
- "tunnel_interface_allow_https_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_snmp": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny SNMP",
- Computed: true,
- },
- "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_allow_bfd": schema.BoolAttribute{
- MarkdownDescription: "Allow/Deny BFD",
- Computed: true,
- },
- "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tunnel_interface_encapsulations": schema.ListNestedAttribute{
- MarkdownDescription: "Encapsulation for TLOC",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: "Encapsulation",
- Computed: true,
- },
- "preference": schema.Int64Attribute{
- MarkdownDescription: "Set preference for TLOC",
- Computed: true,
- },
- "preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "weight": schema.Int64Attribute{
- MarkdownDescription: "Set weight for TLOC",
- Computed: true,
- },
- "weight_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "qos_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: "1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps",
- Computed: true,
- },
- "qos_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: "TCP MSS on SYN packets, in bytes",
- Computed: true,
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "mtu": schema.Int64Attribute{
- MarkdownDescription: "Interface MTU <68...2000>, in bytes",
- Computed: true,
- },
- "mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: "Set ip mtu",
- Computed: true,
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "tloc_extension": schema.StringAttribute{
- MarkdownDescription: "Extends a local TLOC to a remote node only for vpn 0",
- Computed: true,
- },
- "tloc_extension_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- }
-}
-
-func (d *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportWANVPNInterfaceT1E1Serial
-
- // 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_transport_wan_vpn_interface_t1_e1_serial_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel_test.go
deleted file mode 100644
index 316e97071..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel_test.go
+++ /dev/null
@@ -1,241 +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 TestAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "interface_name", "Serial0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ipv6_address", "2001:0:0:1::/64"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "bandwidth", "123456"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "bandwidth_downstream", "123456"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "clock_rate", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "encapsulation", "ppp"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "per_tunnel_qos", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "per_tunnel_qos_aggregator", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_qos_mode", "hub"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_color", "mpls"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_restrict", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_groups", "42949672"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_border", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_max_control_connections", "62"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_vbond_as_stun_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_vmanage_connection_preference", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_port_hop", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_low_bandwidth_link", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_clear_network_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_carrier", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_bind_loopback_tunnel", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_last_resort_circuit", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_nat_refresh_interval", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_hello_interval", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_hello_tolerance", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_all", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_dhcp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_dns", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_icmp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_netconf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_ntp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_ssh", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_stun", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_https", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_snmp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_bfd", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_encapsulations.0.weight", "250"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tloc_extension", "tloc"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig() string {
- config := `resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "Serial0"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
- config += ` bandwidth = 123456` + "\n"
- config += ` bandwidth_downstream = 123456` + "\n"
- config += ` clock_rate = "1200"` + "\n"
- config += ` encapsulation = "ppp"` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += ` per_tunnel_qos = true` + "\n"
- config += ` per_tunnel_qos_aggregator = false` + "\n"
- config += ` tunnel_qos_mode = "hub"` + "\n"
- config += ` tunnel_interface_color = "mpls"` + "\n"
- config += ` tunnel_interface_restrict = true` + "\n"
- config += ` tunnel_interface_groups = 42949672` + "\n"
- config += ` tunnel_interface_border = false` + "\n"
- config += ` tunnel_interface_max_control_connections = 62` + "\n"
- config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
- config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
- config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
- config += ` tunnel_interface_port_hop = true` + "\n"
- config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
- config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
- config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
- config += ` tunnel_interface_clear_network_broadcast = false` + "\n"
- config += ` tunnel_interface_carrier = "default"` + "\n"
- config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
- config += ` tunnel_interface_last_resort_circuit = false` + "\n"
- config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
- config += ` tunnel_interface_hello_interval = 1000` + "\n"
- config += ` tunnel_interface_hello_tolerance = 12` + "\n"
- config += ` tunnel_interface_allow_all = false` + "\n"
- config += ` tunnel_interface_allow_bgp = false` + "\n"
- config += ` tunnel_interface_allow_dhcp = true` + "\n"
- config += ` tunnel_interface_allow_dns = true` + "\n"
- config += ` tunnel_interface_allow_icmp = true` + "\n"
- config += ` tunnel_interface_allow_netconf = false` + "\n"
- config += ` tunnel_interface_allow_ntp = false` + "\n"
- config += ` tunnel_interface_allow_ospf = false` + "\n"
- config += ` tunnel_interface_allow_ssh = false` + "\n"
- config += ` tunnel_interface_allow_stun = false` + "\n"
- config += ` tunnel_interface_allow_https = true` + "\n"
- config += ` tunnel_interface_allow_snmp = false` + "\n"
- config += ` tunnel_interface_allow_bfd = false` + "\n"
- config += ` tunnel_interface_encapsulations = [{` + "\n"
- config += ` encapsulation = "gre"` + "\n"
- config += ` preference = 4294967` + "\n"
- config += ` weight = 250` + "\n"
- config += ` }]` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` mtu = 1500` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` tloc_extension = "tloc"` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "test" {
- id = sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_transport_wan_vpn_profile_parcel.go b/internal/provider/data_source_sdwan_transport_wan_vpn_profile_parcel.go
deleted file mode 100644
index a6659b6cf..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_profile_parcel.go
+++ /dev/null
@@ -1,356 +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/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-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 the implementation satisfies the expected interfaces.
-var (
- _ datasource.DataSource = &TransportWANVPNProfileParcelDataSource{}
- _ datasource.DataSourceWithConfigure = &TransportWANVPNProfileParcelDataSource{}
-)
-
-func NewTransportWANVPNProfileParcelDataSource() datasource.DataSource {
- return &TransportWANVPNProfileParcelDataSource{}
-}
-
-type TransportWANVPNProfileParcelDataSource struct {
- client *sdwan.Client
-}
-
-func (d *TransportWANVPNProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_profile_parcel"
-}
-
-func (d *TransportWANVPNProfileParcelDataSource) 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 Transport WAN VPN 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,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: "VPN",
- Computed: true,
- },
- "enhance_ecmp_keying": schema.BoolAttribute{
- MarkdownDescription: "Enhance ECMP Keying",
- Computed: true,
- },
- "enhance_ecmp_keying_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "primary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: "Primary DNS Address (IPv4)",
- Computed: true,
- },
- "primary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: "Secondary DNS Address (IPv4)",
- Computed: true,
- },
- "secondary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "primary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: "Primary DNS Address (IPv6)",
- Computed: true,
- },
- "primary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "secondary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: "Secondary DNS Address (IPv6)",
- Computed: true,
- },
- "secondary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "new_host_mappings": schema.ListNestedAttribute{
- MarkdownDescription: "",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "host_name": schema.StringAttribute{
- MarkdownDescription: "Hostname",
- Computed: true,
- },
- "host_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "list_of_ip_addresses": schema.SetAttribute{
- MarkdownDescription: "List of IP",
- ElementType: types.StringType,
- Computed: true,
- },
- "list_of_ip_addresses_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv4_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Static Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: "IP Address",
- Computed: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: "Subnet Mask",
- Computed: true,
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "gateway": schema.StringAttribute{
- MarkdownDescription: "Gateway",
- Computed: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: "IPv4 Route Gateway Next Hop",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "ipv6_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Static Route",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: "Prefix",
- Computed: true,
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: "IPv6 Route Gateway Next Hop",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: "Address",
- Computed: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: "Administrative distance",
- Computed: true,
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: "IPv6 Route Gateway Next Hop",
- Computed: true,
- },
- "nat": schema.StringAttribute{
- MarkdownDescription: "IPv6 Nat",
- Computed: true,
- },
- "nat_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- "services": schema.ListNestedAttribute{
- MarkdownDescription: "Service",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "service_type": schema.StringAttribute{
- MarkdownDescription: "Service Type",
- Computed: true,
- },
- },
- },
- },
- "nat_64_v4_pools": schema.ListNestedAttribute{
- MarkdownDescription: "NAT64 V4 Pool",
- Computed: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat64_v4_pool_name": schema.StringAttribute{
- MarkdownDescription: "NAT64 v4 Pool Name",
- Computed: true,
- },
- "nat64_v4_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat64_v4_pool_range_start": schema.StringAttribute{
- MarkdownDescription: "NAT64 Pool Range Start",
- Computed: true,
- },
- "nat64_v4_pool_range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat64_v4_pool_range_end": schema.StringAttribute{
- MarkdownDescription: "NAT64 Pool Range End",
- Computed: true,
- },
- "nat64_v4_pool_range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- "nat64_v4_pool_overload": schema.BoolAttribute{
- MarkdownDescription: "NAT64 Overload",
- Computed: true,
- },
- "nat64_v4_pool_overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Computed: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (d *TransportWANVPNProfileParcelDataSource) 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 *TransportWANVPNProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
- var config TransportWANVPN
-
- // 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_transport_wan_vpn_profile_parcel_test.go b/internal/provider/data_source_sdwan_transport_wan_vpn_profile_parcel_test.go
deleted file mode 100644
index 322ef667c..000000000
--- a/internal/provider/data_source_sdwan_transport_wan_vpn_profile_parcel_test.go
+++ /dev/null
@@ -1,135 +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 TestAccDataSourceSdwanTransportWANVPNProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "enhance_ecmp_keying", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "primary_dns_address_ipv4", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "secondary_dns_address_ipv4", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "new_host_mappings.0.host_name", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.gateway", "nextHop"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv6_static_routes.0.prefix", "2002::/16"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "services.0.service_type", "TE"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_name", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_range_start", "203.0.113.50"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_range_end", "203.0.113.100"))
- checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_overload", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccDataSourceSdwanTransportWANVPNPrerequisitesProfileParcelConfig + testAccDataSourceSdwanTransportWANVPNProfileParcelConfig(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAccDataSource
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccDataSourceSdwanTransportWANVPNPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
-func testAccDataSourceSdwanTransportWANVPNProfileParcelConfig() string {
- config := `resource "sdwan_transport_wan_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` vpn = 0` + "\n"
- config += ` enhance_ecmp_keying = true` + "\n"
- config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
- config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
- config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
- config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
- config += ` new_host_mappings = [{` + "\n"
- config += ` host_name = "example"` + "\n"
- config += ` list_of_ip_addresses = ["1.2.3.4"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_static_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` gateway = "nextHop"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_static_routes = [{` + "\n"
- config += ` prefix = "2002::/16"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` services = [{` + "\n"
- config += ` service_type = "TE"` + "\n"
- config += ` }]` + "\n"
- config += ` nat_64_v4_pools = [{` + "\n"
- config += ` nat64_v4_pool_name = "example"` + "\n"
- config += ` nat64_v4_pool_range_start = "203.0.113.50"` + "\n"
- config += ` nat64_v4_pool_range_end = "203.0.113.100"` + "\n"
- config += ` nat64_v4_pool_overload = false` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
-
- config += `
- data "sdwan_transport_wan_vpn_profile_parcel" "test" {
- id = sdwan_transport_wan_vpn_profile_parcel.test.id
- feature_profile_id = sdwan_transport_feature_profile.test.id
- }
- `
- return config
-}
-
-// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/data_source_sdwan_zone_based_firewall_policy_definition_test.go b/internal/provider/data_source_sdwan_zone_based_firewall_policy_definition_test.go
index fc52e195f..74d72da48 100644
--- a/internal/provider/data_source_sdwan_zone_based_firewall_policy_definition_test.go
+++ b/internal/provider/data_source_sdwan_zone_based_firewall_policy_definition_test.go
@@ -73,6 +73,7 @@ resource "sdwan_geo_location_list_policy_object" "test" {
}
]
}
+
`
// End of section. //template:end testPrerequisites
diff --git a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go
index 90fbc7b77..aa23e3194 100644
--- a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go
+++ b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go
@@ -53,6 +53,7 @@ type ApplicationAwareRoutingPolicyDefinitionSequencesMatchEntries struct {
ApplicationListVersion types.Int64 `tfsdk:"application_list_version"`
DnsApplicationListId types.String `tfsdk:"dns_application_list_id"`
DnsApplicationListVersion types.Int64 `tfsdk:"dns_application_list_version"`
+ IcmpMessage types.String `tfsdk:"icmp_message"`
Dns types.String `tfsdk:"dns"`
Dscp types.Int64 `tfsdk:"dscp"`
Plp types.String `tfsdk:"plp"`
@@ -136,6 +137,9 @@ func (data ApplicationAwareRoutingPolicyDefinition) toBody(ctx context.Context)
if !childItem.DnsApplicationListId.IsNull() && childItem.Type.ValueString() == "dnsAppList" {
itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.DnsApplicationListId.ValueString())
}
+ if !childItem.IcmpMessage.IsNull() && childItem.Type.ValueString() == "icmpMessage" {
+ itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.IcmpMessage.ValueString())
+ }
if !childItem.Dns.IsNull() && childItem.Type.ValueString() == "dns" {
itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.Dns.ValueString())
}
@@ -279,6 +283,11 @@ func (data *ApplicationAwareRoutingPolicyDefinition) fromBody(ctx context.Contex
} else {
cItem.DnsApplicationListId = types.StringNull()
}
+ if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "icmpMessage" {
+ cItem.IcmpMessage = types.StringValue(ccValue.String())
+ } else {
+ cItem.IcmpMessage = types.StringNull()
+ }
if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "dns" {
cItem.Dns = types.StringValue(ccValue.String())
} else {
@@ -468,6 +477,9 @@ func (data *ApplicationAwareRoutingPolicyDefinition) hasChanges(ctx context.Cont
if !data.Sequences[i].MatchEntries[ii].DnsApplicationListId.Equal(state.Sequences[i].MatchEntries[ii].DnsApplicationListId) {
hasChanges = true
}
+ if !data.Sequences[i].MatchEntries[ii].IcmpMessage.Equal(state.Sequences[i].MatchEntries[ii].IcmpMessage) {
+ hasChanges = true
+ }
if !data.Sequences[i].MatchEntries[ii].Dns.Equal(state.Sequences[i].MatchEntries[ii].Dns) {
hasChanges = true
}
diff --git a/internal/provider/model_sdwan_application_priority_qos_policy.go b/internal/provider/model_sdwan_application_priority_qos_policy.go
new file mode 100644
index 000000000..eddefdf11
--- /dev/null
+++ b/internal/provider/model_sdwan_application_priority_qos_policy.go
@@ -0,0 +1,313 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ApplicationPriorityQoS 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"`
+ TargetInterface types.Set `tfsdk:"target_interface"`
+ TargetInterfaceVariable types.String `tfsdk:"target_interface_variable"`
+ QosSchedulers []ApplicationPriorityQoSQosSchedulers `tfsdk:"qos_schedulers"`
+}
+
+type ApplicationPriorityQoSQosSchedulers struct {
+ ForwardingClassId types.String `tfsdk:"forwarding_class_id"`
+ Drops types.String `tfsdk:"drops"`
+ Queue types.String `tfsdk:"queue"`
+ Bandwidth types.String `tfsdk:"bandwidth"`
+ SchedulingType types.String `tfsdk:"scheduling_type"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ApplicationPriorityQoS) getModel() string {
+ return "application_priority_qos"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ApplicationPriorityQoS) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/application-priority/%v/qos-policy", 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 ApplicationPriorityQoS) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.TargetInterfaceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"target.interfaces.optionType", "variable")
+ body, _ = sjson.Set(body, path+"target.interfaces.value", data.TargetInterfaceVariable.ValueString())
+ }
+ } else if !data.TargetInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global")
+ var values []string
+ data.TargetInterface.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"target.interfaces.value", values)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"qosMap.qosSchedulers", []interface{}{})
+ for _, item := range data.QosSchedulers {
+ itemBody := ""
+ if !item.ForwardingClassId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString())
+ }
+ }
+ if !item.Drops.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString())
+ }
+ }
+ if !item.Queue.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString())
+ }
+ }
+ if !item.Bandwidth.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString())
+ }
+ }
+ if !item.SchedulingType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"qosMap.qosSchedulers.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ApplicationPriorityQoS) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.TargetInterface = types.SetNull(types.StringType)
+ data.TargetInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "target.interfaces.optionType"); t.Exists() {
+ va := res.Get(path + "target.interfaces.value")
+ if t.String() == "variable" {
+ data.TargetInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TargetInterface = helpers.GetStringSet(va.Array())
+ }
+ }
+ if value := res.Get(path + "qosMap.qosSchedulers"); value.Exists() {
+ data.QosSchedulers = make([]ApplicationPriorityQoSQosSchedulers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ApplicationPriorityQoSQosSchedulers{}
+ item.ForwardingClassId = types.StringNull()
+
+ if t := v.Get("classMapRef.refId.optionType"); t.Exists() {
+ va := v.Get("classMapRef.refId.value")
+ if t.String() == "global" {
+ item.ForwardingClassId = types.StringValue(va.String())
+ }
+ }
+ item.Drops = types.StringNull()
+
+ if t := v.Get("drops.optionType"); t.Exists() {
+ va := v.Get("drops.value")
+ if t.String() == "global" {
+ item.Drops = types.StringValue(va.String())
+ }
+ }
+ item.Queue = types.StringNull()
+
+ if t := v.Get("queue.optionType"); t.Exists() {
+ va := v.Get("queue.value")
+ if t.String() == "global" {
+ item.Queue = types.StringValue(va.String())
+ }
+ }
+ item.Bandwidth = types.StringNull()
+
+ if t := v.Get("bandwidthPercent.optionType"); t.Exists() {
+ va := v.Get("bandwidthPercent.value")
+ if t.String() == "global" {
+ item.Bandwidth = types.StringValue(va.String())
+ }
+ }
+ item.SchedulingType = types.StringNull()
+
+ if t := v.Get("scheduling.optionType"); t.Exists() {
+ va := v.Get("scheduling.value")
+ if t.String() == "global" {
+ item.SchedulingType = types.StringValue(va.String())
+ }
+ }
+ data.QosSchedulers = append(data.QosSchedulers, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ApplicationPriorityQoS) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.TargetInterface = types.SetNull(types.StringType)
+ data.TargetInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "target.interfaces.optionType"); t.Exists() {
+ va := res.Get(path + "target.interfaces.value")
+ if t.String() == "variable" {
+ data.TargetInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TargetInterface = helpers.GetStringSet(va.Array())
+ }
+ }
+ for i := range data.QosSchedulers {
+ keys := [...]string{"queue"}
+ keyValues := [...]string{data.QosSchedulers[i].Queue.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "qosMap.qosSchedulers").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.QosSchedulers[i].ForwardingClassId = types.StringNull()
+
+ if t := r.Get("classMapRef.refId.optionType"); t.Exists() {
+ va := r.Get("classMapRef.refId.value")
+ if t.String() == "global" {
+ data.QosSchedulers[i].ForwardingClassId = types.StringValue(va.String())
+ }
+ }
+ data.QosSchedulers[i].Drops = types.StringNull()
+
+ if t := r.Get("drops.optionType"); t.Exists() {
+ va := r.Get("drops.value")
+ if t.String() == "global" {
+ data.QosSchedulers[i].Drops = types.StringValue(va.String())
+ }
+ }
+ data.QosSchedulers[i].Queue = types.StringNull()
+
+ if t := r.Get("queue.optionType"); t.Exists() {
+ va := r.Get("queue.value")
+ if t.String() == "global" {
+ data.QosSchedulers[i].Queue = types.StringValue(va.String())
+ }
+ }
+ data.QosSchedulers[i].Bandwidth = types.StringNull()
+
+ if t := r.Get("bandwidthPercent.optionType"); t.Exists() {
+ va := r.Get("bandwidthPercent.value")
+ if t.String() == "global" {
+ data.QosSchedulers[i].Bandwidth = types.StringValue(va.String())
+ }
+ }
+ data.QosSchedulers[i].SchedulingType = types.StringNull()
+
+ if t := r.Get("scheduling.optionType"); t.Exists() {
+ va := r.Get("scheduling.value")
+ if t.String() == "global" {
+ data.QosSchedulers[i].SchedulingType = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ApplicationPriorityQoS) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TargetInterface.IsNull() {
+ return false
+ }
+ if !data.TargetInterfaceVariable.IsNull() {
+ return false
+ }
+ if len(data.QosSchedulers) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go b/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go
deleted file mode 100644
index 4a789c9a6..000000000
--- a/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go
+++ /dev/null
@@ -1,310 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type ApplicationPriorityQoSPolicy 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"`
- TargetInterface types.Set `tfsdk:"target_interface"`
- TargetInterfaceVariable types.String `tfsdk:"target_interface_variable"`
- QosSchedulers []ApplicationPriorityQoSPolicyQosSchedulers `tfsdk:"qos_schedulers"`
-}
-
-type ApplicationPriorityQoSPolicyQosSchedulers struct {
- ForwardingClassId types.String `tfsdk:"forwarding_class_id"`
- Drops types.String `tfsdk:"drops"`
- Queue types.String `tfsdk:"queue"`
- Bandwidth types.String `tfsdk:"bandwidth"`
- SchedulingType types.String `tfsdk:"scheduling_type"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data ApplicationPriorityQoSPolicy) getModel() string {
- return "application_priority_qos_policy"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data ApplicationPriorityQoSPolicy) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/application-priority/%v/qos-policy", 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 ApplicationPriorityQoSPolicy) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.TargetInterfaceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"target.interfaces.optionType", "variable")
- body, _ = sjson.Set(body, path+"target.interfaces.value", data.TargetInterfaceVariable.ValueString())
- }
- } else if !data.TargetInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global")
- var values []string
- data.TargetInterface.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"target.interfaces.value", values)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"qosMap.qosSchedulers", []interface{}{})
- for _, item := range data.QosSchedulers {
- itemBody := ""
- if !item.ForwardingClassId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString())
- }
- }
- if !item.Drops.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString())
- }
- }
- if !item.Queue.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString())
- }
- }
- if !item.Bandwidth.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString())
- }
- }
- if !item.SchedulingType.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"qosMap.qosSchedulers.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *ApplicationPriorityQoSPolicy) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.TargetInterface = types.SetNull(types.StringType)
- data.TargetInterfaceVariable = types.StringNull()
- if t := res.Get(path + "target.interfaces.optionType"); t.Exists() {
- va := res.Get(path + "target.interfaces.value")
- if t.String() == "variable" {
- data.TargetInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TargetInterface = helpers.GetStringSet(va.Array())
- }
- }
- if value := res.Get(path + "qosMap.qosSchedulers"); value.Exists() {
- data.QosSchedulers = make([]ApplicationPriorityQoSPolicyQosSchedulers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ApplicationPriorityQoSPolicyQosSchedulers{}
- item.ForwardingClassId = types.StringNull()
-
- if t := v.Get("classMapRef.refId.optionType"); t.Exists() {
- va := v.Get("classMapRef.refId.value")
- if t.String() == "global" {
- item.ForwardingClassId = types.StringValue(va.String())
- }
- }
- item.Drops = types.StringNull()
-
- if t := v.Get("drops.optionType"); t.Exists() {
- va := v.Get("drops.value")
- if t.String() == "global" {
- item.Drops = types.StringValue(va.String())
- }
- }
- item.Queue = types.StringNull()
-
- if t := v.Get("queue.optionType"); t.Exists() {
- va := v.Get("queue.value")
- if t.String() == "global" {
- item.Queue = types.StringValue(va.String())
- }
- }
- item.Bandwidth = types.StringNull()
-
- if t := v.Get("bandwidthPercent.optionType"); t.Exists() {
- va := v.Get("bandwidthPercent.value")
- if t.String() == "global" {
- item.Bandwidth = types.StringValue(va.String())
- }
- }
- item.SchedulingType = types.StringNull()
-
- if t := v.Get("scheduling.optionType"); t.Exists() {
- va := v.Get("scheduling.value")
- if t.String() == "global" {
- item.SchedulingType = types.StringValue(va.String())
- }
- }
- data.QosSchedulers = append(data.QosSchedulers, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *ApplicationPriorityQoSPolicy) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.TargetInterface = types.SetNull(types.StringType)
- data.TargetInterfaceVariable = types.StringNull()
- if t := res.Get(path + "target.interfaces.optionType"); t.Exists() {
- va := res.Get(path + "target.interfaces.value")
- if t.String() == "variable" {
- data.TargetInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TargetInterface = helpers.GetStringSet(va.Array())
- }
- }
- for i := range data.QosSchedulers {
- keys := [...]string{"queue"}
- keyValues := [...]string{data.QosSchedulers[i].Queue.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "qosMap.qosSchedulers").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.QosSchedulers[i].ForwardingClassId = types.StringNull()
-
- if t := r.Get("classMapRef.refId.optionType"); t.Exists() {
- va := r.Get("classMapRef.refId.value")
- if t.String() == "global" {
- data.QosSchedulers[i].ForwardingClassId = types.StringValue(va.String())
- }
- }
- data.QosSchedulers[i].Drops = types.StringNull()
-
- if t := r.Get("drops.optionType"); t.Exists() {
- va := r.Get("drops.value")
- if t.String() == "global" {
- data.QosSchedulers[i].Drops = types.StringValue(va.String())
- }
- }
- data.QosSchedulers[i].Queue = types.StringNull()
-
- if t := r.Get("queue.optionType"); t.Exists() {
- va := r.Get("queue.value")
- if t.String() == "global" {
- data.QosSchedulers[i].Queue = types.StringValue(va.String())
- }
- }
- data.QosSchedulers[i].Bandwidth = types.StringNull()
-
- if t := r.Get("bandwidthPercent.optionType"); t.Exists() {
- va := r.Get("bandwidthPercent.value")
- if t.String() == "global" {
- data.QosSchedulers[i].Bandwidth = types.StringValue(va.String())
- }
- }
- data.QosSchedulers[i].SchedulingType = types.StringNull()
-
- if t := r.Get("scheduling.optionType"); t.Exists() {
- va := r.Get("scheduling.value")
- if t.String() == "global" {
- data.QosSchedulers[i].SchedulingType = types.StringValue(va.String())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *ApplicationPriorityQoSPolicy) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.TargetInterface.IsNull() {
- return false
- }
- if !data.TargetInterfaceVariable.IsNull() {
- return false
- }
- if len(data.QosSchedulers) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_cli_config_feature.go b/internal/provider/model_sdwan_cli_config_feature.go
new file mode 100644
index 000000000..2123c6c2f
--- /dev/null
+++ b/internal/provider/model_sdwan_cli_config_feature.go
@@ -0,0 +1,112 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type CLIConfigFeature struct {
+ Id types.String `tfsdk:"id"`
+ Version types.Int64 `tfsdk:"version"`
+ FeatureProfileId types.String `tfsdk:"feature_profile_id"`
+ Name types.String `tfsdk:"name"`
+ Description types.String `tfsdk:"description"`
+ CliConfiguration types.String `tfsdk:"cli_configuration"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data CLIConfigFeature) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/cli/%v/config/", 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 CLIConfigFeature) toBody(ctx context.Context) string {
+ body := ""
+ if !data.Name.IsNull() {
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ }
+ if !data.Description.IsNull() {
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ }
+ if !data.CliConfiguration.IsNull() {
+ body, _ = sjson.Set(body, "data.config", data.CliConfiguration.ValueString())
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *CLIConfigFeature) fromBody(ctx context.Context, res gjson.Result) {
+ if value := res.Get("payload.name"); value.Exists() {
+ data.Name = types.StringValue(value.String())
+ } else {
+ data.Name = types.StringNull()
+ }
+ if value := res.Get("payload.description"); value.Exists() {
+ data.Description = types.StringValue(value.String())
+ } else {
+ data.Description = types.StringNull()
+ }
+ if value := res.Get("payload.data.config"); value.Exists() {
+ data.CliConfiguration = types.StringValue(value.String())
+ } else {
+ data.CliConfiguration = types.StringNull()
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin hasChanges
+func (data *CLIConfigFeature) hasChanges(ctx context.Context, state *CLIConfigFeature) bool {
+ hasChanges := false
+ if !data.FeatureProfileId.Equal(state.FeatureProfileId) {
+ hasChanges = true
+ }
+ if !data.Name.Equal(state.Name) {
+ hasChanges = true
+ }
+ if !data.Description.Equal(state.Description) {
+ hasChanges = true
+ }
+ if !data.CliConfiguration.Equal(state.CliConfiguration) {
+ hasChanges = true
+ }
+ return hasChanges
+}
+
+// End of section. //template:end hasChanges
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateVersions
+
+// End of section. //template:end updateVersions
diff --git a/internal/provider/model_sdwan_cli_config_profile_parcel.go b/internal/provider/model_sdwan_cli_config_profile_parcel.go
deleted file mode 100644
index fee605bdd..000000000
--- a/internal/provider/model_sdwan_cli_config_profile_parcel.go
+++ /dev/null
@@ -1,112 +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/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type CLIConfigProfileParcel struct {
- Id types.String `tfsdk:"id"`
- Version types.Int64 `tfsdk:"version"`
- FeatureProfileId types.String `tfsdk:"feature_profile_id"`
- Name types.String `tfsdk:"name"`
- Description types.String `tfsdk:"description"`
- CliConfiguration types.String `tfsdk:"cli_configuration"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data CLIConfigProfileParcel) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/cli/%v/config/", 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 CLIConfigProfileParcel) toBody(ctx context.Context) string {
- body := ""
- if !data.Name.IsNull() {
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- }
- if !data.Description.IsNull() {
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- }
- if !data.CliConfiguration.IsNull() {
- body, _ = sjson.Set(body, "data.config", data.CliConfiguration.ValueString())
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *CLIConfigProfileParcel) fromBody(ctx context.Context, res gjson.Result) {
- if value := res.Get("payload.name"); value.Exists() {
- data.Name = types.StringValue(value.String())
- } else {
- data.Name = types.StringNull()
- }
- if value := res.Get("payload.description"); value.Exists() {
- data.Description = types.StringValue(value.String())
- } else {
- data.Description = types.StringNull()
- }
- if value := res.Get("payload.data.config"); value.Exists() {
- data.CliConfiguration = types.StringValue(value.String())
- } else {
- data.CliConfiguration = types.StringNull()
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin hasChanges
-func (data *CLIConfigProfileParcel) hasChanges(ctx context.Context, state *CLIConfigProfileParcel) bool {
- hasChanges := false
- if !data.FeatureProfileId.Equal(state.FeatureProfileId) {
- hasChanges = true
- }
- if !data.Name.Equal(state.Name) {
- hasChanges = true
- }
- if !data.Description.Equal(state.Description) {
- hasChanges = true
- }
- if !data.CliConfiguration.Equal(state.CliConfiguration) {
- hasChanges = true
- }
- return hasChanges
-}
-
-// End of section. //template:end hasChanges
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateVersions
-
-// End of section. //template:end updateVersions
diff --git a/internal/provider/model_sdwan_dns_security_feature_profile.go b/internal/provider/model_sdwan_dns_security_feature_profile.go
new file mode 100644
index 000000000..1f3161d77
--- /dev/null
+++ b/internal/provider/model_sdwan_dns_security_feature_profile.go
@@ -0,0 +1,93 @@
+// 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"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type DNSSecurityFeatureProfile struct {
+ Id types.String `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ Description types.String `tfsdk:"description"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data DNSSecurityFeatureProfile) getPath() string {
+ return "/v1/feature-profile/sdwan/dns-security/"
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data DNSSecurityFeatureProfile) toBody(ctx context.Context) string {
+ body := ""
+ if !data.Name.IsNull() {
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ }
+ if !data.Description.IsNull() {
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *DNSSecurityFeatureProfile) fromBody(ctx context.Context, res gjson.Result) {
+ if value := res.Get("profileName"); value.Exists() {
+ data.Name = types.StringValue(value.String())
+ } else {
+ data.Name = types.StringNull()
+ }
+ if value := res.Get("description"); value.Exists() {
+ data.Description = types.StringValue(value.String())
+ } else {
+ data.Description = types.StringNull()
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin hasChanges
+func (data *DNSSecurityFeatureProfile) hasChanges(ctx context.Context, state *DNSSecurityFeatureProfile) bool {
+ hasChanges := false
+ if !data.Name.Equal(state.Name) {
+ hasChanges = true
+ }
+ if !data.Description.Equal(state.Description) {
+ hasChanges = true
+ }
+ return hasChanges
+}
+
+// End of section. //template:end hasChanges
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateVersions
+
+// End of section. //template:end updateVersions
diff --git a/internal/provider/model_sdwan_embedded_security_feature_profile.go b/internal/provider/model_sdwan_embedded_security_feature_profile.go
new file mode 100644
index 000000000..a19c34810
--- /dev/null
+++ b/internal/provider/model_sdwan_embedded_security_feature_profile.go
@@ -0,0 +1,93 @@
+// 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"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type EmbeddedSecurityFeatureProfile struct {
+ Id types.String `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ Description types.String `tfsdk:"description"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data EmbeddedSecurityFeatureProfile) getPath() string {
+ return "/v1/feature-profile/sdwan/embedded-security/"
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data EmbeddedSecurityFeatureProfile) toBody(ctx context.Context) string {
+ body := ""
+ if !data.Name.IsNull() {
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ }
+ if !data.Description.IsNull() {
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *EmbeddedSecurityFeatureProfile) fromBody(ctx context.Context, res gjson.Result) {
+ if value := res.Get("profileName"); value.Exists() {
+ data.Name = types.StringValue(value.String())
+ } else {
+ data.Name = types.StringNull()
+ }
+ if value := res.Get("description"); value.Exists() {
+ data.Description = types.StringValue(value.String())
+ } else {
+ data.Description = types.StringNull()
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin hasChanges
+func (data *EmbeddedSecurityFeatureProfile) hasChanges(ctx context.Context, state *EmbeddedSecurityFeatureProfile) bool {
+ hasChanges := false
+ if !data.Name.Equal(state.Name) {
+ hasChanges = true
+ }
+ if !data.Description.Equal(state.Description) {
+ hasChanges = true
+ }
+ return hasChanges
+}
+
+// End of section. //template:end hasChanges
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateVersions
+
+// End of section. //template:end updateVersions
diff --git a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go
index c6c6ce9f4..800fe7c51 100644
--- a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go
+++ b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go
@@ -52,6 +52,7 @@ type IPv4ACLPolicyDefinitionSequencesMatchEntries struct {
Type types.String `tfsdk:"type"`
Dscp types.Int64 `tfsdk:"dscp"`
SourceIp types.String `tfsdk:"source_ip"`
+ IcmpMessage types.String `tfsdk:"icmp_message"`
DestinationIp types.String `tfsdk:"destination_ip"`
ClassMapId types.String `tfsdk:"class_map_id"`
ClassMapVersion types.Int64 `tfsdk:"class_map_version"`
@@ -138,6 +139,9 @@ func (data IPv4ACLPolicyDefinition) toBody(ctx context.Context) string {
if !childItem.SourceIp.IsNull() && childItem.Type.ValueString() == "sourceIp" {
itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.SourceIp.ValueString())
}
+ if !childItem.IcmpMessage.IsNull() && childItem.Type.ValueString() == "icmpMessage" {
+ itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.IcmpMessage.ValueString())
+ }
if !childItem.DestinationIp.IsNull() && childItem.Type.ValueString() == "destinationIp" {
itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.DestinationIp.ValueString())
}
@@ -278,6 +282,11 @@ func (data *IPv4ACLPolicyDefinition) fromBody(ctx context.Context, res gjson.Res
} else {
cItem.SourceIp = types.StringNull()
}
+ if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "icmpMessage" {
+ cItem.IcmpMessage = types.StringValue(ccValue.String())
+ } else {
+ cItem.IcmpMessage = types.StringNull()
+ }
if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "destinationIp" {
cItem.DestinationIp = types.StringValue(ccValue.String())
} else {
@@ -458,6 +467,9 @@ func (data *IPv4ACLPolicyDefinition) hasChanges(ctx context.Context, state *IPv4
if !data.Sequences[i].MatchEntries[ii].SourceIp.Equal(state.Sequences[i].MatchEntries[ii].SourceIp) {
hasChanges = true
}
+ if !data.Sequences[i].MatchEntries[ii].IcmpMessage.Equal(state.Sequences[i].MatchEntries[ii].IcmpMessage) {
+ hasChanges = true
+ }
if !data.Sequences[i].MatchEntries[ii].DestinationIp.Equal(state.Sequences[i].MatchEntries[ii].DestinationIp) {
hasChanges = true
}
diff --git a/internal/provider/model_sdwan_other_feature_profile.go b/internal/provider/model_sdwan_other_feature_profile.go
new file mode 100644
index 000000000..18866e160
--- /dev/null
+++ b/internal/provider/model_sdwan_other_feature_profile.go
@@ -0,0 +1,93 @@
+// 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"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type OtherFeatureProfile struct {
+ Id types.String `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ Description types.String `tfsdk:"description"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data OtherFeatureProfile) getPath() string {
+ return "/v1/feature-profile/sdwan/other/"
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data OtherFeatureProfile) toBody(ctx context.Context) string {
+ body := ""
+ if !data.Name.IsNull() {
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ }
+ if !data.Description.IsNull() {
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *OtherFeatureProfile) fromBody(ctx context.Context, res gjson.Result) {
+ if value := res.Get("profileName"); value.Exists() {
+ data.Name = types.StringValue(value.String())
+ } else {
+ data.Name = types.StringNull()
+ }
+ if value := res.Get("description"); value.Exists() {
+ data.Description = types.StringValue(value.String())
+ } else {
+ data.Description = types.StringNull()
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin hasChanges
+func (data *OtherFeatureProfile) hasChanges(ctx context.Context, state *OtherFeatureProfile) bool {
+ hasChanges := false
+ if !data.Name.Equal(state.Name) {
+ hasChanges = true
+ }
+ if !data.Description.Equal(state.Description) {
+ hasChanges = true
+ }
+ return hasChanges
+}
+
+// End of section. //template:end hasChanges
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateVersions
+
+// End of section. //template:end updateVersions
diff --git a/internal/provider/model_sdwan_other_thousandeyes_feature.go b/internal/provider/model_sdwan_other_thousandeyes_feature.go
new file mode 100644
index 000000000..5ac4d0693
--- /dev/null
+++ b/internal/provider/model_sdwan_other_thousandeyes_feature.go
@@ -0,0 +1,533 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type OtherThousandEyes 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"`
+ VirtualApplication []OtherThousandEyesVirtualApplication `tfsdk:"virtual_application"`
+}
+
+type OtherThousandEyesVirtualApplication struct {
+ AccountGroupToken types.String `tfsdk:"account_group_token"`
+ AccountGroupTokenVariable types.String `tfsdk:"account_group_token_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ VpnVariable types.String `tfsdk:"vpn_variable"`
+ ManagementIp types.String `tfsdk:"management_ip"`
+ ManagementIpVariable types.String `tfsdk:"management_ip_variable"`
+ ManagementSubnetMask types.String `tfsdk:"management_subnet_mask"`
+ ManagementSubnetMaskVariable types.String `tfsdk:"management_subnet_mask_variable"`
+ AgentDefaultGateway types.String `tfsdk:"agent_default_gateway"`
+ AgentDefaultGatewayVariable types.String `tfsdk:"agent_default_gateway_variable"`
+ NameServerIp types.String `tfsdk:"name_server_ip"`
+ NameServerIpVariable types.String `tfsdk:"name_server_ip_variable"`
+ Hostname types.String `tfsdk:"hostname"`
+ HostnameVariable types.String `tfsdk:"hostname_variable"`
+ ProxyType types.String `tfsdk:"proxy_type"`
+ ProxyHost types.String `tfsdk:"proxy_host"`
+ ProxyHostVariable types.String `tfsdk:"proxy_host_variable"`
+ ProxyPort types.Int64 `tfsdk:"proxy_port"`
+ ProxyPortVariable types.String `tfsdk:"proxy_port_variable"`
+ PacUrl types.String `tfsdk:"pac_url"`
+ PacUrlVariable types.String `tfsdk:"pac_url_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data OtherThousandEyes) getModel() string {
+ return "other_thousandeyes"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data OtherThousandEyes) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/other/%v/thousandeyes", 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 OtherThousandEyes) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.VirtualApplication {
+ itemBody := ""
+
+ if !item.AccountGroupTokenVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "token.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "token.value", item.AccountGroupTokenVariable.ValueString())
+ }
+ } else if !item.AccountGroupToken.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "token.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "token.value", item.AccountGroupToken.ValueString())
+ }
+ }
+
+ if !item.VpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
+ }
+ } else if item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+
+ if !item.ManagementIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "teMgmtIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "teMgmtIp.value", item.ManagementIpVariable.ValueString())
+ }
+ } else if !item.ManagementIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "teMgmtIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "teMgmtIp.value", item.ManagementIp.ValueString())
+ }
+ }
+
+ if !item.ManagementSubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "teMgmtSubnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "teMgmtSubnetMask.value", item.ManagementSubnetMaskVariable.ValueString())
+ }
+ } else if !item.ManagementSubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "teMgmtSubnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "teMgmtSubnetMask.value", item.ManagementSubnetMask.ValueString())
+ }
+ }
+
+ if !item.AgentDefaultGatewayVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "teVpgIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "teVpgIp.value", item.AgentDefaultGatewayVariable.ValueString())
+ }
+ } else if !item.AgentDefaultGateway.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "teVpgIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "teVpgIp.value", item.AgentDefaultGateway.ValueString())
+ }
+ }
+
+ if !item.NameServerIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nameServer.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nameServer.value", item.NameServerIpVariable.ValueString())
+ }
+ } else if item.NameServerIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nameServer.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nameServer.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nameServer.value", item.NameServerIp.ValueString())
+ }
+ }
+
+ if !item.HostnameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostname.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "hostname.value", item.HostnameVariable.ValueString())
+ }
+ } else if item.Hostname.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostname.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostname.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "hostname.value", item.Hostname.ValueString())
+ }
+ }
+ if !item.ProxyType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyType.value", item.ProxyType.ValueString())
+ }
+ }
+
+ if !item.ProxyHostVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyHost.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyHost.value", item.ProxyHostVariable.ValueString())
+ }
+ } else if !item.ProxyHost.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyHost.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyHost.value", item.ProxyHost.ValueString())
+ }
+ }
+
+ if !item.ProxyPortVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyPort.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyPort.value", item.ProxyPortVariable.ValueString())
+ }
+ } else if !item.ProxyPort.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyPort.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.proxyPort.value", item.ProxyPort.ValueInt64())
+ }
+ }
+
+ if !item.PacUrlVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.pacUrl.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.pacUrl.value", item.PacUrlVariable.ValueString())
+ }
+ } else if !item.PacUrl.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.pacUrl.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "proxyConfig.pacUrl.value", item.PacUrl.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"virtualApplication.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *OtherThousandEyes) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "virtualApplication"); value.Exists() {
+ data.VirtualApplication = make([]OtherThousandEyesVirtualApplication, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := OtherThousandEyesVirtualApplication{}
+ item.AccountGroupToken = types.StringNull()
+ item.AccountGroupTokenVariable = types.StringNull()
+ if t := v.Get("token.optionType"); t.Exists() {
+ va := v.Get("token.value")
+ if t.String() == "variable" {
+ item.AccountGroupTokenVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AccountGroupToken = types.StringValue(va.String())
+ }
+ }
+ item.Vpn = types.Int64Null()
+ item.VpnVariable = types.StringNull()
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "variable" {
+ item.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ item.ManagementIp = types.StringNull()
+ item.ManagementIpVariable = types.StringNull()
+ if t := v.Get("teMgmtIp.optionType"); t.Exists() {
+ va := v.Get("teMgmtIp.value")
+ if t.String() == "variable" {
+ item.ManagementIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ManagementIp = types.StringValue(va.String())
+ }
+ }
+ item.ManagementSubnetMask = types.StringNull()
+ item.ManagementSubnetMaskVariable = types.StringNull()
+ if t := v.Get("teMgmtSubnetMask.optionType"); t.Exists() {
+ va := v.Get("teMgmtSubnetMask.value")
+ if t.String() == "variable" {
+ item.ManagementSubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ManagementSubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.AgentDefaultGateway = types.StringNull()
+ item.AgentDefaultGatewayVariable = types.StringNull()
+ if t := v.Get("teVpgIp.optionType"); t.Exists() {
+ va := v.Get("teVpgIp.value")
+ if t.String() == "variable" {
+ item.AgentDefaultGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AgentDefaultGateway = types.StringValue(va.String())
+ }
+ }
+ item.NameServerIp = types.StringNull()
+ item.NameServerIpVariable = types.StringNull()
+ if t := v.Get("nameServer.optionType"); t.Exists() {
+ va := v.Get("nameServer.value")
+ if t.String() == "variable" {
+ item.NameServerIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NameServerIp = types.StringValue(va.String())
+ }
+ }
+ item.Hostname = types.StringNull()
+ item.HostnameVariable = types.StringNull()
+ if t := v.Get("hostname.optionType"); t.Exists() {
+ va := v.Get("hostname.value")
+ if t.String() == "variable" {
+ item.HostnameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Hostname = types.StringValue(va.String())
+ }
+ }
+ item.ProxyType = types.StringNull()
+
+ if t := v.Get("proxyConfig.proxyType.optionType"); t.Exists() {
+ va := v.Get("proxyConfig.proxyType.value")
+ if t.String() == "global" {
+ item.ProxyType = types.StringValue(va.String())
+ }
+ }
+ item.ProxyHost = types.StringNull()
+ item.ProxyHostVariable = types.StringNull()
+ if t := v.Get("proxyConfig.proxyHost.optionType"); t.Exists() {
+ va := v.Get("proxyConfig.proxyHost.value")
+ if t.String() == "variable" {
+ item.ProxyHostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ProxyHost = types.StringValue(va.String())
+ }
+ }
+ item.ProxyPort = types.Int64Null()
+ item.ProxyPortVariable = types.StringNull()
+ if t := v.Get("proxyConfig.proxyPort.optionType"); t.Exists() {
+ va := v.Get("proxyConfig.proxyPort.value")
+ if t.String() == "variable" {
+ item.ProxyPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ProxyPort = types.Int64Value(va.Int())
+ }
+ }
+ item.PacUrl = types.StringNull()
+ item.PacUrlVariable = types.StringNull()
+ if t := v.Get("proxyConfig.pacUrl.optionType"); t.Exists() {
+ va := v.Get("proxyConfig.pacUrl.value")
+ if t.String() == "variable" {
+ item.PacUrlVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PacUrl = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication = append(data.VirtualApplication, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *OtherThousandEyes) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.VirtualApplication {
+ keys := [...]string{"token"}
+ keyValues := [...]string{data.VirtualApplication[i].AccountGroupToken.ValueString()}
+ keyValuesVariables := [...]string{data.VirtualApplication[i].AccountGroupTokenVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "virtualApplication").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.VirtualApplication[i].AccountGroupToken = types.StringNull()
+ data.VirtualApplication[i].AccountGroupTokenVariable = types.StringNull()
+ if t := r.Get("token.optionType"); t.Exists() {
+ va := r.Get("token.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].AccountGroupTokenVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].AccountGroupToken = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].Vpn = types.Int64Null()
+ data.VirtualApplication[i].VpnVariable = types.StringNull()
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.VirtualApplication[i].ManagementIp = types.StringNull()
+ data.VirtualApplication[i].ManagementIpVariable = types.StringNull()
+ if t := r.Get("teMgmtIp.optionType"); t.Exists() {
+ va := r.Get("teMgmtIp.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].ManagementIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].ManagementIp = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].ManagementSubnetMask = types.StringNull()
+ data.VirtualApplication[i].ManagementSubnetMaskVariable = types.StringNull()
+ if t := r.Get("teMgmtSubnetMask.optionType"); t.Exists() {
+ va := r.Get("teMgmtSubnetMask.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].ManagementSubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].ManagementSubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].AgentDefaultGateway = types.StringNull()
+ data.VirtualApplication[i].AgentDefaultGatewayVariable = types.StringNull()
+ if t := r.Get("teVpgIp.optionType"); t.Exists() {
+ va := r.Get("teVpgIp.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].AgentDefaultGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].AgentDefaultGateway = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].NameServerIp = types.StringNull()
+ data.VirtualApplication[i].NameServerIpVariable = types.StringNull()
+ if t := r.Get("nameServer.optionType"); t.Exists() {
+ va := r.Get("nameServer.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].NameServerIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].NameServerIp = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].Hostname = types.StringNull()
+ data.VirtualApplication[i].HostnameVariable = types.StringNull()
+ if t := r.Get("hostname.optionType"); t.Exists() {
+ va := r.Get("hostname.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].HostnameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].Hostname = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].ProxyType = types.StringNull()
+
+ if t := r.Get("proxyConfig.proxyType.optionType"); t.Exists() {
+ va := r.Get("proxyConfig.proxyType.value")
+ if t.String() == "global" {
+ data.VirtualApplication[i].ProxyType = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].ProxyHost = types.StringNull()
+ data.VirtualApplication[i].ProxyHostVariable = types.StringNull()
+ if t := r.Get("proxyConfig.proxyHost.optionType"); t.Exists() {
+ va := r.Get("proxyConfig.proxyHost.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].ProxyHostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].ProxyHost = types.StringValue(va.String())
+ }
+ }
+ data.VirtualApplication[i].ProxyPort = types.Int64Null()
+ data.VirtualApplication[i].ProxyPortVariable = types.StringNull()
+ if t := r.Get("proxyConfig.proxyPort.optionType"); t.Exists() {
+ va := r.Get("proxyConfig.proxyPort.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].ProxyPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].ProxyPort = types.Int64Value(va.Int())
+ }
+ }
+ data.VirtualApplication[i].PacUrl = types.StringNull()
+ data.VirtualApplication[i].PacUrlVariable = types.StringNull()
+ if t := r.Get("proxyConfig.pacUrl.optionType"); t.Exists() {
+ va := r.Get("proxyConfig.pacUrl.value")
+ if t.String() == "variable" {
+ data.VirtualApplication[i].PacUrlVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VirtualApplication[i].PacUrl = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *OtherThousandEyes) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.VirtualApplication) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_other_ucse_feature.go b/internal/provider/model_sdwan_other_ucse_feature.go
new file mode 100644
index 000000000..765bf523b
--- /dev/null
+++ b/internal/provider/model_sdwan_other_ucse_feature.go
@@ -0,0 +1,581 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type OtherUCSE 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"`
+ Bay types.Int64 `tfsdk:"bay"`
+ Slot types.Int64 `tfsdk:"slot"`
+ AccessPortDedicated types.Bool `tfsdk:"access_port_dedicated"`
+ AccessPortSharedType types.String `tfsdk:"access_port_shared_type"`
+ AccessPortSharedFailoverType types.String `tfsdk:"access_port_shared_failover_type"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ DefaultGateway types.String `tfsdk:"default_gateway"`
+ DefaultGatewayVariable types.String `tfsdk:"default_gateway_variable"`
+ VlanId types.Int64 `tfsdk:"vlan_id"`
+ VlanIdVariable types.String `tfsdk:"vlan_id_variable"`
+ AssignPriority types.Int64 `tfsdk:"assign_priority"`
+ AssignPriorityVariable types.String `tfsdk:"assign_priority_variable"`
+ Interfaces []OtherUCSEInterfaces `tfsdk:"interfaces"`
+}
+
+type OtherUCSEInterfaces struct {
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ UcseInterfaceVpn types.Int64 `tfsdk:"ucse_interface_vpn"`
+ UcseInterfaceVpnVariable types.String `tfsdk:"ucse_interface_vpn_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data OtherUCSE) getModel() string {
+ return "other_ucse"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data OtherUCSE) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/other/%v/ucse", 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 OtherUCSE) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if !data.Bay.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bay.optionType", "global")
+ body, _ = sjson.Set(body, path+"bay.value", data.Bay.ValueInt64())
+ }
+ }
+ if !data.Slot.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"slot.optionType", "global")
+ body, _ = sjson.Set(body, path+"slot.value", data.Slot.ValueInt64())
+ }
+ }
+ if data.AccessPortDedicated.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.access-port.dedicated.optionType", "default")
+ body, _ = sjson.Set(body, path+"imc.access-port.dedicated.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.access-port.dedicated.optionType", "global")
+ body, _ = sjson.Set(body, path+"imc.access-port.dedicated.value", data.AccessPortDedicated.ValueBool())
+ }
+ }
+ if !data.AccessPortSharedType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.access-port.sharedLom.lomType.optionType", "global")
+ body, _ = sjson.Set(body, path+"imc.access-port.sharedLom.lomType.value", data.AccessPortSharedType.ValueString())
+ }
+ }
+ if !data.AccessPortSharedFailoverType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.access-port.sharedLom.failOverType.optionType", "global")
+ body, _ = sjson.Set(body, path+"imc.access-port.sharedLom.failOverType.value", data.AccessPortSharedFailoverType.ValueString())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.ip.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"imc.ip.address.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.ip.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"imc.ip.address.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.DefaultGatewayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.ip.defaultGateway.optionType", "variable")
+ body, _ = sjson.Set(body, path+"imc.ip.defaultGateway.value", data.DefaultGatewayVariable.ValueString())
+ }
+ } else if data.DefaultGateway.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.ip.defaultGateway.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.ip.defaultGateway.optionType", "global")
+ body, _ = sjson.Set(body, path+"imc.ip.defaultGateway.value", data.DefaultGateway.ValueString())
+ }
+ }
+
+ if !data.VlanIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.vlan.vlanId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"imc.vlan.vlanId.value", data.VlanIdVariable.ValueString())
+ }
+ } else if data.VlanId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.vlan.vlanId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.vlan.vlanId.optionType", "global")
+ body, _ = sjson.Set(body, path+"imc.vlan.vlanId.value", data.VlanId.ValueInt64())
+ }
+ }
+
+ if !data.AssignPriorityVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.vlan.priority.optionType", "variable")
+ body, _ = sjson.Set(body, path+"imc.vlan.priority.value", data.AssignPriorityVariable.ValueString())
+ }
+ } else if data.AssignPriority.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.vlan.priority.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"imc.vlan.priority.optionType", "global")
+ body, _ = sjson.Set(body, path+"imc.vlan.priority.value", data.AssignPriority.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"interface", []interface{}{})
+ for _, item := range data.Interfaces {
+ itemBody := ""
+
+ if !item.InterfaceNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString())
+ }
+ } else if item.InterfaceName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "l3.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "l3.value", true)
+ }
+
+ if !item.UcseInterfaceVpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ucseInterfaceVpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ucseInterfaceVpn.value", item.UcseInterfaceVpnVariable.ValueString())
+ }
+ } else if item.UcseInterfaceVpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ucseInterfaceVpn.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ucseInterfaceVpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ucseInterfaceVpn.value", item.UcseInterfaceVpn.ValueInt64())
+ }
+ }
+
+ if !item.Ipv4AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Ipv4AddressVariable.ValueString())
+ }
+ } else if !item.Ipv4Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Ipv4Address.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"interface.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *OtherUCSE) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Bay = types.Int64Null()
+
+ if t := res.Get(path + "bay.optionType"); t.Exists() {
+ va := res.Get(path + "bay.value")
+ if t.String() == "global" {
+ data.Bay = types.Int64Value(va.Int())
+ }
+ }
+ data.Slot = types.Int64Null()
+
+ if t := res.Get(path + "slot.optionType"); t.Exists() {
+ va := res.Get(path + "slot.value")
+ if t.String() == "global" {
+ data.Slot = types.Int64Value(va.Int())
+ }
+ }
+ data.AccessPortDedicated = types.BoolNull()
+
+ if t := res.Get(path + "imc.access-port.dedicated.optionType"); t.Exists() {
+ va := res.Get(path + "imc.access-port.dedicated.value")
+ if t.String() == "global" {
+ data.AccessPortDedicated = types.BoolValue(va.Bool())
+ }
+ }
+ data.AccessPortSharedType = types.StringNull()
+
+ if t := res.Get(path + "imc.access-port.sharedLom.lomType.optionType"); t.Exists() {
+ va := res.Get(path + "imc.access-port.sharedLom.lomType.value")
+ if t.String() == "global" {
+ data.AccessPortSharedType = types.StringValue(va.String())
+ }
+ }
+ data.AccessPortSharedFailoverType = types.StringNull()
+
+ if t := res.Get(path + "imc.access-port.sharedLom.failOverType.optionType"); t.Exists() {
+ va := res.Get(path + "imc.access-port.sharedLom.failOverType.value")
+ if t.String() == "global" {
+ data.AccessPortSharedFailoverType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "imc.ip.address.optionType"); t.Exists() {
+ va := res.Get(path + "imc.ip.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.DefaultGateway = types.StringNull()
+ data.DefaultGatewayVariable = types.StringNull()
+ if t := res.Get(path + "imc.ip.defaultGateway.optionType"); t.Exists() {
+ va := res.Get(path + "imc.ip.defaultGateway.value")
+ if t.String() == "variable" {
+ data.DefaultGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultGateway = types.StringValue(va.String())
+ }
+ }
+ data.VlanId = types.Int64Null()
+ data.VlanIdVariable = types.StringNull()
+ if t := res.Get(path + "imc.vlan.vlanId.optionType"); t.Exists() {
+ va := res.Get(path + "imc.vlan.vlanId.value")
+ if t.String() == "variable" {
+ data.VlanIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VlanId = types.Int64Value(va.Int())
+ }
+ }
+ data.AssignPriority = types.Int64Null()
+ data.AssignPriorityVariable = types.StringNull()
+ if t := res.Get(path + "imc.vlan.priority.optionType"); t.Exists() {
+ va := res.Get(path + "imc.vlan.priority.value")
+ if t.String() == "variable" {
+ data.AssignPriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AssignPriority = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "interface"); value.Exists() {
+ data.Interfaces = make([]OtherUCSEInterfaces, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := OtherUCSEInterfaces{}
+ item.InterfaceName = types.StringNull()
+ item.InterfaceNameVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ item.UcseInterfaceVpn = types.Int64Null()
+ item.UcseInterfaceVpnVariable = types.StringNull()
+ if t := v.Get("ucseInterfaceVpn.optionType"); t.Exists() {
+ va := v.Get("ucseInterfaceVpn.value")
+ if t.String() == "variable" {
+ item.UcseInterfaceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.UcseInterfaceVpn = types.Int64Value(va.Int())
+ }
+ }
+ item.Ipv4Address = types.StringNull()
+ item.Ipv4AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces = append(data.Interfaces, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *OtherUCSE) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Bay = types.Int64Null()
+
+ if t := res.Get(path + "bay.optionType"); t.Exists() {
+ va := res.Get(path + "bay.value")
+ if t.String() == "global" {
+ data.Bay = types.Int64Value(va.Int())
+ }
+ }
+ data.Slot = types.Int64Null()
+
+ if t := res.Get(path + "slot.optionType"); t.Exists() {
+ va := res.Get(path + "slot.value")
+ if t.String() == "global" {
+ data.Slot = types.Int64Value(va.Int())
+ }
+ }
+ data.AccessPortDedicated = types.BoolNull()
+
+ if t := res.Get(path + "imc.access-port.dedicated.optionType"); t.Exists() {
+ va := res.Get(path + "imc.access-port.dedicated.value")
+ if t.String() == "global" {
+ data.AccessPortDedicated = types.BoolValue(va.Bool())
+ }
+ }
+ data.AccessPortSharedType = types.StringNull()
+
+ if t := res.Get(path + "imc.access-port.sharedLom.lomType.optionType"); t.Exists() {
+ va := res.Get(path + "imc.access-port.sharedLom.lomType.value")
+ if t.String() == "global" {
+ data.AccessPortSharedType = types.StringValue(va.String())
+ }
+ }
+ data.AccessPortSharedFailoverType = types.StringNull()
+
+ if t := res.Get(path + "imc.access-port.sharedLom.failOverType.optionType"); t.Exists() {
+ va := res.Get(path + "imc.access-port.sharedLom.failOverType.value")
+ if t.String() == "global" {
+ data.AccessPortSharedFailoverType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "imc.ip.address.optionType"); t.Exists() {
+ va := res.Get(path + "imc.ip.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.DefaultGateway = types.StringNull()
+ data.DefaultGatewayVariable = types.StringNull()
+ if t := res.Get(path + "imc.ip.defaultGateway.optionType"); t.Exists() {
+ va := res.Get(path + "imc.ip.defaultGateway.value")
+ if t.String() == "variable" {
+ data.DefaultGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultGateway = types.StringValue(va.String())
+ }
+ }
+ data.VlanId = types.Int64Null()
+ data.VlanIdVariable = types.StringNull()
+ if t := res.Get(path + "imc.vlan.vlanId.optionType"); t.Exists() {
+ va := res.Get(path + "imc.vlan.vlanId.value")
+ if t.String() == "variable" {
+ data.VlanIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VlanId = types.Int64Value(va.Int())
+ }
+ }
+ data.AssignPriority = types.Int64Null()
+ data.AssignPriorityVariable = types.StringNull()
+ if t := res.Get(path + "imc.vlan.priority.optionType"); t.Exists() {
+ va := res.Get(path + "imc.vlan.priority.value")
+ if t.String() == "variable" {
+ data.AssignPriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AssignPriority = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Interfaces {
+ keys := [...]string{"ifName"}
+ keyValues := [...]string{data.Interfaces[i].InterfaceName.ValueString()}
+ keyValuesVariables := [...]string{data.Interfaces[i].InterfaceNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "interface").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Interfaces[i].InterfaceName = types.StringNull()
+ data.Interfaces[i].InterfaceNameVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].UcseInterfaceVpn = types.Int64Null()
+ data.Interfaces[i].UcseInterfaceVpnVariable = types.StringNull()
+ if t := r.Get("ucseInterfaceVpn.optionType"); t.Exists() {
+ va := r.Get("ucseInterfaceVpn.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].UcseInterfaceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].UcseInterfaceVpn = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].Ipv4Address = types.StringNull()
+ data.Interfaces[i].Ipv4AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *OtherUCSE) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.Bay.IsNull() {
+ return false
+ }
+ if !data.Slot.IsNull() {
+ return false
+ }
+ if !data.AccessPortDedicated.IsNull() {
+ return false
+ }
+ if !data.AccessPortSharedType.IsNull() {
+ return false
+ }
+ if !data.AccessPortSharedFailoverType.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultGateway.IsNull() {
+ return false
+ }
+ if !data.DefaultGatewayVariable.IsNull() {
+ return false
+ }
+ if !data.VlanId.IsNull() {
+ return false
+ }
+ if !data.VlanIdVariable.IsNull() {
+ return false
+ }
+ if !data.AssignPriority.IsNull() {
+ return false
+ }
+ if !data.AssignPriorityVariable.IsNull() {
+ return false
+ }
+ if len(data.Interfaces) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_app_probe_class.go b/internal/provider/model_sdwan_policy_object_app_probe_class.go
new file mode 100644
index 000000000..4ae2ec03a
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_app_probe_class.go
@@ -0,0 +1,273 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 PolicyObjectAppProbeClassEntries struct {
+ Map []PolicyObjectAppProbeClassEntriesMap `tfsdk:"map"`
+ ForwardingClass types.String `tfsdk:"forwarding_class"`
+}
+
+type PolicyObjectAppProbeClassEntriesMap struct {
+ Color types.String `tfsdk:"color"`
+ Dscp types.Int64 `tfsdk:"dscp"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+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 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 PolicyObjectAppProbeClass) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "map", []interface{}{})
+ for _, childItem := range item.Map {
+ itemChildBody := ""
+ if !childItem.Color.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "color.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "color.value", childItem.Color.ValueString())
+ }
+ }
+ if !childItem.Dscp.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "dscp.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "dscp.value", childItem.Dscp.ValueInt64())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "map.-1", itemChildBody)
+ }
+ }
+ if !item.ForwardingClass.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "forwardingClass.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "forwardingClass.value", item.ForwardingClass.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectAppProbeClassEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectAppProbeClassEntries{}
+ if cValue := v.Get("map"); cValue.Exists() {
+ item.Map = make([]PolicyObjectAppProbeClassEntriesMap, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := PolicyObjectAppProbeClassEntriesMap{}
+ cItem.Color = types.StringNull()
+
+ if t := cv.Get("color.optionType"); t.Exists() {
+ va := cv.Get("color.value")
+ if t.String() == "global" {
+ cItem.Color = types.StringValue(va.String())
+ }
+ }
+ cItem.Dscp = types.Int64Null()
+
+ if t := cv.Get("dscp.optionType"); t.Exists() {
+ va := cv.Get("dscp.value")
+ if t.String() == "global" {
+ cItem.Dscp = types.Int64Value(va.Int())
+ }
+ }
+ item.Map = append(item.Map, cItem)
+ return true
+ })
+ }
+ item.ForwardingClass = types.StringNull()
+
+ if t := v.Get("forwardingClass.optionType"); t.Exists() {
+ va := v.Get("forwardingClass.value")
+ if t.String() == "global" {
+ item.ForwardingClass = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"forwardingClass"}
+ keyValues := [...]string{data.Entries[i].ForwardingClass.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ for ci := range data.Entries[i].Map {
+ keys := [...]string{"color"}
+ keyValues := [...]string{data.Entries[i].Map[ci].Color.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("map").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Map[ci].Color = types.StringNull()
+
+ if t := cr.Get("color.optionType"); t.Exists() {
+ va := cr.Get("color.value")
+ if t.String() == "global" {
+ data.Entries[i].Map[ci].Color = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Map[ci].Dscp = types.Int64Null()
+
+ if t := cr.Get("dscp.optionType"); t.Exists() {
+ va := cr.Get("dscp.value")
+ if t.String() == "global" {
+ data.Entries[i].Map[ci].Dscp = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Entries[i].ForwardingClass = types.StringNull()
+
+ if t := r.Get("forwardingClass.optionType"); t.Exists() {
+ va := r.Get("forwardingClass.value")
+ if t.String() == "global" {
+ data.Entries[i].ForwardingClass = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectAppProbeClass) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_application_list.go b/internal/provider/model_sdwan_policy_object_application_list.go
new file mode 100644
index 000000000..21e6769ce
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_application_list.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectApplicationList 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 []PolicyObjectApplicationListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectApplicationListEntries struct {
+ Application types.String `tfsdk:"application"`
+ ApplicationFamily types.String `tfsdk:"application_family"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectApplicationList) getModel() string {
+ return "policy_object_application_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectApplicationList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/app-list", 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 PolicyObjectApplicationList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Application.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "app.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "app.value", item.Application.ValueString())
+ }
+ }
+ if !item.ApplicationFamily.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "appFamily.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "appFamily.value", item.ApplicationFamily.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectApplicationList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectApplicationListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectApplicationListEntries{}
+ item.Application = types.StringNull()
+
+ if t := v.Get("app.optionType"); t.Exists() {
+ va := v.Get("app.value")
+ if t.String() == "global" {
+ item.Application = types.StringValue(va.String())
+ }
+ }
+ item.ApplicationFamily = types.StringNull()
+
+ if t := v.Get("appFamily.optionType"); t.Exists() {
+ va := v.Get("appFamily.value")
+ if t.String() == "global" {
+ item.ApplicationFamily = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectApplicationList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"app", "appFamily"}
+ keyValues := [...]string{data.Entries[i].Application.ValueString(), data.Entries[i].ApplicationFamily.ValueString()}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Application = types.StringNull()
+
+ if t := r.Get("app.optionType"); t.Exists() {
+ va := r.Get("app.value")
+ if t.String() == "global" {
+ data.Entries[i].Application = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].ApplicationFamily = types.StringNull()
+
+ if t := r.Get("appFamily.optionType"); t.Exists() {
+ va := r.Get("appFamily.value")
+ if t.String() == "global" {
+ data.Entries[i].ApplicationFamily = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectApplicationList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_as_path_list.go b/internal/provider/model_sdwan_policy_object_as_path_list.go
new file mode 100644
index 000000000..936f3d632
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_as_path_list.go
@@ -0,0 +1,204 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 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 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 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 PolicyObjectASPathList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if !data.AsPathListId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"asPathListNum.optionType", "global")
+ body, _ = sjson.Set(body, path+"asPathListNum.value", data.AsPathListId.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"entries", []interface{}{})
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.AsPathList.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asPath.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asPath.value", item.AsPathList.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AsPathListId = types.Int64Null()
+
+ if t := res.Get(path + "asPathListNum.optionType"); t.Exists() {
+ va := res.Get(path + "asPathListNum.value")
+ if t.String() == "global" {
+ data.AsPathListId = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectASPathListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectASPathListEntries{}
+ item.AsPathList = types.StringNull()
+
+ if t := v.Get("asPath.optionType"); t.Exists() {
+ va := v.Get("asPath.value")
+ if t.String() == "global" {
+ item.AsPathList = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AsPathListId = types.Int64Null()
+
+ if t := res.Get(path + "asPathListNum.optionType"); t.Exists() {
+ va := res.Get(path + "asPathListNum.value")
+ if t.String() == "global" {
+ data.AsPathListId = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Entries {
+ keys := [...]string{"asPath"}
+ keyValues := [...]string{data.Entries[i].AsPathList.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].AsPathList = types.StringNull()
+
+ if t := r.Get("asPath.optionType"); t.Exists() {
+ va := r.Get("asPath.value")
+ if t.String() == "global" {
+ data.Entries[i].AsPathList = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectASPathList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.AsPathListId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_class_map.go b/internal/provider/model_sdwan_policy_object_class_map.go
new file mode 100644
index 000000000..0ffd21580
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_class_map.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectClassMap 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 []PolicyObjectClassMapEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectClassMapEntries struct {
+ Queue types.String `tfsdk:"queue"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectClassMap) getModel() string {
+ return "policy_object_class_map"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectClassMap) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/class", 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 PolicyObjectClassMap) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Queue.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectClassMap) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectClassMapEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectClassMapEntries{}
+ item.Queue = types.StringNull()
+
+ if t := v.Get("queue.optionType"); t.Exists() {
+ va := v.Get("queue.value")
+ if t.String() == "global" {
+ item.Queue = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectClassMap) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"queue"}
+ keyValues := [...]string{data.Entries[i].Queue.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Queue = types.StringNull()
+
+ if t := r.Get("queue.optionType"); t.Exists() {
+ va := r.Get("queue.value")
+ if t.String() == "global" {
+ data.Entries[i].Queue = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectClassMap) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_color_list.go b/internal/provider/model_sdwan_policy_object_color_list.go
new file mode 100644
index 000000000..9b673b767
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_color_list.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectColorList 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 []PolicyObjectColorListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectColorListEntries struct {
+ Color types.String `tfsdk:"color"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectColorList) getModel() string {
+ return "policy_object_color_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectColorList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/color", 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 PolicyObjectColorList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Color.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "color.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectColorList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectColorListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectColorListEntries{}
+ item.Color = types.StringNull()
+
+ if t := v.Get("color.optionType"); t.Exists() {
+ va := v.Get("color.value")
+ if t.String() == "global" {
+ item.Color = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectColorList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"color"}
+ keyValues := [...]string{data.Entries[i].Color.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Color = types.StringNull()
+
+ if t := r.Get("color.optionType"); t.Exists() {
+ va := r.Get("color.value")
+ if t.String() == "global" {
+ data.Entries[i].Color = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectColorList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_data_ipv4_prefix_list.go b/internal/provider/model_sdwan_policy_object_data_ipv4_prefix_list.go
new file mode 100644
index 000000000..b89830edb
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_data_ipv4_prefix_list.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectDataIPv4PrefixList 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 []PolicyObjectDataIPv4PrefixListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectDataIPv4PrefixListEntries struct {
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4PrefixLength types.Int64 `tfsdk:"ipv4_prefix_length"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectDataIPv4PrefixList) getModel() string {
+ return "policy_object_data_ipv4_prefix_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectDataIPv4PrefixList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/data-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 PolicyObjectDataIPv4PrefixList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Ipv4Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv4Address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv4Address.value", item.Ipv4Address.ValueString())
+ }
+ }
+ if !item.Ipv4PrefixLength.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv4PrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv4PrefixLength.value", item.Ipv4PrefixLength.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectDataIPv4PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectDataIPv4PrefixListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectDataIPv4PrefixListEntries{}
+ item.Ipv4Address = types.StringNull()
+
+ if t := v.Get("ipv4Address.optionType"); t.Exists() {
+ va := v.Get("ipv4Address.value")
+ if t.String() == "global" {
+ item.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ item.Ipv4PrefixLength = types.Int64Null()
+
+ if t := v.Get("ipv4PrefixLength.optionType"); t.Exists() {
+ va := v.Get("ipv4PrefixLength.value")
+ if t.String() == "global" {
+ item.Ipv4PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectDataIPv4PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"ipv4Address"}
+ keyValues := [...]string{data.Entries[i].Ipv4Address.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Ipv4Address = types.StringNull()
+
+ if t := r.Get("ipv4Address.optionType"); t.Exists() {
+ va := r.Get("ipv4Address.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Ipv4PrefixLength = types.Int64Null()
+
+ if t := r.Get("ipv4PrefixLength.optionType"); t.Exists() {
+ va := r.Get("ipv4PrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv4PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectDataIPv4PrefixList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_data_ipv6_prefix_list.go b/internal/provider/model_sdwan_policy_object_data_ipv6_prefix_list.go
new file mode 100644
index 000000000..dc181a92e
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_data_ipv6_prefix_list.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectDataIPv6PrefixList 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 []PolicyObjectDataIPv6PrefixListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectDataIPv6PrefixListEntries struct {
+ Ipv6Address types.String `tfsdk:"ipv6_address"`
+ Ipv6PrefixLength types.Int64 `tfsdk:"ipv6_prefix_length"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectDataIPv6PrefixList) getModel() string {
+ return "policy_object_data_ipv6_prefix_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectDataIPv6PrefixList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/data-ipv6-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 PolicyObjectDataIPv6PrefixList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Ipv6Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv6Address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv6Address.value", item.Ipv6Address.ValueString())
+ }
+ }
+ if !item.Ipv6PrefixLength.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv6PrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv6PrefixLength.value", item.Ipv6PrefixLength.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectDataIPv6PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectDataIPv6PrefixListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectDataIPv6PrefixListEntries{}
+ item.Ipv6Address = types.StringNull()
+
+ if t := v.Get("ipv6Address.optionType"); t.Exists() {
+ va := v.Get("ipv6Address.value")
+ if t.String() == "global" {
+ item.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ item.Ipv6PrefixLength = types.Int64Null()
+
+ if t := v.Get("ipv6PrefixLength.optionType"); t.Exists() {
+ va := v.Get("ipv6PrefixLength.value")
+ if t.String() == "global" {
+ item.Ipv6PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectDataIPv6PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"ipv6Address"}
+ keyValues := [...]string{data.Entries[i].Ipv6Address.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Ipv6Address = types.StringNull()
+
+ if t := r.Get("ipv6Address.optionType"); t.Exists() {
+ va := r.Get("ipv6Address.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Ipv6PrefixLength = types.Int64Null()
+
+ if t := r.Get("ipv6PrefixLength.optionType"); t.Exists() {
+ va := r.Get("ipv6PrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv6PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectDataIPv6PrefixList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_expanded_community_list.go b/internal/provider/model_sdwan_policy_object_expanded_community_list.go
new file mode 100644
index 000000000..4991c8bb9
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_expanded_community_list.go
@@ -0,0 +1,146 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectExpandedCommunityList 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"`
+ ExpandedCommunityLists types.Set `tfsdk:"expanded_community_lists"`
+ ExpandedCommunityListsVariable types.String `tfsdk:"expanded_community_lists_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectExpandedCommunityList) getModel() string {
+ return "policy_object_expanded_community_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectExpandedCommunityList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/expanded-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 PolicyObjectExpandedCommunityList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ExpandedCommunityListsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"expandedCommunityList.optionType", "variable")
+ body, _ = sjson.Set(body, path+"expandedCommunityList.value", data.ExpandedCommunityListsVariable.ValueString())
+ }
+ } else if !data.ExpandedCommunityLists.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"expandedCommunityList.optionType", "global")
+ var values []string
+ data.ExpandedCommunityLists.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"expandedCommunityList.value", values)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectExpandedCommunityList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.ExpandedCommunityLists = types.SetNull(types.StringType)
+ data.ExpandedCommunityListsVariable = types.StringNull()
+ if t := res.Get(path + "expandedCommunityList.optionType"); t.Exists() {
+ va := res.Get(path + "expandedCommunityList.value")
+ if t.String() == "variable" {
+ data.ExpandedCommunityListsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExpandedCommunityLists = helpers.GetStringSet(va.Array())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectExpandedCommunityList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.ExpandedCommunityLists = types.SetNull(types.StringType)
+ data.ExpandedCommunityListsVariable = types.StringNull()
+ if t := res.Get(path + "expandedCommunityList.optionType"); t.Exists() {
+ va := res.Get(path + "expandedCommunityList.value")
+ if t.String() == "variable" {
+ data.ExpandedCommunityListsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExpandedCommunityLists = helpers.GetStringSet(va.Array())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectExpandedCommunityList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.ExpandedCommunityLists.IsNull() {
+ return false
+ }
+ if !data.ExpandedCommunityListsVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_extended_community_list.go b/internal/provider/model_sdwan_policy_object_extended_community_list.go
new file mode 100644
index 000000000..5ad2e64d0
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_extended_community_list.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectExtendedCommunityList 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 []PolicyObjectExtendedCommunityListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectExtendedCommunityListEntries struct {
+ ExtendedCommunity types.String `tfsdk:"extended_community"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectExtendedCommunityList) getModel() string {
+ return "policy_object_extended_community_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectExtendedCommunityList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/ext-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 PolicyObjectExtendedCommunityList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+ body, _ = sjson.Set(body, path+"entries", []interface{}{})
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.ExtendedCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "extCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "extCommunity.value", item.ExtendedCommunity.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectExtendedCommunityList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectExtendedCommunityListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectExtendedCommunityListEntries{}
+ item.ExtendedCommunity = types.StringNull()
+
+ if t := v.Get("extCommunity.optionType"); t.Exists() {
+ va := v.Get("extCommunity.value")
+ if t.String() == "global" {
+ item.ExtendedCommunity = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectExtendedCommunityList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"extCommunity"}
+ keyValues := [...]string{data.Entries[i].ExtendedCommunity.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].ExtendedCommunity = types.StringNull()
+
+ if t := r.Get("extCommunity.optionType"); t.Exists() {
+ va := r.Get("extCommunity.value")
+ if t.String() == "global" {
+ data.Entries[i].ExtendedCommunity = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectExtendedCommunityList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_feature_profile.go b/internal/provider/model_sdwan_policy_object_feature_profile.go
new file mode 100644
index 000000000..218379b39
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_feature_profile.go
@@ -0,0 +1,93 @@
+// 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"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectFeatureProfile struct {
+ Id types.String `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ Description types.String `tfsdk:"description"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectFeatureProfile) getPath() string {
+ return "/v1/feature-profile/sdwan/policy-object/"
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data PolicyObjectFeatureProfile) toBody(ctx context.Context) string {
+ body := ""
+ if !data.Name.IsNull() {
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ }
+ if !data.Description.IsNull() {
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectFeatureProfile) fromBody(ctx context.Context, res gjson.Result) {
+ if value := res.Get("profileName"); value.Exists() {
+ data.Name = types.StringValue(value.String())
+ } else {
+ data.Name = types.StringNull()
+ }
+ if value := res.Get("description"); value.Exists() {
+ data.Description = types.StringValue(value.String())
+ } else {
+ data.Description = types.StringNull()
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin hasChanges
+func (data *PolicyObjectFeatureProfile) hasChanges(ctx context.Context, state *PolicyObjectFeatureProfile) bool {
+ hasChanges := false
+ if !data.Name.Equal(state.Name) {
+ hasChanges = true
+ }
+ if !data.Description.Equal(state.Description) {
+ hasChanges = true
+ }
+ return hasChanges
+}
+
+// End of section. //template:end hasChanges
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateVersions
+
+// End of section. //template:end updateVersions
diff --git a/internal/provider/model_sdwan_policy_object_ipv4_prefix_list.go b/internal/provider/model_sdwan_policy_object_ipv4_prefix_list.go
new file mode 100644
index 000000000..04b01a6d6
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_ipv4_prefix_list.go
@@ -0,0 +1,248 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectIPv4PrefixList 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 []PolicyObjectIPv4PrefixListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectIPv4PrefixListEntries struct {
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4PrefixLength types.Int64 `tfsdk:"ipv4_prefix_length"`
+ Le types.Int64 `tfsdk:"le"`
+ Ge types.Int64 `tfsdk:"ge"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectIPv4PrefixList) getModel() string {
+ return "policy_object_ipv4_prefix_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectIPv4PrefixList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/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 PolicyObjectIPv4PrefixList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Ipv4Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv4Address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv4Address.value", item.Ipv4Address.ValueString())
+ }
+ }
+ if !item.Ipv4PrefixLength.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv4PrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv4PrefixLength.value", item.Ipv4PrefixLength.ValueInt64())
+ }
+ }
+ if !item.Le.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "leRangePrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "leRangePrefixLength.value", item.Le.ValueInt64())
+ }
+ }
+ if !item.Ge.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "geRangePrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "geRangePrefixLength.value", item.Ge.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectIPv4PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectIPv4PrefixListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectIPv4PrefixListEntries{}
+ item.Ipv4Address = types.StringNull()
+
+ if t := v.Get("ipv4Address.optionType"); t.Exists() {
+ va := v.Get("ipv4Address.value")
+ if t.String() == "global" {
+ item.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ item.Ipv4PrefixLength = types.Int64Null()
+
+ if t := v.Get("ipv4PrefixLength.optionType"); t.Exists() {
+ va := v.Get("ipv4PrefixLength.value")
+ if t.String() == "global" {
+ item.Ipv4PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ item.Le = types.Int64Null()
+
+ if t := v.Get("leRangePrefixLength.optionType"); t.Exists() {
+ va := v.Get("leRangePrefixLength.value")
+ if t.String() == "global" {
+ item.Le = types.Int64Value(va.Int())
+ }
+ }
+ item.Ge = types.Int64Null()
+
+ if t := v.Get("geRangePrefixLength.optionType"); t.Exists() {
+ va := v.Get("geRangePrefixLength.value")
+ if t.String() == "global" {
+ item.Ge = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectIPv4PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"ipv4Address", "ipv4PrefixLength"}
+ keyValues := [...]string{data.Entries[i].Ipv4Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv4PrefixLength.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Ipv4Address = types.StringNull()
+
+ if t := r.Get("ipv4Address.optionType"); t.Exists() {
+ va := r.Get("ipv4Address.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Ipv4PrefixLength = types.Int64Null()
+
+ if t := r.Get("ipv4PrefixLength.optionType"); t.Exists() {
+ va := r.Get("ipv4PrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv4PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].Le = types.Int64Null()
+
+ if t := r.Get("leRangePrefixLength.optionType"); t.Exists() {
+ va := r.Get("leRangePrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Le = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].Ge = types.Int64Null()
+
+ if t := r.Get("geRangePrefixLength.optionType"); t.Exists() {
+ va := r.Get("geRangePrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Ge = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectIPv4PrefixList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_ipv6_prefix_list.go b/internal/provider/model_sdwan_policy_object_ipv6_prefix_list.go
new file mode 100644
index 000000000..b73b0b724
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_ipv6_prefix_list.go
@@ -0,0 +1,248 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectIPv6PrefixList 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 []PolicyObjectIPv6PrefixListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectIPv6PrefixListEntries struct {
+ Ipv6Address types.String `tfsdk:"ipv6_address"`
+ Ipv6PrefixLength types.Int64 `tfsdk:"ipv6_prefix_length"`
+ Le types.Int64 `tfsdk:"le"`
+ Ge types.Int64 `tfsdk:"ge"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectIPv6PrefixList) getModel() string {
+ return "policy_object_ipv6_prefix_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectIPv6PrefixList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/ipv6-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 PolicyObjectIPv6PrefixList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Ipv6Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv6Address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv6Address.value", item.Ipv6Address.ValueString())
+ }
+ }
+ if !item.Ipv6PrefixLength.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv6PrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipv6PrefixLength.value", item.Ipv6PrefixLength.ValueInt64())
+ }
+ }
+ if !item.Le.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "leRangePrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "leRangePrefixLength.value", item.Le.ValueInt64())
+ }
+ }
+ if !item.Ge.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "geRangePrefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "geRangePrefixLength.value", item.Ge.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectIPv6PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectIPv6PrefixListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectIPv6PrefixListEntries{}
+ item.Ipv6Address = types.StringNull()
+
+ if t := v.Get("ipv6Address.optionType"); t.Exists() {
+ va := v.Get("ipv6Address.value")
+ if t.String() == "global" {
+ item.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ item.Ipv6PrefixLength = types.Int64Null()
+
+ if t := v.Get("ipv6PrefixLength.optionType"); t.Exists() {
+ va := v.Get("ipv6PrefixLength.value")
+ if t.String() == "global" {
+ item.Ipv6PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ item.Le = types.Int64Null()
+
+ if t := v.Get("leRangePrefixLength.optionType"); t.Exists() {
+ va := v.Get("leRangePrefixLength.value")
+ if t.String() == "global" {
+ item.Le = types.Int64Value(va.Int())
+ }
+ }
+ item.Ge = types.Int64Null()
+
+ if t := v.Get("geRangePrefixLength.optionType"); t.Exists() {
+ va := v.Get("geRangePrefixLength.value")
+ if t.String() == "global" {
+ item.Ge = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectIPv6PrefixList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"ipv6Address", "ipv6PrefixLength"}
+ keyValues := [...]string{data.Entries[i].Ipv6Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv6PrefixLength.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Ipv6Address = types.StringNull()
+
+ if t := r.Get("ipv6Address.optionType"); t.Exists() {
+ va := r.Get("ipv6Address.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Ipv6PrefixLength = types.Int64Null()
+
+ if t := r.Get("ipv6PrefixLength.optionType"); t.Exists() {
+ va := r.Get("ipv6PrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Ipv6PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].Le = types.Int64Null()
+
+ if t := r.Get("leRangePrefixLength.optionType"); t.Exists() {
+ va := r.Get("leRangePrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Le = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].Ge = types.Int64Null()
+
+ if t := r.Get("geRangePrefixLength.optionType"); t.Exists() {
+ va := r.Get("geRangePrefixLength.value")
+ if t.String() == "global" {
+ data.Entries[i].Ge = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectIPv6PrefixList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_mirror.go b/internal/provider/model_sdwan_policy_object_mirror.go
new file mode 100644
index 000000000..eb5f7ef97
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_mirror.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectMirror 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 []PolicyObjectMirrorEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectMirrorEntries struct {
+ RemoteDestinationIp types.String `tfsdk:"remote_destination_ip"`
+ SourceIp types.String `tfsdk:"source_ip"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectMirror) getModel() string {
+ return "policy_object_mirror"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectMirror) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/mirror", 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 PolicyObjectMirror) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.RemoteDestinationIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteDestIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "remoteDestIp.value", item.RemoteDestinationIp.ValueString())
+ }
+ }
+ if !item.SourceIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectMirror) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectMirrorEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectMirrorEntries{}
+ item.RemoteDestinationIp = types.StringNull()
+
+ if t := v.Get("remoteDestIp.optionType"); t.Exists() {
+ va := v.Get("remoteDestIp.value")
+ if t.String() == "global" {
+ item.RemoteDestinationIp = types.StringValue(va.String())
+ }
+ }
+ item.SourceIp = types.StringNull()
+
+ if t := v.Get("sourceIp.optionType"); t.Exists() {
+ va := v.Get("sourceIp.value")
+ if t.String() == "global" {
+ item.SourceIp = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectMirror) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"remoteDestIp", "sourceIp"}
+ keyValues := [...]string{data.Entries[i].RemoteDestinationIp.ValueString(), data.Entries[i].SourceIp.ValueString()}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].RemoteDestinationIp = types.StringNull()
+
+ if t := r.Get("remoteDestIp.optionType"); t.Exists() {
+ va := r.Get("remoteDestIp.value")
+ if t.String() == "global" {
+ data.Entries[i].RemoteDestinationIp = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].SourceIp = types.StringNull()
+
+ if t := r.Get("sourceIp.optionType"); t.Exists() {
+ va := r.Get("sourceIp.value")
+ if t.String() == "global" {
+ data.Entries[i].SourceIp = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectMirror) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_policer.go b/internal/provider/model_sdwan_policy_object_policer.go
new file mode 100644
index 000000000..7ef72ff1b
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_policer.go
@@ -0,0 +1,225 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectPolicer 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 []PolicyObjectPolicerEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectPolicerEntries struct {
+ BurstBytes types.Int64 `tfsdk:"burst_bytes"`
+ ExceedAction types.String `tfsdk:"exceed_action"`
+ RateBps types.Int64 `tfsdk:"rate_bps"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectPolicer) getModel() string {
+ return "policy_object_policer"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectPolicer) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/policer", 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 PolicyObjectPolicer) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.BurstBytes.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "burst.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "burst.value", item.BurstBytes.ValueInt64())
+ }
+ }
+ if !item.ExceedAction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "exceed.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "exceed.value", item.ExceedAction.ValueString())
+ }
+ }
+ if !item.RateBps.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rate.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "rate.value", item.RateBps.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectPolicer) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectPolicerEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectPolicerEntries{}
+ item.BurstBytes = types.Int64Null()
+
+ if t := v.Get("burst.optionType"); t.Exists() {
+ va := v.Get("burst.value")
+ if t.String() == "global" {
+ item.BurstBytes = types.Int64Value(va.Int())
+ }
+ }
+ item.ExceedAction = types.StringNull()
+
+ if t := v.Get("exceed.optionType"); t.Exists() {
+ va := v.Get("exceed.value")
+ if t.String() == "global" {
+ item.ExceedAction = types.StringValue(va.String())
+ }
+ }
+ item.RateBps = types.Int64Null()
+
+ if t := v.Get("rate.optionType"); t.Exists() {
+ va := v.Get("rate.value")
+ if t.String() == "global" {
+ item.RateBps = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectPolicer) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"burst", "exceed", "rate"}
+ keyValues := [...]string{strconv.FormatInt(data.Entries[i].BurstBytes.ValueInt64(), 10), data.Entries[i].ExceedAction.ValueString(), strconv.FormatInt(data.Entries[i].RateBps.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{"", "", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].BurstBytes = types.Int64Null()
+
+ if t := r.Get("burst.optionType"); t.Exists() {
+ va := r.Get("burst.value")
+ if t.String() == "global" {
+ data.Entries[i].BurstBytes = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].ExceedAction = types.StringNull()
+
+ if t := r.Get("exceed.optionType"); t.Exists() {
+ va := r.Get("exceed.value")
+ if t.String() == "global" {
+ data.Entries[i].ExceedAction = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].RateBps = types.Int64Null()
+
+ if t := r.Get("rate.optionType"); t.Exists() {
+ va := r.Get("rate.value")
+ if t.String() == "global" {
+ data.Entries[i].RateBps = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectPolicer) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_preferred_color_group.go b/internal/provider/model_sdwan_policy_object_preferred_color_group.go
new file mode 100644
index 000000000..f1078fc78
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_preferred_color_group.go
@@ -0,0 +1,300 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectPreferredColorGroup 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 []PolicyObjectPreferredColorGroupEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectPreferredColorGroupEntries struct {
+ PrimaryColorPreference types.Set `tfsdk:"primary_color_preference"`
+ PrimaryPathPreference types.String `tfsdk:"primary_path_preference"`
+ SecondaryColorPreference types.Set `tfsdk:"secondary_color_preference"`
+ SecondaryPathPreference types.String `tfsdk:"secondary_path_preference"`
+ TertiaryColorPreference types.Set `tfsdk:"tertiary_color_preference"`
+ TertiaryPathPreference types.String `tfsdk:"tertiary_path_preference"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectPreferredColorGroup) getModel() string {
+ return "policy_object_preferred_color_group"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectPreferredColorGroup) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/preferred-color-group", 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 PolicyObjectPreferredColorGroup) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.PrimaryColorPreference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "primaryPreference.colorPreference.optionType", "global")
+ var values []string
+ item.PrimaryColorPreference.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "primaryPreference.colorPreference.value", values)
+ }
+ }
+ if !item.PrimaryPathPreference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "primaryPreference.pathPreference.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "primaryPreference.pathPreference.value", item.PrimaryPathPreference.ValueString())
+ }
+ }
+ if !item.SecondaryColorPreference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "secondaryPreference.colorPreference.optionType", "global")
+ var values []string
+ item.SecondaryColorPreference.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "secondaryPreference.colorPreference.value", values)
+ }
+ }
+ if !item.SecondaryPathPreference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "secondaryPreference.pathPreference.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "secondaryPreference.pathPreference.value", item.SecondaryPathPreference.ValueString())
+ }
+ }
+ if !item.TertiaryColorPreference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tertiaryPreference.colorPreference.optionType", "global")
+ var values []string
+ item.TertiaryColorPreference.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "tertiaryPreference.colorPreference.value", values)
+ }
+ }
+ if !item.TertiaryPathPreference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tertiaryPreference.pathPreference.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tertiaryPreference.pathPreference.value", item.TertiaryPathPreference.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectPreferredColorGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectPreferredColorGroupEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectPreferredColorGroupEntries{}
+ item.PrimaryColorPreference = types.SetNull(types.StringType)
+
+ if t := v.Get("primaryPreference.colorPreference.optionType"); t.Exists() {
+ va := v.Get("primaryPreference.colorPreference.value")
+ if t.String() == "global" {
+ item.PrimaryColorPreference = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.PrimaryPathPreference = types.StringNull()
+
+ if t := v.Get("primaryPreference.pathPreference.optionType"); t.Exists() {
+ va := v.Get("primaryPreference.pathPreference.value")
+ if t.String() == "global" {
+ item.PrimaryPathPreference = types.StringValue(va.String())
+ }
+ }
+ item.SecondaryColorPreference = types.SetNull(types.StringType)
+
+ if t := v.Get("secondaryPreference.colorPreference.optionType"); t.Exists() {
+ va := v.Get("secondaryPreference.colorPreference.value")
+ if t.String() == "global" {
+ item.SecondaryColorPreference = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.SecondaryPathPreference = types.StringNull()
+
+ if t := v.Get("secondaryPreference.pathPreference.optionType"); t.Exists() {
+ va := v.Get("secondaryPreference.pathPreference.value")
+ if t.String() == "global" {
+ item.SecondaryPathPreference = types.StringValue(va.String())
+ }
+ }
+ item.TertiaryColorPreference = types.SetNull(types.StringType)
+
+ if t := v.Get("tertiaryPreference.colorPreference.optionType"); t.Exists() {
+ va := v.Get("tertiaryPreference.colorPreference.value")
+ if t.String() == "global" {
+ item.TertiaryColorPreference = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.TertiaryPathPreference = types.StringNull()
+
+ if t := v.Get("tertiaryPreference.pathPreference.optionType"); t.Exists() {
+ va := v.Get("tertiaryPreference.pathPreference.value")
+ if t.String() == "global" {
+ item.TertiaryPathPreference = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectPreferredColorGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"primaryPreference.pathPreference", "secondaryPreference.pathPreference", "tertiaryPreference.pathPreference"}
+ keyValues := [...]string{data.Entries[i].PrimaryPathPreference.ValueString(), data.Entries[i].SecondaryPathPreference.ValueString(), data.Entries[i].TertiaryPathPreference.ValueString()}
+ keyValuesVariables := [...]string{"", "", "", "", "", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].PrimaryColorPreference = types.SetNull(types.StringType)
+
+ if t := r.Get("primaryPreference.colorPreference.optionType"); t.Exists() {
+ va := r.Get("primaryPreference.colorPreference.value")
+ if t.String() == "global" {
+ data.Entries[i].PrimaryColorPreference = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Entries[i].PrimaryPathPreference = types.StringNull()
+
+ if t := r.Get("primaryPreference.pathPreference.optionType"); t.Exists() {
+ va := r.Get("primaryPreference.pathPreference.value")
+ if t.String() == "global" {
+ data.Entries[i].PrimaryPathPreference = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].SecondaryColorPreference = types.SetNull(types.StringType)
+
+ if t := r.Get("secondaryPreference.colorPreference.optionType"); t.Exists() {
+ va := r.Get("secondaryPreference.colorPreference.value")
+ if t.String() == "global" {
+ data.Entries[i].SecondaryColorPreference = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Entries[i].SecondaryPathPreference = types.StringNull()
+
+ if t := r.Get("secondaryPreference.pathPreference.optionType"); t.Exists() {
+ va := r.Get("secondaryPreference.pathPreference.value")
+ if t.String() == "global" {
+ data.Entries[i].SecondaryPathPreference = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].TertiaryColorPreference = types.SetNull(types.StringType)
+
+ if t := r.Get("tertiaryPreference.colorPreference.optionType"); t.Exists() {
+ va := r.Get("tertiaryPreference.colorPreference.value")
+ if t.String() == "global" {
+ data.Entries[i].TertiaryColorPreference = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Entries[i].TertiaryPathPreference = types.StringNull()
+
+ if t := r.Get("tertiaryPreference.pathPreference.optionType"); t.Exists() {
+ va := r.Get("tertiaryPreference.pathPreference.value")
+ if t.String() == "global" {
+ data.Entries[i].TertiaryPathPreference = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectPreferredColorGroup) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_data_ipv4_prefix_list.go b/internal/provider/model_sdwan_policy_object_security_data_ipv4_prefix_list.go
new file mode 100644
index 000000000..db1739136
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_data_ipv4_prefix_list.go
@@ -0,0 +1,189 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 PolicyObjectSecurityDataIPv4PrefixListEntries struct {
+ IpPrefix types.String `tfsdk:"ip_prefix"`
+ IpPrefixVariable types.String `tfsdk:"ip_prefix_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+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 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 PolicyObjectSecurityDataIPv4PrefixList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+
+ if !item.IpPrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipPrefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipPrefix.value", item.IpPrefixVariable.ValueString())
+ }
+ } else if !item.IpPrefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipPrefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipPrefix.value", item.IpPrefix.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityDataIPv4PrefixListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityDataIPv4PrefixListEntries{}
+ item.IpPrefix = types.StringNull()
+ item.IpPrefixVariable = types.StringNull()
+ if t := v.Get("ipPrefix.optionType"); t.Exists() {
+ va := v.Get("ipPrefix.value")
+ if t.String() == "variable" {
+ item.IpPrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.IpPrefix = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"ipPrefix"}
+ keyValues := [...]string{data.Entries[i].IpPrefix.ValueString()}
+ keyValuesVariables := [...]string{data.Entries[i].IpPrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].IpPrefix = types.StringNull()
+ data.Entries[i].IpPrefixVariable = types.StringNull()
+ if t := r.Get("ipPrefix.optionType"); t.Exists() {
+ va := r.Get("ipPrefix.value")
+ if t.String() == "variable" {
+ data.Entries[i].IpPrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Entries[i].IpPrefix = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityDataIPv4PrefixList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_fqdn_list.go b/internal/provider/model_sdwan_policy_object_security_fqdn_list.go
new file mode 100644
index 000000000..ff8c2fb5c
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_fqdn_list.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 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 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 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 PolicyObjectSecurityFQDNList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Pattern.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "pattern.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "pattern.value", item.Pattern.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityFQDNListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityFQDNListEntries{}
+ item.Pattern = types.StringNull()
+
+ if t := v.Get("pattern.optionType"); t.Exists() {
+ va := v.Get("pattern.value")
+ if t.String() == "global" {
+ item.Pattern = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"pattern"}
+ keyValues := [...]string{data.Entries[i].Pattern.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Pattern = types.StringNull()
+
+ if t := r.Get("pattern.optionType"); t.Exists() {
+ va := r.Get("pattern.value")
+ if t.String() == "global" {
+ data.Entries[i].Pattern = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityFQDNList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_geolocation_list.go b/internal/provider/model_sdwan_policy_object_security_geolocation_list.go
new file mode 100644
index 000000000..036e36390
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_geolocation_list.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 PolicyObjectSecurityGeolocationListEntries struct {
+ Country types.String `tfsdk:"country"`
+ Continent types.String `tfsdk:"continent"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+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 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 PolicyObjectSecurityGeolocationList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Country.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "country.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "country.value", item.Country.ValueString())
+ }
+ }
+ if !item.Continent.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "continent.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "continent.value", item.Continent.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityGeolocationListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityGeolocationListEntries{}
+ item.Country = types.StringNull()
+
+ if t := v.Get("country.optionType"); t.Exists() {
+ va := v.Get("country.value")
+ if t.String() == "global" {
+ item.Country = types.StringValue(va.String())
+ }
+ }
+ item.Continent = types.StringNull()
+
+ if t := v.Get("continent.optionType"); t.Exists() {
+ va := v.Get("continent.value")
+ if t.String() == "global" {
+ item.Continent = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"country", "continent"}
+ keyValues := [...]string{data.Entries[i].Country.ValueString(), data.Entries[i].Continent.ValueString()}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Country = types.StringNull()
+
+ if t := r.Get("country.optionType"); t.Exists() {
+ va := r.Get("country.value")
+ if t.String() == "global" {
+ data.Entries[i].Country = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Continent = types.StringNull()
+
+ if t := r.Get("continent.optionType"); t.Exists() {
+ va := r.Get("continent.value")
+ if t.String() == "global" {
+ data.Entries[i].Continent = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityGeolocationList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_identity_list.go b/internal/provider/model_sdwan_policy_object_security_identity_list.go
new file mode 100644
index 000000000..2e206d59c
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_identity_list.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 PolicyObjectSecurityIdentityListEntries struct {
+ User types.String `tfsdk:"user"`
+ UserGroup types.String `tfsdk:"user_group"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+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 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 PolicyObjectSecurityIdentityList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.User.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "user.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "user.value", item.User.ValueString())
+ }
+ }
+ if !item.UserGroup.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "userGroup.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "userGroup.value", item.UserGroup.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityIdentityListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityIdentityListEntries{}
+ item.User = types.StringNull()
+
+ if t := v.Get("user.optionType"); t.Exists() {
+ va := v.Get("user.value")
+ if t.String() == "global" {
+ item.User = types.StringValue(va.String())
+ }
+ }
+ item.UserGroup = types.StringNull()
+
+ if t := v.Get("userGroup.optionType"); t.Exists() {
+ va := v.Get("userGroup.value")
+ if t.String() == "global" {
+ item.UserGroup = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"user", "userGroup"}
+ keyValues := [...]string{data.Entries[i].User.ValueString(), data.Entries[i].UserGroup.ValueString()}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].User = types.StringNull()
+
+ if t := r.Get("user.optionType"); t.Exists() {
+ va := r.Get("user.value")
+ if t.String() == "global" {
+ data.Entries[i].User = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].UserGroup = types.StringNull()
+
+ if t := r.Get("userGroup.optionType"); t.Exists() {
+ va := r.Get("userGroup.value")
+ if t.String() == "global" {
+ data.Entries[i].UserGroup = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityIdentityList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_ips_signature.go b/internal/provider/model_sdwan_policy_object_security_ips_signature.go
new file mode 100644
index 000000000..979af2783
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_ips_signature.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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"`
+}
+
+type PolicyObjectSecurityIPSSignatureEntries struct {
+ GeneratorId types.String `tfsdk:"generator_id"`
+ SignatureId types.String `tfsdk:"signature_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+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 {
+ 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 {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.GeneratorId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "generatorId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "generatorId.value", item.GeneratorId.ValueString())
+ }
+ }
+ if !item.SignatureId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "signatureId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "signatureId.value", item.SignatureId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// 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) {
+ 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityIPSSignatureEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityIPSSignatureEntries{}
+ item.GeneratorId = types.StringNull()
+
+ if t := v.Get("generatorId.optionType"); t.Exists() {
+ va := v.Get("generatorId.value")
+ if t.String() == "global" {
+ item.GeneratorId = types.StringValue(va.String())
+ }
+ }
+ item.SignatureId = types.StringNull()
+
+ if t := v.Get("signatureId.optionType"); t.Exists() {
+ va := v.Get("signatureId.value")
+ if t.String() == "global" {
+ item.SignatureId = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// 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) {
+ 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"generatorId", "signatureId"}
+ keyValues := [...]string{data.Entries[i].GeneratorId.ValueString(), data.Entries[i].SignatureId.ValueString()}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].GeneratorId = types.StringNull()
+
+ if t := r.Get("generatorId.optionType"); t.Exists() {
+ va := r.Get("generatorId.value")
+ if t.String() == "global" {
+ data.Entries[i].GeneratorId = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].SignatureId = types.StringNull()
+
+ if t := r.Get("signatureId.optionType"); t.Exists() {
+ va := r.Get("signatureId.value")
+ if t.String() == "global" {
+ data.Entries[i].SignatureId = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// 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 {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_local_application_list.go b/internal/provider/model_sdwan_policy_object_security_local_application_list.go
new file mode 100644
index 000000000..5696df6fb
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_local_application_list.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 PolicyObjectSecurityLocalApplicationListEntries struct {
+ App types.String `tfsdk:"app"`
+ AppFamily types.String `tfsdk:"app_family"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+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 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 PolicyObjectSecurityLocalApplicationList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.App.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "app.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "app.value", item.App.ValueString())
+ }
+ }
+ if !item.AppFamily.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "appFamily.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "appFamily.value", item.AppFamily.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityLocalApplicationListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityLocalApplicationListEntries{}
+ item.App = types.StringNull()
+
+ if t := v.Get("app.optionType"); t.Exists() {
+ va := v.Get("app.value")
+ if t.String() == "global" {
+ item.App = types.StringValue(va.String())
+ }
+ }
+ item.AppFamily = types.StringNull()
+
+ if t := v.Get("appFamily.optionType"); t.Exists() {
+ va := v.Get("appFamily.value")
+ if t.String() == "global" {
+ item.AppFamily = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"app", "appFamily"}
+ keyValues := [...]string{data.Entries[i].App.ValueString(), data.Entries[i].AppFamily.ValueString()}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].App = types.StringNull()
+
+ if t := r.Get("app.optionType"); t.Exists() {
+ va := r.Get("app.value")
+ if t.String() == "global" {
+ data.Entries[i].App = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].AppFamily = types.StringNull()
+
+ if t := r.Get("appFamily.optionType"); t.Exists() {
+ va := r.Get("appFamily.value")
+ if t.String() == "global" {
+ data.Entries[i].AppFamily = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityLocalApplicationList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_local_domain_list.go b/internal/provider/model_sdwan_policy_object_security_local_domain_list.go
new file mode 100644
index 000000000..a0fd93d91
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_local_domain_list.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 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 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 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 PolicyObjectSecurityLocalDomainList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.LocalDomain.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nameServer.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nameServer.value", item.LocalDomain.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityLocalDomainListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityLocalDomainListEntries{}
+ item.LocalDomain = types.StringNull()
+
+ if t := v.Get("nameServer.optionType"); t.Exists() {
+ va := v.Get("nameServer.value")
+ if t.String() == "global" {
+ item.LocalDomain = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"nameServer"}
+ keyValues := [...]string{data.Entries[i].LocalDomain.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ 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].LocalDomain = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityLocalDomainList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_port_list.go b/internal/provider/model_sdwan_policy_object_security_port_list.go
new file mode 100644
index 000000000..d63a92a47
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_port_list.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 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 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 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 PolicyObjectSecurityPortList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Port.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "port.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "port.value", item.Port.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityPortListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityPortListEntries{}
+ item.Port = types.StringNull()
+
+ if t := v.Get("port.optionType"); t.Exists() {
+ va := v.Get("port.value")
+ if t.String() == "global" {
+ item.Port = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"port"}
+ keyValues := [...]string{data.Entries[i].Port.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Port = types.StringNull()
+
+ if t := r.Get("port.optionType"); t.Exists() {
+ va := r.Get("port.value")
+ if t.String() == "global" {
+ data.Entries[i].Port = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityPortList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_scalable_group_tag_list.go b/internal/provider/model_sdwan_policy_object_security_scalable_group_tag_list.go
new file mode 100644
index 000000000..6aecc5bd3
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_scalable_group_tag_list.go
@@ -0,0 +1,201 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 PolicyObjectSecurityScalableGroupTagListEntries struct {
+ SgtName types.String `tfsdk:"sgt_name"`
+ Tag types.String `tfsdk:"tag"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+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 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 PolicyObjectSecurityScalableGroupTagList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.SgtName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sgtName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sgtName.value", item.SgtName.ValueString())
+ }
+ }
+ if !item.Tag.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tag.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tag.value", item.Tag.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityScalableGroupTagListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityScalableGroupTagListEntries{}
+ item.SgtName = types.StringNull()
+
+ if t := v.Get("sgtName.optionType"); t.Exists() {
+ va := v.Get("sgtName.value")
+ if t.String() == "global" {
+ item.SgtName = types.StringValue(va.String())
+ }
+ }
+ item.Tag = types.StringNull()
+
+ if t := v.Get("tag.optionType"); t.Exists() {
+ va := v.Get("tag.value")
+ if t.String() == "global" {
+ item.Tag = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"sgtName", "tag"}
+ keyValues := [...]string{data.Entries[i].SgtName.ValueString(), data.Entries[i].Tag.ValueString()}
+ keyValuesVariables := [...]string{"", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].SgtName = types.StringNull()
+
+ if t := r.Get("sgtName.optionType"); t.Exists() {
+ va := r.Get("sgtName.value")
+ if t.String() == "global" {
+ data.Entries[i].SgtName = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Tag = types.StringNull()
+
+ if t := r.Get("tag.optionType"); t.Exists() {
+ va := r.Get("tag.value")
+ if t.String() == "global" {
+ data.Entries[i].Tag = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSecurityScalableGroupTagList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_security_url_list.go b/internal/provider/model_sdwan_policy_object_security_url_list.go
new file mode 100644
index 000000000..fbeec73d3
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_security_url_list.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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"`
+}
+
+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_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 {
+ 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 {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Pattern.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "pattern.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "pattern.value", item.Pattern.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// 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) {
+ 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSecurityURLListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSecurityURLListEntries{}
+ item.Pattern = types.StringNull()
+
+ if t := v.Get("pattern.optionType"); t.Exists() {
+ va := v.Get("pattern.value")
+ if t.String() == "global" {
+ item.Pattern = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// 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) {
+ 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"pattern"}
+ keyValues := [...]string{data.Entries[i].Pattern.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Pattern = types.StringNull()
+
+ if t := r.Get("pattern.optionType"); t.Exists() {
+ va := r.Get("pattern.value")
+ if t.String() == "global" {
+ data.Entries[i].Pattern = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// 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 {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_sla_class_list.go b/internal/provider/model_sdwan_policy_object_sla_class_list.go
new file mode 100644
index 000000000..df198fb80
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_sla_class_list.go
@@ -0,0 +1,340 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectSLAClassList 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 []PolicyObjectSLAClassListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectSLAClassListEntries struct {
+ Latency types.Int64 `tfsdk:"latency"`
+ Loss types.Int64 `tfsdk:"loss"`
+ Jitter types.Int64 `tfsdk:"jitter"`
+ AppProbeClassListId types.String `tfsdk:"app_probe_class_list_id"`
+ FallbackBestTunnelCriteria types.String `tfsdk:"fallback_best_tunnel_criteria"`
+ FallbackBestTunnelLossVariance types.Int64 `tfsdk:"fallback_best_tunnel_loss_variance"`
+ FallbackBestTunnelLatencyVariance types.Int64 `tfsdk:"fallback_best_tunnel_latency_variance"`
+ FallbackBestTunnelJitterVariance types.Int64 `tfsdk:"fallback_best_tunnel_jitter_variance"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectSLAClassList) getModel() string {
+ return "policy_object_sla_class_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectSLAClassList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/sla-class", 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 PolicyObjectSLAClassList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Latency.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "latency.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "latency.value", item.Latency.ValueInt64())
+ }
+ }
+ if !item.Loss.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "loss.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "loss.value", item.Loss.ValueInt64())
+ }
+ }
+ if !item.Jitter.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "jitter.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "jitter.value", item.Jitter.ValueInt64())
+ }
+ }
+ if !item.AppProbeClassListId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "appProbeClass.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "appProbeClass.refId.value", item.AppProbeClassListId.ValueString())
+ }
+ }
+ if !item.FallbackBestTunnelCriteria.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.criteria.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.criteria.value", item.FallbackBestTunnelCriteria.ValueString())
+ }
+ }
+ if !item.FallbackBestTunnelLossVariance.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.lossVariance.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.lossVariance.value", item.FallbackBestTunnelLossVariance.ValueInt64())
+ }
+ }
+ if !item.FallbackBestTunnelLatencyVariance.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.latencyVariance.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.latencyVariance.value", item.FallbackBestTunnelLatencyVariance.ValueInt64())
+ }
+ }
+ if !item.FallbackBestTunnelJitterVariance.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.jitterVariance.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "fallbackBestTunnel.jitterVariance.value", item.FallbackBestTunnelJitterVariance.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectSLAClassList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectSLAClassListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectSLAClassListEntries{}
+ item.Latency = types.Int64Null()
+
+ if t := v.Get("latency.optionType"); t.Exists() {
+ va := v.Get("latency.value")
+ if t.String() == "global" {
+ item.Latency = types.Int64Value(va.Int())
+ }
+ }
+ item.Loss = types.Int64Null()
+
+ if t := v.Get("loss.optionType"); t.Exists() {
+ va := v.Get("loss.value")
+ if t.String() == "global" {
+ item.Loss = types.Int64Value(va.Int())
+ }
+ }
+ item.Jitter = types.Int64Null()
+
+ if t := v.Get("jitter.optionType"); t.Exists() {
+ va := v.Get("jitter.value")
+ if t.String() == "global" {
+ item.Jitter = types.Int64Value(va.Int())
+ }
+ }
+ item.AppProbeClassListId = types.StringNull()
+
+ if t := v.Get("appProbeClass.refId.optionType"); t.Exists() {
+ va := v.Get("appProbeClass.refId.value")
+ if t.String() == "global" {
+ item.AppProbeClassListId = types.StringValue(va.String())
+ }
+ }
+ item.FallbackBestTunnelCriteria = types.StringNull()
+
+ if t := v.Get("fallbackBestTunnel.criteria.optionType"); t.Exists() {
+ va := v.Get("fallbackBestTunnel.criteria.value")
+ if t.String() == "global" {
+ item.FallbackBestTunnelCriteria = types.StringValue(va.String())
+ }
+ }
+ item.FallbackBestTunnelLossVariance = types.Int64Null()
+
+ if t := v.Get("fallbackBestTunnel.lossVariance.optionType"); t.Exists() {
+ va := v.Get("fallbackBestTunnel.lossVariance.value")
+ if t.String() == "global" {
+ item.FallbackBestTunnelLossVariance = types.Int64Value(va.Int())
+ }
+ }
+ item.FallbackBestTunnelLatencyVariance = types.Int64Null()
+
+ if t := v.Get("fallbackBestTunnel.latencyVariance.optionType"); t.Exists() {
+ va := v.Get("fallbackBestTunnel.latencyVariance.value")
+ if t.String() == "global" {
+ item.FallbackBestTunnelLatencyVariance = types.Int64Value(va.Int())
+ }
+ }
+ item.FallbackBestTunnelJitterVariance = types.Int64Null()
+
+ if t := v.Get("fallbackBestTunnel.jitterVariance.optionType"); t.Exists() {
+ va := v.Get("fallbackBestTunnel.jitterVariance.value")
+ if t.String() == "global" {
+ item.FallbackBestTunnelJitterVariance = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectSLAClassList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"latency", "loss", "jitter", "appProbeClass.refId", "fallbackBestTunnel.criteria", "fallbackBestTunnel.lossVariance", "fallbackBestTunnel.latencyVariance", "fallbackBestTunnel.jitterVariance"}
+ keyValues := [...]string{strconv.FormatInt(data.Entries[i].Latency.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].Loss.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].Jitter.ValueInt64(), 10), data.Entries[i].AppProbeClassListId.ValueString(), data.Entries[i].FallbackBestTunnelCriteria.ValueString(), strconv.FormatInt(data.Entries[i].FallbackBestTunnelLossVariance.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].FallbackBestTunnelLatencyVariance.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].FallbackBestTunnelJitterVariance.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{"", "", "", "", "", "", "", ""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Latency = types.Int64Null()
+
+ if t := r.Get("latency.optionType"); t.Exists() {
+ va := r.Get("latency.value")
+ if t.String() == "global" {
+ data.Entries[i].Latency = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].Loss = types.Int64Null()
+
+ if t := r.Get("loss.optionType"); t.Exists() {
+ va := r.Get("loss.value")
+ if t.String() == "global" {
+ data.Entries[i].Loss = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].Jitter = types.Int64Null()
+
+ if t := r.Get("jitter.optionType"); t.Exists() {
+ va := r.Get("jitter.value")
+ if t.String() == "global" {
+ data.Entries[i].Jitter = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].AppProbeClassListId = types.StringNull()
+
+ if t := r.Get("appProbeClass.refId.optionType"); t.Exists() {
+ va := r.Get("appProbeClass.refId.value")
+ if t.String() == "global" {
+ data.Entries[i].AppProbeClassListId = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].FallbackBestTunnelCriteria = types.StringNull()
+
+ if t := r.Get("fallbackBestTunnel.criteria.optionType"); t.Exists() {
+ va := r.Get("fallbackBestTunnel.criteria.value")
+ if t.String() == "global" {
+ data.Entries[i].FallbackBestTunnelCriteria = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].FallbackBestTunnelLossVariance = types.Int64Null()
+
+ if t := r.Get("fallbackBestTunnel.lossVariance.optionType"); t.Exists() {
+ va := r.Get("fallbackBestTunnel.lossVariance.value")
+ if t.String() == "global" {
+ data.Entries[i].FallbackBestTunnelLossVariance = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].FallbackBestTunnelLatencyVariance = types.Int64Null()
+
+ if t := r.Get("fallbackBestTunnel.latencyVariance.optionType"); t.Exists() {
+ va := r.Get("fallbackBestTunnel.latencyVariance.value")
+ if t.String() == "global" {
+ data.Entries[i].FallbackBestTunnelLatencyVariance = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries[i].FallbackBestTunnelJitterVariance = types.Int64Null()
+
+ if t := r.Get("fallbackBestTunnel.jitterVariance.optionType"); t.Exists() {
+ va := r.Get("fallbackBestTunnel.jitterVariance.value")
+ if t.String() == "global" {
+ data.Entries[i].FallbackBestTunnelJitterVariance = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectSLAClassList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_standard_community_list.go b/internal/provider/model_sdwan_policy_object_standard_community_list.go
new file mode 100644
index 000000000..c80a5eaae
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_standard_community_list.go
@@ -0,0 +1,178 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+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 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 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 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 PolicyObjectStandardCommunityList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.StandardCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "standardCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "standardCommunity.value", item.StandardCommunity.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectStandardCommunityListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectStandardCommunityListEntries{}
+ item.StandardCommunity = types.StringNull()
+
+ if t := v.Get("standardCommunity.optionType"); t.Exists() {
+ va := v.Get("standardCommunity.value")
+ if t.String() == "global" {
+ item.StandardCommunity = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"standardCommunity"}
+ keyValues := [...]string{data.Entries[i].StandardCommunity.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].StandardCommunity = types.StringNull()
+
+ if t := r.Get("standardCommunity.optionType"); t.Exists() {
+ va := r.Get("standardCommunity.value")
+ if t.String() == "global" {
+ data.Entries[i].StandardCommunity = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectStandardCommunityList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_tloc_list.go b/internal/provider/model_sdwan_policy_object_tloc_list.go
new file mode 100644
index 000000000..ecc0860f7
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_tloc_list.go
@@ -0,0 +1,247 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectTLOCList 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 []PolicyObjectTLOCListEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectTLOCListEntries struct {
+ TlocIp types.String `tfsdk:"tloc_ip"`
+ Color types.String `tfsdk:"color"`
+ Encapsulation types.String `tfsdk:"encapsulation"`
+ Preference types.String `tfsdk:"preference"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectTLOCList) getModel() string {
+ return "policy_object_tloc_list"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectTLOCList) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/tloc", 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 PolicyObjectTLOCList) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.TlocIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tloc.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tloc.value", item.TlocIp.ValueString())
+ }
+ }
+ if !item.Color.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "color.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString())
+ }
+ }
+ if !item.Encapsulation.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString())
+ }
+ }
+ if !item.Preference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectTLOCList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectTLOCListEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectTLOCListEntries{}
+ item.TlocIp = types.StringNull()
+
+ if t := v.Get("tloc.optionType"); t.Exists() {
+ va := v.Get("tloc.value")
+ if t.String() == "global" {
+ item.TlocIp = types.StringValue(va.String())
+ }
+ }
+ item.Color = types.StringNull()
+
+ if t := v.Get("color.optionType"); t.Exists() {
+ va := v.Get("color.value")
+ if t.String() == "global" {
+ item.Color = types.StringValue(va.String())
+ }
+ }
+ item.Encapsulation = types.StringNull()
+
+ if t := v.Get("encap.optionType"); t.Exists() {
+ va := v.Get("encap.value")
+ if t.String() == "global" {
+ item.Encapsulation = types.StringValue(va.String())
+ }
+ }
+ item.Preference = types.StringNull()
+
+ if t := v.Get("preference.optionType"); t.Exists() {
+ va := v.Get("preference.value")
+ if t.String() == "global" {
+ item.Preference = types.StringValue(va.String())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectTLOCList) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"tloc"}
+ keyValues := [...]string{data.Entries[i].TlocIp.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].TlocIp = types.StringNull()
+
+ if t := r.Get("tloc.optionType"); t.Exists() {
+ va := r.Get("tloc.value")
+ if t.String() == "global" {
+ data.Entries[i].TlocIp = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Color = types.StringNull()
+
+ if t := r.Get("color.optionType"); t.Exists() {
+ va := r.Get("color.value")
+ if t.String() == "global" {
+ data.Entries[i].Color = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Encapsulation = types.StringNull()
+
+ if t := r.Get("encap.optionType"); t.Exists() {
+ va := r.Get("encap.value")
+ if t.String() == "global" {
+ data.Entries[i].Encapsulation = types.StringValue(va.String())
+ }
+ }
+ data.Entries[i].Preference = types.StringNull()
+
+ if t := r.Get("preference.optionType"); t.Exists() {
+ va := r.Get("preference.value")
+ if t.String() == "global" {
+ data.Entries[i].Preference = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectTLOCList) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_policy_object_vpn_group.go b/internal/provider/model_sdwan_policy_object_vpn_group.go
new file mode 100644
index 000000000..023c4cfc7
--- /dev/null
+++ b/internal/provider/model_sdwan_policy_object_vpn_group.go
@@ -0,0 +1,179 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type PolicyObjectVPNGroup 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 []PolicyObjectVPNGroupEntries `tfsdk:"entries"`
+}
+
+type PolicyObjectVPNGroupEntries struct {
+ Vpn types.Int64 `tfsdk:"vpn"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data PolicyObjectVPNGroup) getModel() string {
+ return "policy_object_vpn_group"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data PolicyObjectVPNGroup) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/vpn-group", 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 PolicyObjectVPNGroup) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+ body, _ = sjson.Set(body, path+"entries", []interface{}{})
+ for _, item := range data.Entries {
+ itemBody := ""
+ if !item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *PolicyObjectVPNGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "entries"); value.Exists() {
+ data.Entries = make([]PolicyObjectVPNGroupEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := PolicyObjectVPNGroupEntries{}
+ item.Vpn = types.Int64Null()
+
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.Entries = append(data.Entries, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *PolicyObjectVPNGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Entries {
+ keys := [...]string{"vpn"}
+ keyValues := [...]string{strconv.FormatInt(data.Entries[i].Vpn.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "entries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Entries[i].Vpn = types.Int64Null()
+
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "global" {
+ data.Entries[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *PolicyObjectVPNGroup) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Entries) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_feature.go b/internal/provider/model_sdwan_service_lan_vpn_feature.go
new file mode 100644
index 000000000..d99808eb8
--- /dev/null
+++ b/internal/provider/model_sdwan_service_lan_vpn_feature.go
@@ -0,0 +1,4530 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceLANVPN 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"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ VpnVariable types.String `tfsdk:"vpn_variable"`
+ ConfigDescription types.String `tfsdk:"config_description"`
+ ConfigDescriptionVariable types.String `tfsdk:"config_description_variable"`
+ OmpAdminDistanceIpv4 types.Int64 `tfsdk:"omp_admin_distance_ipv4"`
+ OmpAdminDistanceIpv4Variable types.String `tfsdk:"omp_admin_distance_ipv4_variable"`
+ OmpAdminDistanceIpv6 types.Int64 `tfsdk:"omp_admin_distance_ipv6"`
+ OmpAdminDistanceIpv6Variable types.String `tfsdk:"omp_admin_distance_ipv6_variable"`
+ EnableSdwanRemoteAccess types.Bool `tfsdk:"enable_sdwan_remote_access"`
+ PrimaryDnsAddressIpv4 types.String `tfsdk:"primary_dns_address_ipv4"`
+ PrimaryDnsAddressIpv4Variable types.String `tfsdk:"primary_dns_address_ipv4_variable"`
+ SecondaryDnsAddressIpv4 types.String `tfsdk:"secondary_dns_address_ipv4"`
+ SecondaryDnsAddressIpv4Variable types.String `tfsdk:"secondary_dns_address_ipv4_variable"`
+ PrimaryDnsAddressIpv6 types.String `tfsdk:"primary_dns_address_ipv6"`
+ PrimaryDnsAddressIpv6Variable types.String `tfsdk:"primary_dns_address_ipv6_variable"`
+ SecondaryDnsAddressIpv6 types.String `tfsdk:"secondary_dns_address_ipv6"`
+ SecondaryDnsAddressIpv6Variable types.String `tfsdk:"secondary_dns_address_ipv6_variable"`
+ HostMappings []ServiceLANVPNHostMappings `tfsdk:"host_mappings"`
+ AdvertiseOmpIpv4s []ServiceLANVPNAdvertiseOmpIpv4s `tfsdk:"advertise_omp_ipv4s"`
+ AdvertiseOmpIpv6s []ServiceLANVPNAdvertiseOmpIpv6s `tfsdk:"advertise_omp_ipv6s"`
+ Ipv4StaticRoutes []ServiceLANVPNIpv4StaticRoutes `tfsdk:"ipv4_static_routes"`
+ Ipv6StaticRoutes []ServiceLANVPNIpv6StaticRoutes `tfsdk:"ipv6_static_routes"`
+ Services []ServiceLANVPNServices `tfsdk:"services"`
+ ServiceRoutes []ServiceLANVPNServiceRoutes `tfsdk:"service_routes"`
+ GreRoutes []ServiceLANVPNGreRoutes `tfsdk:"gre_routes"`
+ IpsecRoutes []ServiceLANVPNIpsecRoutes `tfsdk:"ipsec_routes"`
+ NatPools []ServiceLANVPNNatPools `tfsdk:"nat_pools"`
+ NatPortForwards []ServiceLANVPNNatPortForwards `tfsdk:"nat_port_forwards"`
+ StaticNats []ServiceLANVPNStaticNats `tfsdk:"static_nats"`
+ Nat64V4Pools []ServiceLANVPNNat64V4Pools `tfsdk:"nat_64_v4_pools"`
+ RouteLeakFromGlobalVpns []ServiceLANVPNRouteLeakFromGlobalVpns `tfsdk:"route_leak_from_global_vpns"`
+ RouteLeakToGlobalVpns []ServiceLANVPNRouteLeakToGlobalVpns `tfsdk:"route_leak_to_global_vpns"`
+ RouteLeakFromOtherServices []ServiceLANVPNRouteLeakFromOtherServices `tfsdk:"route_leak_from_other_services"`
+ Ipv4ImportRouteTargets []ServiceLANVPNIpv4ImportRouteTargets `tfsdk:"ipv4_import_route_targets"`
+ Ipv4ExportRouteTargets []ServiceLANVPNIpv4ExportRouteTargets `tfsdk:"ipv4_export_route_targets"`
+ Ipv6ImportRouteTargets []ServiceLANVPNIpv6ImportRouteTargets `tfsdk:"ipv6_import_route_targets"`
+ Ipv6ExportRouteTargets []ServiceLANVPNIpv6ExportRouteTargets `tfsdk:"ipv6_export_route_targets"`
+}
+
+type ServiceLANVPNHostMappings struct {
+ HostName types.String `tfsdk:"host_name"`
+ HostNameVariable types.String `tfsdk:"host_name_variable"`
+ ListOfIps types.Set `tfsdk:"list_of_ips"`
+ ListOfIpsVariable types.String `tfsdk:"list_of_ips_variable"`
+}
+
+type ServiceLANVPNAdvertiseOmpIpv4s struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Prefixes []ServiceLANVPNAdvertiseOmpIpv4sPrefixes `tfsdk:"prefixes"`
+}
+
+type ServiceLANVPNAdvertiseOmpIpv6s struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ ProtocolSubType types.String `tfsdk:"protocol_sub_type"`
+ ProtocolSubTypeVariable types.String `tfsdk:"protocol_sub_type_variable"`
+ Prefixes []ServiceLANVPNAdvertiseOmpIpv6sPrefixes `tfsdk:"prefixes"`
+}
+
+type ServiceLANVPNIpv4StaticRoutes struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ NextHops []ServiceLANVPNIpv4StaticRoutesNextHops `tfsdk:"next_hops"`
+ NextHopWithTrackers []ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers `tfsdk:"next_hop_with_trackers"`
+ Null0 types.Bool `tfsdk:"null0"`
+ GatewayDhcp types.Bool `tfsdk:"gateway_dhcp"`
+ Vpn types.Bool `tfsdk:"vpn"`
+}
+
+type ServiceLANVPNIpv6StaticRoutes struct {
+ Prefix types.String `tfsdk:"prefix"`
+ PrefixVariable types.String `tfsdk:"prefix_variable"`
+ NextHops []ServiceLANVPNIpv6StaticRoutesNextHops `tfsdk:"next_hops"`
+ Null0 types.Bool `tfsdk:"null0"`
+ Nat types.String `tfsdk:"nat"`
+ NatVariable types.String `tfsdk:"nat_variable"`
+}
+
+type ServiceLANVPNServices struct {
+ ServiceType types.String `tfsdk:"service_type"`
+ ServiceTypeVariable types.String `tfsdk:"service_type_variable"`
+ Ipv4Addresses types.Set `tfsdk:"ipv4_addresses"`
+ Ipv4AddressesVariable types.String `tfsdk:"ipv4_addresses_variable"`
+ Tracking types.Bool `tfsdk:"tracking"`
+ TrackingVariable types.String `tfsdk:"tracking_variable"`
+}
+
+type ServiceLANVPNServiceRoutes struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Service types.String `tfsdk:"service"`
+ ServiceVariable types.String `tfsdk:"service_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+}
+
+type ServiceLANVPNGreRoutes struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Interface types.Set `tfsdk:"interface"`
+ InterfaceVariable types.String `tfsdk:"interface_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+}
+
+type ServiceLANVPNIpsecRoutes struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Interface types.Set `tfsdk:"interface"`
+ InterfaceVariable types.String `tfsdk:"interface_variable"`
+}
+
+type ServiceLANVPNNatPools struct {
+ NatPoolName types.Int64 `tfsdk:"nat_pool_name"`
+ NatPoolNameVariable types.String `tfsdk:"nat_pool_name_variable"`
+ PrefixLength types.Int64 `tfsdk:"prefix_length"`
+ PrefixLengthVariable types.String `tfsdk:"prefix_length_variable"`
+ RangeStart types.String `tfsdk:"range_start"`
+ RangeStartVariable types.String `tfsdk:"range_start_variable"`
+ RangeEnd types.String `tfsdk:"range_end"`
+ RangeEndVariable types.String `tfsdk:"range_end_variable"`
+ Overload types.Bool `tfsdk:"overload"`
+ OverloadVariable types.String `tfsdk:"overload_variable"`
+ Direction types.String `tfsdk:"direction"`
+ DirectionVariable types.String `tfsdk:"direction_variable"`
+ TrackerObjectId types.String `tfsdk:"tracker_object_id"`
+}
+
+type ServiceLANVPNNatPortForwards struct {
+ NatPoolName types.Int64 `tfsdk:"nat_pool_name"`
+ NatPoolNameVariable types.String `tfsdk:"nat_pool_name_variable"`
+ SourcePort types.Int64 `tfsdk:"source_port"`
+ SourcePortVariable types.String `tfsdk:"source_port_variable"`
+ TranslatePort types.Int64 `tfsdk:"translate_port"`
+ TranslatePortVariable types.String `tfsdk:"translate_port_variable"`
+ SourceIp types.String `tfsdk:"source_ip"`
+ SourceIpVariable types.String `tfsdk:"source_ip_variable"`
+ TranslatedSourceIp types.String `tfsdk:"translated_source_ip"`
+ TranslatedSourceIpVariable types.String `tfsdk:"translated_source_ip_variable"`
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+}
+
+type ServiceLANVPNStaticNats struct {
+ NatPoolName types.Int64 `tfsdk:"nat_pool_name"`
+ NatPoolNameVariable types.String `tfsdk:"nat_pool_name_variable"`
+ SourceIp types.String `tfsdk:"source_ip"`
+ SourceIpVariable types.String `tfsdk:"source_ip_variable"`
+ TranslatedSourceIp types.String `tfsdk:"translated_source_ip"`
+ TranslatedSourceIpVariable types.String `tfsdk:"translated_source_ip_variable"`
+ StaticNatDirection types.String `tfsdk:"static_nat_direction"`
+ StaticNatDirectionVariable types.String `tfsdk:"static_nat_direction_variable"`
+ TrackerObjectId types.String `tfsdk:"tracker_object_id"`
+}
+
+type ServiceLANVPNNat64V4Pools struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ RangeStart types.String `tfsdk:"range_start"`
+ RangeStartVariable types.String `tfsdk:"range_start_variable"`
+ RangeEnd types.String `tfsdk:"range_end"`
+ RangeEndVariable types.String `tfsdk:"range_end_variable"`
+ Overload types.Bool `tfsdk:"overload"`
+ OverloadVariable types.String `tfsdk:"overload_variable"`
+}
+
+type ServiceLANVPNRouteLeakFromGlobalVpns struct {
+ RouteProtocol types.String `tfsdk:"route_protocol"`
+ RouteProtocolVariable types.String `tfsdk:"route_protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Redistributions []ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions `tfsdk:"redistributions"`
+}
+
+type ServiceLANVPNRouteLeakToGlobalVpns struct {
+ RouteProtocol types.String `tfsdk:"route_protocol"`
+ RouteProtocolVariable types.String `tfsdk:"route_protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Redistributions []ServiceLANVPNRouteLeakToGlobalVpnsRedistributions `tfsdk:"redistributions"`
+}
+
+type ServiceLANVPNRouteLeakFromOtherServices struct {
+ SourceVpn types.Int64 `tfsdk:"source_vpn"`
+ SourceVpnVariable types.String `tfsdk:"source_vpn_variable"`
+ RouteProtocol types.String `tfsdk:"route_protocol"`
+ RouteProtocolVariable types.String `tfsdk:"route_protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Redistributions []ServiceLANVPNRouteLeakFromOtherServicesRedistributions `tfsdk:"redistributions"`
+}
+
+type ServiceLANVPNIpv4ImportRouteTargets struct {
+ RouteTarget types.String `tfsdk:"route_target"`
+ RouteTargetVariable types.String `tfsdk:"route_target_variable"`
+}
+
+type ServiceLANVPNIpv4ExportRouteTargets struct {
+ RouteTarget types.String `tfsdk:"route_target"`
+ RouteTargetVariable types.String `tfsdk:"route_target_variable"`
+}
+
+type ServiceLANVPNIpv6ImportRouteTargets struct {
+ RouteTarget types.String `tfsdk:"route_target"`
+ RouteTargetVariable types.String `tfsdk:"route_target_variable"`
+}
+
+type ServiceLANVPNIpv6ExportRouteTargets struct {
+ RouteTarget types.String `tfsdk:"route_target"`
+ RouteTargetVariable types.String `tfsdk:"route_target_variable"`
+}
+
+type ServiceLANVPNAdvertiseOmpIpv4sPrefixes struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ AggregateOnly types.Bool `tfsdk:"aggregate_only"`
+ Region types.String `tfsdk:"region"`
+ RegionVariable types.String `tfsdk:"region_variable"`
+}
+
+type ServiceLANVPNAdvertiseOmpIpv6sPrefixes struct {
+ Prefix types.String `tfsdk:"prefix"`
+ PrefixVariable types.String `tfsdk:"prefix_variable"`
+ AggregateOnly types.Bool `tfsdk:"aggregate_only"`
+}
+
+type ServiceLANVPNIpv4StaticRoutesNextHops struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+type ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+ TrackerId types.String `tfsdk:"tracker_id"`
+}
+
+type ServiceLANVPNIpv6StaticRoutesNextHops struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+
+type ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RedistributionPolicyId types.String `tfsdk:"redistribution_policy_id"`
+}
+
+type ServiceLANVPNRouteLeakToGlobalVpnsRedistributions struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RedistributionPolicyId types.String `tfsdk:"redistribution_policy_id"`
+}
+
+type ServiceLANVPNRouteLeakFromOtherServicesRedistributions struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RedistributionPolicyId types.String `tfsdk:"redistribution_policy_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceLANVPN) getModel() string {
+ return "service_lan_vpn"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceLANVPN) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn", 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 ServiceLANVPN) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.VpnVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"vpnId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"vpnId.value", data.VpnVariable.ValueString())
+ }
+ } else if data.Vpn.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"vpnId.optionType", "default")
+ body, _ = sjson.Set(body, path+"vpnId.value", 0)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"vpnId.optionType", "global")
+ body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64())
+ }
+ }
+
+ if !data.ConfigDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"name.optionType", "variable")
+ body, _ = sjson.Set(body, path+"name.value", data.ConfigDescriptionVariable.ValueString())
+ }
+ } else if data.ConfigDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"name.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"name.optionType", "global")
+ body, _ = sjson.Set(body, path+"name.value", data.ConfigDescription.ValueString())
+ }
+ }
+
+ if !data.OmpAdminDistanceIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4Variable.ValueString())
+ }
+ } else if data.OmpAdminDistanceIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4.ValueInt64())
+ }
+ }
+
+ if !data.OmpAdminDistanceIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6Variable.ValueString())
+ }
+ } else if data.OmpAdminDistanceIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64())
+ }
+ }
+ if data.EnableSdwanRemoteAccess.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"enableSdra.optionType", "default")
+ body, _ = sjson.Set(body, path+"enableSdra.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"enableSdra.optionType", "global")
+ body, _ = sjson.Set(body, path+"enableSdra.value", data.EnableSdwanRemoteAccess.ValueBool())
+ }
+ }
+
+ if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString())
+ }
+ } else if data.PrimaryDnsAddressIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString())
+ }
+ }
+
+ if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString())
+ }
+ } else if !data.SecondaryDnsAddressIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString())
+ }
+ }
+
+ if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString())
+ }
+ } else if data.PrimaryDnsAddressIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString())
+ }
+ }
+
+ if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString())
+ }
+ } else if !data.SecondaryDnsAddressIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{})
+ for _, item := range data.HostMappings {
+ itemBody := ""
+
+ if !item.HostNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString())
+ }
+ } else if !item.HostName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString())
+ }
+ }
+
+ if !item.ListOfIpsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpsVariable.ValueString())
+ }
+ } else if !item.ListOfIps.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global")
+ var values []string
+ item.ListOfIps.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdvertiseIp4", []interface{}{})
+ for _, item := range data.AdvertiseOmpIpv4s {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Prefixes {
+ itemChildBody := ""
+
+ if !childItem.NetworkAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddressVariable.ValueString())
+ }
+ } else if !childItem.NetworkAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddress.ValueString())
+ }
+ }
+
+ if !childItem.SubnetMaskVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMaskVariable.ValueString())
+ }
+ } else if !childItem.SubnetMask.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMask.ValueString())
+ }
+ }
+ if childItem.AggregateOnly.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool())
+ }
+ }
+
+ if !childItem.RegionVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.RegionVariable.ValueString())
+ }
+ } else if childItem.Region.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "region.value", "core-and-access")
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.Region.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ompAdvertiseIp4.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ompAdvertiseIpv6", []interface{}{})
+ for _, item := range data.AdvertiseOmpIpv6s {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+
+ if !item.ProtocolSubTypeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubTypeVariable.ValueString())
+ }
+ } else if item.ProtocolSubType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubType.ValueString())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Prefixes {
+ itemChildBody := ""
+
+ if !childItem.PrefixVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString())
+ }
+ } else if !childItem.Prefix.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString())
+ }
+ }
+ if childItem.AggregateOnly.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ompAdvertiseIpv6.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{})
+ for _, item := range data.Ipv4StaticRoutes {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.NextHops {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AdministrativeDistanceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if !childItem.AdministrativeDistance.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
+ }
+ }
+ if true {
+
+ for _, childItem := range item.NextHopWithTrackers {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AdministrativeDistanceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if !childItem.AdministrativeDistance.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
+ }
+ }
+ if !childItem.TrackerId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.value", childItem.TrackerId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHopWithTracker.-1", itemChildBody)
+ }
+ }
+ if !item.Null0.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
+ }
+ }
+ if !item.GatewayDhcp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.value", item.GatewayDhcp.ValueBool())
+ }
+ }
+ if !item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.value", item.Vpn.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{})
+ for _, item := range data.Ipv6StaticRoutes {
+ itemBody := ""
+
+ if !item.PrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString())
+ }
+ } else if !item.Prefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.NextHops {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AdministrativeDistanceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if !childItem.AdministrativeDistance.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
+ }
+ }
+ if !item.Null0.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
+ }
+ }
+
+ if !item.NatVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString())
+ }
+ } else if !item.Nat.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"service", []interface{}{})
+ for _, item := range data.Services {
+ itemBody := ""
+
+ if !item.ServiceTypeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceTypeVariable.ValueString())
+ }
+ } else if !item.ServiceType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString())
+ }
+ }
+
+ if !item.Ipv4AddressesVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", item.Ipv4AddressesVariable.ValueString())
+ }
+ } else if !item.Ipv4Addresses.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "global")
+ var values []string
+ item.Ipv4Addresses.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", values)
+ }
+ }
+
+ if !item.TrackingVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tracking.value", item.TrackingVariable.ValueString())
+ }
+ } else if item.Tracking.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tracking.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tracking.value", item.Tracking.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"service.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"serviceRoute", []interface{}{})
+ for _, item := range data.ServiceRoutes {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+
+ if !item.ServiceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "service.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "service.value", item.ServiceVariable.ValueString())
+ }
+ } else if item.Service.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "service.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "service.value", "SIG")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "service.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "service.value", item.Service.ValueString())
+ }
+ }
+ if !item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"serviceRoute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"greRoute", []interface{}{})
+ for _, item := range data.GreRoutes {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+
+ if !item.InterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString())
+ }
+ } else if item.Interface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global")
+ var values []string
+ item.Interface.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "interface.value", values)
+ }
+ }
+ if !item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"greRoute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecRoute", []interface{}{})
+ for _, item := range data.IpsecRoutes {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+
+ if !item.InterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString())
+ }
+ } else if item.Interface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global")
+ var values []string
+ item.Interface.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "interface.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipsecRoute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"natPool", []interface{}{})
+ for _, item := range data.NatPools {
+ itemBody := ""
+
+ if !item.NatPoolNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString())
+ }
+ } else if !item.NatPoolName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64())
+ }
+ }
+
+ if !item.PrefixLengthVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLengthVariable.ValueString())
+ }
+ } else if !item.PrefixLength.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLength.ValueInt64())
+ }
+ }
+
+ if !item.RangeStartVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStartVariable.ValueString())
+ }
+ } else if !item.RangeStart.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStart.ValueString())
+ }
+ }
+
+ if !item.RangeEndVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEndVariable.ValueString())
+ }
+ } else if !item.RangeEnd.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEnd.ValueString())
+ }
+ }
+
+ if !item.OverloadVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "overload.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "overload.value", item.OverloadVariable.ValueString())
+ }
+ } else if item.Overload.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "overload.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "overload.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "overload.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "overload.value", item.Overload.ValueBool())
+ }
+ }
+
+ if !item.DirectionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "direction.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "direction.value", item.DirectionVariable.ValueString())
+ }
+ } else if !item.Direction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "direction.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "direction.value", item.Direction.ValueString())
+ }
+ }
+ if !item.TrackerObjectId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"natPool.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"natPortForward", []interface{}{})
+ for _, item := range data.NatPortForwards {
+ itemBody := ""
+
+ if !item.NatPoolNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString())
+ }
+ } else if item.NatPoolName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64())
+ }
+ }
+
+ if !item.SourcePortVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePortVariable.ValueString())
+ }
+ } else if !item.SourcePort.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePort.ValueInt64())
+ }
+ }
+
+ if !item.TranslatePortVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePortVariable.ValueString())
+ }
+ } else if !item.TranslatePort.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePort.ValueInt64())
+ }
+ }
+
+ if !item.SourceIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
+ }
+ } else if !item.SourceIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
+ }
+ }
+
+ if !item.TranslatedSourceIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString())
+ }
+ } else if !item.TranslatedSourceIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString())
+ }
+ }
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"natPortForward.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"staticNat", []interface{}{})
+ for _, item := range data.StaticNats {
+ itemBody := ""
+
+ if !item.NatPoolNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString())
+ }
+ } else if item.NatPoolName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64())
+ }
+ }
+
+ if !item.SourceIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
+ }
+ } else if !item.SourceIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
+ }
+ }
+
+ if !item.TranslatedSourceIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString())
+ }
+ } else if !item.TranslatedSourceIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString())
+ }
+ }
+
+ if !item.StaticNatDirectionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirectionVariable.ValueString())
+ }
+ } else if !item.StaticNatDirection.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirection.ValueString())
+ }
+ }
+ if !item.TrackerObjectId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"staticNat.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{})
+ for _, item := range data.Nat64V4Pools {
+ itemBody := ""
+
+ if !item.NameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.NameVariable.ValueString())
+ }
+ } else if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Name.ValueString())
+ }
+ }
+
+ if !item.RangeStartVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStartVariable.ValueString())
+ }
+ } else if !item.RangeStart.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStart.ValueString())
+ }
+ }
+
+ if !item.RangeEndVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEndVariable.ValueString())
+ }
+ } else if !item.RangeEnd.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEnd.ValueString())
+ }
+ }
+
+ if !item.OverloadVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.OverloadVariable.ValueString())
+ }
+ } else if item.Overload.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Overload.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"routeLeakFromGlobal", []interface{}{})
+ for _, item := range data.RouteLeakFromGlobalVpns {
+ itemBody := ""
+
+ if !item.RouteProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString())
+ }
+ } else if !item.RouteProtocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{})
+ for _, childItem := range item.Redistributions {
+ itemChildBody := ""
+
+ if !childItem.ProtocolVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString())
+ }
+ } else if !childItem.Protocol.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString())
+ }
+ }
+ if !childItem.RedistributionPolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"routeLeakFromGlobal.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"routeLeakFromService", []interface{}{})
+ for _, item := range data.RouteLeakToGlobalVpns {
+ itemBody := ""
+
+ if !item.RouteProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString())
+ }
+ } else if !item.RouteProtocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{})
+ for _, childItem := range item.Redistributions {
+ itemChildBody := ""
+
+ if !childItem.ProtocolVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString())
+ }
+ } else if !childItem.Protocol.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString())
+ }
+ }
+ if !childItem.RedistributionPolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"routeLeakFromService.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"routeLeakBetweenServices", []interface{}{})
+ for _, item := range data.RouteLeakFromOtherServices {
+ itemBody := ""
+
+ if !item.SourceVpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString())
+ }
+ } else if !item.SourceVpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64())
+ }
+ }
+
+ if !item.RouteProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString())
+ }
+ } else if !item.RouteProtocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{})
+ for _, childItem := range item.Redistributions {
+ itemChildBody := ""
+
+ if !childItem.ProtocolVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString())
+ }
+ } else if !childItem.Protocol.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString())
+ }
+ }
+ if !childItem.RedistributionPolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"routeLeakBetweenServices.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.importRtList", []interface{}{})
+ for _, item := range data.Ipv4ImportRouteTargets {
+ itemBody := ""
+
+ if !item.RouteTargetVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
+ }
+ } else if !item.RouteTarget.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.importRtList.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.exportRtList", []interface{}{})
+ for _, item := range data.Ipv4ExportRouteTargets {
+ itemBody := ""
+
+ if !item.RouteTargetVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
+ }
+ } else if !item.RouteTarget.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.exportRtList.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.importRtList", []interface{}{})
+ for _, item := range data.Ipv6ImportRouteTargets {
+ itemBody := ""
+
+ if !item.RouteTargetVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
+ }
+ } else if !item.RouteTarget.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.importRtList.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.exportRtList", []interface{}{})
+ for _, item := range data.Ipv6ExportRouteTargets {
+ itemBody := ""
+
+ if !item.RouteTargetVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
+ }
+ } else if !item.RouteTarget.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.exportRtList.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceLANVPN) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Vpn = types.Int64Null()
+ data.VpnVariable = types.StringNull()
+ if t := res.Get(path + "vpnId.optionType"); t.Exists() {
+ va := res.Get(path + "vpnId.value")
+ if t.String() == "variable" {
+ data.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.ConfigDescription = types.StringNull()
+ data.ConfigDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "name.optionType"); t.Exists() {
+ va := res.Get(path + "name.value")
+ if t.String() == "variable" {
+ data.ConfigDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ConfigDescription = types.StringValue(va.String())
+ }
+ }
+ data.OmpAdminDistanceIpv4 = types.Int64Null()
+ data.OmpAdminDistanceIpv4Variable = types.StringNull()
+ if t := res.Get(path + "ompAdminDistance.optionType"); t.Exists() {
+ va := res.Get(path + "ompAdminDistance.value")
+ if t.String() == "variable" {
+ data.OmpAdminDistanceIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OmpAdminDistanceIpv4 = types.Int64Value(va.Int())
+ }
+ }
+ data.OmpAdminDistanceIpv6 = types.Int64Null()
+ data.OmpAdminDistanceIpv6Variable = types.StringNull()
+ if t := res.Get(path + "ompAdminDistanceIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "ompAdminDistanceIpv6.value")
+ if t.String() == "variable" {
+ data.OmpAdminDistanceIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OmpAdminDistanceIpv6 = types.Int64Value(va.Int())
+ }
+ }
+ data.EnableSdwanRemoteAccess = types.BoolNull()
+
+ if t := res.Get(path + "enableSdra.optionType"); t.Exists() {
+ va := res.Get(path + "enableSdra.value")
+ if t.String() == "global" {
+ data.EnableSdwanRemoteAccess = types.BoolValue(va.Bool())
+ }
+ }
+ data.PrimaryDnsAddressIpv4 = types.StringNull()
+ data.PrimaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv4 = types.StringNull()
+ data.SecondaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv6 = types.StringNull()
+ data.PrimaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv6 = types.StringNull()
+ data.SecondaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "newHostMapping"); value.Exists() {
+ data.HostMappings = make([]ServiceLANVPNHostMappings, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNHostMappings{}
+ item.HostName = types.StringNull()
+ item.HostNameVariable = types.StringNull()
+ if t := v.Get("hostName.optionType"); t.Exists() {
+ va := v.Get("hostName.value")
+ if t.String() == "variable" {
+ item.HostNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HostName = types.StringValue(va.String())
+ }
+ }
+ item.ListOfIps = types.SetNull(types.StringType)
+ item.ListOfIpsVariable = types.StringNull()
+ if t := v.Get("listOfIp.optionType"); t.Exists() {
+ va := v.Get("listOfIp.value")
+ if t.String() == "variable" {
+ item.ListOfIpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ListOfIps = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.HostMappings = append(data.HostMappings, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ompAdvertiseIp4"); value.Exists() {
+ data.AdvertiseOmpIpv4s = make([]ServiceLANVPNAdvertiseOmpIpv4s, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNAdvertiseOmpIpv4s{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("ompProtocol.optionType"); t.Exists() {
+ va := v.Get("ompProtocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("prefixList"); cValue.Exists() {
+ item.Prefixes = make([]ServiceLANVPNAdvertiseOmpIpv4sPrefixes, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNAdvertiseOmpIpv4sPrefixes{}
+ cItem.NetworkAddress = types.StringNull()
+ cItem.NetworkAddressVariable = types.StringNull()
+ if t := cv.Get("prefix.address.optionType"); t.Exists() {
+ va := cv.Get("prefix.address.value")
+ if t.String() == "variable" {
+ cItem.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ cItem.SubnetMask = types.StringNull()
+ cItem.SubnetMaskVariable = types.StringNull()
+ if t := cv.Get("prefix.mask.optionType"); t.Exists() {
+ va := cv.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ cItem.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ cItem.AggregateOnly = types.BoolNull()
+
+ if t := cv.Get("aggregateOnly.optionType"); t.Exists() {
+ va := cv.Get("aggregateOnly.value")
+ if t.String() == "global" {
+ cItem.AggregateOnly = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.Region = types.StringNull()
+ cItem.RegionVariable = types.StringNull()
+ if t := cv.Get("region.optionType"); t.Exists() {
+ va := cv.Get("region.value")
+ if t.String() == "variable" {
+ cItem.RegionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Region = types.StringValue(va.String())
+ }
+ }
+ item.Prefixes = append(item.Prefixes, cItem)
+ return true
+ })
+ }
+ data.AdvertiseOmpIpv4s = append(data.AdvertiseOmpIpv4s, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ompAdvertiseIpv6"); value.Exists() {
+ data.AdvertiseOmpIpv6s = make([]ServiceLANVPNAdvertiseOmpIpv6s, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNAdvertiseOmpIpv6s{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("ompProtocol.optionType"); t.Exists() {
+ va := v.Get("ompProtocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ item.ProtocolSubType = types.StringNull()
+ item.ProtocolSubTypeVariable = types.StringNull()
+ if t := v.Get("protocolSubType.optionType"); t.Exists() {
+ va := v.Get("protocolSubType.value")
+ if t.String() == "variable" {
+ item.ProtocolSubTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ProtocolSubType = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("prefixList"); cValue.Exists() {
+ item.Prefixes = make([]ServiceLANVPNAdvertiseOmpIpv6sPrefixes, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNAdvertiseOmpIpv6sPrefixes{}
+ cItem.Prefix = types.StringNull()
+ cItem.PrefixVariable = types.StringNull()
+ if t := cv.Get("prefix.optionType"); t.Exists() {
+ va := cv.Get("prefix.value")
+ if t.String() == "variable" {
+ cItem.PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Prefix = types.StringValue(va.String())
+ }
+ }
+ cItem.AggregateOnly = types.BoolNull()
+
+ if t := cv.Get("aggregateOnly.optionType"); t.Exists() {
+ va := cv.Get("aggregateOnly.value")
+ if t.String() == "global" {
+ cItem.AggregateOnly = types.BoolValue(va.Bool())
+ }
+ }
+ item.Prefixes = append(item.Prefixes, cItem)
+ return true
+ })
+ }
+ data.AdvertiseOmpIpv6s = append(data.AdvertiseOmpIpv6s, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv4Route"); value.Exists() {
+ data.Ipv4StaticRoutes = make([]ServiceLANVPNIpv4StaticRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNIpv4StaticRoutes{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := v.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := v.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
+ item.NextHops = make([]ServiceLANVPNIpv4StaticRoutesNextHops, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNIpv4StaticRoutesNextHops{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AdministrativeDistance = types.Int64Null()
+ cItem.AdministrativeDistanceVariable = types.StringNull()
+ if t := cv.Get("distance.optionType"); t.Exists() {
+ va := cv.Get("distance.value")
+ if t.String() == "variable" {
+ cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ item.NextHops = append(item.NextHops, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHopWithTracker"); cValue.Exists() {
+ item.NextHopWithTrackers = make([]ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AdministrativeDistance = types.Int64Null()
+ cItem.AdministrativeDistanceVariable = types.StringNull()
+ if t := cv.Get("distance.optionType"); t.Exists() {
+ va := cv.Get("distance.value")
+ if t.String() == "variable" {
+ cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ cItem.TrackerId = types.StringNull()
+
+ if t := cv.Get("tracker.refId.optionType"); t.Exists() {
+ va := cv.Get("tracker.refId.value")
+ if t.String() == "global" {
+ cItem.TrackerId = types.StringValue(va.String())
+ }
+ }
+ item.NextHopWithTrackers = append(item.NextHopWithTrackers, cItem)
+ return true
+ })
+ }
+ item.Null0 = types.BoolNull()
+
+ if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ item.Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ item.GatewayDhcp = types.BoolNull()
+
+ if t := v.Get("oneOfIpRoute.dhcp.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.dhcp.value")
+ if t.String() == "global" {
+ item.GatewayDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ item.Vpn = types.BoolNull()
+
+ if t := v.Get("oneOfIpRoute.vpn.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.vpn.value")
+ if t.String() == "global" {
+ item.Vpn = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4StaticRoutes = append(data.Ipv4StaticRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6Route"); value.Exists() {
+ data.Ipv6StaticRoutes = make([]ServiceLANVPNIpv6StaticRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNIpv6StaticRoutes{}
+ item.Prefix = types.StringNull()
+ item.PrefixVariable = types.StringNull()
+ if t := v.Get("prefix.optionType"); t.Exists() {
+ va := v.Get("prefix.value")
+ if t.String() == "variable" {
+ item.PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Prefix = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
+ item.NextHops = make([]ServiceLANVPNIpv6StaticRoutesNextHops, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNIpv6StaticRoutesNextHops{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AdministrativeDistance = types.Int64Null()
+ cItem.AdministrativeDistanceVariable = types.StringNull()
+ if t := cv.Get("distance.optionType"); t.Exists() {
+ va := cv.Get("distance.value")
+ if t.String() == "variable" {
+ cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ item.NextHops = append(item.NextHops, cItem)
+ return true
+ })
+ }
+ item.Null0 = types.BoolNull()
+
+ if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ item.Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ item.Nat = types.StringNull()
+ item.NatVariable = types.StringNull()
+ if t := v.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.nat.value")
+ if t.String() == "variable" {
+ item.NatVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Nat = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6StaticRoutes = append(data.Ipv6StaticRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "service"); value.Exists() {
+ data.Services = make([]ServiceLANVPNServices, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNServices{}
+ item.ServiceType = types.StringNull()
+ item.ServiceTypeVariable = types.StringNull()
+ if t := v.Get("serviceType.optionType"); t.Exists() {
+ va := v.Get("serviceType.value")
+ if t.String() == "variable" {
+ item.ServiceTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ServiceType = types.StringValue(va.String())
+ }
+ }
+ item.Ipv4Addresses = types.SetNull(types.StringType)
+ item.Ipv4AddressesVariable = types.StringNull()
+ if t := v.Get("ipv4Addresses.optionType"); t.Exists() {
+ va := v.Get("ipv4Addresses.value")
+ if t.String() == "variable" {
+ item.Ipv4AddressesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Ipv4Addresses = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.Tracking = types.BoolNull()
+ item.TrackingVariable = types.StringNull()
+ if t := v.Get("tracking.optionType"); t.Exists() {
+ va := v.Get("tracking.value")
+ if t.String() == "variable" {
+ item.TrackingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Tracking = types.BoolValue(va.Bool())
+ }
+ }
+ data.Services = append(data.Services, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "serviceRoute"); value.Exists() {
+ data.ServiceRoutes = make([]ServiceLANVPNServiceRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNServiceRoutes{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := v.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := v.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.Service = types.StringNull()
+ item.ServiceVariable = types.StringNull()
+ if t := v.Get("service.optionType"); t.Exists() {
+ va := v.Get("service.value")
+ if t.String() == "variable" {
+ item.ServiceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Service = types.StringValue(va.String())
+ }
+ }
+ item.Vpn = types.Int64Null()
+
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.ServiceRoutes = append(data.ServiceRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "greRoute"); value.Exists() {
+ data.GreRoutes = make([]ServiceLANVPNGreRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNGreRoutes{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := v.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := v.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.Interface = types.SetNull(types.StringType)
+ item.InterfaceVariable = types.StringNull()
+ if t := v.Get("interface.optionType"); t.Exists() {
+ va := v.Get("interface.value")
+ if t.String() == "variable" {
+ item.InterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Interface = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.Vpn = types.Int64Null()
+
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.GreRoutes = append(data.GreRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipsecRoute"); value.Exists() {
+ data.IpsecRoutes = make([]ServiceLANVPNIpsecRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNIpsecRoutes{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := v.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := v.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.Interface = types.SetNull(types.StringType)
+ item.InterfaceVariable = types.StringNull()
+ if t := v.Get("interface.optionType"); t.Exists() {
+ va := v.Get("interface.value")
+ if t.String() == "variable" {
+ item.InterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Interface = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.IpsecRoutes = append(data.IpsecRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "natPool"); value.Exists() {
+ data.NatPools = make([]ServiceLANVPNNatPools, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNNatPools{}
+ item.NatPoolName = types.Int64Null()
+ item.NatPoolNameVariable = types.StringNull()
+ if t := v.Get("natPoolName.optionType"); t.Exists() {
+ va := v.Get("natPoolName.value")
+ if t.String() == "variable" {
+ item.NatPoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NatPoolName = types.Int64Value(va.Int())
+ }
+ }
+ item.PrefixLength = types.Int64Null()
+ item.PrefixLengthVariable = types.StringNull()
+ if t := v.Get("prefixLength.optionType"); t.Exists() {
+ va := v.Get("prefixLength.value")
+ if t.String() == "variable" {
+ item.PrefixLengthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ item.RangeStart = types.StringNull()
+ item.RangeStartVariable = types.StringNull()
+ if t := v.Get("rangeStart.optionType"); t.Exists() {
+ va := v.Get("rangeStart.value")
+ if t.String() == "variable" {
+ item.RangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RangeStart = types.StringValue(va.String())
+ }
+ }
+ item.RangeEnd = types.StringNull()
+ item.RangeEndVariable = types.StringNull()
+ if t := v.Get("rangeEnd.optionType"); t.Exists() {
+ va := v.Get("rangeEnd.value")
+ if t.String() == "variable" {
+ item.RangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RangeEnd = types.StringValue(va.String())
+ }
+ }
+ item.Overload = types.BoolNull()
+ item.OverloadVariable = types.StringNull()
+ if t := v.Get("overload.optionType"); t.Exists() {
+ va := v.Get("overload.value")
+ if t.String() == "variable" {
+ item.OverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Overload = types.BoolValue(va.Bool())
+ }
+ }
+ item.Direction = types.StringNull()
+ item.DirectionVariable = types.StringNull()
+ if t := v.Get("direction.optionType"); t.Exists() {
+ va := v.Get("direction.value")
+ if t.String() == "variable" {
+ item.DirectionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Direction = types.StringValue(va.String())
+ }
+ }
+ item.TrackerObjectId = types.StringNull()
+
+ if t := v.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
+ va := v.Get("trackingObject.trackerId.refId.value")
+ if t.String() == "global" {
+ item.TrackerObjectId = types.StringValue(va.String())
+ }
+ }
+ data.NatPools = append(data.NatPools, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "natPortForward"); value.Exists() {
+ data.NatPortForwards = make([]ServiceLANVPNNatPortForwards, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNNatPortForwards{}
+ item.NatPoolName = types.Int64Null()
+ item.NatPoolNameVariable = types.StringNull()
+ if t := v.Get("natPoolName.optionType"); t.Exists() {
+ va := v.Get("natPoolName.value")
+ if t.String() == "variable" {
+ item.NatPoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NatPoolName = types.Int64Value(va.Int())
+ }
+ }
+ item.SourcePort = types.Int64Null()
+ item.SourcePortVariable = types.StringNull()
+ if t := v.Get("sourcePort.optionType"); t.Exists() {
+ va := v.Get("sourcePort.value")
+ if t.String() == "variable" {
+ item.SourcePortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourcePort = types.Int64Value(va.Int())
+ }
+ }
+ item.TranslatePort = types.Int64Null()
+ item.TranslatePortVariable = types.StringNull()
+ if t := v.Get("translatePort.optionType"); t.Exists() {
+ va := v.Get("translatePort.value")
+ if t.String() == "variable" {
+ item.TranslatePortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TranslatePort = types.Int64Value(va.Int())
+ }
+ }
+ item.SourceIp = types.StringNull()
+ item.SourceIpVariable = types.StringNull()
+ if t := v.Get("sourceIp.optionType"); t.Exists() {
+ va := v.Get("sourceIp.value")
+ if t.String() == "variable" {
+ item.SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceIp = types.StringValue(va.String())
+ }
+ }
+ item.TranslatedSourceIp = types.StringNull()
+ item.TranslatedSourceIpVariable = types.StringNull()
+ if t := v.Get("TranslatedSourceIp.optionType"); t.Exists() {
+ va := v.Get("TranslatedSourceIp.value")
+ if t.String() == "variable" {
+ item.TranslatedSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TranslatedSourceIp = types.StringValue(va.String())
+ }
+ }
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ data.NatPortForwards = append(data.NatPortForwards, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "staticNat"); value.Exists() {
+ data.StaticNats = make([]ServiceLANVPNStaticNats, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNStaticNats{}
+ item.NatPoolName = types.Int64Null()
+ item.NatPoolNameVariable = types.StringNull()
+ if t := v.Get("natPoolName.optionType"); t.Exists() {
+ va := v.Get("natPoolName.value")
+ if t.String() == "variable" {
+ item.NatPoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NatPoolName = types.Int64Value(va.Int())
+ }
+ }
+ item.SourceIp = types.StringNull()
+ item.SourceIpVariable = types.StringNull()
+ if t := v.Get("sourceIp.optionType"); t.Exists() {
+ va := v.Get("sourceIp.value")
+ if t.String() == "variable" {
+ item.SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceIp = types.StringValue(va.String())
+ }
+ }
+ item.TranslatedSourceIp = types.StringNull()
+ item.TranslatedSourceIpVariable = types.StringNull()
+ if t := v.Get("TranslatedSourceIp.optionType"); t.Exists() {
+ va := v.Get("TranslatedSourceIp.value")
+ if t.String() == "variable" {
+ item.TranslatedSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TranslatedSourceIp = types.StringValue(va.String())
+ }
+ }
+ item.StaticNatDirection = types.StringNull()
+ item.StaticNatDirectionVariable = types.StringNull()
+ if t := v.Get("staticNatDirection.optionType"); t.Exists() {
+ va := v.Get("staticNatDirection.value")
+ if t.String() == "variable" {
+ item.StaticNatDirectionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.StaticNatDirection = types.StringValue(va.String())
+ }
+ }
+ item.TrackerObjectId = types.StringNull()
+
+ if t := v.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
+ va := v.Get("trackingObject.trackerId.refId.value")
+ if t.String() == "global" {
+ item.TrackerObjectId = types.StringValue(va.String())
+ }
+ }
+ data.StaticNats = append(data.StaticNats, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "nat64V4Pool"); value.Exists() {
+ data.Nat64V4Pools = make([]ServiceLANVPNNat64V4Pools, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNNat64V4Pools{}
+ item.Name = types.StringNull()
+ item.NameVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolName.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolName.value")
+ if t.String() == "variable" {
+ item.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.RangeStart = types.StringNull()
+ item.RangeStartVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolRangeStart.value")
+ if t.String() == "variable" {
+ item.RangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RangeStart = types.StringValue(va.String())
+ }
+ }
+ item.RangeEnd = types.StringNull()
+ item.RangeEndVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolRangeEnd.value")
+ if t.String() == "variable" {
+ item.RangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RangeEnd = types.StringValue(va.String())
+ }
+ }
+ item.Overload = types.BoolNull()
+ item.OverloadVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolOverload.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolOverload.value")
+ if t.String() == "variable" {
+ item.OverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Overload = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat64V4Pools = append(data.Nat64V4Pools, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "routeLeakFromGlobal"); value.Exists() {
+ data.RouteLeakFromGlobalVpns = make([]ServiceLANVPNRouteLeakFromGlobalVpns, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNRouteLeakFromGlobalVpns{}
+ item.RouteProtocol = types.StringNull()
+ item.RouteProtocolVariable = types.StringNull()
+ if t := v.Get("routeProtocol.optionType"); t.Exists() {
+ va := v.Get("routeProtocol.value")
+ if t.String() == "variable" {
+ item.RouteProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RouteProtocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("redistributeToProtocol"); cValue.Exists() {
+ item.Redistributions = make([]ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions{}
+ cItem.Protocol = types.StringNull()
+ cItem.ProtocolVariable = types.StringNull()
+ if t := cv.Get("protocol.optionType"); t.Exists() {
+ va := cv.Get("protocol.value")
+ if t.String() == "variable" {
+ cItem.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Protocol = types.StringValue(va.String())
+ }
+ }
+ cItem.RedistributionPolicyId = types.StringNull()
+
+ if t := cv.Get("policy.refId.optionType"); t.Exists() {
+ va := cv.Get("policy.refId.value")
+ if t.String() == "global" {
+ cItem.RedistributionPolicyId = types.StringValue(va.String())
+ }
+ }
+ item.Redistributions = append(item.Redistributions, cItem)
+ return true
+ })
+ }
+ data.RouteLeakFromGlobalVpns = append(data.RouteLeakFromGlobalVpns, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "routeLeakFromService"); value.Exists() {
+ data.RouteLeakToGlobalVpns = make([]ServiceLANVPNRouteLeakToGlobalVpns, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNRouteLeakToGlobalVpns{}
+ item.RouteProtocol = types.StringNull()
+ item.RouteProtocolVariable = types.StringNull()
+ if t := v.Get("routeProtocol.optionType"); t.Exists() {
+ va := v.Get("routeProtocol.value")
+ if t.String() == "variable" {
+ item.RouteProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RouteProtocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("redistributeToProtocol"); cValue.Exists() {
+ item.Redistributions = make([]ServiceLANVPNRouteLeakToGlobalVpnsRedistributions, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNRouteLeakToGlobalVpnsRedistributions{}
+ cItem.Protocol = types.StringNull()
+ cItem.ProtocolVariable = types.StringNull()
+ if t := cv.Get("protocol.optionType"); t.Exists() {
+ va := cv.Get("protocol.value")
+ if t.String() == "variable" {
+ cItem.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Protocol = types.StringValue(va.String())
+ }
+ }
+ cItem.RedistributionPolicyId = types.StringNull()
+
+ if t := cv.Get("policy.refId.optionType"); t.Exists() {
+ va := cv.Get("policy.refId.value")
+ if t.String() == "global" {
+ cItem.RedistributionPolicyId = types.StringValue(va.String())
+ }
+ }
+ item.Redistributions = append(item.Redistributions, cItem)
+ return true
+ })
+ }
+ data.RouteLeakToGlobalVpns = append(data.RouteLeakToGlobalVpns, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "routeLeakBetweenServices"); value.Exists() {
+ data.RouteLeakFromOtherServices = make([]ServiceLANVPNRouteLeakFromOtherServices, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNRouteLeakFromOtherServices{}
+ item.SourceVpn = types.Int64Null()
+ item.SourceVpnVariable = types.StringNull()
+ if t := v.Get("sourceVpn.optionType"); t.Exists() {
+ va := v.Get("sourceVpn.value")
+ if t.String() == "variable" {
+ item.SourceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceVpn = types.Int64Value(va.Int())
+ }
+ }
+ item.RouteProtocol = types.StringNull()
+ item.RouteProtocolVariable = types.StringNull()
+ if t := v.Get("routeProtocol.optionType"); t.Exists() {
+ va := v.Get("routeProtocol.value")
+ if t.String() == "variable" {
+ item.RouteProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RouteProtocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("redistributeToProtocol"); cValue.Exists() {
+ item.Redistributions = make([]ServiceLANVPNRouteLeakFromOtherServicesRedistributions, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNRouteLeakFromOtherServicesRedistributions{}
+ cItem.Protocol = types.StringNull()
+ cItem.ProtocolVariable = types.StringNull()
+ if t := cv.Get("protocol.optionType"); t.Exists() {
+ va := cv.Get("protocol.value")
+ if t.String() == "variable" {
+ cItem.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Protocol = types.StringValue(va.String())
+ }
+ }
+ cItem.RedistributionPolicyId = types.StringNull()
+
+ if t := cv.Get("policy.refId.optionType"); t.Exists() {
+ va := cv.Get("policy.refId.value")
+ if t.String() == "global" {
+ cItem.RedistributionPolicyId = types.StringValue(va.String())
+ }
+ }
+ item.Redistributions = append(item.Redistributions, cItem)
+ return true
+ })
+ }
+ data.RouteLeakFromOtherServices = append(data.RouteLeakFromOtherServices, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "mplsVpnIpv4RouteTarget.importRtList"); value.Exists() {
+ data.Ipv4ImportRouteTargets = make([]ServiceLANVPNIpv4ImportRouteTargets, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNIpv4ImportRouteTargets{}
+ item.RouteTarget = types.StringNull()
+ item.RouteTargetVariable = types.StringNull()
+ if t := v.Get("rt.optionType"); t.Exists() {
+ va := v.Get("rt.value")
+ if t.String() == "variable" {
+ item.RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RouteTarget = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4ImportRouteTargets = append(data.Ipv4ImportRouteTargets, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "mplsVpnIpv4RouteTarget.exportRtList"); value.Exists() {
+ data.Ipv4ExportRouteTargets = make([]ServiceLANVPNIpv4ExportRouteTargets, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNIpv4ExportRouteTargets{}
+ item.RouteTarget = types.StringNull()
+ item.RouteTargetVariable = types.StringNull()
+ if t := v.Get("rt.optionType"); t.Exists() {
+ va := v.Get("rt.value")
+ if t.String() == "variable" {
+ item.RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RouteTarget = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4ExportRouteTargets = append(data.Ipv4ExportRouteTargets, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "mplsVpnIpv6RouteTarget.importRtList"); value.Exists() {
+ data.Ipv6ImportRouteTargets = make([]ServiceLANVPNIpv6ImportRouteTargets, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNIpv6ImportRouteTargets{}
+ item.RouteTarget = types.StringNull()
+ item.RouteTargetVariable = types.StringNull()
+ if t := v.Get("rt.optionType"); t.Exists() {
+ va := v.Get("rt.value")
+ if t.String() == "variable" {
+ item.RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RouteTarget = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6ImportRouteTargets = append(data.Ipv6ImportRouteTargets, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "mplsVpnIpv6RouteTarget.exportRtList"); value.Exists() {
+ data.Ipv6ExportRouteTargets = make([]ServiceLANVPNIpv6ExportRouteTargets, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNIpv6ExportRouteTargets{}
+ item.RouteTarget = types.StringNull()
+ item.RouteTargetVariable = types.StringNull()
+ if t := v.Get("rt.optionType"); t.Exists() {
+ va := v.Get("rt.value")
+ if t.String() == "variable" {
+ item.RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RouteTarget = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6ExportRouteTargets = append(data.Ipv6ExportRouteTargets, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceLANVPN) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Vpn = types.Int64Null()
+ data.VpnVariable = types.StringNull()
+ if t := res.Get(path + "vpnId.optionType"); t.Exists() {
+ va := res.Get(path + "vpnId.value")
+ if t.String() == "variable" {
+ data.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.ConfigDescription = types.StringNull()
+ data.ConfigDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "name.optionType"); t.Exists() {
+ va := res.Get(path + "name.value")
+ if t.String() == "variable" {
+ data.ConfigDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ConfigDescription = types.StringValue(va.String())
+ }
+ }
+ data.OmpAdminDistanceIpv4 = types.Int64Null()
+ data.OmpAdminDistanceIpv4Variable = types.StringNull()
+ if t := res.Get(path + "ompAdminDistance.optionType"); t.Exists() {
+ va := res.Get(path + "ompAdminDistance.value")
+ if t.String() == "variable" {
+ data.OmpAdminDistanceIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OmpAdminDistanceIpv4 = types.Int64Value(va.Int())
+ }
+ }
+ data.OmpAdminDistanceIpv6 = types.Int64Null()
+ data.OmpAdminDistanceIpv6Variable = types.StringNull()
+ if t := res.Get(path + "ompAdminDistanceIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "ompAdminDistanceIpv6.value")
+ if t.String() == "variable" {
+ data.OmpAdminDistanceIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OmpAdminDistanceIpv6 = types.Int64Value(va.Int())
+ }
+ }
+ data.EnableSdwanRemoteAccess = types.BoolNull()
+
+ if t := res.Get(path + "enableSdra.optionType"); t.Exists() {
+ va := res.Get(path + "enableSdra.value")
+ if t.String() == "global" {
+ data.EnableSdwanRemoteAccess = types.BoolValue(va.Bool())
+ }
+ }
+ data.PrimaryDnsAddressIpv4 = types.StringNull()
+ data.PrimaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv4 = types.StringNull()
+ data.SecondaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv6 = types.StringNull()
+ data.PrimaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv6 = types.StringNull()
+ data.SecondaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ for i := range data.HostMappings {
+ keys := [...]string{"hostName"}
+ keyValues := [...]string{data.HostMappings[i].HostName.ValueString()}
+ keyValuesVariables := [...]string{data.HostMappings[i].HostNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "newHostMapping").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.HostMappings[i].HostName = types.StringNull()
+ data.HostMappings[i].HostNameVariable = types.StringNull()
+ if t := r.Get("hostName.optionType"); t.Exists() {
+ va := r.Get("hostName.value")
+ if t.String() == "variable" {
+ data.HostMappings[i].HostNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.HostMappings[i].HostName = types.StringValue(va.String())
+ }
+ }
+ data.HostMappings[i].ListOfIps = types.SetNull(types.StringType)
+ data.HostMappings[i].ListOfIpsVariable = types.StringNull()
+ if t := r.Get("listOfIp.optionType"); t.Exists() {
+ va := r.Get("listOfIp.value")
+ if t.String() == "variable" {
+ data.HostMappings[i].ListOfIpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.HostMappings[i].ListOfIps = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+ for i := range data.AdvertiseOmpIpv4s {
+ keys := [...]string{"routePolicy.refId"}
+ keyValues := [...]string{data.AdvertiseOmpIpv4s[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "ompAdvertiseIp4").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AdvertiseOmpIpv4s[i].Protocol = types.StringNull()
+ data.AdvertiseOmpIpv4s[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("ompProtocol.optionType"); t.Exists() {
+ va := r.Get("ompProtocol.value")
+ if t.String() == "variable" {
+ data.AdvertiseOmpIpv4s[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdvertiseOmpIpv4s[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.AdvertiseOmpIpv4s[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.AdvertiseOmpIpv4s[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.AdvertiseOmpIpv4s[i].Prefixes {
+ keys := [...]string{"prefix.address"}
+ keyValues := [...]string{data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("prefixList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddress = types.StringNull()
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddressVariable = types.StringNull()
+ if t := cr.Get("prefix.address.optionType"); t.Exists() {
+ va := cr.Get("prefix.address.value")
+ if t.String() == "variable" {
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMask = types.StringNull()
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMaskVariable = types.StringNull()
+ if t := cr.Get("prefix.mask.optionType"); t.Exists() {
+ va := cr.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].AggregateOnly = types.BoolNull()
+
+ if t := cr.Get("aggregateOnly.optionType"); t.Exists() {
+ va := cr.Get("aggregateOnly.value")
+ if t.String() == "global" {
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].AggregateOnly = types.BoolValue(va.Bool())
+ }
+ }
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].Region = types.StringNull()
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].RegionVariable = types.StringNull()
+ if t := cr.Get("region.optionType"); t.Exists() {
+ va := cr.Get("region.value")
+ if t.String() == "variable" {
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].RegionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdvertiseOmpIpv4s[i].Prefixes[ci].Region = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.AdvertiseOmpIpv6s {
+ keys := [...]string{"routePolicy.refId"}
+ keyValues := [...]string{data.AdvertiseOmpIpv6s[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "ompAdvertiseIpv6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AdvertiseOmpIpv6s[i].Protocol = types.StringNull()
+ data.AdvertiseOmpIpv6s[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("ompProtocol.optionType"); t.Exists() {
+ va := r.Get("ompProtocol.value")
+ if t.String() == "variable" {
+ data.AdvertiseOmpIpv6s[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdvertiseOmpIpv6s[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.AdvertiseOmpIpv6s[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.AdvertiseOmpIpv6s[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.AdvertiseOmpIpv6s[i].ProtocolSubType = types.StringNull()
+ data.AdvertiseOmpIpv6s[i].ProtocolSubTypeVariable = types.StringNull()
+ if t := r.Get("protocolSubType.optionType"); t.Exists() {
+ va := r.Get("protocolSubType.value")
+ if t.String() == "variable" {
+ data.AdvertiseOmpIpv6s[i].ProtocolSubTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdvertiseOmpIpv6s[i].ProtocolSubType = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.AdvertiseOmpIpv6s[i].Prefixes {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.AdvertiseOmpIpv6s[i].Prefixes[ci].Prefix.ValueString()}
+ keyValuesVariables := [...]string{data.AdvertiseOmpIpv6s[i].Prefixes[ci].PrefixVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("prefixList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AdvertiseOmpIpv6s[i].Prefixes[ci].Prefix = types.StringNull()
+ data.AdvertiseOmpIpv6s[i].Prefixes[ci].PrefixVariable = types.StringNull()
+ if t := cr.Get("prefix.optionType"); t.Exists() {
+ va := cr.Get("prefix.value")
+ if t.String() == "variable" {
+ data.AdvertiseOmpIpv6s[i].Prefixes[ci].PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdvertiseOmpIpv6s[i].Prefixes[ci].Prefix = types.StringValue(va.String())
+ }
+ }
+ data.AdvertiseOmpIpv6s[i].Prefixes[ci].AggregateOnly = types.BoolNull()
+
+ if t := cr.Get("aggregateOnly.optionType"); t.Exists() {
+ va := cr.Get("aggregateOnly.value")
+ if t.String() == "global" {
+ data.AdvertiseOmpIpv6s[i].Prefixes[ci].AggregateOnly = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+ for i := range data.Ipv4StaticRoutes {
+ keys := [...]string{"prefix.ipAddress"}
+ keyValues := [...]string{data.Ipv4StaticRoutes[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv4Route").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4StaticRoutes[i].NetworkAddress = types.StringNull()
+ data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := r.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].SubnetMask = types.StringNull()
+ data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := r.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv4StaticRoutes[i].NextHops {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringNull()
+ data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
+ if t := cr.Get("distance.optionType"); t.Exists() {
+ va := cr.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for ci := range data.Ipv4StaticRoutes[i].NextHopWithTrackers {
+ keys := [...]string{"address", "distance", "tracker.refId"}
+ keyValues := [...]string{data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].Address.ValueString(), strconv.FormatInt(data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistance.ValueInt64(), 10), data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].TrackerId.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AddressVariable.ValueString(), data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistanceVariable.ValueString(), ""}
+
+ var cr gjson.Result
+ r.Get("oneOfIpRoute.nextHopContainer.nextHopWithTracker").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].Address = types.StringNull()
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistance = types.Int64Null()
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistanceVariable = types.StringNull()
+ if t := cr.Get("distance.optionType"); t.Exists() {
+ va := cr.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].TrackerId = types.StringNull()
+
+ if t := cr.Get("tracker.refId.optionType"); t.Exists() {
+ va := cr.Get("tracker.refId.value")
+ if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].TrackerId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4StaticRoutes[i].Null0 = types.BoolNull()
+
+ if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4StaticRoutes[i].GatewayDhcp = types.BoolNull()
+
+ if t := r.Get("oneOfIpRoute.dhcp.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.dhcp.value")
+ if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].GatewayDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4StaticRoutes[i].Vpn = types.BoolNull()
+
+ if t := r.Get("oneOfIpRoute.vpn.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.vpn.value")
+ if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].Vpn = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.Ipv6StaticRoutes {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6StaticRoutes[i].Prefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].PrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6Route").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6StaticRoutes[i].Prefix = types.StringNull()
+ data.Ipv6StaticRoutes[i].PrefixVariable = types.StringNull()
+ if t := r.Get("prefix.optionType"); t.Exists() {
+ va := r.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Prefix = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv6StaticRoutes[i].NextHops {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringNull()
+ data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
+ if t := cr.Get("distance.optionType"); t.Exists() {
+ va := cr.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Ipv6StaticRoutes[i].Null0 = types.BoolNull()
+
+ if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6StaticRoutes[i].Nat = types.StringNull()
+ data.Ipv6StaticRoutes[i].NatVariable = types.StringNull()
+ if t := r.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.nat.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NatVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Nat = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Services {
+ keys := [...]string{"serviceType"}
+ keyValues := [...]string{data.Services[i].ServiceType.ValueString()}
+ keyValuesVariables := [...]string{data.Services[i].ServiceTypeVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "service").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Services[i].ServiceType = types.StringNull()
+ data.Services[i].ServiceTypeVariable = types.StringNull()
+ if t := r.Get("serviceType.optionType"); t.Exists() {
+ va := r.Get("serviceType.value")
+ if t.String() == "variable" {
+ data.Services[i].ServiceTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Services[i].ServiceType = types.StringValue(va.String())
+ }
+ }
+ data.Services[i].Ipv4Addresses = types.SetNull(types.StringType)
+ data.Services[i].Ipv4AddressesVariable = types.StringNull()
+ if t := r.Get("ipv4Addresses.optionType"); t.Exists() {
+ va := r.Get("ipv4Addresses.value")
+ if t.String() == "variable" {
+ data.Services[i].Ipv4AddressesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Services[i].Ipv4Addresses = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Services[i].Tracking = types.BoolNull()
+ data.Services[i].TrackingVariable = types.StringNull()
+ if t := r.Get("tracking.optionType"); t.Exists() {
+ va := r.Get("tracking.value")
+ if t.String() == "variable" {
+ data.Services[i].TrackingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Services[i].Tracking = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.ServiceRoutes {
+ keys := [...]string{"prefix.ipAddress"}
+ keyValues := [...]string{data.ServiceRoutes[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.ServiceRoutes[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "serviceRoute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.ServiceRoutes[i].NetworkAddress = types.StringNull()
+ data.ServiceRoutes[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := r.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ data.ServiceRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ServiceRoutes[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.ServiceRoutes[i].SubnetMask = types.StringNull()
+ data.ServiceRoutes[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := r.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ data.ServiceRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ServiceRoutes[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.ServiceRoutes[i].Service = types.StringNull()
+ data.ServiceRoutes[i].ServiceVariable = types.StringNull()
+ if t := r.Get("service.optionType"); t.Exists() {
+ va := r.Get("service.value")
+ if t.String() == "variable" {
+ data.ServiceRoutes[i].ServiceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ServiceRoutes[i].Service = types.StringValue(va.String())
+ }
+ }
+ data.ServiceRoutes[i].Vpn = types.Int64Null()
+
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "global" {
+ data.ServiceRoutes[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.GreRoutes {
+ keys := [...]string{"prefix.ipAddress"}
+ keyValues := [...]string{data.GreRoutes[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.GreRoutes[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "greRoute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.GreRoutes[i].NetworkAddress = types.StringNull()
+ data.GreRoutes[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := r.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ data.GreRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GreRoutes[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.GreRoutes[i].SubnetMask = types.StringNull()
+ data.GreRoutes[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := r.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ data.GreRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GreRoutes[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.GreRoutes[i].Interface = types.SetNull(types.StringType)
+ data.GreRoutes[i].InterfaceVariable = types.StringNull()
+ if t := r.Get("interface.optionType"); t.Exists() {
+ va := r.Get("interface.value")
+ if t.String() == "variable" {
+ data.GreRoutes[i].InterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GreRoutes[i].Interface = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.GreRoutes[i].Vpn = types.Int64Null()
+
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "global" {
+ data.GreRoutes[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.IpsecRoutes {
+ keys := [...]string{"prefix.ipAddress"}
+ keyValues := [...]string{data.IpsecRoutes[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.IpsecRoutes[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipsecRoute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.IpsecRoutes[i].NetworkAddress = types.StringNull()
+ data.IpsecRoutes[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := r.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ data.IpsecRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecRoutes[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.IpsecRoutes[i].SubnetMask = types.StringNull()
+ data.IpsecRoutes[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := r.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ data.IpsecRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecRoutes[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.IpsecRoutes[i].Interface = types.SetNull(types.StringType)
+ data.IpsecRoutes[i].InterfaceVariable = types.StringNull()
+ if t := r.Get("interface.optionType"); t.Exists() {
+ va := r.Get("interface.value")
+ if t.String() == "variable" {
+ data.IpsecRoutes[i].InterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecRoutes[i].Interface = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+ for i := range data.NatPools {
+ keys := [...]string{"natPoolName"}
+ keyValues := [...]string{strconv.FormatInt(data.NatPools[i].NatPoolName.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.NatPools[i].NatPoolNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "natPool").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.NatPools[i].NatPoolName = types.Int64Null()
+ data.NatPools[i].NatPoolNameVariable = types.StringNull()
+ if t := r.Get("natPoolName.optionType"); t.Exists() {
+ va := r.Get("natPoolName.value")
+ if t.String() == "variable" {
+ data.NatPools[i].NatPoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPools[i].NatPoolName = types.Int64Value(va.Int())
+ }
+ }
+ data.NatPools[i].PrefixLength = types.Int64Null()
+ data.NatPools[i].PrefixLengthVariable = types.StringNull()
+ if t := r.Get("prefixLength.optionType"); t.Exists() {
+ va := r.Get("prefixLength.value")
+ if t.String() == "variable" {
+ data.NatPools[i].PrefixLengthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPools[i].PrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.NatPools[i].RangeStart = types.StringNull()
+ data.NatPools[i].RangeStartVariable = types.StringNull()
+ if t := r.Get("rangeStart.optionType"); t.Exists() {
+ va := r.Get("rangeStart.value")
+ if t.String() == "variable" {
+ data.NatPools[i].RangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPools[i].RangeStart = types.StringValue(va.String())
+ }
+ }
+ data.NatPools[i].RangeEnd = types.StringNull()
+ data.NatPools[i].RangeEndVariable = types.StringNull()
+ if t := r.Get("rangeEnd.optionType"); t.Exists() {
+ va := r.Get("rangeEnd.value")
+ if t.String() == "variable" {
+ data.NatPools[i].RangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPools[i].RangeEnd = types.StringValue(va.String())
+ }
+ }
+ data.NatPools[i].Overload = types.BoolNull()
+ data.NatPools[i].OverloadVariable = types.StringNull()
+ if t := r.Get("overload.optionType"); t.Exists() {
+ va := r.Get("overload.value")
+ if t.String() == "variable" {
+ data.NatPools[i].OverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPools[i].Overload = types.BoolValue(va.Bool())
+ }
+ }
+ data.NatPools[i].Direction = types.StringNull()
+ data.NatPools[i].DirectionVariable = types.StringNull()
+ if t := r.Get("direction.optionType"); t.Exists() {
+ va := r.Get("direction.value")
+ if t.String() == "variable" {
+ data.NatPools[i].DirectionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPools[i].Direction = types.StringValue(va.String())
+ }
+ }
+ data.NatPools[i].TrackerObjectId = types.StringNull()
+
+ if t := r.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
+ va := r.Get("trackingObject.trackerId.refId.value")
+ if t.String() == "global" {
+ data.NatPools[i].TrackerObjectId = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.NatPortForwards {
+ keys := [...]string{"natPoolName"}
+ keyValues := [...]string{strconv.FormatInt(data.NatPortForwards[i].NatPoolName.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.NatPortForwards[i].NatPoolNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "natPortForward").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.NatPortForwards[i].NatPoolName = types.Int64Null()
+ data.NatPortForwards[i].NatPoolNameVariable = types.StringNull()
+ if t := r.Get("natPoolName.optionType"); t.Exists() {
+ va := r.Get("natPoolName.value")
+ if t.String() == "variable" {
+ data.NatPortForwards[i].NatPoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPortForwards[i].NatPoolName = types.Int64Value(va.Int())
+ }
+ }
+ data.NatPortForwards[i].SourcePort = types.Int64Null()
+ data.NatPortForwards[i].SourcePortVariable = types.StringNull()
+ if t := r.Get("sourcePort.optionType"); t.Exists() {
+ va := r.Get("sourcePort.value")
+ if t.String() == "variable" {
+ data.NatPortForwards[i].SourcePortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPortForwards[i].SourcePort = types.Int64Value(va.Int())
+ }
+ }
+ data.NatPortForwards[i].TranslatePort = types.Int64Null()
+ data.NatPortForwards[i].TranslatePortVariable = types.StringNull()
+ if t := r.Get("translatePort.optionType"); t.Exists() {
+ va := r.Get("translatePort.value")
+ if t.String() == "variable" {
+ data.NatPortForwards[i].TranslatePortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPortForwards[i].TranslatePort = types.Int64Value(va.Int())
+ }
+ }
+ data.NatPortForwards[i].SourceIp = types.StringNull()
+ data.NatPortForwards[i].SourceIpVariable = types.StringNull()
+ if t := r.Get("sourceIp.optionType"); t.Exists() {
+ va := r.Get("sourceIp.value")
+ if t.String() == "variable" {
+ data.NatPortForwards[i].SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPortForwards[i].SourceIp = types.StringValue(va.String())
+ }
+ }
+ data.NatPortForwards[i].TranslatedSourceIp = types.StringNull()
+ data.NatPortForwards[i].TranslatedSourceIpVariable = types.StringNull()
+ if t := r.Get("TranslatedSourceIp.optionType"); t.Exists() {
+ va := r.Get("TranslatedSourceIp.value")
+ if t.String() == "variable" {
+ data.NatPortForwards[i].TranslatedSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPortForwards[i].TranslatedSourceIp = types.StringValue(va.String())
+ }
+ }
+ data.NatPortForwards[i].Protocol = types.StringNull()
+ data.NatPortForwards[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.NatPortForwards[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPortForwards[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.StaticNats {
+ keys := [...]string{"natPoolName"}
+ keyValues := [...]string{strconv.FormatInt(data.StaticNats[i].NatPoolName.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.StaticNats[i].NatPoolNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "staticNat").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.StaticNats[i].NatPoolName = types.Int64Null()
+ data.StaticNats[i].NatPoolNameVariable = types.StringNull()
+ if t := r.Get("natPoolName.optionType"); t.Exists() {
+ va := r.Get("natPoolName.value")
+ if t.String() == "variable" {
+ data.StaticNats[i].NatPoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNats[i].NatPoolName = types.Int64Value(va.Int())
+ }
+ }
+ data.StaticNats[i].SourceIp = types.StringNull()
+ data.StaticNats[i].SourceIpVariable = types.StringNull()
+ if t := r.Get("sourceIp.optionType"); t.Exists() {
+ va := r.Get("sourceIp.value")
+ if t.String() == "variable" {
+ data.StaticNats[i].SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNats[i].SourceIp = types.StringValue(va.String())
+ }
+ }
+ data.StaticNats[i].TranslatedSourceIp = types.StringNull()
+ data.StaticNats[i].TranslatedSourceIpVariable = types.StringNull()
+ if t := r.Get("TranslatedSourceIp.optionType"); t.Exists() {
+ va := r.Get("TranslatedSourceIp.value")
+ if t.String() == "variable" {
+ data.StaticNats[i].TranslatedSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNats[i].TranslatedSourceIp = types.StringValue(va.String())
+ }
+ }
+ data.StaticNats[i].StaticNatDirection = types.StringNull()
+ data.StaticNats[i].StaticNatDirectionVariable = types.StringNull()
+ if t := r.Get("staticNatDirection.optionType"); t.Exists() {
+ va := r.Get("staticNatDirection.value")
+ if t.String() == "variable" {
+ data.StaticNats[i].StaticNatDirectionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNats[i].StaticNatDirection = types.StringValue(va.String())
+ }
+ }
+ data.StaticNats[i].TrackerObjectId = types.StringNull()
+
+ if t := r.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
+ va := r.Get("trackingObject.trackerId.refId.value")
+ if t.String() == "global" {
+ data.StaticNats[i].TrackerObjectId = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Nat64V4Pools {
+ keys := [...]string{"nat64V4PoolName"}
+ keyValues := [...]string{data.Nat64V4Pools[i].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Nat64V4Pools[i].NameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "nat64V4Pool").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Nat64V4Pools[i].Name = types.StringNull()
+ data.Nat64V4Pools[i].NameVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolName.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolName.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Nat64V4Pools[i].RangeStart = types.StringNull()
+ data.Nat64V4Pools[i].RangeStartVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolRangeStart.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].RangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].RangeStart = types.StringValue(va.String())
+ }
+ }
+ data.Nat64V4Pools[i].RangeEnd = types.StringNull()
+ data.Nat64V4Pools[i].RangeEndVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolRangeEnd.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].RangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].RangeEnd = types.StringValue(va.String())
+ }
+ }
+ data.Nat64V4Pools[i].Overload = types.BoolNull()
+ data.Nat64V4Pools[i].OverloadVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolOverload.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolOverload.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].OverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].Overload = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.RouteLeakFromGlobalVpns {
+ keys := [...]string{"routePolicy.refId"}
+ keyValues := [...]string{data.RouteLeakFromGlobalVpns[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "routeLeakFromGlobal").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouteLeakFromGlobalVpns[i].RouteProtocol = types.StringNull()
+ data.RouteLeakFromGlobalVpns[i].RouteProtocolVariable = types.StringNull()
+ if t := r.Get("routeProtocol.optionType"); t.Exists() {
+ va := r.Get("routeProtocol.value")
+ if t.String() == "variable" {
+ data.RouteLeakFromGlobalVpns[i].RouteProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteLeakFromGlobalVpns[i].RouteProtocol = types.StringValue(va.String())
+ }
+ }
+ data.RouteLeakFromGlobalVpns[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.RouteLeakFromGlobalVpns[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.RouteLeakFromGlobalVpns[i].Redistributions {
+ keys := [...]string{"policy.refId"}
+ keyValues := [...]string{data.RouteLeakFromGlobalVpns[i].Redistributions[ci].RedistributionPolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("redistributeToProtocol").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouteLeakFromGlobalVpns[i].Redistributions[ci].Protocol = types.StringNull()
+ data.RouteLeakFromGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringNull()
+ if t := cr.Get("protocol.optionType"); t.Exists() {
+ va := cr.Get("protocol.value")
+ if t.String() == "variable" {
+ data.RouteLeakFromGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteLeakFromGlobalVpns[i].Redistributions[ci].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.RouteLeakFromGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringNull()
+
+ if t := cr.Get("policy.refId.optionType"); t.Exists() {
+ va := cr.Get("policy.refId.value")
+ if t.String() == "global" {
+ data.RouteLeakFromGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.RouteLeakToGlobalVpns {
+ keys := [...]string{"routePolicy.refId"}
+ keyValues := [...]string{data.RouteLeakToGlobalVpns[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "routeLeakFromService").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouteLeakToGlobalVpns[i].RouteProtocol = types.StringNull()
+ data.RouteLeakToGlobalVpns[i].RouteProtocolVariable = types.StringNull()
+ if t := r.Get("routeProtocol.optionType"); t.Exists() {
+ va := r.Get("routeProtocol.value")
+ if t.String() == "variable" {
+ data.RouteLeakToGlobalVpns[i].RouteProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteLeakToGlobalVpns[i].RouteProtocol = types.StringValue(va.String())
+ }
+ }
+ data.RouteLeakToGlobalVpns[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.RouteLeakToGlobalVpns[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.RouteLeakToGlobalVpns[i].Redistributions {
+ keys := [...]string{"policy.refId"}
+ keyValues := [...]string{data.RouteLeakToGlobalVpns[i].Redistributions[ci].RedistributionPolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("redistributeToProtocol").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouteLeakToGlobalVpns[i].Redistributions[ci].Protocol = types.StringNull()
+ data.RouteLeakToGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringNull()
+ if t := cr.Get("protocol.optionType"); t.Exists() {
+ va := cr.Get("protocol.value")
+ if t.String() == "variable" {
+ data.RouteLeakToGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteLeakToGlobalVpns[i].Redistributions[ci].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.RouteLeakToGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringNull()
+
+ if t := cr.Get("policy.refId.optionType"); t.Exists() {
+ va := cr.Get("policy.refId.value")
+ if t.String() == "global" {
+ data.RouteLeakToGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.RouteLeakFromOtherServices {
+ keys := [...]string{"routePolicy.refId"}
+ keyValues := [...]string{data.RouteLeakFromOtherServices[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "routeLeakBetweenServices").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouteLeakFromOtherServices[i].SourceVpn = types.Int64Null()
+ data.RouteLeakFromOtherServices[i].SourceVpnVariable = types.StringNull()
+ if t := r.Get("sourceVpn.optionType"); t.Exists() {
+ va := r.Get("sourceVpn.value")
+ if t.String() == "variable" {
+ data.RouteLeakFromOtherServices[i].SourceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteLeakFromOtherServices[i].SourceVpn = types.Int64Value(va.Int())
+ }
+ }
+ data.RouteLeakFromOtherServices[i].RouteProtocol = types.StringNull()
+ data.RouteLeakFromOtherServices[i].RouteProtocolVariable = types.StringNull()
+ if t := r.Get("routeProtocol.optionType"); t.Exists() {
+ va := r.Get("routeProtocol.value")
+ if t.String() == "variable" {
+ data.RouteLeakFromOtherServices[i].RouteProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteLeakFromOtherServices[i].RouteProtocol = types.StringValue(va.String())
+ }
+ }
+ data.RouteLeakFromOtherServices[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.RouteLeakFromOtherServices[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.RouteLeakFromOtherServices[i].Redistributions {
+ keys := [...]string{"policy.refId"}
+ keyValues := [...]string{data.RouteLeakFromOtherServices[i].Redistributions[ci].RedistributionPolicyId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("redistributeToProtocol").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouteLeakFromOtherServices[i].Redistributions[ci].Protocol = types.StringNull()
+ data.RouteLeakFromOtherServices[i].Redistributions[ci].ProtocolVariable = types.StringNull()
+ if t := cr.Get("protocol.optionType"); t.Exists() {
+ va := cr.Get("protocol.value")
+ if t.String() == "variable" {
+ data.RouteLeakFromOtherServices[i].Redistributions[ci].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteLeakFromOtherServices[i].Redistributions[ci].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.RouteLeakFromOtherServices[i].Redistributions[ci].RedistributionPolicyId = types.StringNull()
+
+ if t := cr.Get("policy.refId.optionType"); t.Exists() {
+ va := cr.Get("policy.refId.value")
+ if t.String() == "global" {
+ data.RouteLeakFromOtherServices[i].Redistributions[ci].RedistributionPolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.Ipv4ImportRouteTargets {
+ keys := [...]string{"rt"}
+ keyValues := [...]string{data.Ipv4ImportRouteTargets[i].RouteTarget.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4ImportRouteTargets[i].RouteTargetVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "mplsVpnIpv4RouteTarget.importRtList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4ImportRouteTargets[i].RouteTarget = types.StringNull()
+ data.Ipv4ImportRouteTargets[i].RouteTargetVariable = types.StringNull()
+ if t := r.Get("rt.optionType"); t.Exists() {
+ va := r.Get("rt.value")
+ if t.String() == "variable" {
+ data.Ipv4ImportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4ImportRouteTargets[i].RouteTarget = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv4ExportRouteTargets {
+ keys := [...]string{"rt"}
+ keyValues := [...]string{data.Ipv4ExportRouteTargets[i].RouteTarget.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4ExportRouteTargets[i].RouteTargetVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "mplsVpnIpv4RouteTarget.exportRtList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4ExportRouteTargets[i].RouteTarget = types.StringNull()
+ data.Ipv4ExportRouteTargets[i].RouteTargetVariable = types.StringNull()
+ if t := r.Get("rt.optionType"); t.Exists() {
+ va := r.Get("rt.value")
+ if t.String() == "variable" {
+ data.Ipv4ExportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4ExportRouteTargets[i].RouteTarget = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv6ImportRouteTargets {
+ keys := [...]string{"rt"}
+ keyValues := [...]string{data.Ipv6ImportRouteTargets[i].RouteTarget.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6ImportRouteTargets[i].RouteTargetVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "mplsVpnIpv6RouteTarget.importRtList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6ImportRouteTargets[i].RouteTarget = types.StringNull()
+ data.Ipv6ImportRouteTargets[i].RouteTargetVariable = types.StringNull()
+ if t := r.Get("rt.optionType"); t.Exists() {
+ va := r.Get("rt.value")
+ if t.String() == "variable" {
+ data.Ipv6ImportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6ImportRouteTargets[i].RouteTarget = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv6ExportRouteTargets {
+ keys := [...]string{"rt"}
+ keyValues := [...]string{data.Ipv6ExportRouteTargets[i].RouteTarget.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6ExportRouteTargets[i].RouteTargetVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "mplsVpnIpv6RouteTarget.exportRtList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6ExportRouteTargets[i].RouteTarget = types.StringNull()
+ data.Ipv6ExportRouteTargets[i].RouteTargetVariable = types.StringNull()
+ if t := r.Get("rt.optionType"); t.Exists() {
+ va := r.Get("rt.value")
+ if t.String() == "variable" {
+ data.Ipv6ExportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6ExportRouteTargets[i].RouteTarget = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceLANVPN) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.Vpn.IsNull() {
+ return false
+ }
+ if !data.VpnVariable.IsNull() {
+ return false
+ }
+ if !data.ConfigDescription.IsNull() {
+ return false
+ }
+ if !data.ConfigDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.OmpAdminDistanceIpv4.IsNull() {
+ return false
+ }
+ if !data.OmpAdminDistanceIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.OmpAdminDistanceIpv6.IsNull() {
+ return false
+ }
+ if !data.OmpAdminDistanceIpv6Variable.IsNull() {
+ return false
+ }
+ if !data.EnableSdwanRemoteAccess.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv4.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv4.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv6.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv6.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
+ return false
+ }
+ if len(data.HostMappings) > 0 {
+ return false
+ }
+ if len(data.AdvertiseOmpIpv4s) > 0 {
+ return false
+ }
+ if len(data.AdvertiseOmpIpv6s) > 0 {
+ return false
+ }
+ if len(data.Ipv4StaticRoutes) > 0 {
+ return false
+ }
+ if len(data.Ipv6StaticRoutes) > 0 {
+ return false
+ }
+ if len(data.Services) > 0 {
+ return false
+ }
+ if len(data.ServiceRoutes) > 0 {
+ return false
+ }
+ if len(data.GreRoutes) > 0 {
+ return false
+ }
+ if len(data.IpsecRoutes) > 0 {
+ return false
+ }
+ if len(data.NatPools) > 0 {
+ return false
+ }
+ if len(data.NatPortForwards) > 0 {
+ return false
+ }
+ if len(data.StaticNats) > 0 {
+ return false
+ }
+ if len(data.Nat64V4Pools) > 0 {
+ return false
+ }
+ if len(data.RouteLeakFromGlobalVpns) > 0 {
+ return false
+ }
+ if len(data.RouteLeakToGlobalVpns) > 0 {
+ return false
+ }
+ if len(data.RouteLeakFromOtherServices) > 0 {
+ return false
+ }
+ if len(data.Ipv4ImportRouteTargets) > 0 {
+ return false
+ }
+ if len(data.Ipv4ExportRouteTargets) > 0 {
+ return false
+ }
+ if len(data.Ipv6ImportRouteTargets) > 0 {
+ return false
+ }
+ if len(data.Ipv6ExportRouteTargets) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_feature.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..85fbaee32
--- /dev/null
+++ b/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_feature.go
@@ -0,0 +1,3314 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceLANVPNInterfaceEthernet 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"`
+ ServiceLanVpnFeatureId types.String `tfsdk:"service_lan_vpn_feature_id"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"`
+ Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ Ipv4SecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
+ Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
+ Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
+ EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
+ Ipv6DhcpSecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses `tfsdk:"ipv6_dhcp_secondary_addresses"`
+ Ipv6Address types.String `tfsdk:"ipv6_address"`
+ Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
+ Ipv6SecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses `tfsdk:"ipv6_secondary_addresses"`
+ Ipv6DhcpHelpers []ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers `tfsdk:"ipv6_dhcp_helpers"`
+ Ipv4Nat types.Bool `tfsdk:"ipv4_nat"`
+ Ipv4NatType types.String `tfsdk:"ipv4_nat_type"`
+ Ipv4NatTypeVariable types.String `tfsdk:"ipv4_nat_type_variable"`
+ Ipv4NatRangeStart types.String `tfsdk:"ipv4_nat_range_start"`
+ Ipv4NatRangeStartVariable types.String `tfsdk:"ipv4_nat_range_start_variable"`
+ Ipv4NatRangeEnd types.String `tfsdk:"ipv4_nat_range_end"`
+ Ipv4NatRangeEndVariable types.String `tfsdk:"ipv4_nat_range_end_variable"`
+ Ipv4NatPrefixLength types.Int64 `tfsdk:"ipv4_nat_prefix_length"`
+ Ipv4NatPrefixLengthVariable types.String `tfsdk:"ipv4_nat_prefix_length_variable"`
+ Ipv4NatOverload types.Bool `tfsdk:"ipv4_nat_overload"`
+ Ipv4NatOverloadVariable types.String `tfsdk:"ipv4_nat_overload_variable"`
+ Ipv4NatLoopback types.String `tfsdk:"ipv4_nat_loopback"`
+ Ipv4NatLoopbackVariable types.String `tfsdk:"ipv4_nat_loopback_variable"`
+ Ipv4NatUdpTimeout types.Int64 `tfsdk:"ipv4_nat_udp_timeout"`
+ Ipv4NatUdpTimeoutVariable types.String `tfsdk:"ipv4_nat_udp_timeout_variable"`
+ Ipv4NatTcpTimeout types.Int64 `tfsdk:"ipv4_nat_tcp_timeout"`
+ Ipv4NatTcpTimeoutVariable types.String `tfsdk:"ipv4_nat_tcp_timeout_variable"`
+ StaticNats []ServiceLANVPNInterfaceEthernetStaticNats `tfsdk:"static_nats"`
+ Ipv6Nat types.Bool `tfsdk:"ipv6_nat"`
+ Nat64 types.Bool `tfsdk:"nat64"`
+ AclShapingRate types.Int64 `tfsdk:"acl_shaping_rate"`
+ AclShapingRateVariable types.String `tfsdk:"acl_shaping_rate_variable"`
+ AclIpv4EgressPolicyId types.String `tfsdk:"acl_ipv4_egress_policy_id"`
+ AclIpv4IngressPolicyId types.String `tfsdk:"acl_ipv4_ingress_policy_id"`
+ AclIpv6EgressPolicyId types.String `tfsdk:"acl_ipv6_egress_policy_id"`
+ AclIpv6IngressPolicyId types.String `tfsdk:"acl_ipv6_ingress_policy_id"`
+ Ipv6Vrrps []ServiceLANVPNInterfaceEthernetIpv6Vrrps `tfsdk:"ipv6_vrrps"`
+ Ipv4Vrrps []ServiceLANVPNInterfaceEthernetIpv4Vrrps `tfsdk:"ipv4_vrrps"`
+ Arps []ServiceLANVPNInterfaceEthernetArps `tfsdk:"arps"`
+ TrustsecEnableSgtPropogation types.Bool `tfsdk:"trustsec_enable_sgt_propogation"`
+ TrustsecPropogate types.Bool `tfsdk:"trustsec_propogate"`
+ TrustsecSecurityGroupTag types.Int64 `tfsdk:"trustsec_security_group_tag"`
+ TrustsecSecurityGroupTagVariable types.String `tfsdk:"trustsec_security_group_tag_variable"`
+ TrustsecEnableEnforcedPropogation types.Bool `tfsdk:"trustsec_enable_enforced_propogation"`
+ TrustsecEnforcedSecurityGroupTag types.Int64 `tfsdk:"trustsec_enforced_security_group_tag"`
+ TrustsecEnforcedSecurityGroupTagVariable types.String `tfsdk:"trustsec_enforced_security_group_tag_variable"`
+ Duplex types.String `tfsdk:"duplex"`
+ DuplexVariable types.String `tfsdk:"duplex_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
+ InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ Speed types.String `tfsdk:"speed"`
+ SpeedVariable types.String `tfsdk:"speed_variable"`
+ ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
+ ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
+ Autonegotiate types.Bool `tfsdk:"autonegotiate"`
+ AutonegotiateVariable types.String `tfsdk:"autonegotiate_variable"`
+ MediaType types.String `tfsdk:"media_type"`
+ MediaTypeVariable types.String `tfsdk:"media_type_variable"`
+ LoadInterval types.Int64 `tfsdk:"load_interval"`
+ LoadIntervalVariable types.String `tfsdk:"load_interval_variable"`
+ Tracker types.String `tfsdk:"tracker"`
+ TrackerVariable types.String `tfsdk:"tracker_variable"`
+ IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
+ IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
+ Xconnect types.String `tfsdk:"xconnect"`
+ XconnectVariable types.String `tfsdk:"xconnect_variable"`
+ IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
+ IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ Dhcpv6HelperVpn types.Int64 `tfsdk:"dhcpv6_helper_vpn"`
+ Dhcpv6HelperVpnVariable types.String `tfsdk:"dhcpv6_helper_vpn_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetStaticNats struct {
+ SourceIp types.String `tfsdk:"source_ip"`
+ SourceIpVariable types.String `tfsdk:"source_ip_variable"`
+ TranslateIp types.String `tfsdk:"translate_ip"`
+ TranslateIpVariable types.String `tfsdk:"translate_ip_variable"`
+ Direction types.String `tfsdk:"direction"`
+ SourceVpn types.Int64 `tfsdk:"source_vpn"`
+ SourceVpnVariable types.String `tfsdk:"source_vpn_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv6Vrrps struct {
+ GroupId types.Int64 `tfsdk:"group_id"`
+ GroupIdVariable types.String `tfsdk:"group_id_variable"`
+ Priority types.Int64 `tfsdk:"priority"`
+ PriorityVariable types.String `tfsdk:"priority_variable"`
+ Timer types.Int64 `tfsdk:"timer"`
+ TimerVariable types.String `tfsdk:"timer_variable"`
+ TrackOmp types.Bool `tfsdk:"track_omp"`
+ Ipv6Addresses []ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses `tfsdk:"ipv6_addresses"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv4Vrrps struct {
+ GroupId types.Int64 `tfsdk:"group_id"`
+ GroupIdVariable types.String `tfsdk:"group_id_variable"`
+ Priority types.Int64 `tfsdk:"priority"`
+ PriorityVariable types.String `tfsdk:"priority_variable"`
+ Timer types.Int64 `tfsdk:"timer"`
+ TimerVariable types.String `tfsdk:"timer_variable"`
+ TrackOmp types.Bool `tfsdk:"track_omp"`
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ SecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses `tfsdk:"secondary_addresses"`
+ TlocPrefixChange types.Bool `tfsdk:"tloc_prefix_change"`
+ TlocPrefChangeValue types.Int64 `tfsdk:"tloc_pref_change_value"`
+}
+
+type ServiceLANVPNInterfaceEthernetArps struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses struct {
+ LinkLocalAddress types.String `tfsdk:"link_local_address"`
+ LinkLocalAddressVariable types.String `tfsdk:"link_local_address_variable"`
+ GlobalAddress types.String `tfsdk:"global_address"`
+ GlobalAddressVariable types.String `tfsdk:"global_address_variable"`
+}
+
+type ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceLANVPNInterfaceEthernet) getModel() string {
+ return "service_lan_vpn_interface_ethernet"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceLANVPNInterfaceEthernet) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/ethernet", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4DhcpDistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString())
+ }
+ } else if !data.Ipv4DhcpDistance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+ if true {
+
+ for _, item := range data.Ipv4SecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
+ }
+ } else if data.Ipv4DhcpHelper.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
+ var values []string
+ data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
+ }
+ }
+ if !data.EnableDhcpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool())
+ }
+ }
+ if true {
+
+ for _, item := range data.Ipv6DhcpSecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv6AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString())
+ }
+ } else if !data.Ipv6Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString())
+ }
+ }
+ if true {
+
+ for _, item := range data.Ipv6SecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody)
+ }
+ }
+ if true {
+
+ for _, item := range data.Ipv6DhcpHelpers {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.Dhcpv6HelperVpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpnVariable.ValueString())
+ }
+ } else if !item.Dhcpv6HelperVpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpn.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.dhcpHelperV6.-1", itemBody)
+ }
+ }
+ if data.Ipv4Nat.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "default")
+ body, _ = sjson.Set(body, path+"nat.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "global")
+ body, _ = sjson.Set(body, path+"nat.value", data.Ipv4Nat.ValueBool())
+ }
+ }
+
+ if !data.Ipv4NatTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatTypeVariable.ValueString())
+ }
+ } else if !data.Ipv4NatType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatType.ValueString())
+ }
+ }
+
+ if !data.Ipv4NatRangeStartVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStartVariable.ValueString())
+ }
+ } else if data.Ipv4NatRangeStart.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStart.ValueString())
+ }
+ }
+
+ if !data.Ipv4NatRangeEndVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEndVariable.ValueString())
+ }
+ } else if data.Ipv4NatRangeEnd.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEnd.ValueString())
+ }
+ }
+
+ if !data.Ipv4NatPrefixLengthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLengthVariable.ValueString())
+ }
+ } else if data.Ipv4NatPrefixLength.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLength.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4NatOverloadVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverloadVariable.ValueString())
+ }
+ } else if data.Ipv4NatOverload.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverload.ValueBool())
+ }
+ }
+
+ if !data.Ipv4NatLoopbackVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopbackVariable.ValueString())
+ }
+ } else if data.Ipv4NatLoopback.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopback.ValueString())
+ }
+ }
+
+ if !data.Ipv4NatUdpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeoutVariable.ValueString())
+ }
+ } else if data.Ipv4NatUdpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeout.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4NatTcpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeoutVariable.ValueString())
+ }
+ } else if data.Ipv4NatTcpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeout.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{})
+ for _, item := range data.StaticNats {
+ itemBody := ""
+
+ if !item.SourceIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
+ }
+ } else if !item.SourceIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
+ }
+ }
+
+ if !item.TranslateIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIpVariable.ValueString())
+ }
+ } else if !item.TranslateIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIp.ValueString())
+ }
+ }
+ if item.Direction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString())
+ }
+ }
+
+ if !item.SourceVpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString())
+ }
+ } else if item.SourceVpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody)
+ }
+ }
+ if data.Ipv6Nat.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natIpv6.optionType", "default")
+ body, _ = sjson.Set(body, path+"natIpv6.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"natIpv6.value", data.Ipv6Nat.ValueBool())
+ }
+ }
+ if !data.Nat64.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool())
+ }
+ }
+
+ if !data.AclShapingRateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRateVariable.ValueString())
+ }
+ } else if data.AclShapingRate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRate.ValueInt64())
+ }
+ }
+ if !data.AclIpv4EgressPolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.value", data.AclIpv4EgressPolicyId.ValueString())
+ }
+ }
+ if !data.AclIpv4IngressPolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.value", data.AclIpv4IngressPolicyId.ValueString())
+ }
+ }
+ if !data.AclIpv6EgressPolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.value", data.AclIpv6EgressPolicyId.ValueString())
+ }
+ }
+ if !data.AclIpv6IngressPolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.value", data.AclIpv6IngressPolicyId.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{})
+ for _, item := range data.Ipv6Vrrps {
+ itemBody := ""
+
+ if !item.GroupIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString())
+ }
+ } else if !item.GroupId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64())
+ }
+ }
+
+ if !item.PriorityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
+ }
+ } else if item.Priority.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
+ }
+ }
+
+ if !item.TimerVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
+ }
+ } else if item.Timer.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
+ }
+ }
+ if item.TrackOmp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{})
+ for _, childItem := range item.Ipv6Addresses {
+ itemChildBody := ""
+
+ if !childItem.LinkLocalAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString())
+ }
+ } else if !childItem.LinkLocalAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString())
+ }
+ }
+
+ if !childItem.GlobalAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString())
+ }
+ } else if childItem.GlobalAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"vrrp", []interface{}{})
+ for _, item := range data.Ipv4Vrrps {
+ itemBody := ""
+
+ if !item.GroupIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString())
+ }
+ } else if !item.GroupId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64())
+ }
+ }
+
+ if !item.PriorityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
+ }
+ } else if item.Priority.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
+ }
+ }
+
+ if !item.TimerVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
+ }
+ } else if item.Timer.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
+ }
+ }
+ if item.TrackOmp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
+ }
+ }
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{})
+ for _, childItem := range item.SecondaryAddresses {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.SubnetMaskVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMaskVariable.ValueString())
+ }
+ } else if !childItem.SubnetMask.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMask.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody)
+ }
+ }
+ if item.TlocPrefixChange.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool())
+ }
+ }
+ if item.TlocPrefChangeValue.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefChangeValue.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"arp", []interface{}{})
+ for _, item := range data.Arps {
+ itemBody := ""
+
+ if !item.IpAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
+ }
+ } else if item.IpAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
+ }
+ }
+
+ if !item.MacAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
+ }
+ } else if !item.MacAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
+ }
+ }
+ if data.TrustsecEnableSgtPropogation.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "default")
+ body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "global")
+ body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", data.TrustsecEnableSgtPropogation.ValueBool())
+ }
+ }
+ if data.TrustsecPropogate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "default")
+ body, _ = sjson.Set(body, path+"trustsec.propogate.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "global")
+ body, _ = sjson.Set(body, path+"trustsec.propogate.value", data.TrustsecPropogate.ValueBool())
+ }
+ }
+
+ if !data.TrustsecSecurityGroupTagVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTagVariable.ValueString())
+ }
+ } else if data.TrustsecSecurityGroupTag.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "global")
+ body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTag.ValueInt64())
+ }
+ }
+ if data.TrustsecEnableEnforcedPropogation.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "global")
+ body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.value", data.TrustsecEnableEnforcedPropogation.ValueBool())
+ }
+ }
+
+ if !data.TrustsecEnforcedSecurityGroupTagVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTagVariable.ValueString())
+ }
+ } else if data.TrustsecEnforcedSecurityGroupTag.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "global")
+ body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTag.ValueInt64())
+ }
+ }
+
+ if !data.DuplexVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString())
+ }
+ } else if data.Duplex.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString())
+ }
+ }
+
+ if !data.MacAddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString())
+ }
+ } else if data.MacAddress.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.InterfaceMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
+ }
+ } else if data.InterfaceMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.SpeedVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString())
+ }
+ } else if data.Speed.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString())
+ }
+ }
+
+ if !data.ArpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
+ }
+ } else if data.ArpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
+ }
+ }
+
+ if !data.AutonegotiateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString())
+ }
+ } else if data.Autonegotiate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool())
+ }
+ }
+
+ if !data.MediaTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString())
+ }
+ } else if data.MediaType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString())
+ }
+ }
+
+ if !data.LoadIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString())
+ }
+ } else if data.LoadInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64())
+ }
+ }
+
+ if !data.TrackerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString())
+ }
+ } else if data.Tracker.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString())
+ }
+ }
+
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
+ }
+ } else if data.IcmpRedirectDisable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
+ }
+ }
+
+ if !data.XconnectVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.XconnectVariable.ValueString())
+ }
+ } else if data.Xconnect.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.Xconnect.ValueString())
+ }
+ }
+
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
+ }
+ } else if data.IpDirectedBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceLANVPNInterfaceEthernet) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpDistance = types.Int64Null()
+ data.Ipv4DhcpDistanceVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary"); value.Exists() {
+ data.Ipv4SecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("subnetMask.optionType"); t.Exists() {
+ va := v.Get("subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
+ return true
+ })
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+
+ if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
+ if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address"); value.Exists() {
+ data.Ipv6DhcpSecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6DhcpSecondaryAddresses = append(data.Ipv6DhcpSecondaryAddresses, item)
+ return true
+ })
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "intfIpV6Address.static.secondaryIpV6Address"); value.Exists() {
+ data.Ipv6SecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6SecondaryAddresses = append(data.Ipv6SecondaryAddresses, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "intfIpV6Address.static.dhcpHelperV6"); value.Exists() {
+ data.Ipv6DhcpHelpers = make([]ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.Dhcpv6HelperVpn = types.Int64Null()
+ item.Dhcpv6HelperVpnVariable = types.StringNull()
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "variable" {
+ item.Dhcpv6HelperVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Dhcpv6HelperVpn = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6DhcpHelpers = append(data.Ipv6DhcpHelpers, item)
+ return true
+ })
+ }
+ data.Ipv4Nat = types.BoolNull()
+
+ if t := res.Get(path + "nat.optionType"); t.Exists() {
+ va := res.Get(path + "nat.value")
+ if t.String() == "global" {
+ data.Ipv4Nat = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4NatType = types.StringNull()
+ data.Ipv4NatTypeVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natType.value")
+ if t.String() == "variable" {
+ data.Ipv4NatTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatRangeStart = types.StringNull()
+ data.Ipv4NatRangeStartVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
+ if t.String() == "variable" {
+ data.Ipv4NatRangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatRangeStart = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatRangeEnd = types.StringNull()
+ data.Ipv4NatRangeEndVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
+ if t.String() == "variable" {
+ data.Ipv4NatRangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatRangeEnd = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatPrefixLength = types.Int64Null()
+ data.Ipv4NatPrefixLengthVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
+ if t.String() == "variable" {
+ data.Ipv4NatPrefixLengthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatPrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4NatOverload = types.BoolNull()
+ data.Ipv4NatOverloadVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
+ if t.String() == "variable" {
+ data.Ipv4NatOverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatOverload = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4NatLoopback = types.StringNull()
+ data.Ipv4NatLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natLookback.value")
+ if t.String() == "variable" {
+ data.Ipv4NatLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatLoopback = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatUdpTimeout = types.Int64Null()
+ data.Ipv4NatUdpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
+ if t.String() == "variable" {
+ data.Ipv4NatUdpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatUdpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4NatTcpTimeout = types.Int64Null()
+ data.Ipv4NatTcpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
+ if t.String() == "variable" {
+ data.Ipv4NatTcpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatTcpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "natAttributesIpv4.newStaticNat"); value.Exists() {
+ data.StaticNats = make([]ServiceLANVPNInterfaceEthernetStaticNats, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetStaticNats{}
+ item.SourceIp = types.StringNull()
+ item.SourceIpVariable = types.StringNull()
+ if t := v.Get("sourceIp.optionType"); t.Exists() {
+ va := v.Get("sourceIp.value")
+ if t.String() == "variable" {
+ item.SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceIp = types.StringValue(va.String())
+ }
+ }
+ item.TranslateIp = types.StringNull()
+ item.TranslateIpVariable = types.StringNull()
+ if t := v.Get("translateIp.optionType"); t.Exists() {
+ va := v.Get("translateIp.value")
+ if t.String() == "variable" {
+ item.TranslateIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TranslateIp = types.StringValue(va.String())
+ }
+ }
+ item.Direction = types.StringNull()
+
+ if t := v.Get("staticNatDirection.optionType"); t.Exists() {
+ va := v.Get("staticNatDirection.value")
+ if t.String() == "global" {
+ item.Direction = types.StringValue(va.String())
+ }
+ }
+ item.SourceVpn = types.Int64Null()
+ item.SourceVpnVariable = types.StringNull()
+ if t := v.Get("sourceVpn.optionType"); t.Exists() {
+ va := v.Get("sourceVpn.value")
+ if t.String() == "variable" {
+ item.SourceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceVpn = types.Int64Value(va.Int())
+ }
+ }
+ data.StaticNats = append(data.StaticNats, item)
+ return true
+ })
+ }
+ data.Ipv6Nat = types.BoolNull()
+
+ if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "natIpv6.value")
+ if t.String() == "global" {
+ data.Ipv6Nat = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat64 = types.BoolNull()
+
+ if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv6.nat64.value")
+ if t.String() == "global" {
+ data.Nat64 = types.BoolValue(va.Bool())
+ }
+ }
+ data.AclShapingRate = types.Int64Null()
+ data.AclShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.AclShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AclShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ data.AclIpv4EgressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv4AclEgress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv4AclEgress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv4EgressPolicyId = types.StringValue(va.String())
+ }
+ }
+ data.AclIpv4IngressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv4AclIngress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv4AclIngress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv4IngressPolicyId = types.StringValue(va.String())
+ }
+ }
+ data.AclIpv6EgressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv6AclEgress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv6AclEgress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv6EgressPolicyId = types.StringValue(va.String())
+ }
+ }
+ data.AclIpv6IngressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv6AclIngress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv6AclIngress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv6IngressPolicyId = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "vrrpIpv6"); value.Exists() {
+ data.Ipv6Vrrps = make([]ServiceLANVPNInterfaceEthernetIpv6Vrrps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetIpv6Vrrps{}
+ item.GroupId = types.Int64Null()
+ item.GroupIdVariable = types.StringNull()
+ if t := v.Get("groupId.optionType"); t.Exists() {
+ va := v.Get("groupId.value")
+ if t.String() == "variable" {
+ item.GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.GroupId = types.Int64Value(va.Int())
+ }
+ }
+ item.Priority = types.Int64Null()
+ item.PriorityVariable = types.StringNull()
+ if t := v.Get("priority.optionType"); t.Exists() {
+ va := v.Get("priority.value")
+ if t.String() == "variable" {
+ item.PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Priority = types.Int64Value(va.Int())
+ }
+ }
+ item.Timer = types.Int64Null()
+ item.TimerVariable = types.StringNull()
+ if t := v.Get("timer.optionType"); t.Exists() {
+ va := v.Get("timer.value")
+ if t.String() == "variable" {
+ item.TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Timer = types.Int64Value(va.Int())
+ }
+ }
+ item.TrackOmp = types.BoolNull()
+
+ if t := v.Get("trackOmp.optionType"); t.Exists() {
+ va := v.Get("trackOmp.value")
+ if t.String() == "global" {
+ item.TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ if cValue := v.Get("ipv6"); cValue.Exists() {
+ item.Ipv6Addresses = make([]ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses{}
+ cItem.LinkLocalAddress = types.StringNull()
+ cItem.LinkLocalAddressVariable = types.StringNull()
+ if t := cv.Get("ipv6LinkLocal.optionType"); t.Exists() {
+ va := cv.Get("ipv6LinkLocal.value")
+ if t.String() == "variable" {
+ cItem.LinkLocalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LinkLocalAddress = types.StringValue(va.String())
+ }
+ }
+ cItem.GlobalAddress = types.StringNull()
+ cItem.GlobalAddressVariable = types.StringNull()
+ if t := cv.Get("prefix.optionType"); t.Exists() {
+ va := cv.Get("prefix.value")
+ if t.String() == "variable" {
+ cItem.GlobalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.GlobalAddress = types.StringValue(va.String())
+ }
+ }
+ item.Ipv6Addresses = append(item.Ipv6Addresses, cItem)
+ return true
+ })
+ }
+ data.Ipv6Vrrps = append(data.Ipv6Vrrps, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "vrrp"); value.Exists() {
+ data.Ipv4Vrrps = make([]ServiceLANVPNInterfaceEthernetIpv4Vrrps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetIpv4Vrrps{}
+ item.GroupId = types.Int64Null()
+ item.GroupIdVariable = types.StringNull()
+ if t := v.Get("group_id.optionType"); t.Exists() {
+ va := v.Get("group_id.value")
+ if t.String() == "variable" {
+ item.GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.GroupId = types.Int64Value(va.Int())
+ }
+ }
+ item.Priority = types.Int64Null()
+ item.PriorityVariable = types.StringNull()
+ if t := v.Get("priority.optionType"); t.Exists() {
+ va := v.Get("priority.value")
+ if t.String() == "variable" {
+ item.PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Priority = types.Int64Value(va.Int())
+ }
+ }
+ item.Timer = types.Int64Null()
+ item.TimerVariable = types.StringNull()
+ if t := v.Get("timer.optionType"); t.Exists() {
+ va := v.Get("timer.value")
+ if t.String() == "variable" {
+ item.TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Timer = types.Int64Value(va.Int())
+ }
+ }
+ item.TrackOmp = types.BoolNull()
+
+ if t := v.Get("trackOmp.optionType"); t.Exists() {
+ va := v.Get("trackOmp.value")
+ if t.String() == "global" {
+ item.TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("ipAddressSecondary"); cValue.Exists() {
+ item.SecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("ipAddress.optionType"); t.Exists() {
+ va := cv.Get("ipAddress.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.SubnetMask = types.StringNull()
+ cItem.SubnetMaskVariable = types.StringNull()
+ if t := cv.Get("subnetMask.optionType"); t.Exists() {
+ va := cv.Get("subnetMask.value")
+ if t.String() == "variable" {
+ cItem.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.SecondaryAddresses = append(item.SecondaryAddresses, cItem)
+ return true
+ })
+ }
+ item.TlocPrefixChange = types.BoolNull()
+
+ if t := v.Get("tlocPrefChange.optionType"); t.Exists() {
+ va := v.Get("tlocPrefChange.value")
+ if t.String() == "global" {
+ item.TlocPrefixChange = types.BoolValue(va.Bool())
+ }
+ }
+ item.TlocPrefChangeValue = types.Int64Null()
+
+ if t := v.Get("tlocPrefChangeValue.optionType"); t.Exists() {
+ va := v.Get("tlocPrefChangeValue.value")
+ if t.String() == "global" {
+ item.TlocPrefChangeValue = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps = append(data.Ipv4Vrrps, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "arp"); value.Exists() {
+ data.Arps = make([]ServiceLANVPNInterfaceEthernetArps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceEthernetArps{}
+ item.IpAddress = types.StringNull()
+ item.IpAddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.IpAddress = types.StringValue(va.String())
+ }
+ }
+ item.MacAddress = types.StringNull()
+ item.MacAddressVariable = types.StringNull()
+ if t := v.Get("macAddress.optionType"); t.Exists() {
+ va := v.Get("macAddress.value")
+ if t.String() == "variable" {
+ item.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps = append(data.Arps, item)
+ return true
+ })
+ }
+ data.TrustsecEnableSgtPropogation = types.BoolNull()
+
+ if t := res.Get(path + "trustsec.enableSGTPropogation.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.enableSGTPropogation.value")
+ if t.String() == "global" {
+ data.TrustsecEnableSgtPropogation = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrustsecPropogate = types.BoolNull()
+
+ if t := res.Get(path + "trustsec.propogate.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.propogate.value")
+ if t.String() == "global" {
+ data.TrustsecPropogate = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrustsecSecurityGroupTag = types.Int64Null()
+ data.TrustsecSecurityGroupTagVariable = types.StringNull()
+ if t := res.Get(path + "trustsec.securityGroupTag.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.securityGroupTag.value")
+ if t.String() == "variable" {
+ data.TrustsecSecurityGroupTagVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrustsecSecurityGroupTag = types.Int64Value(va.Int())
+ }
+ }
+ data.TrustsecEnableEnforcedPropogation = types.BoolNull()
+
+ if t := res.Get(path + "trustsec.enableEnforcedPropogation.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.enableEnforcedPropogation.value")
+ if t.String() == "global" {
+ data.TrustsecEnableEnforcedPropogation = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrustsecEnforcedSecurityGroupTag = types.Int64Null()
+ data.TrustsecEnforcedSecurityGroupTagVariable = types.StringNull()
+ if t := res.Get(path + "trustsec.enforcedSecurityGroupTag.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.enforcedSecurityGroupTag.value")
+ if t.String() == "variable" {
+ data.TrustsecEnforcedSecurityGroupTagVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrustsecEnforcedSecurityGroupTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Duplex = types.StringNull()
+ data.DuplexVariable = types.StringNull()
+ if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.duplex.value")
+ if t.String() == "variable" {
+ data.DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Duplex = types.StringValue(va.String())
+ }
+ }
+ data.MacAddress = types.StringNull()
+ data.MacAddressVariable = types.StringNull()
+ if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.macAddress.value")
+ if t.String() == "variable" {
+ data.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Speed = types.StringNull()
+ data.SpeedVariable = types.StringNull()
+ if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.speed.value")
+ if t.String() == "variable" {
+ data.SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Speed = types.StringValue(va.String())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Autonegotiate = types.BoolNull()
+ data.AutonegotiateVariable = types.StringNull()
+ if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.autonegotiate.value")
+ if t.String() == "variable" {
+ data.AutonegotiateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Autonegotiate = types.BoolValue(va.Bool())
+ }
+ }
+ data.MediaType = types.StringNull()
+ data.MediaTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mediaType.value")
+ if t.String() == "variable" {
+ data.MediaTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MediaType = types.StringValue(va.String())
+ }
+ }
+ data.LoadInterval = types.Int64Null()
+ data.LoadIntervalVariable = types.StringNull()
+ if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.loadInterval.value")
+ if t.String() == "variable" {
+ data.LoadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LoadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Tracker = types.StringNull()
+ data.TrackerVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tracker.value")
+ if t.String() == "variable" {
+ data.TrackerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Tracker = types.StringValue(va.String())
+ }
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+ data.Xconnect = types.StringNull()
+ data.XconnectVariable = types.StringNull()
+ if t := res.Get(path + "advanced.xconnect.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.xconnect.value")
+ if t.String() == "variable" {
+ data.XconnectVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Xconnect = types.StringValue(va.String())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceLANVPNInterfaceEthernet) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpDistance = types.Int64Null()
+ data.Ipv4DhcpDistanceVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv4SecondaryAddresses {
+ keys := [...]string{"ipAddress"}
+ keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("subnetMask.optionType"); t.Exists() {
+ va := r.Get("subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+
+ if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
+ if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv6DhcpSecondaryAddresses {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6DhcpSecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6DhcpSecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6DhcpSecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv6DhcpSecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6DhcpSecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6DhcpSecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv6SecondaryAddresses {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6SecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6SecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpV6Address.static.secondaryIpV6Address").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6SecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6SecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv6DhcpHelpers {
+ keys := [...]string{"ipAddress", "vpn"}
+ keyValues := [...]string{data.Ipv6DhcpHelpers[i].Address.ValueString(), strconv.FormatInt(data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpn.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Ipv6DhcpHelpers[i].AddressVariable.ValueString(), data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpnVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpV6Address.static.dhcpHelperV6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6DhcpHelpers[i].Address = types.StringNull()
+ data.Ipv6DhcpHelpers[i].AddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv6DhcpHelpers[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6DhcpHelpers[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpn = types.Int64Null()
+ data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpnVariable = types.StringNull()
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "variable" {
+ data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpn = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Ipv4Nat = types.BoolNull()
+
+ if t := res.Get(path + "nat.optionType"); t.Exists() {
+ va := res.Get(path + "nat.value")
+ if t.String() == "global" {
+ data.Ipv4Nat = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4NatType = types.StringNull()
+ data.Ipv4NatTypeVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natType.value")
+ if t.String() == "variable" {
+ data.Ipv4NatTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatRangeStart = types.StringNull()
+ data.Ipv4NatRangeStartVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
+ if t.String() == "variable" {
+ data.Ipv4NatRangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatRangeStart = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatRangeEnd = types.StringNull()
+ data.Ipv4NatRangeEndVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
+ if t.String() == "variable" {
+ data.Ipv4NatRangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatRangeEnd = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatPrefixLength = types.Int64Null()
+ data.Ipv4NatPrefixLengthVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
+ if t.String() == "variable" {
+ data.Ipv4NatPrefixLengthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatPrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4NatOverload = types.BoolNull()
+ data.Ipv4NatOverloadVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
+ if t.String() == "variable" {
+ data.Ipv4NatOverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatOverload = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4NatLoopback = types.StringNull()
+ data.Ipv4NatLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natLookback.value")
+ if t.String() == "variable" {
+ data.Ipv4NatLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatLoopback = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4NatUdpTimeout = types.Int64Null()
+ data.Ipv4NatUdpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
+ if t.String() == "variable" {
+ data.Ipv4NatUdpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatUdpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4NatTcpTimeout = types.Int64Null()
+ data.Ipv4NatTcpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
+ if t.String() == "variable" {
+ data.Ipv4NatTcpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4NatTcpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.StaticNats {
+ keys := [...]string{"sourceIp", "translateIp", "staticNatDirection", "sourceVpn"}
+ keyValues := [...]string{data.StaticNats[i].SourceIp.ValueString(), data.StaticNats[i].TranslateIp.ValueString(), data.StaticNats[i].Direction.ValueString(), strconv.FormatInt(data.StaticNats[i].SourceVpn.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.StaticNats[i].SourceIpVariable.ValueString(), data.StaticNats[i].TranslateIpVariable.ValueString(), "", data.StaticNats[i].SourceVpnVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "natAttributesIpv4.newStaticNat").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.StaticNats[i].SourceIp = types.StringNull()
+ data.StaticNats[i].SourceIpVariable = types.StringNull()
+ if t := r.Get("sourceIp.optionType"); t.Exists() {
+ va := r.Get("sourceIp.value")
+ if t.String() == "variable" {
+ data.StaticNats[i].SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNats[i].SourceIp = types.StringValue(va.String())
+ }
+ }
+ data.StaticNats[i].TranslateIp = types.StringNull()
+ data.StaticNats[i].TranslateIpVariable = types.StringNull()
+ if t := r.Get("translateIp.optionType"); t.Exists() {
+ va := r.Get("translateIp.value")
+ if t.String() == "variable" {
+ data.StaticNats[i].TranslateIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNats[i].TranslateIp = types.StringValue(va.String())
+ }
+ }
+ data.StaticNats[i].Direction = types.StringNull()
+
+ if t := r.Get("staticNatDirection.optionType"); t.Exists() {
+ va := r.Get("staticNatDirection.value")
+ if t.String() == "global" {
+ data.StaticNats[i].Direction = types.StringValue(va.String())
+ }
+ }
+ data.StaticNats[i].SourceVpn = types.Int64Null()
+ data.StaticNats[i].SourceVpnVariable = types.StringNull()
+ if t := r.Get("sourceVpn.optionType"); t.Exists() {
+ va := r.Get("sourceVpn.value")
+ if t.String() == "variable" {
+ data.StaticNats[i].SourceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNats[i].SourceVpn = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Ipv6Nat = types.BoolNull()
+
+ if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "natIpv6.value")
+ if t.String() == "global" {
+ data.Ipv6Nat = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat64 = types.BoolNull()
+
+ if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv6.nat64.value")
+ if t.String() == "global" {
+ data.Nat64 = types.BoolValue(va.Bool())
+ }
+ }
+ data.AclShapingRate = types.Int64Null()
+ data.AclShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.AclShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AclShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ data.AclIpv4EgressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv4AclEgress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv4AclEgress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv4EgressPolicyId = types.StringValue(va.String())
+ }
+ }
+ data.AclIpv4IngressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv4AclIngress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv4AclIngress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv4IngressPolicyId = types.StringValue(va.String())
+ }
+ }
+ data.AclIpv6EgressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv6AclEgress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv6AclEgress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv6EgressPolicyId = types.StringValue(va.String())
+ }
+ }
+ data.AclIpv6IngressPolicyId = types.StringNull()
+
+ if t := res.Get(path + "aclQos.ipv6AclIngress.refId.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.ipv6AclIngress.refId.value")
+ if t.String() == "global" {
+ data.AclIpv6IngressPolicyId = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv6Vrrps {
+ keys := [...]string{"groupId"}
+ keyValues := [...]string{strconv.FormatInt(data.Ipv6Vrrps[i].GroupId.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Ipv6Vrrps[i].GroupIdVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "vrrpIpv6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Vrrps[i].GroupId = types.Int64Null()
+ data.Ipv6Vrrps[i].GroupIdVariable = types.StringNull()
+ if t := r.Get("groupId.optionType"); t.Exists() {
+ va := r.Get("groupId.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].GroupId = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Vrrps[i].Priority = types.Int64Null()
+ data.Ipv6Vrrps[i].PriorityVariable = types.StringNull()
+ if t := r.Get("priority.optionType"); t.Exists() {
+ va := r.Get("priority.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Priority = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Vrrps[i].Timer = types.Int64Null()
+ data.Ipv6Vrrps[i].TimerVariable = types.StringNull()
+ if t := r.Get("timer.optionType"); t.Exists() {
+ va := r.Get("timer.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Timer = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Vrrps[i].TrackOmp = types.BoolNull()
+
+ if t := r.Get("trackOmp.optionType"); t.Exists() {
+ va := r.Get("trackOmp.value")
+ if t.String() == "global" {
+ data.Ipv6Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ for ci := range data.Ipv6Vrrps[i].Ipv6Addresses {
+ keys := [...]string{"ipv6LinkLocal"}
+ keyValues := [...]string{data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ipv6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddress = types.StringNull()
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddressVariable = types.StringNull()
+ if t := cr.Get("ipv6LinkLocal.optionType"); t.Exists() {
+ va := cr.Get("ipv6LinkLocal.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddress = types.StringNull()
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddressVariable = types.StringNull()
+ if t := cr.Get("prefix.optionType"); t.Exists() {
+ va := cr.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddress = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.Ipv4Vrrps {
+ keys := [...]string{"group_id"}
+ keyValues := [...]string{strconv.FormatInt(data.Ipv4Vrrps[i].GroupId.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Ipv4Vrrps[i].GroupIdVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "vrrp").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Vrrps[i].GroupId = types.Int64Null()
+ data.Ipv4Vrrps[i].GroupIdVariable = types.StringNull()
+ if t := r.Get("group_id.optionType"); t.Exists() {
+ va := r.Get("group_id.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].GroupId = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps[i].Priority = types.Int64Null()
+ data.Ipv4Vrrps[i].PriorityVariable = types.StringNull()
+ if t := r.Get("priority.optionType"); t.Exists() {
+ va := r.Get("priority.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].Priority = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps[i].Timer = types.Int64Null()
+ data.Ipv4Vrrps[i].TimerVariable = types.StringNull()
+ if t := r.Get("timer.optionType"); t.Exists() {
+ va := r.Get("timer.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].Timer = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps[i].TrackOmp = types.BoolNull()
+
+ if t := r.Get("trackOmp.optionType"); t.Exists() {
+ va := r.Get("trackOmp.value")
+ if t.String() == "global" {
+ data.Ipv4Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Vrrps[i].Address = types.StringNull()
+ data.Ipv4Vrrps[i].AddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].Address = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv4Vrrps[i].SecondaryAddresses {
+ keys := [...]string{"ipAddress"}
+ keyValues := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ipAddressSecondary").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringNull()
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("ipAddress.optionType"); t.Exists() {
+ va := cr.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMask = types.StringNull()
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMaskVariable = types.StringNull()
+ if t := cr.Get("subnetMask.optionType"); t.Exists() {
+ va := cr.Get("subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolNull()
+
+ if t := r.Get("tlocPrefChange.optionType"); t.Exists() {
+ va := r.Get("tlocPrefChange.value")
+ if t.String() == "global" {
+ data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Vrrps[i].TlocPrefChangeValue = types.Int64Null()
+
+ if t := r.Get("tlocPrefChangeValue.optionType"); t.Exists() {
+ va := r.Get("tlocPrefChangeValue.value")
+ if t.String() == "global" {
+ data.Ipv4Vrrps[i].TlocPrefChangeValue = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.Arps {
+ keys := [...]string{"ipAddress", "macAddress"}
+ keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "arp").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Arps[i].IpAddress = types.StringNull()
+ data.Arps[i].IpAddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps[i].MacAddress = types.StringNull()
+ data.Arps[i].MacAddressVariable = types.StringNull()
+ if t := r.Get("macAddress.optionType"); t.Exists() {
+ va := r.Get("macAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].MacAddress = types.StringValue(va.String())
+ }
+ }
+ }
+ data.TrustsecEnableSgtPropogation = types.BoolNull()
+
+ if t := res.Get(path + "trustsec.enableSGTPropogation.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.enableSGTPropogation.value")
+ if t.String() == "global" {
+ data.TrustsecEnableSgtPropogation = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrustsecPropogate = types.BoolNull()
+
+ if t := res.Get(path + "trustsec.propogate.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.propogate.value")
+ if t.String() == "global" {
+ data.TrustsecPropogate = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrustsecSecurityGroupTag = types.Int64Null()
+ data.TrustsecSecurityGroupTagVariable = types.StringNull()
+ if t := res.Get(path + "trustsec.securityGroupTag.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.securityGroupTag.value")
+ if t.String() == "variable" {
+ data.TrustsecSecurityGroupTagVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrustsecSecurityGroupTag = types.Int64Value(va.Int())
+ }
+ }
+ data.TrustsecEnableEnforcedPropogation = types.BoolNull()
+
+ if t := res.Get(path + "trustsec.enableEnforcedPropogation.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.enableEnforcedPropogation.value")
+ if t.String() == "global" {
+ data.TrustsecEnableEnforcedPropogation = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrustsecEnforcedSecurityGroupTag = types.Int64Null()
+ data.TrustsecEnforcedSecurityGroupTagVariable = types.StringNull()
+ if t := res.Get(path + "trustsec.enforcedSecurityGroupTag.optionType"); t.Exists() {
+ va := res.Get(path + "trustsec.enforcedSecurityGroupTag.value")
+ if t.String() == "variable" {
+ data.TrustsecEnforcedSecurityGroupTagVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrustsecEnforcedSecurityGroupTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Duplex = types.StringNull()
+ data.DuplexVariable = types.StringNull()
+ if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.duplex.value")
+ if t.String() == "variable" {
+ data.DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Duplex = types.StringValue(va.String())
+ }
+ }
+ data.MacAddress = types.StringNull()
+ data.MacAddressVariable = types.StringNull()
+ if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.macAddress.value")
+ if t.String() == "variable" {
+ data.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Speed = types.StringNull()
+ data.SpeedVariable = types.StringNull()
+ if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.speed.value")
+ if t.String() == "variable" {
+ data.SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Speed = types.StringValue(va.String())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Autonegotiate = types.BoolNull()
+ data.AutonegotiateVariable = types.StringNull()
+ if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.autonegotiate.value")
+ if t.String() == "variable" {
+ data.AutonegotiateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Autonegotiate = types.BoolValue(va.Bool())
+ }
+ }
+ data.MediaType = types.StringNull()
+ data.MediaTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mediaType.value")
+ if t.String() == "variable" {
+ data.MediaTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MediaType = types.StringValue(va.String())
+ }
+ }
+ data.LoadInterval = types.Int64Null()
+ data.LoadIntervalVariable = types.StringNull()
+ if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.loadInterval.value")
+ if t.String() == "variable" {
+ data.LoadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LoadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Tracker = types.StringNull()
+ data.TrackerVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tracker.value")
+ if t.String() == "variable" {
+ data.TrackerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Tracker = types.StringValue(va.String())
+ }
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+ data.Xconnect = types.StringNull()
+ data.XconnectVariable = types.StringNull()
+ if t := res.Get(path + "advanced.xconnect.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.xconnect.value")
+ if t.String() == "variable" {
+ data.XconnectVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Xconnect = types.StringValue(va.String())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceLANVPNInterfaceEthernet) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.ServiceLanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpDistance.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4SecondaryAddresses) > 0 {
+ return false
+ }
+ if !data.Ipv4DhcpHelper.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ return false
+ }
+ if !data.EnableDhcpv6.IsNull() {
+ return false
+ }
+ if len(data.Ipv6DhcpSecondaryAddresses) > 0 {
+ return false
+ }
+ if !data.Ipv6Address.IsNull() {
+ return false
+ }
+ if !data.Ipv6AddressVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv6SecondaryAddresses) > 0 {
+ return false
+ }
+ if len(data.Ipv6DhcpHelpers) > 0 {
+ return false
+ }
+ if !data.Ipv4Nat.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatType.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatTypeVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatRangeStart.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatRangeStartVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatRangeEnd.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatRangeEndVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatPrefixLength.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatPrefixLengthVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatOverload.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatOverloadVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatLoopback.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatLoopbackVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatUdpTimeout.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatUdpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatTcpTimeout.IsNull() {
+ return false
+ }
+ if !data.Ipv4NatTcpTimeoutVariable.IsNull() {
+ return false
+ }
+ if len(data.StaticNats) > 0 {
+ return false
+ }
+ if !data.Ipv6Nat.IsNull() {
+ return false
+ }
+ if !data.Nat64.IsNull() {
+ return false
+ }
+ if !data.AclShapingRate.IsNull() {
+ return false
+ }
+ if !data.AclShapingRateVariable.IsNull() {
+ return false
+ }
+ if !data.AclIpv4EgressPolicyId.IsNull() {
+ return false
+ }
+ if !data.AclIpv4IngressPolicyId.IsNull() {
+ return false
+ }
+ if !data.AclIpv6EgressPolicyId.IsNull() {
+ return false
+ }
+ if !data.AclIpv6IngressPolicyId.IsNull() {
+ return false
+ }
+ if len(data.Ipv6Vrrps) > 0 {
+ return false
+ }
+ if len(data.Ipv4Vrrps) > 0 {
+ return false
+ }
+ if len(data.Arps) > 0 {
+ return false
+ }
+ if !data.TrustsecEnableSgtPropogation.IsNull() {
+ return false
+ }
+ if !data.TrustsecPropogate.IsNull() {
+ return false
+ }
+ if !data.TrustsecSecurityGroupTag.IsNull() {
+ return false
+ }
+ if !data.TrustsecSecurityGroupTagVariable.IsNull() {
+ return false
+ }
+ if !data.TrustsecEnableEnforcedPropogation.IsNull() {
+ return false
+ }
+ if !data.TrustsecEnforcedSecurityGroupTag.IsNull() {
+ return false
+ }
+ if !data.TrustsecEnforcedSecurityGroupTagVariable.IsNull() {
+ return false
+ }
+ if !data.Duplex.IsNull() {
+ return false
+ }
+ if !data.DuplexVariable.IsNull() {
+ return false
+ }
+ if !data.MacAddress.IsNull() {
+ return false
+ }
+ if !data.MacAddressVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtu.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtuVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.Speed.IsNull() {
+ return false
+ }
+ if !data.SpeedVariable.IsNull() {
+ return false
+ }
+ if !data.ArpTimeout.IsNull() {
+ return false
+ }
+ if !data.ArpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.Autonegotiate.IsNull() {
+ return false
+ }
+ if !data.AutonegotiateVariable.IsNull() {
+ return false
+ }
+ if !data.MediaType.IsNull() {
+ return false
+ }
+ if !data.MediaTypeVariable.IsNull() {
+ return false
+ }
+ if !data.LoadInterval.IsNull() {
+ return false
+ }
+ if !data.LoadIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.Tracker.IsNull() {
+ return false
+ }
+ if !data.TrackerVariable.IsNull() {
+ return false
+ }
+ if !data.IcmpRedirectDisable.IsNull() {
+ return false
+ }
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ return false
+ }
+ if !data.Xconnect.IsNull() {
+ return false
+ }
+ if !data.XconnectVariable.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcast.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index f6bf2317c..000000000
--- a/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,3284 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type ServiceLANVPNInterfaceEthernet 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"`
- ServiceLanVpnProfileParcelId types.String `tfsdk:"service_lan_vpn_profile_parcel_id"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"`
- Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- Ipv4SecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
- Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
- Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
- EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
- Ipv6DhcpSecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses `tfsdk:"ipv6_dhcp_secondary_addresses"`
- Ipv6Address types.String `tfsdk:"ipv6_address"`
- Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
- Ipv6SecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses `tfsdk:"ipv6_secondary_addresses"`
- Ipv6DhcpHelpers []ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers `tfsdk:"ipv6_dhcp_helpers"`
- Ipv4Nat types.Bool `tfsdk:"ipv4_nat"`
- Ipv4NatType types.String `tfsdk:"ipv4_nat_type"`
- Ipv4NatTypeVariable types.String `tfsdk:"ipv4_nat_type_variable"`
- Ipv4NatRangeStart types.String `tfsdk:"ipv4_nat_range_start"`
- Ipv4NatRangeStartVariable types.String `tfsdk:"ipv4_nat_range_start_variable"`
- Ipv4NatRangeEnd types.String `tfsdk:"ipv4_nat_range_end"`
- Ipv4NatRangeEndVariable types.String `tfsdk:"ipv4_nat_range_end_variable"`
- Ipv4NatPrefixLength types.Int64 `tfsdk:"ipv4_nat_prefix_length"`
- Ipv4NatPrefixLengthVariable types.String `tfsdk:"ipv4_nat_prefix_length_variable"`
- Ipv4NatOverload types.Bool `tfsdk:"ipv4_nat_overload"`
- Ipv4NatOverloadVariable types.String `tfsdk:"ipv4_nat_overload_variable"`
- Ipv4NatLoopback types.String `tfsdk:"ipv4_nat_loopback"`
- Ipv4NatLoopbackVariable types.String `tfsdk:"ipv4_nat_loopback_variable"`
- Ipv4NatUdpTimeout types.Int64 `tfsdk:"ipv4_nat_udp_timeout"`
- Ipv4NatUdpTimeoutVariable types.String `tfsdk:"ipv4_nat_udp_timeout_variable"`
- Ipv4NatTcpTimeout types.Int64 `tfsdk:"ipv4_nat_tcp_timeout"`
- Ipv4NatTcpTimeoutVariable types.String `tfsdk:"ipv4_nat_tcp_timeout_variable"`
- StaticNats []ServiceLANVPNInterfaceEthernetStaticNats `tfsdk:"static_nats"`
- Ipv6Nat types.Bool `tfsdk:"ipv6_nat"`
- Nat64 types.Bool `tfsdk:"nat64"`
- AclShapingRate types.Int64 `tfsdk:"acl_shaping_rate"`
- AclShapingRateVariable types.String `tfsdk:"acl_shaping_rate_variable"`
- AclIpv4EgressPolicyId types.String `tfsdk:"acl_ipv4_egress_policy_id"`
- AclIpv4IngressPolicyId types.String `tfsdk:"acl_ipv4_ingress_policy_id"`
- AclIpv6EgressPolicyId types.String `tfsdk:"acl_ipv6_egress_policy_id"`
- AclIpv6IngressPolicyId types.String `tfsdk:"acl_ipv6_ingress_policy_id"`
- Ipv6Vrrps []ServiceLANVPNInterfaceEthernetIpv6Vrrps `tfsdk:"ipv6_vrrps"`
- Ipv4Vrrps []ServiceLANVPNInterfaceEthernetIpv4Vrrps `tfsdk:"ipv4_vrrps"`
- Arps []ServiceLANVPNInterfaceEthernetArps `tfsdk:"arps"`
- TrustsecEnableSgtPropogation types.Bool `tfsdk:"trustsec_enable_sgt_propogation"`
- TrustsecPropogate types.Bool `tfsdk:"trustsec_propogate"`
- TrustsecSecurityGroupTag types.Int64 `tfsdk:"trustsec_security_group_tag"`
- TrustsecSecurityGroupTagVariable types.String `tfsdk:"trustsec_security_group_tag_variable"`
- TrustsecEnableEnforcedPropogation types.Bool `tfsdk:"trustsec_enable_enforced_propogation"`
- TrustsecEnforcedSecurityGroupTag types.Int64 `tfsdk:"trustsec_enforced_security_group_tag"`
- TrustsecEnforcedSecurityGroupTagVariable types.String `tfsdk:"trustsec_enforced_security_group_tag_variable"`
- Duplex types.String `tfsdk:"duplex"`
- DuplexVariable types.String `tfsdk:"duplex_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
- InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- Speed types.String `tfsdk:"speed"`
- SpeedVariable types.String `tfsdk:"speed_variable"`
- ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
- ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
- Autonegotiate types.Bool `tfsdk:"autonegotiate"`
- AutonegotiateVariable types.String `tfsdk:"autonegotiate_variable"`
- MediaType types.String `tfsdk:"media_type"`
- MediaTypeVariable types.String `tfsdk:"media_type_variable"`
- LoadInterval types.Int64 `tfsdk:"load_interval"`
- LoadIntervalVariable types.String `tfsdk:"load_interval_variable"`
- Tracker types.String `tfsdk:"tracker"`
- TrackerVariable types.String `tfsdk:"tracker_variable"`
- IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
- IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
- Xconnect types.String `tfsdk:"xconnect"`
- XconnectVariable types.String `tfsdk:"xconnect_variable"`
- IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
- IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- Dhcpv6HelperVpn types.Int64 `tfsdk:"dhcpv6_helper_vpn"`
- Dhcpv6HelperVpnVariable types.String `tfsdk:"dhcpv6_helper_vpn_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetStaticNats struct {
- SourceIp types.String `tfsdk:"source_ip"`
- SourceIpVariable types.String `tfsdk:"source_ip_variable"`
- TranslateIp types.String `tfsdk:"translate_ip"`
- TranslateIpVariable types.String `tfsdk:"translate_ip_variable"`
- Direction types.String `tfsdk:"direction"`
- SourceVpn types.Int64 `tfsdk:"source_vpn"`
- SourceVpnVariable types.String `tfsdk:"source_vpn_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv6Vrrps struct {
- GroupId types.Int64 `tfsdk:"group_id"`
- GroupIdVariable types.String `tfsdk:"group_id_variable"`
- Priority types.Int64 `tfsdk:"priority"`
- PriorityVariable types.String `tfsdk:"priority_variable"`
- Timer types.Int64 `tfsdk:"timer"`
- TimerVariable types.String `tfsdk:"timer_variable"`
- TrackOmp types.Bool `tfsdk:"track_omp"`
- Ipv6Addresses []ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses `tfsdk:"ipv6_addresses"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv4Vrrps struct {
- GroupId types.Int64 `tfsdk:"group_id"`
- GroupIdVariable types.String `tfsdk:"group_id_variable"`
- Priority types.Int64 `tfsdk:"priority"`
- PriorityVariable types.String `tfsdk:"priority_variable"`
- Timer types.Int64 `tfsdk:"timer"`
- TimerVariable types.String `tfsdk:"timer_variable"`
- TrackOmp types.Bool `tfsdk:"track_omp"`
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- SecondaryAddresses []ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses `tfsdk:"secondary_addresses"`
- TlocPrefixChange types.Bool `tfsdk:"tloc_prefix_change"`
- TlocPrefChangeValue types.Int64 `tfsdk:"tloc_pref_change_value"`
-}
-
-type ServiceLANVPNInterfaceEthernetArps struct {
- IpAddress types.String `tfsdk:"ip_address"`
- IpAddressVariable types.String `tfsdk:"ip_address_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses struct {
- LinkLocalAddress types.String `tfsdk:"link_local_address"`
- LinkLocalAddressVariable types.String `tfsdk:"link_local_address_variable"`
- GlobalAddress types.String `tfsdk:"global_address"`
- GlobalAddressVariable types.String `tfsdk:"global_address_variable"`
-}
-
-type ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data ServiceLANVPNInterfaceEthernet) getModel() string {
- return "service_lan_vpn_interface_ethernet"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data ServiceLANVPNInterfaceEthernet) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/ethernet", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4DhcpDistanceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString())
- }
- } else if !data.Ipv4DhcpDistance.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
- if true {
-
- for _, item := range data.Ipv4SecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody)
- }
- }
-
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
- body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
- }
- } else if data.Ipv4DhcpHelper.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
- var values []string
- data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
- }
- }
- if !data.EnableDhcpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool())
- }
- }
- if true {
-
- for _, item := range data.Ipv6DhcpSecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody)
- }
- }
-
- if !data.Ipv6AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString())
- }
- } else if !data.Ipv6Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString())
- }
- }
- if true {
-
- for _, item := range data.Ipv6SecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody)
- }
- }
- if true {
-
- for _, item := range data.Ipv6DhcpHelpers {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
- }
- }
-
- if !item.Dhcpv6HelperVpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpnVariable.ValueString())
- }
- } else if !item.Dhcpv6HelperVpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpn.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.dhcpHelperV6.-1", itemBody)
- }
- }
- if data.Ipv4Nat.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "default")
- body, _ = sjson.Set(body, path+"nat.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "global")
- body, _ = sjson.Set(body, path+"nat.value", data.Ipv4Nat.ValueBool())
- }
- }
-
- if !data.Ipv4NatTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatTypeVariable.ValueString())
- }
- } else if !data.Ipv4NatType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatType.ValueString())
- }
- }
-
- if !data.Ipv4NatRangeStartVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStartVariable.ValueString())
- }
- } else if data.Ipv4NatRangeStart.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStart.ValueString())
- }
- }
-
- if !data.Ipv4NatRangeEndVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEndVariable.ValueString())
- }
- } else if data.Ipv4NatRangeEnd.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEnd.ValueString())
- }
- }
-
- if !data.Ipv4NatPrefixLengthVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLengthVariable.ValueString())
- }
- } else if data.Ipv4NatPrefixLength.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLength.ValueInt64())
- }
- }
-
- if !data.Ipv4NatOverloadVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverloadVariable.ValueString())
- }
- } else if data.Ipv4NatOverload.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverload.ValueBool())
- }
- }
-
- if !data.Ipv4NatLoopbackVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopbackVariable.ValueString())
- }
- } else if data.Ipv4NatLoopback.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopback.ValueString())
- }
- }
-
- if !data.Ipv4NatUdpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeoutVariable.ValueString())
- }
- } else if data.Ipv4NatUdpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeout.ValueInt64())
- }
- }
-
- if !data.Ipv4NatTcpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeoutVariable.ValueString())
- }
- } else if data.Ipv4NatTcpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeout.ValueInt64())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{})
- for _, item := range data.StaticNats {
- itemBody := ""
-
- if !item.SourceIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
- }
- } else if !item.SourceIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
- }
- }
-
- if !item.TranslateIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIpVariable.ValueString())
- }
- } else if !item.TranslateIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIp.ValueString())
- }
- }
- if item.Direction.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString())
- }
- }
-
- if !item.SourceVpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString())
- }
- } else if item.SourceVpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody)
- }
- }
- if data.Ipv6Nat.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natIpv6.optionType", "default")
- body, _ = sjson.Set(body, path+"natIpv6.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"natIpv6.value", data.Ipv6Nat.ValueBool())
- }
- }
- if !data.Nat64.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool())
- }
- }
-
- if !data.AclShapingRateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRateVariable.ValueString())
- }
- } else if data.AclShapingRate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRate.ValueInt64())
- }
- }
- if !data.AclIpv4EgressPolicyId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.value", data.AclIpv4EgressPolicyId.ValueString())
- }
- }
- if !data.AclIpv4IngressPolicyId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.value", data.AclIpv4IngressPolicyId.ValueString())
- }
- }
- if !data.AclIpv6EgressPolicyId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.value", data.AclIpv6EgressPolicyId.ValueString())
- }
- }
- if !data.AclIpv6IngressPolicyId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.value", data.AclIpv6IngressPolicyId.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{})
- for _, item := range data.Ipv6Vrrps {
- itemBody := ""
-
- if !item.GroupIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString())
- }
- } else if !item.GroupId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64())
- }
- }
-
- if !item.PriorityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
- }
- } else if item.Priority.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
- }
- }
-
- if !item.TimerVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
- }
- } else if item.Timer.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
- }
- }
- if item.TrackOmp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{})
- for _, childItem := range item.Ipv6Addresses {
- itemChildBody := ""
-
- if !childItem.LinkLocalAddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString())
- }
- } else if !childItem.LinkLocalAddress.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString())
- }
- }
-
- if !childItem.GlobalAddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString())
- }
- } else if childItem.GlobalAddress.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default")
-
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"vrrp", []interface{}{})
- for _, item := range data.Ipv4Vrrps {
- itemBody := ""
-
- if !item.GroupIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString())
- }
- } else if !item.GroupId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64())
- }
- }
-
- if !item.PriorityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
- }
- } else if item.Priority.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
- }
- }
-
- if !item.TimerVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
- }
- } else if item.Timer.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
- }
- }
- if item.TrackOmp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
- }
- }
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{})
- for _, childItem := range item.SecondaryAddresses {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.SubnetMaskVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMaskVariable.ValueString())
- }
- } else if !childItem.SubnetMask.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMask.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody)
- }
- }
- if item.TlocPrefixChange.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool())
- }
- }
- if item.TlocPrefChangeValue.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefChangeValue.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"arp", []interface{}{})
- for _, item := range data.Arps {
- itemBody := ""
-
- if !item.IpAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
- }
- } else if item.IpAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
- }
- }
-
- if !item.MacAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
- }
- } else if !item.MacAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
- }
- }
- if data.TrustsecEnableSgtPropogation.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "default")
- body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "global")
- body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", data.TrustsecEnableSgtPropogation.ValueBool())
- }
- }
- if data.TrustsecPropogate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "default")
- body, _ = sjson.Set(body, path+"trustsec.propogate.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "global")
- body, _ = sjson.Set(body, path+"trustsec.propogate.value", data.TrustsecPropogate.ValueBool())
- }
- }
-
- if !data.TrustsecSecurityGroupTagVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "variable")
- body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTagVariable.ValueString())
- }
- } else if data.TrustsecSecurityGroupTag.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "global")
- body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTag.ValueInt64())
- }
- }
- if data.TrustsecEnableEnforcedPropogation.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "global")
- body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.value", data.TrustsecEnableEnforcedPropogation.ValueBool())
- }
- }
-
- if !data.TrustsecEnforcedSecurityGroupTagVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "variable")
- body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTagVariable.ValueString())
- }
- } else if data.TrustsecEnforcedSecurityGroupTag.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "global")
- body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTag.ValueInt64())
- }
- }
-
- if !data.DuplexVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString())
- }
- } else if data.Duplex.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString())
- }
- }
-
- if !data.MacAddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString())
- }
- } else if data.MacAddress.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.InterfaceMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
- }
- } else if data.InterfaceMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.SpeedVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString())
- }
- } else if data.Speed.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString())
- }
- }
-
- if !data.ArpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
- }
- } else if data.ArpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
- }
- }
-
- if !data.AutonegotiateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString())
- }
- } else if data.Autonegotiate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool())
- }
- }
-
- if !data.MediaTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString())
- }
- } else if data.MediaType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString())
- }
- }
-
- if !data.LoadIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString())
- }
- } else if data.LoadInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64())
- }
- }
-
- if !data.TrackerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString())
- }
- } else if data.Tracker.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString())
- }
- }
-
- if !data.IcmpRedirectDisableVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
- }
- } else if data.IcmpRedirectDisable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
- }
- }
-
- if !data.XconnectVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.XconnectVariable.ValueString())
- }
- } else if data.Xconnect.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.Xconnect.ValueString())
- }
- }
-
- if !data.IpDirectedBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
- }
- } else if data.IpDirectedBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *ServiceLANVPNInterfaceEthernet) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpDistance = types.Int64Null()
- data.Ipv4DhcpDistanceVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
- if t.String() == "variable" {
- data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary"); value.Exists() {
- data.Ipv4SecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetIpv4SecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("subnetMask.optionType"); t.Exists() {
- va := v.Get("subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
- return true
- })
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.EnableDhcpv6 = types.BoolNull()
-
- if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
- if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address"); value.Exists() {
- data.Ipv6DhcpSecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetIpv6DhcpSecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- data.Ipv6DhcpSecondaryAddresses = append(data.Ipv6DhcpSecondaryAddresses, item)
- return true
- })
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "intfIpV6Address.static.secondaryIpV6Address"); value.Exists() {
- data.Ipv6SecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetIpv6SecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- data.Ipv6SecondaryAddresses = append(data.Ipv6SecondaryAddresses, item)
- return true
- })
- }
- if value := res.Get(path + "intfIpV6Address.static.dhcpHelperV6"); value.Exists() {
- data.Ipv6DhcpHelpers = make([]ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetIpv6DhcpHelpers{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.Dhcpv6HelperVpn = types.Int64Null()
- item.Dhcpv6HelperVpnVariable = types.StringNull()
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "variable" {
- item.Dhcpv6HelperVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Dhcpv6HelperVpn = types.Int64Value(va.Int())
- }
- }
- data.Ipv6DhcpHelpers = append(data.Ipv6DhcpHelpers, item)
- return true
- })
- }
- data.Ipv4Nat = types.BoolNull()
-
- if t := res.Get(path + "nat.optionType"); t.Exists() {
- va := res.Get(path + "nat.value")
- if t.String() == "global" {
- data.Ipv4Nat = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4NatType = types.StringNull()
- data.Ipv4NatTypeVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natType.value")
- if t.String() == "variable" {
- data.Ipv4NatTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatType = types.StringValue(va.String())
- }
- }
- data.Ipv4NatRangeStart = types.StringNull()
- data.Ipv4NatRangeStartVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
- if t.String() == "variable" {
- data.Ipv4NatRangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatRangeStart = types.StringValue(va.String())
- }
- }
- data.Ipv4NatRangeEnd = types.StringNull()
- data.Ipv4NatRangeEndVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
- if t.String() == "variable" {
- data.Ipv4NatRangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatRangeEnd = types.StringValue(va.String())
- }
- }
- data.Ipv4NatPrefixLength = types.Int64Null()
- data.Ipv4NatPrefixLengthVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
- if t.String() == "variable" {
- data.Ipv4NatPrefixLengthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatPrefixLength = types.Int64Value(va.Int())
- }
- }
- data.Ipv4NatOverload = types.BoolNull()
- data.Ipv4NatOverloadVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
- if t.String() == "variable" {
- data.Ipv4NatOverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatOverload = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4NatLoopback = types.StringNull()
- data.Ipv4NatLoopbackVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natLookback.value")
- if t.String() == "variable" {
- data.Ipv4NatLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatLoopback = types.StringValue(va.String())
- }
- }
- data.Ipv4NatUdpTimeout = types.Int64Null()
- data.Ipv4NatUdpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
- if t.String() == "variable" {
- data.Ipv4NatUdpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatUdpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Ipv4NatTcpTimeout = types.Int64Null()
- data.Ipv4NatTcpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
- if t.String() == "variable" {
- data.Ipv4NatTcpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatTcpTimeout = types.Int64Value(va.Int())
- }
- }
- if value := res.Get(path + "natAttributesIpv4.newStaticNat"); value.Exists() {
- data.StaticNats = make([]ServiceLANVPNInterfaceEthernetStaticNats, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetStaticNats{}
- item.SourceIp = types.StringNull()
- item.SourceIpVariable = types.StringNull()
- if t := v.Get("sourceIp.optionType"); t.Exists() {
- va := v.Get("sourceIp.value")
- if t.String() == "variable" {
- item.SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceIp = types.StringValue(va.String())
- }
- }
- item.TranslateIp = types.StringNull()
- item.TranslateIpVariable = types.StringNull()
- if t := v.Get("translateIp.optionType"); t.Exists() {
- va := v.Get("translateIp.value")
- if t.String() == "variable" {
- item.TranslateIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TranslateIp = types.StringValue(va.String())
- }
- }
- item.Direction = types.StringNull()
-
- if t := v.Get("staticNatDirection.optionType"); t.Exists() {
- va := v.Get("staticNatDirection.value")
- if t.String() == "global" {
- item.Direction = types.StringValue(va.String())
- }
- }
- item.SourceVpn = types.Int64Null()
- item.SourceVpnVariable = types.StringNull()
- if t := v.Get("sourceVpn.optionType"); t.Exists() {
- va := v.Get("sourceVpn.value")
- if t.String() == "variable" {
- item.SourceVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceVpn = types.Int64Value(va.Int())
- }
- }
- data.StaticNats = append(data.StaticNats, item)
- return true
- })
- }
- data.Ipv6Nat = types.BoolNull()
-
- if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
- va := res.Get(path + "natIpv6.value")
- if t.String() == "global" {
- data.Ipv6Nat = types.BoolValue(va.Bool())
- }
- }
- data.Nat64 = types.BoolNull()
-
- if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv6.nat64.value")
- if t.String() == "global" {
- data.Nat64 = types.BoolValue(va.Bool())
- }
- }
- data.AclShapingRate = types.Int64Null()
- data.AclShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.AclShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AclShapingRate = types.Int64Value(va.Int())
- }
- }
- data.AclIpv4EgressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv4AclEgress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv4AclEgress.refId.value")
- if t.String() == "global" {
- data.AclIpv4EgressPolicyId = types.StringValue(va.String())
- }
- }
- data.AclIpv4IngressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv4AclIngress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv4AclIngress.refId.value")
- if t.String() == "global" {
- data.AclIpv4IngressPolicyId = types.StringValue(va.String())
- }
- }
- data.AclIpv6EgressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv6AclEgress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv6AclEgress.refId.value")
- if t.String() == "global" {
- data.AclIpv6EgressPolicyId = types.StringValue(va.String())
- }
- }
- data.AclIpv6IngressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv6AclIngress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv6AclIngress.refId.value")
- if t.String() == "global" {
- data.AclIpv6IngressPolicyId = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "vrrpIpv6"); value.Exists() {
- data.Ipv6Vrrps = make([]ServiceLANVPNInterfaceEthernetIpv6Vrrps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetIpv6Vrrps{}
- item.GroupId = types.Int64Null()
- item.GroupIdVariable = types.StringNull()
- if t := v.Get("groupId.optionType"); t.Exists() {
- va := v.Get("groupId.value")
- if t.String() == "variable" {
- item.GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.GroupId = types.Int64Value(va.Int())
- }
- }
- item.Priority = types.Int64Null()
- item.PriorityVariable = types.StringNull()
- if t := v.Get("priority.optionType"); t.Exists() {
- va := v.Get("priority.value")
- if t.String() == "variable" {
- item.PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Priority = types.Int64Value(va.Int())
- }
- }
- item.Timer = types.Int64Null()
- item.TimerVariable = types.StringNull()
- if t := v.Get("timer.optionType"); t.Exists() {
- va := v.Get("timer.value")
- if t.String() == "variable" {
- item.TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Timer = types.Int64Value(va.Int())
- }
- }
- item.TrackOmp = types.BoolNull()
-
- if t := v.Get("trackOmp.optionType"); t.Exists() {
- va := v.Get("trackOmp.value")
- if t.String() == "global" {
- item.TrackOmp = types.BoolValue(va.Bool())
- }
- }
- if cValue := v.Get("ipv6"); cValue.Exists() {
- item.Ipv6Addresses = make([]ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNInterfaceEthernetIpv6VrrpsIpv6Addresses{}
- cItem.LinkLocalAddress = types.StringNull()
- cItem.LinkLocalAddressVariable = types.StringNull()
- if t := cv.Get("ipv6LinkLocal.optionType"); t.Exists() {
- va := cv.Get("ipv6LinkLocal.value")
- if t.String() == "variable" {
- cItem.LinkLocalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.LinkLocalAddress = types.StringValue(va.String())
- }
- }
- cItem.GlobalAddress = types.StringNull()
- cItem.GlobalAddressVariable = types.StringNull()
- if t := cv.Get("prefix.optionType"); t.Exists() {
- va := cv.Get("prefix.value")
- if t.String() == "variable" {
- cItem.GlobalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.GlobalAddress = types.StringValue(va.String())
- }
- }
- item.Ipv6Addresses = append(item.Ipv6Addresses, cItem)
- return true
- })
- }
- data.Ipv6Vrrps = append(data.Ipv6Vrrps, item)
- return true
- })
- }
- if value := res.Get(path + "vrrp"); value.Exists() {
- data.Ipv4Vrrps = make([]ServiceLANVPNInterfaceEthernetIpv4Vrrps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetIpv4Vrrps{}
- item.GroupId = types.Int64Null()
- item.GroupIdVariable = types.StringNull()
- if t := v.Get("group_id.optionType"); t.Exists() {
- va := v.Get("group_id.value")
- if t.String() == "variable" {
- item.GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.GroupId = types.Int64Value(va.Int())
- }
- }
- item.Priority = types.Int64Null()
- item.PriorityVariable = types.StringNull()
- if t := v.Get("priority.optionType"); t.Exists() {
- va := v.Get("priority.value")
- if t.String() == "variable" {
- item.PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Priority = types.Int64Value(va.Int())
- }
- }
- item.Timer = types.Int64Null()
- item.TimerVariable = types.StringNull()
- if t := v.Get("timer.optionType"); t.Exists() {
- va := v.Get("timer.value")
- if t.String() == "variable" {
- item.TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Timer = types.Int64Value(va.Int())
- }
- }
- item.TrackOmp = types.BoolNull()
-
- if t := v.Get("trackOmp.optionType"); t.Exists() {
- va := v.Get("trackOmp.value")
- if t.String() == "global" {
- item.TrackOmp = types.BoolValue(va.Bool())
- }
- }
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("ipAddressSecondary"); cValue.Exists() {
- item.SecondaryAddresses = make([]ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNInterfaceEthernetIpv4VrrpsSecondaryAddresses{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("ipAddress.optionType"); t.Exists() {
- va := cv.Get("ipAddress.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.SubnetMask = types.StringNull()
- cItem.SubnetMaskVariable = types.StringNull()
- if t := cv.Get("subnetMask.optionType"); t.Exists() {
- va := cv.Get("subnetMask.value")
- if t.String() == "variable" {
- cItem.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.SubnetMask = types.StringValue(va.String())
- }
- }
- item.SecondaryAddresses = append(item.SecondaryAddresses, cItem)
- return true
- })
- }
- item.TlocPrefixChange = types.BoolNull()
-
- if t := v.Get("tlocPrefChange.optionType"); t.Exists() {
- va := v.Get("tlocPrefChange.value")
- if t.String() == "global" {
- item.TlocPrefixChange = types.BoolValue(va.Bool())
- }
- }
- item.TlocPrefChangeValue = types.Int64Null()
-
- if t := v.Get("tlocPrefChangeValue.optionType"); t.Exists() {
- va := v.Get("tlocPrefChangeValue.value")
- if t.String() == "global" {
- item.TlocPrefChangeValue = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps = append(data.Ipv4Vrrps, item)
- return true
- })
- }
- if value := res.Get(path + "arp"); value.Exists() {
- data.Arps = make([]ServiceLANVPNInterfaceEthernetArps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceEthernetArps{}
- item.IpAddress = types.StringNull()
- item.IpAddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.IpAddress = types.StringValue(va.String())
- }
- }
- item.MacAddress = types.StringNull()
- item.MacAddressVariable = types.StringNull()
- if t := v.Get("macAddress.optionType"); t.Exists() {
- va := v.Get("macAddress.value")
- if t.String() == "variable" {
- item.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.MacAddress = types.StringValue(va.String())
- }
- }
- data.Arps = append(data.Arps, item)
- return true
- })
- }
- data.TrustsecEnableSgtPropogation = types.BoolNull()
-
- if t := res.Get(path + "trustsec.enableSGTPropogation.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.enableSGTPropogation.value")
- if t.String() == "global" {
- data.TrustsecEnableSgtPropogation = types.BoolValue(va.Bool())
- }
- }
- data.TrustsecPropogate = types.BoolNull()
-
- if t := res.Get(path + "trustsec.propogate.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.propogate.value")
- if t.String() == "global" {
- data.TrustsecPropogate = types.BoolValue(va.Bool())
- }
- }
- data.TrustsecSecurityGroupTag = types.Int64Null()
- data.TrustsecSecurityGroupTagVariable = types.StringNull()
- if t := res.Get(path + "trustsec.securityGroupTag.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.securityGroupTag.value")
- if t.String() == "variable" {
- data.TrustsecSecurityGroupTagVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrustsecSecurityGroupTag = types.Int64Value(va.Int())
- }
- }
- data.TrustsecEnableEnforcedPropogation = types.BoolNull()
-
- if t := res.Get(path + "trustsec.enableEnforcedPropogation.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.enableEnforcedPropogation.value")
- if t.String() == "global" {
- data.TrustsecEnableEnforcedPropogation = types.BoolValue(va.Bool())
- }
- }
- data.TrustsecEnforcedSecurityGroupTag = types.Int64Null()
- data.TrustsecEnforcedSecurityGroupTagVariable = types.StringNull()
- if t := res.Get(path + "trustsec.enforcedSecurityGroupTag.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.enforcedSecurityGroupTag.value")
- if t.String() == "variable" {
- data.TrustsecEnforcedSecurityGroupTagVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrustsecEnforcedSecurityGroupTag = types.Int64Value(va.Int())
- }
- }
- data.Duplex = types.StringNull()
- data.DuplexVariable = types.StringNull()
- if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
- va := res.Get(path + "advanced.duplex.value")
- if t.String() == "variable" {
- data.DuplexVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Duplex = types.StringValue(va.String())
- }
- }
- data.MacAddress = types.StringNull()
- data.MacAddressVariable = types.StringNull()
- if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
- va := res.Get(path + "advanced.macAddress.value")
- if t.String() == "variable" {
- data.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MacAddress = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Speed = types.StringNull()
- data.SpeedVariable = types.StringNull()
- if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
- va := res.Get(path + "advanced.speed.value")
- if t.String() == "variable" {
- data.SpeedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Speed = types.StringValue(va.String())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Autonegotiate = types.BoolNull()
- data.AutonegotiateVariable = types.StringNull()
- if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
- va := res.Get(path + "advanced.autonegotiate.value")
- if t.String() == "variable" {
- data.AutonegotiateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Autonegotiate = types.BoolValue(va.Bool())
- }
- }
- data.MediaType = types.StringNull()
- data.MediaTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mediaType.value")
- if t.String() == "variable" {
- data.MediaTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MediaType = types.StringValue(va.String())
- }
- }
- data.LoadInterval = types.Int64Null()
- data.LoadIntervalVariable = types.StringNull()
- if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
- va := res.Get(path + "advanced.loadInterval.value")
- if t.String() == "variable" {
- data.LoadIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LoadInterval = types.Int64Value(va.Int())
- }
- }
- data.Tracker = types.StringNull()
- data.TrackerVariable = types.StringNull()
- if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tracker.value")
- if t.String() == "variable" {
- data.TrackerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Tracker = types.StringValue(va.String())
- }
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
- data.Xconnect = types.StringNull()
- data.XconnectVariable = types.StringNull()
- if t := res.Get(path + "advanced.xconnect.optionType"); t.Exists() {
- va := res.Get(path + "advanced.xconnect.value")
- if t.String() == "variable" {
- data.XconnectVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Xconnect = types.StringValue(va.String())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *ServiceLANVPNInterfaceEthernet) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpDistance = types.Int64Null()
- data.Ipv4DhcpDistanceVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
- if t.String() == "variable" {
- data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv4SecondaryAddresses {
- keys := [...]string{"ipAddress"}
- keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringNull()
- data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("subnetMask.optionType"); t.Exists() {
- va := r.Get("subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.EnableDhcpv6 = types.BoolNull()
-
- if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
- if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- for i := range data.Ipv6DhcpSecondaryAddresses {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6DhcpSecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6DhcpSecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6DhcpSecondaryAddresses[i].Address = types.StringNull()
- data.Ipv6DhcpSecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6DhcpSecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6DhcpSecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv6SecondaryAddresses {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6SecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6SecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpV6Address.static.secondaryIpV6Address").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6SecondaryAddresses[i].Address = types.StringNull()
- data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6SecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv6DhcpHelpers {
- keys := [...]string{"ipAddress", "vpn"}
- keyValues := [...]string{data.Ipv6DhcpHelpers[i].Address.ValueString(), strconv.FormatInt(data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpn.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.Ipv6DhcpHelpers[i].AddressVariable.ValueString(), data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpnVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpV6Address.static.dhcpHelperV6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6DhcpHelpers[i].Address = types.StringNull()
- data.Ipv6DhcpHelpers[i].AddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv6DhcpHelpers[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6DhcpHelpers[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpn = types.Int64Null()
- data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpnVariable = types.StringNull()
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "variable" {
- data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6DhcpHelpers[i].Dhcpv6HelperVpn = types.Int64Value(va.Int())
- }
- }
- }
- data.Ipv4Nat = types.BoolNull()
-
- if t := res.Get(path + "nat.optionType"); t.Exists() {
- va := res.Get(path + "nat.value")
- if t.String() == "global" {
- data.Ipv4Nat = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4NatType = types.StringNull()
- data.Ipv4NatTypeVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natType.value")
- if t.String() == "variable" {
- data.Ipv4NatTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatType = types.StringValue(va.String())
- }
- }
- data.Ipv4NatRangeStart = types.StringNull()
- data.Ipv4NatRangeStartVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
- if t.String() == "variable" {
- data.Ipv4NatRangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatRangeStart = types.StringValue(va.String())
- }
- }
- data.Ipv4NatRangeEnd = types.StringNull()
- data.Ipv4NatRangeEndVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
- if t.String() == "variable" {
- data.Ipv4NatRangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatRangeEnd = types.StringValue(va.String())
- }
- }
- data.Ipv4NatPrefixLength = types.Int64Null()
- data.Ipv4NatPrefixLengthVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
- if t.String() == "variable" {
- data.Ipv4NatPrefixLengthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatPrefixLength = types.Int64Value(va.Int())
- }
- }
- data.Ipv4NatOverload = types.BoolNull()
- data.Ipv4NatOverloadVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
- if t.String() == "variable" {
- data.Ipv4NatOverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatOverload = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4NatLoopback = types.StringNull()
- data.Ipv4NatLoopbackVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natLookback.value")
- if t.String() == "variable" {
- data.Ipv4NatLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatLoopback = types.StringValue(va.String())
- }
- }
- data.Ipv4NatUdpTimeout = types.Int64Null()
- data.Ipv4NatUdpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
- if t.String() == "variable" {
- data.Ipv4NatUdpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatUdpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Ipv4NatTcpTimeout = types.Int64Null()
- data.Ipv4NatTcpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
- if t.String() == "variable" {
- data.Ipv4NatTcpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4NatTcpTimeout = types.Int64Value(va.Int())
- }
- }
- for i := range data.StaticNats {
- keys := [...]string{"sourceIp", "translateIp", "staticNatDirection", "sourceVpn"}
- keyValues := [...]string{data.StaticNats[i].SourceIp.ValueString(), data.StaticNats[i].TranslateIp.ValueString(), data.StaticNats[i].Direction.ValueString(), strconv.FormatInt(data.StaticNats[i].SourceVpn.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.StaticNats[i].SourceIpVariable.ValueString(), data.StaticNats[i].TranslateIpVariable.ValueString(), "", data.StaticNats[i].SourceVpnVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "natAttributesIpv4.newStaticNat").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.StaticNats[i].SourceIp = types.StringNull()
- data.StaticNats[i].SourceIpVariable = types.StringNull()
- if t := r.Get("sourceIp.optionType"); t.Exists() {
- va := r.Get("sourceIp.value")
- if t.String() == "variable" {
- data.StaticNats[i].SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNats[i].SourceIp = types.StringValue(va.String())
- }
- }
- data.StaticNats[i].TranslateIp = types.StringNull()
- data.StaticNats[i].TranslateIpVariable = types.StringNull()
- if t := r.Get("translateIp.optionType"); t.Exists() {
- va := r.Get("translateIp.value")
- if t.String() == "variable" {
- data.StaticNats[i].TranslateIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNats[i].TranslateIp = types.StringValue(va.String())
- }
- }
- data.StaticNats[i].Direction = types.StringNull()
-
- if t := r.Get("staticNatDirection.optionType"); t.Exists() {
- va := r.Get("staticNatDirection.value")
- if t.String() == "global" {
- data.StaticNats[i].Direction = types.StringValue(va.String())
- }
- }
- data.StaticNats[i].SourceVpn = types.Int64Null()
- data.StaticNats[i].SourceVpnVariable = types.StringNull()
- if t := r.Get("sourceVpn.optionType"); t.Exists() {
- va := r.Get("sourceVpn.value")
- if t.String() == "variable" {
- data.StaticNats[i].SourceVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNats[i].SourceVpn = types.Int64Value(va.Int())
- }
- }
- }
- data.Ipv6Nat = types.BoolNull()
-
- if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
- va := res.Get(path + "natIpv6.value")
- if t.String() == "global" {
- data.Ipv6Nat = types.BoolValue(va.Bool())
- }
- }
- data.Nat64 = types.BoolNull()
-
- if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv6.nat64.value")
- if t.String() == "global" {
- data.Nat64 = types.BoolValue(va.Bool())
- }
- }
- data.AclShapingRate = types.Int64Null()
- data.AclShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.AclShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AclShapingRate = types.Int64Value(va.Int())
- }
- }
- data.AclIpv4EgressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv4AclEgress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv4AclEgress.refId.value")
- if t.String() == "global" {
- data.AclIpv4EgressPolicyId = types.StringValue(va.String())
- }
- }
- data.AclIpv4IngressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv4AclIngress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv4AclIngress.refId.value")
- if t.String() == "global" {
- data.AclIpv4IngressPolicyId = types.StringValue(va.String())
- }
- }
- data.AclIpv6EgressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv6AclEgress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv6AclEgress.refId.value")
- if t.String() == "global" {
- data.AclIpv6EgressPolicyId = types.StringValue(va.String())
- }
- }
- data.AclIpv6IngressPolicyId = types.StringNull()
-
- if t := res.Get(path + "aclQos.ipv6AclIngress.refId.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.ipv6AclIngress.refId.value")
- if t.String() == "global" {
- data.AclIpv6IngressPolicyId = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv6Vrrps {
- keys := [...]string{"groupId"}
- keyValues := [...]string{strconv.FormatInt(data.Ipv6Vrrps[i].GroupId.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.Ipv6Vrrps[i].GroupIdVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "vrrpIpv6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6Vrrps[i].GroupId = types.Int64Null()
- data.Ipv6Vrrps[i].GroupIdVariable = types.StringNull()
- if t := r.Get("groupId.optionType"); t.Exists() {
- va := r.Get("groupId.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].GroupId = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Vrrps[i].Priority = types.Int64Null()
- data.Ipv6Vrrps[i].PriorityVariable = types.StringNull()
- if t := r.Get("priority.optionType"); t.Exists() {
- va := r.Get("priority.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Priority = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Vrrps[i].Timer = types.Int64Null()
- data.Ipv6Vrrps[i].TimerVariable = types.StringNull()
- if t := r.Get("timer.optionType"); t.Exists() {
- va := r.Get("timer.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Timer = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Vrrps[i].TrackOmp = types.BoolNull()
-
- if t := r.Get("trackOmp.optionType"); t.Exists() {
- va := r.Get("trackOmp.value")
- if t.String() == "global" {
- data.Ipv6Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
- }
- }
- for ci := range data.Ipv6Vrrps[i].Ipv6Addresses {
- keys := [...]string{"ipv6LinkLocal"}
- keyValues := [...]string{data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddress.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("ipv6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddress = types.StringNull()
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddressVariable = types.StringNull()
- if t := cr.Get("ipv6LinkLocal.optionType"); t.Exists() {
- va := cr.Get("ipv6LinkLocal.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].LinkLocalAddress = types.StringValue(va.String())
- }
- }
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddress = types.StringNull()
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddressVariable = types.StringNull()
- if t := cr.Get("prefix.optionType"); t.Exists() {
- va := cr.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Ipv6Addresses[ci].GlobalAddress = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.Ipv4Vrrps {
- keys := [...]string{"group_id"}
- keyValues := [...]string{strconv.FormatInt(data.Ipv4Vrrps[i].GroupId.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.Ipv4Vrrps[i].GroupIdVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "vrrp").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4Vrrps[i].GroupId = types.Int64Null()
- data.Ipv4Vrrps[i].GroupIdVariable = types.StringNull()
- if t := r.Get("group_id.optionType"); t.Exists() {
- va := r.Get("group_id.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].GroupId = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps[i].Priority = types.Int64Null()
- data.Ipv4Vrrps[i].PriorityVariable = types.StringNull()
- if t := r.Get("priority.optionType"); t.Exists() {
- va := r.Get("priority.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].Priority = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps[i].Timer = types.Int64Null()
- data.Ipv4Vrrps[i].TimerVariable = types.StringNull()
- if t := r.Get("timer.optionType"); t.Exists() {
- va := r.Get("timer.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].Timer = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps[i].TrackOmp = types.BoolNull()
-
- if t := r.Get("trackOmp.optionType"); t.Exists() {
- va := r.Get("trackOmp.value")
- if t.String() == "global" {
- data.Ipv4Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Vrrps[i].Address = types.StringNull()
- data.Ipv4Vrrps[i].AddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].Address = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv4Vrrps[i].SecondaryAddresses {
- keys := [...]string{"ipAddress"}
- keyValues := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("ipAddressSecondary").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringNull()
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringNull()
- if t := cr.Get("ipAddress.optionType"); t.Exists() {
- va := cr.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMask = types.StringNull()
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMaskVariable = types.StringNull()
- if t := cr.Get("subnetMask.optionType"); t.Exists() {
- va := cr.Get("subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].SubnetMask = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolNull()
-
- if t := r.Get("tlocPrefChange.optionType"); t.Exists() {
- va := r.Get("tlocPrefChange.value")
- if t.String() == "global" {
- data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Vrrps[i].TlocPrefChangeValue = types.Int64Null()
-
- if t := r.Get("tlocPrefChangeValue.optionType"); t.Exists() {
- va := r.Get("tlocPrefChangeValue.value")
- if t.String() == "global" {
- data.Ipv4Vrrps[i].TlocPrefChangeValue = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.Arps {
- keys := [...]string{"ipAddress", "macAddress"}
- keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
- keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "arp").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Arps[i].IpAddress = types.StringNull()
- data.Arps[i].IpAddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Arps[i].IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].IpAddress = types.StringValue(va.String())
- }
- }
- data.Arps[i].MacAddress = types.StringNull()
- data.Arps[i].MacAddressVariable = types.StringNull()
- if t := r.Get("macAddress.optionType"); t.Exists() {
- va := r.Get("macAddress.value")
- if t.String() == "variable" {
- data.Arps[i].MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].MacAddress = types.StringValue(va.String())
- }
- }
- }
- data.TrustsecEnableSgtPropogation = types.BoolNull()
-
- if t := res.Get(path + "trustsec.enableSGTPropogation.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.enableSGTPropogation.value")
- if t.String() == "global" {
- data.TrustsecEnableSgtPropogation = types.BoolValue(va.Bool())
- }
- }
- data.TrustsecPropogate = types.BoolNull()
-
- if t := res.Get(path + "trustsec.propogate.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.propogate.value")
- if t.String() == "global" {
- data.TrustsecPropogate = types.BoolValue(va.Bool())
- }
- }
- data.TrustsecSecurityGroupTag = types.Int64Null()
- data.TrustsecSecurityGroupTagVariable = types.StringNull()
- if t := res.Get(path + "trustsec.securityGroupTag.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.securityGroupTag.value")
- if t.String() == "variable" {
- data.TrustsecSecurityGroupTagVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrustsecSecurityGroupTag = types.Int64Value(va.Int())
- }
- }
- data.TrustsecEnableEnforcedPropogation = types.BoolNull()
-
- if t := res.Get(path + "trustsec.enableEnforcedPropogation.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.enableEnforcedPropogation.value")
- if t.String() == "global" {
- data.TrustsecEnableEnforcedPropogation = types.BoolValue(va.Bool())
- }
- }
- data.TrustsecEnforcedSecurityGroupTag = types.Int64Null()
- data.TrustsecEnforcedSecurityGroupTagVariable = types.StringNull()
- if t := res.Get(path + "trustsec.enforcedSecurityGroupTag.optionType"); t.Exists() {
- va := res.Get(path + "trustsec.enforcedSecurityGroupTag.value")
- if t.String() == "variable" {
- data.TrustsecEnforcedSecurityGroupTagVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrustsecEnforcedSecurityGroupTag = types.Int64Value(va.Int())
- }
- }
- data.Duplex = types.StringNull()
- data.DuplexVariable = types.StringNull()
- if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
- va := res.Get(path + "advanced.duplex.value")
- if t.String() == "variable" {
- data.DuplexVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Duplex = types.StringValue(va.String())
- }
- }
- data.MacAddress = types.StringNull()
- data.MacAddressVariable = types.StringNull()
- if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
- va := res.Get(path + "advanced.macAddress.value")
- if t.String() == "variable" {
- data.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MacAddress = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Speed = types.StringNull()
- data.SpeedVariable = types.StringNull()
- if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
- va := res.Get(path + "advanced.speed.value")
- if t.String() == "variable" {
- data.SpeedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Speed = types.StringValue(va.String())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Autonegotiate = types.BoolNull()
- data.AutonegotiateVariable = types.StringNull()
- if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
- va := res.Get(path + "advanced.autonegotiate.value")
- if t.String() == "variable" {
- data.AutonegotiateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Autonegotiate = types.BoolValue(va.Bool())
- }
- }
- data.MediaType = types.StringNull()
- data.MediaTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mediaType.value")
- if t.String() == "variable" {
- data.MediaTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MediaType = types.StringValue(va.String())
- }
- }
- data.LoadInterval = types.Int64Null()
- data.LoadIntervalVariable = types.StringNull()
- if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
- va := res.Get(path + "advanced.loadInterval.value")
- if t.String() == "variable" {
- data.LoadIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LoadInterval = types.Int64Value(va.Int())
- }
- }
- data.Tracker = types.StringNull()
- data.TrackerVariable = types.StringNull()
- if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tracker.value")
- if t.String() == "variable" {
- data.TrackerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Tracker = types.StringValue(va.String())
- }
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
- data.Xconnect = types.StringNull()
- data.XconnectVariable = types.StringNull()
- if t := res.Get(path + "advanced.xconnect.optionType"); t.Exists() {
- va := res.Get(path + "advanced.xconnect.value")
- if t.String() == "variable" {
- data.XconnectVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Xconnect = types.StringValue(va.String())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *ServiceLANVPNInterfaceEthernet) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.ServiceLanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4DhcpDistance.IsNull() {
- return false
- }
- if !data.Ipv4DhcpDistanceVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if len(data.Ipv4SecondaryAddresses) > 0 {
- return false
- }
- if !data.Ipv4DhcpHelper.IsNull() {
- return false
- }
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- return false
- }
- if !data.EnableDhcpv6.IsNull() {
- return false
- }
- if len(data.Ipv6DhcpSecondaryAddresses) > 0 {
- return false
- }
- if !data.Ipv6Address.IsNull() {
- return false
- }
- if !data.Ipv6AddressVariable.IsNull() {
- return false
- }
- if len(data.Ipv6SecondaryAddresses) > 0 {
- return false
- }
- if len(data.Ipv6DhcpHelpers) > 0 {
- return false
- }
- if !data.Ipv4Nat.IsNull() {
- return false
- }
- if !data.Ipv4NatType.IsNull() {
- return false
- }
- if !data.Ipv4NatTypeVariable.IsNull() {
- return false
- }
- if !data.Ipv4NatRangeStart.IsNull() {
- return false
- }
- if !data.Ipv4NatRangeStartVariable.IsNull() {
- return false
- }
- if !data.Ipv4NatRangeEnd.IsNull() {
- return false
- }
- if !data.Ipv4NatRangeEndVariable.IsNull() {
- return false
- }
- if !data.Ipv4NatPrefixLength.IsNull() {
- return false
- }
- if !data.Ipv4NatPrefixLengthVariable.IsNull() {
- return false
- }
- if !data.Ipv4NatOverload.IsNull() {
- return false
- }
- if !data.Ipv4NatOverloadVariable.IsNull() {
- return false
- }
- if !data.Ipv4NatLoopback.IsNull() {
- return false
- }
- if !data.Ipv4NatLoopbackVariable.IsNull() {
- return false
- }
- if !data.Ipv4NatUdpTimeout.IsNull() {
- return false
- }
- if !data.Ipv4NatUdpTimeoutVariable.IsNull() {
- return false
- }
- if !data.Ipv4NatTcpTimeout.IsNull() {
- return false
- }
- if !data.Ipv4NatTcpTimeoutVariable.IsNull() {
- return false
- }
- if len(data.StaticNats) > 0 {
- return false
- }
- if !data.Ipv6Nat.IsNull() {
- return false
- }
- if !data.Nat64.IsNull() {
- return false
- }
- if !data.AclShapingRate.IsNull() {
- return false
- }
- if !data.AclShapingRateVariable.IsNull() {
- return false
- }
- if !data.AclIpv4EgressPolicyId.IsNull() {
- return false
- }
- if !data.AclIpv4IngressPolicyId.IsNull() {
- return false
- }
- if !data.AclIpv6EgressPolicyId.IsNull() {
- return false
- }
- if !data.AclIpv6IngressPolicyId.IsNull() {
- return false
- }
- if len(data.Ipv6Vrrps) > 0 {
- return false
- }
- if len(data.Ipv4Vrrps) > 0 {
- return false
- }
- if len(data.Arps) > 0 {
- return false
- }
- if !data.TrustsecEnableSgtPropogation.IsNull() {
- return false
- }
- if !data.TrustsecPropogate.IsNull() {
- return false
- }
- if !data.TrustsecSecurityGroupTag.IsNull() {
- return false
- }
- if !data.TrustsecSecurityGroupTagVariable.IsNull() {
- return false
- }
- if !data.TrustsecEnableEnforcedPropogation.IsNull() {
- return false
- }
- if !data.TrustsecEnforcedSecurityGroupTag.IsNull() {
- return false
- }
- if !data.TrustsecEnforcedSecurityGroupTagVariable.IsNull() {
- return false
- }
- if !data.Duplex.IsNull() {
- return false
- }
- if !data.DuplexVariable.IsNull() {
- return false
- }
- if !data.MacAddress.IsNull() {
- return false
- }
- if !data.MacAddressVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.InterfaceMtu.IsNull() {
- return false
- }
- if !data.InterfaceMtuVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.Speed.IsNull() {
- return false
- }
- if !data.SpeedVariable.IsNull() {
- return false
- }
- if !data.ArpTimeout.IsNull() {
- return false
- }
- if !data.ArpTimeoutVariable.IsNull() {
- return false
- }
- if !data.Autonegotiate.IsNull() {
- return false
- }
- if !data.AutonegotiateVariable.IsNull() {
- return false
- }
- if !data.MediaType.IsNull() {
- return false
- }
- if !data.MediaTypeVariable.IsNull() {
- return false
- }
- if !data.LoadInterval.IsNull() {
- return false
- }
- if !data.LoadIntervalVariable.IsNull() {
- return false
- }
- if !data.Tracker.IsNull() {
- return false
- }
- if !data.TrackerVariable.IsNull() {
- return false
- }
- if !data.IcmpRedirectDisable.IsNull() {
- return false
- }
- if !data.IcmpRedirectDisableVariable.IsNull() {
- return false
- }
- if !data.Xconnect.IsNull() {
- return false
- }
- if !data.XconnectVariable.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcast.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcastVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_gre_feature.go b/internal/provider/model_sdwan_service_lan_vpn_interface_gre_feature.go
new file mode 100644
index 000000000..f903a7b05
--- /dev/null
+++ b/internal/provider/model_sdwan_service_lan_vpn_interface_gre_feature.go
@@ -0,0 +1,692 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceLANVPNInterfaceGRE 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"`
+ ServiceLanVpnFeatureId types.String `tfsdk:"service_lan_vpn_feature_id"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
+ TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
+ TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
+ TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
+ TunnelSourceInterfaceLoopback types.String `tfsdk:"tunnel_source_interface_loopback"`
+ TunnelSourceInterfaceLoopbackVariable types.String `tfsdk:"tunnel_source_interface_loopback_variable"`
+ TunnelRouteViaLoopback types.String `tfsdk:"tunnel_route_via_loopback"`
+ TunnelRouteViaLoopbackVariable types.String `tfsdk:"tunnel_route_via_loopback_variable"`
+ TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
+ TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
+ ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
+ ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
+ ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceLANVPNInterfaceGRE) getModel() string {
+ return "service_lan_vpn_interface_gre"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceLANVPNInterfaceGRE) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/gre", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.description.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.shutdown.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelSourceIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
+ }
+ } else if !data.TunnelSourceInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString())
+ }
+ } else if !data.TunnelSourceInterfaceLoopback.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString())
+ }
+ }
+
+ if !data.TunnelRouteViaLoopbackVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString())
+ }
+ } else if !data.TunnelRouteViaLoopback.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString())
+ }
+ }
+
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelDestinationIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.mtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.ClearDontFragmentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
+ }
+ } else if data.ClearDontFragment.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool())
+ }
+ }
+
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString())
+ }
+ } else if !data.ApplicationTunnelType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.application.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceLANVPNInterfaceGRE) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
+ va := res.Get(path + "basic.ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "basic.description.optionType"); t.Exists() {
+ va := res.Get(path + "basic.description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "basic.shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterfaceLoopback = types.StringNull()
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteViaLoopback = types.StringNull()
+ data.TunnelRouteViaLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteViaLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelDestination.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
+ va := res.Get(path + "basic.mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "basic.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceLANVPNInterfaceGRE) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
+ va := res.Get(path + "basic.ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "basic.description.optionType"); t.Exists() {
+ va := res.Get(path + "basic.description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "basic.shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterfaceLoopback = types.StringNull()
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteViaLoopback = types.StringNull()
+ data.TunnelRouteViaLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteViaLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelDestination.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
+ va := res.Get(path + "basic.mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "basic.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceLANVPNInterfaceGRE) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.ServiceLanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterface.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceLoopback.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteViaLoopback.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteViaLoopbackVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragment.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragmentVariable.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelType.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go
deleted file mode 100644
index a6359158d..000000000
--- a/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go
+++ /dev/null
@@ -1,692 +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/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type ServiceLANVPNInterfaceGRE 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"`
- ServiceLanVpnProfileParcelId types.String `tfsdk:"service_lan_vpn_profile_parcel_id"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
- TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
- TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
- TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
- TunnelSourceInterfaceLoopback types.String `tfsdk:"tunnel_source_interface_loopback"`
- TunnelSourceInterfaceLoopbackVariable types.String `tfsdk:"tunnel_source_interface_loopback_variable"`
- TunnelRouteViaLoopback types.String `tfsdk:"tunnel_route_via_loopback"`
- TunnelRouteViaLoopbackVariable types.String `tfsdk:"tunnel_route_via_loopback_variable"`
- TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
- TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
- ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
- ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
- ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data ServiceLANVPNInterfaceGRE) getModel() string {
- return "service_lan_vpn_interface_gre"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data ServiceLANVPNInterfaceGRE) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/gre", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.description.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.description.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"basic.shutdown.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelSourceIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString())
- }
- }
-
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
- }
- } else if !data.TunnelSourceInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
- }
- }
-
- if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString())
- }
- } else if !data.TunnelSourceInterfaceLoopback.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString())
- }
- }
-
- if !data.TunnelRouteViaLoopbackVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString())
- }
- } else if !data.TunnelRouteViaLoopback.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString())
- }
- }
-
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelDestinationIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default")
- body, _ = sjson.Set(body, path+"basic.mtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.ClearDontFragmentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
- }
- } else if data.ClearDontFragment.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default")
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool())
- }
- }
-
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString())
- }
- } else if !data.ApplicationTunnelType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.application.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *ServiceLANVPNInterfaceGRE) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
- va := res.Get(path + "basic.ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "basic.description.optionType"); t.Exists() {
- va := res.Get(path + "basic.description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
- va := res.Get(path + "basic.shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterfaceLoopback = types.StringNull()
- data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelRouteViaLoopback = types.StringNull()
- data.TunnelRouteViaLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteViaLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelDestination.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
- va := res.Get(path + "basic.mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "basic.tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "basic.clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
- va := res.Get(path + "advanced.application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *ServiceLANVPNInterfaceGRE) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
- va := res.Get(path + "basic.ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "basic.description.optionType"); t.Exists() {
- va := res.Get(path + "basic.description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
- va := res.Get(path + "basic.shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterfaceLoopback = types.StringNull()
- data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelRouteViaLoopback = types.StringNull()
- data.TunnelRouteViaLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteViaLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelDestination.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
- va := res.Get(path + "basic.mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "basic.tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "basic.clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
- va := res.Get(path + "advanced.application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *ServiceLANVPNInterfaceGRE) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.ServiceLanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceInterface.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceLoopback.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
- return false
- }
- if !data.TunnelRouteViaLoopback.IsNull() {
- return false
- }
- if !data.TunnelRouteViaLoopbackVariable.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.ClearDontFragment.IsNull() {
- return false
- }
- if !data.ClearDontFragmentVariable.IsNull() {
- return false
- }
- if !data.ApplicationTunnelType.IsNull() {
- return false
- }
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_feature.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_feature.go
new file mode 100644
index 000000000..668b43643
--- /dev/null
+++ b/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_feature.go
@@ -0,0 +1,1393 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceLANVPNInterfaceIPSec 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"`
+ ServiceLanVpnFeatureId types.String `tfsdk:"service_lan_vpn_feature_id"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
+ TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
+ TunnelSourceIpv4SubnetMask types.String `tfsdk:"tunnel_source_ipv4_subnet_mask"`
+ TunnelSourceIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_source_ipv4_subnet_mask_variable"`
+ TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
+ TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
+ TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
+ TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
+ TunnelDestinationIpv4SubnetMask types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask"`
+ TunnelDestinationIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask_variable"`
+ ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
+ ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
+ ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ DpdInterval types.Int64 `tfsdk:"dpd_interval"`
+ DpdIntervalVariable types.String `tfsdk:"dpd_interval_variable"`
+ DpdRetries types.Int64 `tfsdk:"dpd_retries"`
+ DpdRetriesVariable types.String `tfsdk:"dpd_retries_variable"`
+ IkePresharedKey types.String `tfsdk:"ike_preshared_key"`
+ IkePresharedKeyVariable types.String `tfsdk:"ike_preshared_key_variable"`
+ IkeVersion types.Int64 `tfsdk:"ike_version"`
+ IkeIntegrityProtocol types.String `tfsdk:"ike_integrity_protocol"`
+ IkeIntegrityProtocolVariable types.String `tfsdk:"ike_integrity_protocol_variable"`
+ IkeRekeyInterval types.Int64 `tfsdk:"ike_rekey_interval"`
+ IkeRekeyIntervalVariable types.String `tfsdk:"ike_rekey_interval_variable"`
+ IkeCiphersuite types.String `tfsdk:"ike_ciphersuite"`
+ IkeCiphersuiteVariable types.String `tfsdk:"ike_ciphersuite_variable"`
+ IkeDiffieHellmanGroup types.String `tfsdk:"ike_diffie_hellman_group"`
+ IkeDiffieHellmanGroupVariable types.String `tfsdk:"ike_diffie_hellman_group_variable"`
+ IkeIdLocalEndPoint types.String `tfsdk:"ike_id_local_end_point"`
+ IkeIdLocalEndPointVariable types.String `tfsdk:"ike_id_local_end_point_variable"`
+ IkeIdRemoteEndPoint types.String `tfsdk:"ike_id_remote_end_point"`
+ IkeIdRemoteEndPointVariable types.String `tfsdk:"ike_id_remote_end_point_variable"`
+ IpsecRekeyInterval types.Int64 `tfsdk:"ipsec_rekey_interval"`
+ IpsecRekeyIntervalVariable types.String `tfsdk:"ipsec_rekey_interval_variable"`
+ IpsecReplayWindow types.Int64 `tfsdk:"ipsec_replay_window"`
+ IpsecReplayWindowVariable types.String `tfsdk:"ipsec_replay_window_variable"`
+ IpsecCiphersuite types.String `tfsdk:"ipsec_ciphersuite"`
+ IpsecCiphersuiteVariable types.String `tfsdk:"ipsec_ciphersuite_variable"`
+ PerfectForwardSecrecy types.String `tfsdk:"perfect_forward_secrecy"`
+ PerfectForwardSecrecyVariable types.String `tfsdk:"perfect_forward_secrecy_variable"`
+ TrackerId types.String `tfsdk:"tracker_id"`
+ TrackerIdVariable types.String `tfsdk:"tracker_id_variable"`
+ TunnelRouteVia types.String `tfsdk:"tunnel_route_via"`
+ TunnelRouteViaVariable types.String `tfsdk:"tunnel_route_via_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceLANVPNInterfaceIPSec) getModel() string {
+ return "service_lan_vpn_interface_ipsec"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceLANVPNInterfaceIPSec) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/ipsec", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ifName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ifName.optionType", "global")
+ body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelSourceIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.TunnelSourceIpv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
+ }
+ } else if !data.TunnelSourceInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
+ }
+ }
+
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelDestinationIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString())
+ }
+ }
+
+ if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"application.optionType", "variable")
+ body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString())
+ }
+ } else if !data.ApplicationTunnelType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"application.optionType", "global")
+ body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global")
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.ClearDontFragmentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable")
+ body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
+ }
+ } else if data.ClearDontFragment.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default")
+ body, _ = sjson.Set(body, path+"clearDontFragment.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global")
+ body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"mtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"mtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"mtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"mtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.DpdIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString())
+ }
+ } else if data.DpdInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"dpdInterval.value", 10)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64())
+ }
+ }
+
+ if !data.DpdRetriesVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString())
+ }
+ } else if data.DpdRetries.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default")
+ body, _ = sjson.Set(body, path+"dpdRetries.value", 3)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global")
+ body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64())
+ }
+ }
+
+ if !data.IkePresharedKeyVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable")
+ body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString())
+ }
+ } else if !data.IkePresharedKey.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global")
+ body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString())
+ }
+ }
+ if data.IkeVersion.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeVersion.value", 1)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64())
+ }
+ }
+
+ if !data.IkeIntegrityProtocolVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString())
+ }
+ } else if data.IkeIntegrityProtocol.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeMode.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeMode.value", "main")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeMode.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString())
+ }
+ }
+
+ if !data.IkeRekeyIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString())
+ }
+ } else if data.IkeRekeyInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64())
+ }
+ }
+
+ if !data.IkeCiphersuiteVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString())
+ }
+ } else if data.IkeCiphersuite.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString())
+ }
+ }
+
+ if !data.IkeDiffieHellmanGroupVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString())
+ }
+ } else if data.IkeDiffieHellmanGroup.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeGroup.value", "16")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString())
+ }
+ }
+
+ if !data.IkeIdLocalEndPointVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString())
+ }
+ } else if data.IkeIdLocalEndPoint.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString())
+ }
+ }
+
+ if !data.IkeIdRemoteEndPointVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString())
+ }
+ } else if data.IkeIdRemoteEndPoint.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString())
+ }
+ }
+
+ if !data.IpsecRekeyIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString())
+ }
+ } else if data.IpsecRekeyInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64())
+ }
+ }
+
+ if !data.IpsecReplayWindowVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString())
+ }
+ } else if data.IpsecReplayWindow.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64())
+ }
+ }
+
+ if !data.IpsecCiphersuiteVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString())
+ }
+ } else if data.IpsecCiphersuite.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString())
+ }
+ }
+
+ if !data.PerfectForwardSecrecyVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable")
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString())
+ }
+ } else if data.PerfectForwardSecrecy.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default")
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global")
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString())
+ }
+ }
+
+ if !data.TrackerIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tracker.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString())
+ }
+ } else if data.TrackerId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tracker.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tracker.optionType", "global")
+ body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString())
+ }
+ }
+
+ if !data.TunnelRouteViaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString())
+ }
+ } else if data.TunnelRouteVia.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceLANVPNInterfaceIPSec) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "ifName.optionType"); t.Exists() {
+ va := res.Get(path + "ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "address.address.optionType"); t.Exists() {
+ va := res.Get(path + "address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.address.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4SubnetMask = types.StringNull()
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.mask.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.address.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4SubnetMask = types.StringNull()
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.mask.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "application.optionType"); t.Exists() {
+ va := res.Get(path + "application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "mtu.optionType"); t.Exists() {
+ va := res.Get(path + "mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdInterval = types.Int64Null()
+ data.DpdIntervalVariable = types.StringNull()
+ if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
+ va := res.Get(path + "dpdInterval.value")
+ if t.String() == "variable" {
+ data.DpdIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdRetries = types.Int64Null()
+ data.DpdRetriesVariable = types.StringNull()
+ if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
+ va := res.Get(path + "dpdRetries.value")
+ if t.String() == "variable" {
+ data.DpdRetriesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdRetries = types.Int64Value(va.Int())
+ }
+ }
+ data.IkePresharedKey = types.StringNull()
+ data.IkePresharedKeyVariable = types.StringNull()
+ if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
+ va := res.Get(path + "preSharedSecret.value")
+ if t.String() == "variable" {
+ data.IkePresharedKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkePresharedKey = types.StringValue(va.String())
+ }
+ }
+ data.IkeVersion = types.Int64Null()
+
+ if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
+ va := res.Get(path + "ikeVersion.value")
+ if t.String() == "global" {
+ data.IkeVersion = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeIntegrityProtocol = types.StringNull()
+ data.IkeIntegrityProtocolVariable = types.StringNull()
+ if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
+ va := res.Get(path + "ikeMode.value")
+ if t.String() == "variable" {
+ data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIntegrityProtocol = types.StringValue(va.String())
+ }
+ }
+ data.IkeRekeyInterval = types.Int64Null()
+ data.IkeRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IkeRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeCiphersuite = types.StringNull()
+ data.IkeCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ikeCiphersuite.value")
+ if t.String() == "variable" {
+ data.IkeCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.IkeDiffieHellmanGroup = types.StringNull()
+ data.IkeDiffieHellmanGroupVariable = types.StringNull()
+ if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
+ va := res.Get(path + "ikeGroup.value")
+ if t.String() == "variable" {
+ data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeDiffieHellmanGroup = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdLocalEndPoint = types.StringNull()
+ data.IkeIdLocalEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeLocalId.value")
+ if t.String() == "variable" {
+ data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdLocalEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdRemoteEndPoint = types.StringNull()
+ data.IkeIdRemoteEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRemoteId.value")
+ if t.String() == "variable" {
+ data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdRemoteEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IpsecRekeyInterval = types.Int64Null()
+ data.IpsecRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecReplayWindow = types.Int64Null()
+ data.IpsecReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecReplayWindow.value")
+ if t.String() == "variable" {
+ data.IpsecReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecReplayWindow = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecCiphersuite = types.StringNull()
+ data.IpsecCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecCiphersuite.value")
+ if t.String() == "variable" {
+ data.IpsecCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.PerfectForwardSecrecy = types.StringNull()
+ data.PerfectForwardSecrecyVariable = types.StringNull()
+ if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
+ va := res.Get(path + "perfectForwardSecrecy.value")
+ if t.String() == "variable" {
+ data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerfectForwardSecrecy = types.StringValue(va.String())
+ }
+ }
+ data.TrackerId = types.StringNull()
+ data.TrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "tracker.optionType"); t.Exists() {
+ va := res.Get(path + "tracker.value")
+ if t.String() == "variable" {
+ data.TrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteVia = types.StringNull()
+ data.TunnelRouteViaVariable = types.StringNull()
+ if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteVia = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceLANVPNInterfaceIPSec) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "ifName.optionType"); t.Exists() {
+ va := res.Get(path + "ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "address.address.optionType"); t.Exists() {
+ va := res.Get(path + "address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.address.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4SubnetMask = types.StringNull()
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.mask.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.address.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4SubnetMask = types.StringNull()
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.mask.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "application.optionType"); t.Exists() {
+ va := res.Get(path + "application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "mtu.optionType"); t.Exists() {
+ va := res.Get(path + "mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdInterval = types.Int64Null()
+ data.DpdIntervalVariable = types.StringNull()
+ if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
+ va := res.Get(path + "dpdInterval.value")
+ if t.String() == "variable" {
+ data.DpdIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdRetries = types.Int64Null()
+ data.DpdRetriesVariable = types.StringNull()
+ if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
+ va := res.Get(path + "dpdRetries.value")
+ if t.String() == "variable" {
+ data.DpdRetriesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdRetries = types.Int64Value(va.Int())
+ }
+ }
+ data.IkePresharedKey = types.StringNull()
+ data.IkePresharedKeyVariable = types.StringNull()
+ if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
+ va := res.Get(path + "preSharedSecret.value")
+ if t.String() == "variable" {
+ data.IkePresharedKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkePresharedKey = types.StringValue(va.String())
+ }
+ }
+ data.IkeVersion = types.Int64Null()
+
+ if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
+ va := res.Get(path + "ikeVersion.value")
+ if t.String() == "global" {
+ data.IkeVersion = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeIntegrityProtocol = types.StringNull()
+ data.IkeIntegrityProtocolVariable = types.StringNull()
+ if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
+ va := res.Get(path + "ikeMode.value")
+ if t.String() == "variable" {
+ data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIntegrityProtocol = types.StringValue(va.String())
+ }
+ }
+ data.IkeRekeyInterval = types.Int64Null()
+ data.IkeRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IkeRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeCiphersuite = types.StringNull()
+ data.IkeCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ikeCiphersuite.value")
+ if t.String() == "variable" {
+ data.IkeCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.IkeDiffieHellmanGroup = types.StringNull()
+ data.IkeDiffieHellmanGroupVariable = types.StringNull()
+ if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
+ va := res.Get(path + "ikeGroup.value")
+ if t.String() == "variable" {
+ data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeDiffieHellmanGroup = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdLocalEndPoint = types.StringNull()
+ data.IkeIdLocalEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeLocalId.value")
+ if t.String() == "variable" {
+ data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdLocalEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdRemoteEndPoint = types.StringNull()
+ data.IkeIdRemoteEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRemoteId.value")
+ if t.String() == "variable" {
+ data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdRemoteEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IpsecRekeyInterval = types.Int64Null()
+ data.IpsecRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecReplayWindow = types.Int64Null()
+ data.IpsecReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecReplayWindow.value")
+ if t.String() == "variable" {
+ data.IpsecReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecReplayWindow = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecCiphersuite = types.StringNull()
+ data.IpsecCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecCiphersuite.value")
+ if t.String() == "variable" {
+ data.IpsecCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.PerfectForwardSecrecy = types.StringNull()
+ data.PerfectForwardSecrecyVariable = types.StringNull()
+ if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
+ va := res.Get(path + "perfectForwardSecrecy.value")
+ if t.String() == "variable" {
+ data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerfectForwardSecrecy = types.StringValue(va.String())
+ }
+ }
+ data.TrackerId = types.StringNull()
+ data.TrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "tracker.optionType"); t.Exists() {
+ va := res.Get(path + "tracker.value")
+ if t.String() == "variable" {
+ data.TrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteVia = types.StringNull()
+ data.TunnelRouteViaVariable = types.StringNull()
+ if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteVia = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceLANVPNInterfaceIPSec) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.ServiceLanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterface.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelType.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragment.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragmentVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.DpdInterval.IsNull() {
+ return false
+ }
+ if !data.DpdIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.DpdRetries.IsNull() {
+ return false
+ }
+ if !data.DpdRetriesVariable.IsNull() {
+ return false
+ }
+ if !data.IkePresharedKey.IsNull() {
+ return false
+ }
+ if !data.IkePresharedKeyVariable.IsNull() {
+ return false
+ }
+ if !data.IkeVersion.IsNull() {
+ return false
+ }
+ if !data.IkeIntegrityProtocol.IsNull() {
+ return false
+ }
+ if !data.IkeIntegrityProtocolVariable.IsNull() {
+ return false
+ }
+ if !data.IkeRekeyInterval.IsNull() {
+ return false
+ }
+ if !data.IkeRekeyIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.IkeCiphersuite.IsNull() {
+ return false
+ }
+ if !data.IkeCiphersuiteVariable.IsNull() {
+ return false
+ }
+ if !data.IkeDiffieHellmanGroup.IsNull() {
+ return false
+ }
+ if !data.IkeDiffieHellmanGroupVariable.IsNull() {
+ return false
+ }
+ if !data.IkeIdLocalEndPoint.IsNull() {
+ return false
+ }
+ if !data.IkeIdLocalEndPointVariable.IsNull() {
+ return false
+ }
+ if !data.IkeIdRemoteEndPoint.IsNull() {
+ return false
+ }
+ if !data.IkeIdRemoteEndPointVariable.IsNull() {
+ return false
+ }
+ if !data.IpsecRekeyInterval.IsNull() {
+ return false
+ }
+ if !data.IpsecRekeyIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.IpsecReplayWindow.IsNull() {
+ return false
+ }
+ if !data.IpsecReplayWindowVariable.IsNull() {
+ return false
+ }
+ if !data.IpsecCiphersuite.IsNull() {
+ return false
+ }
+ if !data.IpsecCiphersuiteVariable.IsNull() {
+ return false
+ }
+ if !data.PerfectForwardSecrecy.IsNull() {
+ return false
+ }
+ if !data.PerfectForwardSecrecyVariable.IsNull() {
+ return false
+ }
+ if !data.TrackerId.IsNull() {
+ return false
+ }
+ if !data.TrackerIdVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteVia.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteViaVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go
deleted file mode 100644
index 33637e43d..000000000
--- a/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go
+++ /dev/null
@@ -1,1393 +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/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type ServiceLANVPNInterfaceIPSec 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"`
- ServiceLanVpnProfileParcelId types.String `tfsdk:"service_lan_vpn_profile_parcel_id"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
- TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
- TunnelSourceIpv4SubnetMask types.String `tfsdk:"tunnel_source_ipv4_subnet_mask"`
- TunnelSourceIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_source_ipv4_subnet_mask_variable"`
- TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
- TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
- TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
- TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
- TunnelDestinationIpv4SubnetMask types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask"`
- TunnelDestinationIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask_variable"`
- ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
- ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
- ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- DpdInterval types.Int64 `tfsdk:"dpd_interval"`
- DpdIntervalVariable types.String `tfsdk:"dpd_interval_variable"`
- DpdRetries types.Int64 `tfsdk:"dpd_retries"`
- DpdRetriesVariable types.String `tfsdk:"dpd_retries_variable"`
- IkePresharedKey types.String `tfsdk:"ike_preshared_key"`
- IkePresharedKeyVariable types.String `tfsdk:"ike_preshared_key_variable"`
- IkeVersion types.Int64 `tfsdk:"ike_version"`
- IkeIntegrityProtocol types.String `tfsdk:"ike_integrity_protocol"`
- IkeIntegrityProtocolVariable types.String `tfsdk:"ike_integrity_protocol_variable"`
- IkeRekeyInterval types.Int64 `tfsdk:"ike_rekey_interval"`
- IkeRekeyIntervalVariable types.String `tfsdk:"ike_rekey_interval_variable"`
- IkeCiphersuite types.String `tfsdk:"ike_ciphersuite"`
- IkeCiphersuiteVariable types.String `tfsdk:"ike_ciphersuite_variable"`
- IkeDiffieHellmanGroup types.String `tfsdk:"ike_diffie_hellman_group"`
- IkeDiffieHellmanGroupVariable types.String `tfsdk:"ike_diffie_hellman_group_variable"`
- IkeIdLocalEndPoint types.String `tfsdk:"ike_id_local_end_point"`
- IkeIdLocalEndPointVariable types.String `tfsdk:"ike_id_local_end_point_variable"`
- IkeIdRemoteEndPoint types.String `tfsdk:"ike_id_remote_end_point"`
- IkeIdRemoteEndPointVariable types.String `tfsdk:"ike_id_remote_end_point_variable"`
- IpsecRekeyInterval types.Int64 `tfsdk:"ipsec_rekey_interval"`
- IpsecRekeyIntervalVariable types.String `tfsdk:"ipsec_rekey_interval_variable"`
- IpsecReplayWindow types.Int64 `tfsdk:"ipsec_replay_window"`
- IpsecReplayWindowVariable types.String `tfsdk:"ipsec_replay_window_variable"`
- IpsecCiphersuite types.String `tfsdk:"ipsec_ciphersuite"`
- IpsecCiphersuiteVariable types.String `tfsdk:"ipsec_ciphersuite_variable"`
- PerfectForwardSecrecy types.String `tfsdk:"perfect_forward_secrecy"`
- PerfectForwardSecrecyVariable types.String `tfsdk:"perfect_forward_secrecy_variable"`
- TrackerId types.String `tfsdk:"tracker_id"`
- TrackerIdVariable types.String `tfsdk:"tracker_id_variable"`
- TunnelRouteVia types.String `tfsdk:"tunnel_route_via"`
- TunnelRouteViaVariable types.String `tfsdk:"tunnel_route_via_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data ServiceLANVPNInterfaceIPSec) getModel() string {
- return "service_lan_vpn_interface_ipsec"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data ServiceLANVPNInterfaceIPSec) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/ipsec", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ifName.optionType", "variable")
- body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ifName.optionType", "global")
- body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.address.optionType", "global")
- body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
-
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelSourceIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString())
- }
- }
-
- if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString())
- }
- } else if !data.TunnelSourceIpv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString())
- }
- }
-
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
- }
- } else if !data.TunnelSourceInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
- }
- }
-
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelDestinationIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString())
- }
- }
-
- if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString())
- }
- } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString())
- }
- }
-
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"application.optionType", "variable")
- body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString())
- }
- } else if !data.ApplicationTunnelType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"application.optionType", "global")
- body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable")
- body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global")
- body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.ClearDontFragmentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable")
- body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
- }
- } else if data.ClearDontFragment.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default")
- body, _ = sjson.Set(body, path+"clearDontFragment.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global")
- body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"mtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"mtu.optionType", "default")
- body, _ = sjson.Set(body, path+"mtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"mtu.optionType", "global")
- body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.DpdIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString())
- }
- } else if data.DpdInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"dpdInterval.value", 10)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64())
- }
- }
-
- if !data.DpdRetriesVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable")
- body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString())
- }
- } else if data.DpdRetries.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default")
- body, _ = sjson.Set(body, path+"dpdRetries.value", 3)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global")
- body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64())
- }
- }
-
- if !data.IkePresharedKeyVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable")
- body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString())
- }
- } else if !data.IkePresharedKey.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global")
- body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString())
- }
- }
- if data.IkeVersion.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeVersion.value", 1)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64())
- }
- }
-
- if !data.IkeIntegrityProtocolVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString())
- }
- } else if data.IkeIntegrityProtocol.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeMode.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeMode.value", "main")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeMode.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString())
- }
- }
-
- if !data.IkeRekeyIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString())
- }
- } else if data.IkeRekeyInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64())
- }
- }
-
- if !data.IkeCiphersuiteVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString())
- }
- } else if data.IkeCiphersuite.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString())
- }
- }
-
- if !data.IkeDiffieHellmanGroupVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString())
- }
- } else if data.IkeDiffieHellmanGroup.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeGroup.value", "16")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString())
- }
- }
-
- if !data.IkeIdLocalEndPointVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString())
- }
- } else if data.IkeIdLocalEndPoint.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString())
- }
- }
-
- if !data.IkeIdRemoteEndPointVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString())
- }
- } else if data.IkeIdRemoteEndPoint.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString())
- }
- }
-
- if !data.IpsecRekeyIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString())
- }
- } else if data.IpsecRekeyInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64())
- }
- }
-
- if !data.IpsecReplayWindowVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString())
- }
- } else if data.IpsecReplayWindow.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default")
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global")
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64())
- }
- }
-
- if !data.IpsecCiphersuiteVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString())
- }
- } else if data.IpsecCiphersuite.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default")
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global")
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString())
- }
- }
-
- if !data.PerfectForwardSecrecyVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable")
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString())
- }
- } else if data.PerfectForwardSecrecy.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default")
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global")
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString())
- }
- }
-
- if !data.TrackerIdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tracker.optionType", "variable")
- body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString())
- }
- } else if data.TrackerId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tracker.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tracker.optionType", "global")
- body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString())
- }
- }
-
- if !data.TunnelRouteViaVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString())
- }
- } else if data.TunnelRouteVia.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *ServiceLANVPNInterfaceIPSec) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "ifName.optionType"); t.Exists() {
- va := res.Get(path + "ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "address.address.optionType"); t.Exists() {
- va := res.Get(path + "address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "address.mask.optionType"); t.Exists() {
- va := res.Get(path + "address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.address.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4SubnetMask = types.StringNull()
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.mask.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.address.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4SubnetMask = types.StringNull()
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.mask.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "application.optionType"); t.Exists() {
- va := res.Get(path + "application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "mtu.optionType"); t.Exists() {
- va := res.Get(path + "mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.DpdInterval = types.Int64Null()
- data.DpdIntervalVariable = types.StringNull()
- if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
- va := res.Get(path + "dpdInterval.value")
- if t.String() == "variable" {
- data.DpdIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdInterval = types.Int64Value(va.Int())
- }
- }
- data.DpdRetries = types.Int64Null()
- data.DpdRetriesVariable = types.StringNull()
- if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
- va := res.Get(path + "dpdRetries.value")
- if t.String() == "variable" {
- data.DpdRetriesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdRetries = types.Int64Value(va.Int())
- }
- }
- data.IkePresharedKey = types.StringNull()
- data.IkePresharedKeyVariable = types.StringNull()
- if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
- va := res.Get(path + "preSharedSecret.value")
- if t.String() == "variable" {
- data.IkePresharedKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkePresharedKey = types.StringValue(va.String())
- }
- }
- data.IkeVersion = types.Int64Null()
-
- if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
- va := res.Get(path + "ikeVersion.value")
- if t.String() == "global" {
- data.IkeVersion = types.Int64Value(va.Int())
- }
- }
- data.IkeIntegrityProtocol = types.StringNull()
- data.IkeIntegrityProtocolVariable = types.StringNull()
- if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
- va := res.Get(path + "ikeMode.value")
- if t.String() == "variable" {
- data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIntegrityProtocol = types.StringValue(va.String())
- }
- }
- data.IkeRekeyInterval = types.Int64Null()
- data.IkeRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ikeRekeyInterval.value")
- if t.String() == "variable" {
- data.IkeRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IkeCiphersuite = types.StringNull()
- data.IkeCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ikeCiphersuite.value")
- if t.String() == "variable" {
- data.IkeCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeCiphersuite = types.StringValue(va.String())
- }
- }
- data.IkeDiffieHellmanGroup = types.StringNull()
- data.IkeDiffieHellmanGroupVariable = types.StringNull()
- if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
- va := res.Get(path + "ikeGroup.value")
- if t.String() == "variable" {
- data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeDiffieHellmanGroup = types.StringValue(va.String())
- }
- }
- data.IkeIdLocalEndPoint = types.StringNull()
- data.IkeIdLocalEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
- va := res.Get(path + "ikeLocalId.value")
- if t.String() == "variable" {
- data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdLocalEndPoint = types.StringValue(va.String())
- }
- }
- data.IkeIdRemoteEndPoint = types.StringNull()
- data.IkeIdRemoteEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
- va := res.Get(path + "ikeRemoteId.value")
- if t.String() == "variable" {
- data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdRemoteEndPoint = types.StringValue(va.String())
- }
- }
- data.IpsecRekeyInterval = types.Int64Null()
- data.IpsecRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ipsecRekeyInterval.value")
- if t.String() == "variable" {
- data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IpsecReplayWindow = types.Int64Null()
- data.IpsecReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
- va := res.Get(path + "ipsecReplayWindow.value")
- if t.String() == "variable" {
- data.IpsecReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecReplayWindow = types.Int64Value(va.Int())
- }
- }
- data.IpsecCiphersuite = types.StringNull()
- data.IpsecCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ipsecCiphersuite.value")
- if t.String() == "variable" {
- data.IpsecCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecCiphersuite = types.StringValue(va.String())
- }
- }
- data.PerfectForwardSecrecy = types.StringNull()
- data.PerfectForwardSecrecyVariable = types.StringNull()
- if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
- va := res.Get(path + "perfectForwardSecrecy.value")
- if t.String() == "variable" {
- data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerfectForwardSecrecy = types.StringValue(va.String())
- }
- }
- data.TrackerId = types.StringNull()
- data.TrackerIdVariable = types.StringNull()
- if t := res.Get(path + "tracker.optionType"); t.Exists() {
- va := res.Get(path + "tracker.value")
- if t.String() == "variable" {
- data.TrackerIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackerId = types.StringValue(va.String())
- }
- }
- data.TunnelRouteVia = types.StringNull()
- data.TunnelRouteViaVariable = types.StringNull()
- if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteVia = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *ServiceLANVPNInterfaceIPSec) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "ifName.optionType"); t.Exists() {
- va := res.Get(path + "ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "address.address.optionType"); t.Exists() {
- va := res.Get(path + "address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "address.mask.optionType"); t.Exists() {
- va := res.Get(path + "address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.address.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4SubnetMask = types.StringNull()
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.mask.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.address.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4SubnetMask = types.StringNull()
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.mask.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "application.optionType"); t.Exists() {
- va := res.Get(path + "application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "mtu.optionType"); t.Exists() {
- va := res.Get(path + "mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.DpdInterval = types.Int64Null()
- data.DpdIntervalVariable = types.StringNull()
- if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
- va := res.Get(path + "dpdInterval.value")
- if t.String() == "variable" {
- data.DpdIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdInterval = types.Int64Value(va.Int())
- }
- }
- data.DpdRetries = types.Int64Null()
- data.DpdRetriesVariable = types.StringNull()
- if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
- va := res.Get(path + "dpdRetries.value")
- if t.String() == "variable" {
- data.DpdRetriesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdRetries = types.Int64Value(va.Int())
- }
- }
- data.IkePresharedKey = types.StringNull()
- data.IkePresharedKeyVariable = types.StringNull()
- if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
- va := res.Get(path + "preSharedSecret.value")
- if t.String() == "variable" {
- data.IkePresharedKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkePresharedKey = types.StringValue(va.String())
- }
- }
- data.IkeVersion = types.Int64Null()
-
- if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
- va := res.Get(path + "ikeVersion.value")
- if t.String() == "global" {
- data.IkeVersion = types.Int64Value(va.Int())
- }
- }
- data.IkeIntegrityProtocol = types.StringNull()
- data.IkeIntegrityProtocolVariable = types.StringNull()
- if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
- va := res.Get(path + "ikeMode.value")
- if t.String() == "variable" {
- data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIntegrityProtocol = types.StringValue(va.String())
- }
- }
- data.IkeRekeyInterval = types.Int64Null()
- data.IkeRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ikeRekeyInterval.value")
- if t.String() == "variable" {
- data.IkeRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IkeCiphersuite = types.StringNull()
- data.IkeCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ikeCiphersuite.value")
- if t.String() == "variable" {
- data.IkeCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeCiphersuite = types.StringValue(va.String())
- }
- }
- data.IkeDiffieHellmanGroup = types.StringNull()
- data.IkeDiffieHellmanGroupVariable = types.StringNull()
- if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
- va := res.Get(path + "ikeGroup.value")
- if t.String() == "variable" {
- data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeDiffieHellmanGroup = types.StringValue(va.String())
- }
- }
- data.IkeIdLocalEndPoint = types.StringNull()
- data.IkeIdLocalEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
- va := res.Get(path + "ikeLocalId.value")
- if t.String() == "variable" {
- data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdLocalEndPoint = types.StringValue(va.String())
- }
- }
- data.IkeIdRemoteEndPoint = types.StringNull()
- data.IkeIdRemoteEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
- va := res.Get(path + "ikeRemoteId.value")
- if t.String() == "variable" {
- data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdRemoteEndPoint = types.StringValue(va.String())
- }
- }
- data.IpsecRekeyInterval = types.Int64Null()
- data.IpsecRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ipsecRekeyInterval.value")
- if t.String() == "variable" {
- data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IpsecReplayWindow = types.Int64Null()
- data.IpsecReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
- va := res.Get(path + "ipsecReplayWindow.value")
- if t.String() == "variable" {
- data.IpsecReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecReplayWindow = types.Int64Value(va.Int())
- }
- }
- data.IpsecCiphersuite = types.StringNull()
- data.IpsecCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ipsecCiphersuite.value")
- if t.String() == "variable" {
- data.IpsecCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecCiphersuite = types.StringValue(va.String())
- }
- }
- data.PerfectForwardSecrecy = types.StringNull()
- data.PerfectForwardSecrecyVariable = types.StringNull()
- if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
- va := res.Get(path + "perfectForwardSecrecy.value")
- if t.String() == "variable" {
- data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerfectForwardSecrecy = types.StringValue(va.String())
- }
- }
- data.TrackerId = types.StringNull()
- data.TrackerIdVariable = types.StringNull()
- if t := res.Get(path + "tracker.optionType"); t.Exists() {
- va := res.Get(path + "tracker.value")
- if t.String() == "variable" {
- data.TrackerIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackerId = types.StringValue(va.String())
- }
- }
- data.TunnelRouteVia = types.StringNull()
- data.TunnelRouteViaVariable = types.StringNull()
- if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteVia = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *ServiceLANVPNInterfaceIPSec) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.ServiceLanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4SubnetMask.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceInterface.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.ApplicationTunnelType.IsNull() {
- return false
- }
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.ClearDontFragment.IsNull() {
- return false
- }
- if !data.ClearDontFragmentVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.DpdInterval.IsNull() {
- return false
- }
- if !data.DpdIntervalVariable.IsNull() {
- return false
- }
- if !data.DpdRetries.IsNull() {
- return false
- }
- if !data.DpdRetriesVariable.IsNull() {
- return false
- }
- if !data.IkePresharedKey.IsNull() {
- return false
- }
- if !data.IkePresharedKeyVariable.IsNull() {
- return false
- }
- if !data.IkeVersion.IsNull() {
- return false
- }
- if !data.IkeIntegrityProtocol.IsNull() {
- return false
- }
- if !data.IkeIntegrityProtocolVariable.IsNull() {
- return false
- }
- if !data.IkeRekeyInterval.IsNull() {
- return false
- }
- if !data.IkeRekeyIntervalVariable.IsNull() {
- return false
- }
- if !data.IkeCiphersuite.IsNull() {
- return false
- }
- if !data.IkeCiphersuiteVariable.IsNull() {
- return false
- }
- if !data.IkeDiffieHellmanGroup.IsNull() {
- return false
- }
- if !data.IkeDiffieHellmanGroupVariable.IsNull() {
- return false
- }
- if !data.IkeIdLocalEndPoint.IsNull() {
- return false
- }
- if !data.IkeIdLocalEndPointVariable.IsNull() {
- return false
- }
- if !data.IkeIdRemoteEndPoint.IsNull() {
- return false
- }
- if !data.IkeIdRemoteEndPointVariable.IsNull() {
- return false
- }
- if !data.IpsecRekeyInterval.IsNull() {
- return false
- }
- if !data.IpsecRekeyIntervalVariable.IsNull() {
- return false
- }
- if !data.IpsecReplayWindow.IsNull() {
- return false
- }
- if !data.IpsecReplayWindowVariable.IsNull() {
- return false
- }
- if !data.IpsecCiphersuite.IsNull() {
- return false
- }
- if !data.IpsecCiphersuiteVariable.IsNull() {
- return false
- }
- if !data.PerfectForwardSecrecy.IsNull() {
- return false
- }
- if !data.PerfectForwardSecrecyVariable.IsNull() {
- return false
- }
- if !data.TrackerId.IsNull() {
- return false
- }
- if !data.TrackerIdVariable.IsNull() {
- return false
- }
- if !data.TunnelRouteVia.IsNull() {
- return false
- }
- if !data.TunnelRouteViaVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_svi_feature.go b/internal/provider/model_sdwan_service_lan_vpn_interface_svi_feature.go
new file mode 100644
index 000000000..d460ff756
--- /dev/null
+++ b/internal/provider/model_sdwan_service_lan_vpn_interface_svi_feature.go
@@ -0,0 +1,2049 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceLANVPNInterfaceSVI 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"`
+ ServiceLanVpnFeatureId types.String `tfsdk:"service_lan_vpn_feature_id"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
+ InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ Ipv4SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
+ Ipv4DhcpHelpers types.Set `tfsdk:"ipv4_dhcp_helpers"`
+ Ipv4DhcpHelpersVariable types.String `tfsdk:"ipv4_dhcp_helpers_variable"`
+ Ipv6Address types.String `tfsdk:"ipv6_address"`
+ Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
+ Ipv6SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses `tfsdk:"ipv6_secondary_addresses"`
+ Ipv6DhcpHelpers []ServiceLANVPNInterfaceSVIIpv6DhcpHelpers `tfsdk:"ipv6_dhcp_helpers"`
+ Arps []ServiceLANVPNInterfaceSVIArps `tfsdk:"arps"`
+ Ipv4Vrrps []ServiceLANVPNInterfaceSVIIpv4Vrrps `tfsdk:"ipv4_vrrps"`
+ Ipv6Vrrps []ServiceLANVPNInterfaceSVIIpv6Vrrps `tfsdk:"ipv6_vrrps"`
+ EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
+ EnableDhcpv6Variable types.String `tfsdk:"enable_dhcpv6_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
+ ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
+ IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
+ IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
+ IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
+ IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
+}
+
+type ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+}
+
+type ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+}
+
+type ServiceLANVPNInterfaceSVIIpv6DhcpHelpers struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ VpnVariable types.String `tfsdk:"vpn_variable"`
+}
+
+type ServiceLANVPNInterfaceSVIArps struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+}
+
+type ServiceLANVPNInterfaceSVIIpv4Vrrps struct {
+ GroupId types.Int64 `tfsdk:"group_id"`
+ GroupIdVariable types.String `tfsdk:"group_id_variable"`
+ Priority types.Int64 `tfsdk:"priority"`
+ PriorityVariable types.String `tfsdk:"priority_variable"`
+ Timer types.Int64 `tfsdk:"timer"`
+ TimerVariable types.String `tfsdk:"timer_variable"`
+ TrackOmp types.Bool `tfsdk:"track_omp"`
+ TrackOmpVariable types.String `tfsdk:"track_omp_variable"`
+ PrefixList types.String `tfsdk:"prefix_list"`
+ PrefixListVariable types.String `tfsdk:"prefix_list_variable"`
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses `tfsdk:"secondary_addresses"`
+ TlocPrefixChange types.Bool `tfsdk:"tloc_prefix_change"`
+ TlocPrefixChangeValue types.Int64 `tfsdk:"tloc_prefix_change_value"`
+ TlocPrefixChangeValueVariable types.String `tfsdk:"tloc_prefix_change_value_variable"`
+}
+
+type ServiceLANVPNInterfaceSVIIpv6Vrrps struct {
+ GroupId types.Int64 `tfsdk:"group_id"`
+ GroupIdVariable types.String `tfsdk:"group_id_variable"`
+ Priority types.Int64 `tfsdk:"priority"`
+ PriorityVariable types.String `tfsdk:"priority_variable"`
+ Timer types.Int64 `tfsdk:"timer"`
+ TimerVariable types.String `tfsdk:"timer_variable"`
+ TrackOmp types.Bool `tfsdk:"track_omp"`
+ TrackOmpVariable types.String `tfsdk:"track_omp_variable"`
+ TrackPrefixList types.String `tfsdk:"track_prefix_list"`
+ TrackPrefixListVariable types.String `tfsdk:"track_prefix_list_variable"`
+ Addresses []ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses `tfsdk:"addresses"`
+ SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses `tfsdk:"secondary_addresses"`
+}
+
+type ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+}
+
+type ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses struct {
+ LinkLocalAddress types.String `tfsdk:"link_local_address"`
+ LinkLocalAddressVariable types.String `tfsdk:"link_local_address_variable"`
+ GlobalAddress types.String `tfsdk:"global_address"`
+ GlobalAddressVariable types.String `tfsdk:"global_address_variable"`
+}
+type ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses struct {
+ Prefix types.String `tfsdk:"prefix"`
+ PrefixVariable types.String `tfsdk:"prefix_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceLANVPNInterfaceSVI) getModel() string {
+ return "service_lan_vpn_interface_svi"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceLANVPNInterfaceSVI) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/svi", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.InterfaceMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ifMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtuVariable.ValueString())
+ }
+ } else if data.InterfaceMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ifMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"ifMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ifMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtu.ValueInt64())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.secondaryAddressV4", []interface{}{})
+ for _, item := range data.Ipv4SecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !item.Ipv4SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMask.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv4.secondaryAddressV4.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv4DhcpHelpersVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", data.Ipv4DhcpHelpersVariable.ValueString())
+ }
+ } else if data.Ipv4DhcpHelpers.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "global")
+ var values []string
+ data.Ipv4DhcpHelpers.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", values)
+ }
+ }
+
+ if !data.Ipv6AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6AddressVariable.ValueString())
+ }
+ } else if data.Ipv6Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6Address.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6.secondaryAddressV6", []interface{}{})
+ for _, item := range data.Ipv6SecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6.secondaryAddressV6.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6.dhcpHelperV6", []interface{}{})
+ for _, item := range data.Ipv6DhcpHelpers {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.VpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
+ }
+ } else if item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6.dhcpHelperV6.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"arp", []interface{}{})
+ for _, item := range data.Arps {
+ itemBody := ""
+
+ if !item.IpAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
+ }
+ } else if !item.IpAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
+ }
+ }
+
+ if !item.MacAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
+ }
+ } else if !item.MacAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"vrrp", []interface{}{})
+ for _, item := range data.Ipv4Vrrps {
+ itemBody := ""
+
+ if !item.GroupIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString())
+ }
+ } else if !item.GroupId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64())
+ }
+ }
+
+ if !item.PriorityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
+ }
+ } else if item.Priority.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
+ }
+ }
+
+ if !item.TimerVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
+ }
+ } else if item.Timer.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
+ }
+ }
+
+ if !item.TrackOmpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString())
+ }
+ } else if item.TrackOmp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
+ }
+ }
+
+ if !item.PrefixListVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixListVariable.ValueString())
+ }
+ } else if item.PrefixList.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixList.ValueString())
+ }
+ }
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{})
+ for _, childItem := range item.SecondaryAddresses {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody)
+ }
+ }
+ if item.TlocPrefixChange.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool())
+ }
+ }
+
+ if !item.TlocPrefixChangeValueVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValueVariable.ValueString())
+ }
+ } else if !item.TlocPrefixChangeValue.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValue.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{})
+ for _, item := range data.Ipv6Vrrps {
+ itemBody := ""
+
+ if !item.GroupIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString())
+ }
+ } else if !item.GroupId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64())
+ }
+ }
+
+ if !item.PriorityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
+ }
+ } else if item.Priority.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
+ }
+ }
+
+ if !item.TimerVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
+ }
+ } else if item.Timer.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
+ }
+ }
+
+ if !item.TrackOmpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString())
+ }
+ } else if item.TrackOmp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
+ }
+ }
+
+ if !item.TrackPrefixListVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixListVariable.ValueString())
+ }
+ } else if item.TrackPrefixList.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixList.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{})
+ for _, childItem := range item.Addresses {
+ itemChildBody := ""
+
+ if !childItem.LinkLocalAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString())
+ }
+ } else if !childItem.LinkLocalAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString())
+ }
+ }
+
+ if !childItem.GlobalAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString())
+ }
+ } else if childItem.GlobalAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody)
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipv6Secondary", []interface{}{})
+ for _, childItem := range item.SecondaryAddresses {
+ itemChildBody := ""
+
+ if !childItem.PrefixVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString())
+ }
+ } else if !childItem.Prefix.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ipv6Secondary.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody)
+ }
+ }
+
+ if !data.EnableDhcpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6Variable.ValueString())
+ }
+ } else if data.EnableDhcpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "default")
+ body, _ = sjson.Set(body, path+"dhcpClientV6.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "global")
+ body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6.ValueBool())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.ArpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
+ }
+ } else if data.ArpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
+ }
+ }
+
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
+ }
+ } else if data.IpDirectedBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
+ }
+ }
+
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
+ }
+ } else if data.IcmpRedirectDisable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceLANVPNInterfaceSVI) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "ifMtu.optionType"); t.Exists() {
+ va := res.Get(path + "ifMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "ipv4.addressV4.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "ipv4.addressV4.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "ipv4.addressV4.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "ipv4.addressV4.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "ipv4.secondaryAddressV4"); value.Exists() {
+ data.Ipv4SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.Ipv4SubnetMask = types.StringNull()
+ item.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := v.Get("subnetMask.optionType"); t.Exists() {
+ va := v.Get("subnetMask.value")
+ if t.String() == "variable" {
+ item.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
+ return true
+ })
+ }
+ data.Ipv4DhcpHelpers = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelpersVariable = types.StringNull()
+ if t := res.Get(path + "ipv4.dhcpHelperV4.optionType"); t.Exists() {
+ va := res.Get(path + "ipv4.dhcpHelperV4.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelpersVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelpers = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "ipv6.addressV6.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6.addressV6.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "ipv6.secondaryAddressV6"); value.Exists() {
+ data.Ipv6SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6SecondaryAddresses = append(data.Ipv6SecondaryAddresses, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6.dhcpHelperV6"); value.Exists() {
+ data.Ipv6DhcpHelpers = make([]ServiceLANVPNInterfaceSVIIpv6DhcpHelpers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceSVIIpv6DhcpHelpers{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.Vpn = types.Int64Null()
+ item.VpnVariable = types.StringNull()
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "variable" {
+ item.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6DhcpHelpers = append(data.Ipv6DhcpHelpers, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "arp"); value.Exists() {
+ data.Arps = make([]ServiceLANVPNInterfaceSVIArps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceSVIArps{}
+ item.IpAddress = types.StringNull()
+ item.IpAddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.IpAddress = types.StringValue(va.String())
+ }
+ }
+ item.MacAddress = types.StringNull()
+ item.MacAddressVariable = types.StringNull()
+ if t := v.Get("macAddress.optionType"); t.Exists() {
+ va := v.Get("macAddress.value")
+ if t.String() == "variable" {
+ item.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps = append(data.Arps, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "vrrp"); value.Exists() {
+ data.Ipv4Vrrps = make([]ServiceLANVPNInterfaceSVIIpv4Vrrps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceSVIIpv4Vrrps{}
+ item.GroupId = types.Int64Null()
+ item.GroupIdVariable = types.StringNull()
+ if t := v.Get("group_id.optionType"); t.Exists() {
+ va := v.Get("group_id.value")
+ if t.String() == "variable" {
+ item.GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.GroupId = types.Int64Value(va.Int())
+ }
+ }
+ item.Priority = types.Int64Null()
+ item.PriorityVariable = types.StringNull()
+ if t := v.Get("priority.optionType"); t.Exists() {
+ va := v.Get("priority.value")
+ if t.String() == "variable" {
+ item.PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Priority = types.Int64Value(va.Int())
+ }
+ }
+ item.Timer = types.Int64Null()
+ item.TimerVariable = types.StringNull()
+ if t := v.Get("timer.optionType"); t.Exists() {
+ va := v.Get("timer.value")
+ if t.String() == "variable" {
+ item.TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Timer = types.Int64Value(va.Int())
+ }
+ }
+ item.TrackOmp = types.BoolNull()
+ item.TrackOmpVariable = types.StringNull()
+ if t := v.Get("trackOmp.optionType"); t.Exists() {
+ va := v.Get("trackOmp.value")
+ if t.String() == "variable" {
+ item.TrackOmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ item.PrefixList = types.StringNull()
+ item.PrefixListVariable = types.StringNull()
+ if t := v.Get("prefixList.optionType"); t.Exists() {
+ va := v.Get("prefixList.value")
+ if t.String() == "variable" {
+ item.PrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PrefixList = types.StringValue(va.String())
+ }
+ }
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("ipAddressSecondary"); cValue.Exists() {
+ item.SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ item.SecondaryAddresses = append(item.SecondaryAddresses, cItem)
+ return true
+ })
+ }
+ item.TlocPrefixChange = types.BoolNull()
+
+ if t := v.Get("tlocPrefChange.optionType"); t.Exists() {
+ va := v.Get("tlocPrefChange.value")
+ if t.String() == "global" {
+ item.TlocPrefixChange = types.BoolValue(va.Bool())
+ }
+ }
+ item.TlocPrefixChangeValue = types.Int64Null()
+ item.TlocPrefixChangeValueVariable = types.StringNull()
+ if t := v.Get("tlocPrefChangeValue.optionType"); t.Exists() {
+ va := v.Get("tlocPrefChangeValue.value")
+ if t.String() == "variable" {
+ item.TlocPrefixChangeValueVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlocPrefixChangeValue = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps = append(data.Ipv4Vrrps, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "vrrpIpv6"); value.Exists() {
+ data.Ipv6Vrrps = make([]ServiceLANVPNInterfaceSVIIpv6Vrrps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceLANVPNInterfaceSVIIpv6Vrrps{}
+ item.GroupId = types.Int64Null()
+ item.GroupIdVariable = types.StringNull()
+ if t := v.Get("groupId.optionType"); t.Exists() {
+ va := v.Get("groupId.value")
+ if t.String() == "variable" {
+ item.GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.GroupId = types.Int64Value(va.Int())
+ }
+ }
+ item.Priority = types.Int64Null()
+ item.PriorityVariable = types.StringNull()
+ if t := v.Get("priority.optionType"); t.Exists() {
+ va := v.Get("priority.value")
+ if t.String() == "variable" {
+ item.PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Priority = types.Int64Value(va.Int())
+ }
+ }
+ item.Timer = types.Int64Null()
+ item.TimerVariable = types.StringNull()
+ if t := v.Get("timer.optionType"); t.Exists() {
+ va := v.Get("timer.value")
+ if t.String() == "variable" {
+ item.TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Timer = types.Int64Value(va.Int())
+ }
+ }
+ item.TrackOmp = types.BoolNull()
+ item.TrackOmpVariable = types.StringNull()
+ if t := v.Get("trackOmp.optionType"); t.Exists() {
+ va := v.Get("trackOmp.value")
+ if t.String() == "variable" {
+ item.TrackOmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ item.TrackPrefixList = types.StringNull()
+ item.TrackPrefixListVariable = types.StringNull()
+ if t := v.Get("trackPrefixList.optionType"); t.Exists() {
+ va := v.Get("trackPrefixList.value")
+ if t.String() == "variable" {
+ item.TrackPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TrackPrefixList = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("ipv6"); cValue.Exists() {
+ item.Addresses = make([]ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses{}
+ cItem.LinkLocalAddress = types.StringNull()
+ cItem.LinkLocalAddressVariable = types.StringNull()
+ if t := cv.Get("ipv6LinkLocal.optionType"); t.Exists() {
+ va := cv.Get("ipv6LinkLocal.value")
+ if t.String() == "variable" {
+ cItem.LinkLocalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LinkLocalAddress = types.StringValue(va.String())
+ }
+ }
+ cItem.GlobalAddress = types.StringNull()
+ cItem.GlobalAddressVariable = types.StringNull()
+ if t := cv.Get("prefix.optionType"); t.Exists() {
+ va := cv.Get("prefix.value")
+ if t.String() == "variable" {
+ cItem.GlobalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.GlobalAddress = types.StringValue(va.String())
+ }
+ }
+ item.Addresses = append(item.Addresses, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("ipv6Secondary"); cValue.Exists() {
+ item.SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses{}
+ cItem.Prefix = types.StringNull()
+ cItem.PrefixVariable = types.StringNull()
+ if t := cv.Get("prefix.optionType"); t.Exists() {
+ va := cv.Get("prefix.value")
+ if t.String() == "variable" {
+ cItem.PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Prefix = types.StringValue(va.String())
+ }
+ }
+ item.SecondaryAddresses = append(item.SecondaryAddresses, cItem)
+ return true
+ })
+ }
+ data.Ipv6Vrrps = append(data.Ipv6Vrrps, item)
+ return true
+ })
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+ data.EnableDhcpv6Variable = types.StringNull()
+ if t := res.Get(path + "dhcpClientV6.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpClientV6.value")
+ if t.String() == "variable" {
+ data.EnableDhcpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceLANVPNInterfaceSVI) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "ifMtu.optionType"); t.Exists() {
+ va := res.Get(path + "ifMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "ipv4.addressV4.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "ipv4.addressV4.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "ipv4.addressV4.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "ipv4.addressV4.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv4SecondaryAddresses {
+ keys := [...]string{"ipAddress"}
+ keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv4.secondaryAddressV4").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses[i].Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].Ipv4SubnetMaskVariable = types.StringNull()
+ if t := r.Get("subnetMask.optionType"); t.Exists() {
+ va := r.Get("subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4DhcpHelpers = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelpersVariable = types.StringNull()
+ if t := res.Get(path + "ipv4.dhcpHelperV4.optionType"); t.Exists() {
+ va := res.Get(path + "ipv4.dhcpHelperV4.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelpersVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelpers = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "ipv6.addressV6.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6.addressV6.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv6SecondaryAddresses {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6SecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6SecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6.secondaryAddressV6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6SecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6SecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv6DhcpHelpers {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6DhcpHelpers[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6DhcpHelpers[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6.dhcpHelperV6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6DhcpHelpers[i].Address = types.StringNull()
+ data.Ipv6DhcpHelpers[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6DhcpHelpers[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6DhcpHelpers[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6DhcpHelpers[i].Vpn = types.Int64Null()
+ data.Ipv6DhcpHelpers[i].VpnVariable = types.StringNull()
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "variable" {
+ data.Ipv6DhcpHelpers[i].VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6DhcpHelpers[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.Arps {
+ keys := [...]string{"ipAddress", "macAddress"}
+ keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "arp").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Arps[i].IpAddress = types.StringNull()
+ data.Arps[i].IpAddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps[i].MacAddress = types.StringNull()
+ data.Arps[i].MacAddressVariable = types.StringNull()
+ if t := r.Get("macAddress.optionType"); t.Exists() {
+ va := r.Get("macAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].MacAddress = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv4Vrrps {
+ keys := [...]string{"group_id"}
+ keyValues := [...]string{strconv.FormatInt(data.Ipv4Vrrps[i].GroupId.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Ipv4Vrrps[i].GroupIdVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "vrrp").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Vrrps[i].GroupId = types.Int64Null()
+ data.Ipv4Vrrps[i].GroupIdVariable = types.StringNull()
+ if t := r.Get("group_id.optionType"); t.Exists() {
+ va := r.Get("group_id.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].GroupId = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps[i].Priority = types.Int64Null()
+ data.Ipv4Vrrps[i].PriorityVariable = types.StringNull()
+ if t := r.Get("priority.optionType"); t.Exists() {
+ va := r.Get("priority.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].Priority = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps[i].Timer = types.Int64Null()
+ data.Ipv4Vrrps[i].TimerVariable = types.StringNull()
+ if t := r.Get("timer.optionType"); t.Exists() {
+ va := r.Get("timer.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].Timer = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Vrrps[i].TrackOmp = types.BoolNull()
+ data.Ipv4Vrrps[i].TrackOmpVariable = types.StringNull()
+ if t := r.Get("trackOmp.optionType"); t.Exists() {
+ va := r.Get("trackOmp.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].TrackOmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Vrrps[i].PrefixList = types.StringNull()
+ data.Ipv4Vrrps[i].PrefixListVariable = types.StringNull()
+ if t := r.Get("prefixList.optionType"); t.Exists() {
+ va := r.Get("prefixList.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].PrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].PrefixList = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Vrrps[i].Address = types.StringNull()
+ data.Ipv4Vrrps[i].AddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].Address = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv4Vrrps[i].SecondaryAddresses {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ipAddressSecondary").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringNull()
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolNull()
+
+ if t := r.Get("tlocPrefChange.optionType"); t.Exists() {
+ va := r.Get("tlocPrefChange.value")
+ if t.String() == "global" {
+ data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Vrrps[i].TlocPrefixChangeValue = types.Int64Null()
+ data.Ipv4Vrrps[i].TlocPrefixChangeValueVariable = types.StringNull()
+ if t := r.Get("tlocPrefChangeValue.optionType"); t.Exists() {
+ va := r.Get("tlocPrefChangeValue.value")
+ if t.String() == "variable" {
+ data.Ipv4Vrrps[i].TlocPrefixChangeValueVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Vrrps[i].TlocPrefixChangeValue = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.Ipv6Vrrps {
+ keys := [...]string{"groupId"}
+ keyValues := [...]string{strconv.FormatInt(data.Ipv6Vrrps[i].GroupId.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Ipv6Vrrps[i].GroupIdVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "vrrpIpv6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Vrrps[i].GroupId = types.Int64Null()
+ data.Ipv6Vrrps[i].GroupIdVariable = types.StringNull()
+ if t := r.Get("groupId.optionType"); t.Exists() {
+ va := r.Get("groupId.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].GroupIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].GroupId = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Vrrps[i].Priority = types.Int64Null()
+ data.Ipv6Vrrps[i].PriorityVariable = types.StringNull()
+ if t := r.Get("priority.optionType"); t.Exists() {
+ va := r.Get("priority.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Priority = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Vrrps[i].Timer = types.Int64Null()
+ data.Ipv6Vrrps[i].TimerVariable = types.StringNull()
+ if t := r.Get("timer.optionType"); t.Exists() {
+ va := r.Get("timer.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].TimerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Timer = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Vrrps[i].TrackOmp = types.BoolNull()
+ data.Ipv6Vrrps[i].TrackOmpVariable = types.StringNull()
+ if t := r.Get("trackOmp.optionType"); t.Exists() {
+ va := r.Get("trackOmp.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].TrackOmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Vrrps[i].TrackPrefixList = types.StringNull()
+ data.Ipv6Vrrps[i].TrackPrefixListVariable = types.StringNull()
+ if t := r.Get("trackPrefixList.optionType"); t.Exists() {
+ va := r.Get("trackPrefixList.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].TrackPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].TrackPrefixList = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv6Vrrps[i].Addresses {
+ keys := [...]string{"ipv6LinkLocal"}
+ keyValues := [...]string{data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ipv6").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddress = types.StringNull()
+ data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddressVariable = types.StringNull()
+ if t := cr.Get("ipv6LinkLocal.optionType"); t.Exists() {
+ va := cr.Get("ipv6LinkLocal.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Vrrps[i].Addresses[ci].GlobalAddress = types.StringNull()
+ data.Ipv6Vrrps[i].Addresses[ci].GlobalAddressVariable = types.StringNull()
+ if t := cr.Get("prefix.optionType"); t.Exists() {
+ va := cr.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].Addresses[ci].GlobalAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].Addresses[ci].GlobalAddress = types.StringValue(va.String())
+ }
+ }
+ }
+ for ci := range data.Ipv6Vrrps[i].SecondaryAddresses {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6Vrrps[i].SecondaryAddresses[ci].Prefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Vrrps[i].SecondaryAddresses[ci].PrefixVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ipv6Secondary").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Vrrps[i].SecondaryAddresses[ci].Prefix = types.StringNull()
+ data.Ipv6Vrrps[i].SecondaryAddresses[ci].PrefixVariable = types.StringNull()
+ if t := cr.Get("prefix.optionType"); t.Exists() {
+ va := cr.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6Vrrps[i].SecondaryAddresses[ci].PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Vrrps[i].SecondaryAddresses[ci].Prefix = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+ data.EnableDhcpv6Variable = types.StringNull()
+ if t := res.Get(path + "dhcpClientV6.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpClientV6.value")
+ if t.String() == "variable" {
+ data.EnableDhcpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceLANVPNInterfaceSVI) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.ServiceLanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtu.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtuVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4SecondaryAddresses) > 0 {
+ return false
+ }
+ if !data.Ipv4DhcpHelpers.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpHelpersVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6Address.IsNull() {
+ return false
+ }
+ if !data.Ipv6AddressVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv6SecondaryAddresses) > 0 {
+ return false
+ }
+ if len(data.Ipv6DhcpHelpers) > 0 {
+ return false
+ }
+ if len(data.Arps) > 0 {
+ return false
+ }
+ if len(data.Ipv4Vrrps) > 0 {
+ return false
+ }
+ if len(data.Ipv6Vrrps) > 0 {
+ return false
+ }
+ if !data.EnableDhcpv6.IsNull() {
+ return false
+ }
+ if !data.EnableDhcpv6Variable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.ArpTimeout.IsNull() {
+ return false
+ }
+ if !data.ArpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcast.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ return false
+ }
+ if !data.IcmpRedirectDisable.IsNull() {
+ return false
+ }
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go
deleted file mode 100644
index 8b5f8e8dd..000000000
--- a/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go
+++ /dev/null
@@ -1,2022 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type ServiceLANVPNInterfaceSVI 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"`
- ServiceLanVpnProfileParcelId types.String `tfsdk:"service_lan_vpn_profile_parcel_id"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
- InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- Ipv4SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
- Ipv4DhcpHelpers types.Set `tfsdk:"ipv4_dhcp_helpers"`
- Ipv4DhcpHelpersVariable types.String `tfsdk:"ipv4_dhcp_helpers_variable"`
- Ipv6Address types.String `tfsdk:"ipv6_address"`
- Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
- Ipv6SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses `tfsdk:"ipv6_secondary_addresses"`
- Ipv6DhcpHelpers []ServiceLANVPNInterfaceSVIIpv6DhcpHelpers `tfsdk:"ipv6_dhcp_helpers"`
- Arps []ServiceLANVPNInterfaceSVIArps `tfsdk:"arps"`
- Ipv4Vrrps []ServiceLANVPNInterfaceSVIIpv4Vrrps `tfsdk:"ipv4_vrrps"`
- Ipv6Vrrps []ServiceLANVPNInterfaceSVIIpv6Vrrps `tfsdk:"ipv6_vrrps"`
- EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
- EnableDhcpv6Variable types.String `tfsdk:"enable_dhcpv6_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
- ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
- IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
- IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
- IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
- IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
-}
-
-type ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
-}
-
-type ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
-}
-
-type ServiceLANVPNInterfaceSVIIpv6DhcpHelpers struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- Vpn types.Int64 `tfsdk:"vpn"`
- VpnVariable types.String `tfsdk:"vpn_variable"`
-}
-
-type ServiceLANVPNInterfaceSVIArps struct {
- IpAddress types.String `tfsdk:"ip_address"`
- IpAddressVariable types.String `tfsdk:"ip_address_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
-}
-
-type ServiceLANVPNInterfaceSVIIpv4Vrrps struct {
- GroupId types.Int64 `tfsdk:"group_id"`
- GroupIdVariable types.String `tfsdk:"group_id_variable"`
- Priority types.Int64 `tfsdk:"priority"`
- PriorityVariable types.String `tfsdk:"priority_variable"`
- Timer types.Int64 `tfsdk:"timer"`
- TimerVariable types.String `tfsdk:"timer_variable"`
- TrackOmp types.Bool `tfsdk:"track_omp"`
- TrackOmpVariable types.String `tfsdk:"track_omp_variable"`
- PrefixList types.String `tfsdk:"prefix_list"`
- PrefixListVariable types.String `tfsdk:"prefix_list_variable"`
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses `tfsdk:"secondary_addresses"`
- TlocPrefixChange types.Bool `tfsdk:"tloc_prefix_change"`
- TlocPrefixChangeValue types.Int64 `tfsdk:"tloc_prefix_change_value"`
- TlocPrefixChangeValueVariable types.String `tfsdk:"tloc_prefix_change_value_variable"`
-}
-
-type ServiceLANVPNInterfaceSVIIpv6Vrrps struct {
- GroupId types.Int64 `tfsdk:"group_id"`
- GroupIdVariable types.String `tfsdk:"group_id_variable"`
- Priority types.Int64 `tfsdk:"priority"`
- PriorityVariable types.String `tfsdk:"priority_variable"`
- Timer types.Int64 `tfsdk:"timer"`
- TimerVariable types.String `tfsdk:"timer_variable"`
- TrackOmp types.Bool `tfsdk:"track_omp"`
- TrackOmpVariable types.String `tfsdk:"track_omp_variable"`
- TrackPrefixList types.String `tfsdk:"track_prefix_list"`
- TrackPrefixListVariable types.String `tfsdk:"track_prefix_list_variable"`
- Addresses []ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses `tfsdk:"addresses"`
- SecondaryAddresses []ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses `tfsdk:"secondary_addresses"`
-}
-
-type ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
-}
-
-type ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses struct {
- LinkLocalAddress types.String `tfsdk:"link_local_address"`
- LinkLocalAddressVariable types.String `tfsdk:"link_local_address_variable"`
- GlobalAddress types.String `tfsdk:"global_address"`
- GlobalAddressVariable types.String `tfsdk:"global_address_variable"`
-}
-type ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses struct {
- Prefix types.String `tfsdk:"prefix"`
- PrefixVariable types.String `tfsdk:"prefix_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data ServiceLANVPNInterfaceSVI) getModel() string {
- return "service_lan_vpn_interface_svi"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data ServiceLANVPNInterfaceSVI) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/svi", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.ServiceLanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.InterfaceMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ifMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtuVariable.ValueString())
- }
- } else if data.InterfaceMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ifMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"ifMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ifMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtu.ValueInt64())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"ipMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "global")
- body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "global")
- body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv4.secondaryAddressV4", []interface{}{})
- for _, item := range data.Ipv4SecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
- }
- }
-
- if !item.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !item.Ipv4SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMask.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv4.secondaryAddressV4.-1", itemBody)
- }
- }
-
- if !data.Ipv4DhcpHelpersVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", data.Ipv4DhcpHelpersVariable.ValueString())
- }
- } else if data.Ipv4DhcpHelpers.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "global")
- var values []string
- data.Ipv4DhcpHelpers.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", values)
- }
- }
-
- if !data.Ipv6AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6AddressVariable.ValueString())
- }
- } else if data.Ipv6Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "global")
- body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6Address.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6.secondaryAddressV6", []interface{}{})
- for _, item := range data.Ipv6SecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6.secondaryAddressV6.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6.dhcpHelperV6", []interface{}{})
- for _, item := range data.Ipv6DhcpHelpers {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
-
- if !item.VpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
- }
- } else if item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6.dhcpHelperV6.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"arp", []interface{}{})
- for _, item := range data.Arps {
- itemBody := ""
-
- if !item.IpAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
- }
- } else if !item.IpAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
- }
- }
-
- if !item.MacAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
- }
- } else if !item.MacAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"vrrp", []interface{}{})
- for _, item := range data.Ipv4Vrrps {
- itemBody := ""
-
- if !item.GroupIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString())
- }
- } else if !item.GroupId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64())
- }
- }
-
- if !item.PriorityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
- }
- } else if item.Priority.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
- }
- }
-
- if !item.TimerVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
- }
- } else if item.Timer.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
- }
- }
-
- if !item.TrackOmpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString())
- }
- } else if item.TrackOmp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
- }
- }
-
- if !item.PrefixListVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixListVariable.ValueString())
- }
- } else if item.PrefixList.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixList.ValueString())
- }
- }
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{})
- for _, childItem := range item.SecondaryAddresses {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody)
- }
- }
- if item.TlocPrefixChange.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool())
- }
- }
-
- if !item.TlocPrefixChangeValueVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValueVariable.ValueString())
- }
- } else if !item.TlocPrefixChangeValue.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValue.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{})
- for _, item := range data.Ipv6Vrrps {
- itemBody := ""
-
- if !item.GroupIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString())
- }
- } else if !item.GroupId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64())
- }
- }
-
- if !item.PriorityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
- }
- } else if item.Priority.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "priority.value", 100)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64())
- }
- }
-
- if !item.TimerVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString())
- }
- } else if item.Timer.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "timer.value", 1000)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64())
- }
- }
-
- if !item.TrackOmpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString())
- }
- } else if item.TrackOmp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool())
- }
- }
-
- if !item.TrackPrefixListVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixListVariable.ValueString())
- }
- } else if item.TrackPrefixList.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixList.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{})
- for _, childItem := range item.Addresses {
- itemChildBody := ""
-
- if !childItem.LinkLocalAddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString())
- }
- } else if !childItem.LinkLocalAddress.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString())
- }
- }
-
- if !childItem.GlobalAddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString())
- }
- } else if childItem.GlobalAddress.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default")
-
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody)
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipv6Secondary", []interface{}{})
- for _, childItem := range item.SecondaryAddresses {
- itemChildBody := ""
-
- if !childItem.PrefixVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString())
- }
- } else if !childItem.Prefix.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "ipv6Secondary.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody)
- }
- }
-
- if !data.EnableDhcpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "variable")
- body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6Variable.ValueString())
- }
- } else if data.EnableDhcpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "default")
- body, _ = sjson.Set(body, path+"dhcpClientV6.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "global")
- body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6.ValueBool())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.ArpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
- }
- } else if data.ArpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
- }
- }
-
- if !data.IpDirectedBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
- }
- } else if data.IpDirectedBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
- }
- }
-
- if !data.IcmpRedirectDisableVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
- }
- } else if data.IcmpRedirectDisable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *ServiceLANVPNInterfaceSVI) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "ifMtu.optionType"); t.Exists() {
- va := res.Get(path + "ifMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "ipv4.addressV4.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "ipv4.addressV4.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "ipv4.addressV4.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "ipv4.addressV4.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "ipv4.secondaryAddressV4"); value.Exists() {
- data.Ipv4SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceSVIIpv4SecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.Ipv4SubnetMask = types.StringNull()
- item.Ipv4SubnetMaskVariable = types.StringNull()
- if t := v.Get("subnetMask.optionType"); t.Exists() {
- va := v.Get("subnetMask.value")
- if t.String() == "variable" {
- item.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
- return true
- })
- }
- data.Ipv4DhcpHelpers = types.SetNull(types.StringType)
- data.Ipv4DhcpHelpersVariable = types.StringNull()
- if t := res.Get(path + "ipv4.dhcpHelperV4.optionType"); t.Exists() {
- va := res.Get(path + "ipv4.dhcpHelperV4.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelpersVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelpers = helpers.GetStringSet(va.Array())
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "ipv6.addressV6.optionType"); t.Exists() {
- va := res.Get(path + "ipv6.addressV6.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "ipv6.secondaryAddressV6"); value.Exists() {
- data.Ipv6SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceSVIIpv6SecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- data.Ipv6SecondaryAddresses = append(data.Ipv6SecondaryAddresses, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6.dhcpHelperV6"); value.Exists() {
- data.Ipv6DhcpHelpers = make([]ServiceLANVPNInterfaceSVIIpv6DhcpHelpers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceSVIIpv6DhcpHelpers{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.Vpn = types.Int64Null()
- item.VpnVariable = types.StringNull()
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "variable" {
- item.VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- data.Ipv6DhcpHelpers = append(data.Ipv6DhcpHelpers, item)
- return true
- })
- }
- if value := res.Get(path + "arp"); value.Exists() {
- data.Arps = make([]ServiceLANVPNInterfaceSVIArps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceSVIArps{}
- item.IpAddress = types.StringNull()
- item.IpAddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.IpAddress = types.StringValue(va.String())
- }
- }
- item.MacAddress = types.StringNull()
- item.MacAddressVariable = types.StringNull()
- if t := v.Get("macAddress.optionType"); t.Exists() {
- va := v.Get("macAddress.value")
- if t.String() == "variable" {
- item.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.MacAddress = types.StringValue(va.String())
- }
- }
- data.Arps = append(data.Arps, item)
- return true
- })
- }
- if value := res.Get(path + "vrrp"); value.Exists() {
- data.Ipv4Vrrps = make([]ServiceLANVPNInterfaceSVIIpv4Vrrps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceSVIIpv4Vrrps{}
- item.GroupId = types.Int64Null()
- item.GroupIdVariable = types.StringNull()
- if t := v.Get("group_id.optionType"); t.Exists() {
- va := v.Get("group_id.value")
- if t.String() == "variable" {
- item.GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.GroupId = types.Int64Value(va.Int())
- }
- }
- item.Priority = types.Int64Null()
- item.PriorityVariable = types.StringNull()
- if t := v.Get("priority.optionType"); t.Exists() {
- va := v.Get("priority.value")
- if t.String() == "variable" {
- item.PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Priority = types.Int64Value(va.Int())
- }
- }
- item.Timer = types.Int64Null()
- item.TimerVariable = types.StringNull()
- if t := v.Get("timer.optionType"); t.Exists() {
- va := v.Get("timer.value")
- if t.String() == "variable" {
- item.TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Timer = types.Int64Value(va.Int())
- }
- }
- item.TrackOmp = types.BoolNull()
- item.TrackOmpVariable = types.StringNull()
- if t := v.Get("trackOmp.optionType"); t.Exists() {
- va := v.Get("trackOmp.value")
- if t.String() == "variable" {
- item.TrackOmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TrackOmp = types.BoolValue(va.Bool())
- }
- }
- item.PrefixList = types.StringNull()
- item.PrefixListVariable = types.StringNull()
- if t := v.Get("prefixList.optionType"); t.Exists() {
- va := v.Get("prefixList.value")
- if t.String() == "variable" {
- item.PrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.PrefixList = types.StringValue(va.String())
- }
- }
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("ipAddressSecondary"); cValue.Exists() {
- item.SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNInterfaceSVIIpv4VrrpsSecondaryAddresses{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- item.SecondaryAddresses = append(item.SecondaryAddresses, cItem)
- return true
- })
- }
- item.TlocPrefixChange = types.BoolNull()
-
- if t := v.Get("tlocPrefChange.optionType"); t.Exists() {
- va := v.Get("tlocPrefChange.value")
- if t.String() == "global" {
- item.TlocPrefixChange = types.BoolValue(va.Bool())
- }
- }
- item.TlocPrefixChangeValue = types.Int64Null()
- item.TlocPrefixChangeValueVariable = types.StringNull()
- if t := v.Get("tlocPrefChangeValue.optionType"); t.Exists() {
- va := v.Get("tlocPrefChangeValue.value")
- if t.String() == "variable" {
- item.TlocPrefixChangeValueVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlocPrefixChangeValue = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps = append(data.Ipv4Vrrps, item)
- return true
- })
- }
- if value := res.Get(path + "vrrpIpv6"); value.Exists() {
- data.Ipv6Vrrps = make([]ServiceLANVPNInterfaceSVIIpv6Vrrps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNInterfaceSVIIpv6Vrrps{}
- item.GroupId = types.Int64Null()
- item.GroupIdVariable = types.StringNull()
- if t := v.Get("groupId.optionType"); t.Exists() {
- va := v.Get("groupId.value")
- if t.String() == "variable" {
- item.GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.GroupId = types.Int64Value(va.Int())
- }
- }
- item.Priority = types.Int64Null()
- item.PriorityVariable = types.StringNull()
- if t := v.Get("priority.optionType"); t.Exists() {
- va := v.Get("priority.value")
- if t.String() == "variable" {
- item.PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Priority = types.Int64Value(va.Int())
- }
- }
- item.Timer = types.Int64Null()
- item.TimerVariable = types.StringNull()
- if t := v.Get("timer.optionType"); t.Exists() {
- va := v.Get("timer.value")
- if t.String() == "variable" {
- item.TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Timer = types.Int64Value(va.Int())
- }
- }
- item.TrackOmp = types.BoolNull()
- item.TrackOmpVariable = types.StringNull()
- if t := v.Get("trackOmp.optionType"); t.Exists() {
- va := v.Get("trackOmp.value")
- if t.String() == "variable" {
- item.TrackOmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TrackOmp = types.BoolValue(va.Bool())
- }
- }
- item.TrackPrefixList = types.StringNull()
- item.TrackPrefixListVariable = types.StringNull()
- if t := v.Get("trackPrefixList.optionType"); t.Exists() {
- va := v.Get("trackPrefixList.value")
- if t.String() == "variable" {
- item.TrackPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TrackPrefixList = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("ipv6"); cValue.Exists() {
- item.Addresses = make([]ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNInterfaceSVIIpv6VrrpsAddresses{}
- cItem.LinkLocalAddress = types.StringNull()
- cItem.LinkLocalAddressVariable = types.StringNull()
- if t := cv.Get("ipv6LinkLocal.optionType"); t.Exists() {
- va := cv.Get("ipv6LinkLocal.value")
- if t.String() == "variable" {
- cItem.LinkLocalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.LinkLocalAddress = types.StringValue(va.String())
- }
- }
- cItem.GlobalAddress = types.StringNull()
- cItem.GlobalAddressVariable = types.StringNull()
- if t := cv.Get("prefix.optionType"); t.Exists() {
- va := cv.Get("prefix.value")
- if t.String() == "variable" {
- cItem.GlobalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.GlobalAddress = types.StringValue(va.String())
- }
- }
- item.Addresses = append(item.Addresses, cItem)
- return true
- })
- }
- if cValue := v.Get("ipv6Secondary"); cValue.Exists() {
- item.SecondaryAddresses = make([]ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNInterfaceSVIIpv6VrrpsSecondaryAddresses{}
- cItem.Prefix = types.StringNull()
- cItem.PrefixVariable = types.StringNull()
- if t := cv.Get("prefix.optionType"); t.Exists() {
- va := cv.Get("prefix.value")
- if t.String() == "variable" {
- cItem.PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Prefix = types.StringValue(va.String())
- }
- }
- item.SecondaryAddresses = append(item.SecondaryAddresses, cItem)
- return true
- })
- }
- data.Ipv6Vrrps = append(data.Ipv6Vrrps, item)
- return true
- })
- }
- data.EnableDhcpv6 = types.BoolNull()
- data.EnableDhcpv6Variable = types.StringNull()
- if t := res.Get(path + "dhcpClientV6.optionType"); t.Exists() {
- va := res.Get(path + "dhcpClientV6.value")
- if t.String() == "variable" {
- data.EnableDhcpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *ServiceLANVPNInterfaceSVI) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "ifMtu.optionType"); t.Exists() {
- va := res.Get(path + "ifMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "ipv4.addressV4.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "ipv4.addressV4.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "ipv4.addressV4.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "ipv4.addressV4.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv4SecondaryAddresses {
- keys := [...]string{"ipAddress"}
- keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv4.secondaryAddressV4").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses[i].Ipv4SubnetMask = types.StringNull()
- data.Ipv4SecondaryAddresses[i].Ipv4SubnetMaskVariable = types.StringNull()
- if t := r.Get("subnetMask.optionType"); t.Exists() {
- va := r.Get("subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4DhcpHelpers = types.SetNull(types.StringType)
- data.Ipv4DhcpHelpersVariable = types.StringNull()
- if t := res.Get(path + "ipv4.dhcpHelperV4.optionType"); t.Exists() {
- va := res.Get(path + "ipv4.dhcpHelperV4.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelpersVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelpers = helpers.GetStringSet(va.Array())
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "ipv6.addressV6.optionType"); t.Exists() {
- va := res.Get(path + "ipv6.addressV6.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv6SecondaryAddresses {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6SecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6SecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6.secondaryAddressV6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6SecondaryAddresses[i].Address = types.StringNull()
- data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6SecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv6DhcpHelpers {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6DhcpHelpers[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6DhcpHelpers[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6.dhcpHelperV6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6DhcpHelpers[i].Address = types.StringNull()
- data.Ipv6DhcpHelpers[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6DhcpHelpers[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6DhcpHelpers[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv6DhcpHelpers[i].Vpn = types.Int64Null()
- data.Ipv6DhcpHelpers[i].VpnVariable = types.StringNull()
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "variable" {
- data.Ipv6DhcpHelpers[i].VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6DhcpHelpers[i].Vpn = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.Arps {
- keys := [...]string{"ipAddress", "macAddress"}
- keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
- keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "arp").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Arps[i].IpAddress = types.StringNull()
- data.Arps[i].IpAddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Arps[i].IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].IpAddress = types.StringValue(va.String())
- }
- }
- data.Arps[i].MacAddress = types.StringNull()
- data.Arps[i].MacAddressVariable = types.StringNull()
- if t := r.Get("macAddress.optionType"); t.Exists() {
- va := r.Get("macAddress.value")
- if t.String() == "variable" {
- data.Arps[i].MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].MacAddress = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv4Vrrps {
- keys := [...]string{"group_id"}
- keyValues := [...]string{strconv.FormatInt(data.Ipv4Vrrps[i].GroupId.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.Ipv4Vrrps[i].GroupIdVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "vrrp").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4Vrrps[i].GroupId = types.Int64Null()
- data.Ipv4Vrrps[i].GroupIdVariable = types.StringNull()
- if t := r.Get("group_id.optionType"); t.Exists() {
- va := r.Get("group_id.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].GroupId = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps[i].Priority = types.Int64Null()
- data.Ipv4Vrrps[i].PriorityVariable = types.StringNull()
- if t := r.Get("priority.optionType"); t.Exists() {
- va := r.Get("priority.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].Priority = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps[i].Timer = types.Int64Null()
- data.Ipv4Vrrps[i].TimerVariable = types.StringNull()
- if t := r.Get("timer.optionType"); t.Exists() {
- va := r.Get("timer.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].Timer = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Vrrps[i].TrackOmp = types.BoolNull()
- data.Ipv4Vrrps[i].TrackOmpVariable = types.StringNull()
- if t := r.Get("trackOmp.optionType"); t.Exists() {
- va := r.Get("trackOmp.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].TrackOmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Vrrps[i].PrefixList = types.StringNull()
- data.Ipv4Vrrps[i].PrefixListVariable = types.StringNull()
- if t := r.Get("prefixList.optionType"); t.Exists() {
- va := r.Get("prefixList.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].PrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].PrefixList = types.StringValue(va.String())
- }
- }
- data.Ipv4Vrrps[i].Address = types.StringNull()
- data.Ipv4Vrrps[i].AddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].Address = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv4Vrrps[i].SecondaryAddresses {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("ipAddressSecondary").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringNull()
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].SecondaryAddresses[ci].Address = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolNull()
-
- if t := r.Get("tlocPrefChange.optionType"); t.Exists() {
- va := r.Get("tlocPrefChange.value")
- if t.String() == "global" {
- data.Ipv4Vrrps[i].TlocPrefixChange = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Vrrps[i].TlocPrefixChangeValue = types.Int64Null()
- data.Ipv4Vrrps[i].TlocPrefixChangeValueVariable = types.StringNull()
- if t := r.Get("tlocPrefChangeValue.optionType"); t.Exists() {
- va := r.Get("tlocPrefChangeValue.value")
- if t.String() == "variable" {
- data.Ipv4Vrrps[i].TlocPrefixChangeValueVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Vrrps[i].TlocPrefixChangeValue = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.Ipv6Vrrps {
- keys := [...]string{"groupId"}
- keyValues := [...]string{strconv.FormatInt(data.Ipv6Vrrps[i].GroupId.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.Ipv6Vrrps[i].GroupIdVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "vrrpIpv6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6Vrrps[i].GroupId = types.Int64Null()
- data.Ipv6Vrrps[i].GroupIdVariable = types.StringNull()
- if t := r.Get("groupId.optionType"); t.Exists() {
- va := r.Get("groupId.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].GroupIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].GroupId = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Vrrps[i].Priority = types.Int64Null()
- data.Ipv6Vrrps[i].PriorityVariable = types.StringNull()
- if t := r.Get("priority.optionType"); t.Exists() {
- va := r.Get("priority.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Priority = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Vrrps[i].Timer = types.Int64Null()
- data.Ipv6Vrrps[i].TimerVariable = types.StringNull()
- if t := r.Get("timer.optionType"); t.Exists() {
- va := r.Get("timer.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].TimerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Timer = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Vrrps[i].TrackOmp = types.BoolNull()
- data.Ipv6Vrrps[i].TrackOmpVariable = types.StringNull()
- if t := r.Get("trackOmp.optionType"); t.Exists() {
- va := r.Get("trackOmp.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].TrackOmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].TrackOmp = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Vrrps[i].TrackPrefixList = types.StringNull()
- data.Ipv6Vrrps[i].TrackPrefixListVariable = types.StringNull()
- if t := r.Get("trackPrefixList.optionType"); t.Exists() {
- va := r.Get("trackPrefixList.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].TrackPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].TrackPrefixList = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv6Vrrps[i].Addresses {
- keys := [...]string{"ipv6LinkLocal"}
- keyValues := [...]string{data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddress.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("ipv6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddress = types.StringNull()
- data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddressVariable = types.StringNull()
- if t := cr.Get("ipv6LinkLocal.optionType"); t.Exists() {
- va := cr.Get("ipv6LinkLocal.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Addresses[ci].LinkLocalAddress = types.StringValue(va.String())
- }
- }
- data.Ipv6Vrrps[i].Addresses[ci].GlobalAddress = types.StringNull()
- data.Ipv6Vrrps[i].Addresses[ci].GlobalAddressVariable = types.StringNull()
- if t := cr.Get("prefix.optionType"); t.Exists() {
- va := cr.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].Addresses[ci].GlobalAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].Addresses[ci].GlobalAddress = types.StringValue(va.String())
- }
- }
- }
- for ci := range data.Ipv6Vrrps[i].SecondaryAddresses {
- keys := [...]string{"prefix"}
- keyValues := [...]string{data.Ipv6Vrrps[i].SecondaryAddresses[ci].Prefix.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6Vrrps[i].SecondaryAddresses[ci].PrefixVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("ipv6Secondary").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv6Vrrps[i].SecondaryAddresses[ci].Prefix = types.StringNull()
- data.Ipv6Vrrps[i].SecondaryAddresses[ci].PrefixVariable = types.StringNull()
- if t := cr.Get("prefix.optionType"); t.Exists() {
- va := cr.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6Vrrps[i].SecondaryAddresses[ci].PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Vrrps[i].SecondaryAddresses[ci].Prefix = types.StringValue(va.String())
- }
- }
- }
- }
- data.EnableDhcpv6 = types.BoolNull()
- data.EnableDhcpv6Variable = types.StringNull()
- if t := res.Get(path + "dhcpClientV6.optionType"); t.Exists() {
- va := res.Get(path + "dhcpClientV6.value")
- if t.String() == "variable" {
- data.EnableDhcpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *ServiceLANVPNInterfaceSVI) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.ServiceLanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.InterfaceMtu.IsNull() {
- return false
- }
- if !data.InterfaceMtuVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if len(data.Ipv4SecondaryAddresses) > 0 {
- return false
- }
- if !data.Ipv4DhcpHelpers.IsNull() {
- return false
- }
- if !data.Ipv4DhcpHelpersVariable.IsNull() {
- return false
- }
- if !data.Ipv6Address.IsNull() {
- return false
- }
- if !data.Ipv6AddressVariable.IsNull() {
- return false
- }
- if len(data.Ipv6SecondaryAddresses) > 0 {
- return false
- }
- if len(data.Ipv6DhcpHelpers) > 0 {
- return false
- }
- if len(data.Arps) > 0 {
- return false
- }
- if len(data.Ipv4Vrrps) > 0 {
- return false
- }
- if len(data.Ipv6Vrrps) > 0 {
- return false
- }
- if !data.EnableDhcpv6.IsNull() {
- return false
- }
- if !data.EnableDhcpv6Variable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.ArpTimeout.IsNull() {
- return false
- }
- if !data.ArpTimeoutVariable.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcast.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcastVariable.IsNull() {
- return false
- }
- if !data.IcmpRedirectDisable.IsNull() {
- return false
- }
- if !data.IcmpRedirectDisableVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go
deleted file mode 100644
index 86cc3e383..000000000
--- a/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go
+++ /dev/null
@@ -1,4446 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type ServiceLANVPN 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"`
- Vpn types.Int64 `tfsdk:"vpn"`
- VpnVariable types.String `tfsdk:"vpn_variable"`
- ConfigDescription types.String `tfsdk:"config_description"`
- ConfigDescriptionVariable types.String `tfsdk:"config_description_variable"`
- OmpAdminDistanceIpv4 types.Int64 `tfsdk:"omp_admin_distance_ipv4"`
- OmpAdminDistanceIpv4Variable types.String `tfsdk:"omp_admin_distance_ipv4_variable"`
- OmpAdminDistanceIpv6 types.Int64 `tfsdk:"omp_admin_distance_ipv6"`
- OmpAdminDistanceIpv6Variable types.String `tfsdk:"omp_admin_distance_ipv6_variable"`
- EnableSdwanRemoteAccess types.Bool `tfsdk:"enable_sdwan_remote_access"`
- PrimaryDnsAddressIpv4 types.String `tfsdk:"primary_dns_address_ipv4"`
- PrimaryDnsAddressIpv4Variable types.String `tfsdk:"primary_dns_address_ipv4_variable"`
- SecondaryDnsAddressIpv4 types.String `tfsdk:"secondary_dns_address_ipv4"`
- SecondaryDnsAddressIpv4Variable types.String `tfsdk:"secondary_dns_address_ipv4_variable"`
- PrimaryDnsAddressIpv6 types.String `tfsdk:"primary_dns_address_ipv6"`
- PrimaryDnsAddressIpv6Variable types.String `tfsdk:"primary_dns_address_ipv6_variable"`
- SecondaryDnsAddressIpv6 types.String `tfsdk:"secondary_dns_address_ipv6"`
- SecondaryDnsAddressIpv6Variable types.String `tfsdk:"secondary_dns_address_ipv6_variable"`
- HostMappings []ServiceLANVPNHostMappings `tfsdk:"host_mappings"`
- AdvertiseOmpIpv4s []ServiceLANVPNAdvertiseOmpIpv4s `tfsdk:"advertise_omp_ipv4s"`
- AdvertiseOmpIpv6s []ServiceLANVPNAdvertiseOmpIpv6s `tfsdk:"advertise_omp_ipv6s"`
- Ipv4StaticRoutes []ServiceLANVPNIpv4StaticRoutes `tfsdk:"ipv4_static_routes"`
- Ipv6StaticRoutes []ServiceLANVPNIpv6StaticRoutes `tfsdk:"ipv6_static_routes"`
- Services []ServiceLANVPNServices `tfsdk:"services"`
- ServiceRoutes []ServiceLANVPNServiceRoutes `tfsdk:"service_routes"`
- GreRoutes []ServiceLANVPNGreRoutes `tfsdk:"gre_routes"`
- IpsecRoutes []ServiceLANVPNIpsecRoutes `tfsdk:"ipsec_routes"`
- NatPools []ServiceLANVPNNatPools `tfsdk:"nat_pools"`
- NatPortForwards []ServiceLANVPNNatPortForwards `tfsdk:"nat_port_forwards"`
- StaticNats []ServiceLANVPNStaticNats `tfsdk:"static_nats"`
- Nat64V4Pools []ServiceLANVPNNat64V4Pools `tfsdk:"nat_64_v4_pools"`
- RouteLeakFromGlobalVpns []ServiceLANVPNRouteLeakFromGlobalVpns `tfsdk:"route_leak_from_global_vpns"`
- RouteLeakToGlobalVpns []ServiceLANVPNRouteLeakToGlobalVpns `tfsdk:"route_leak_to_global_vpns"`
- RouteLeakFromOtherServices []ServiceLANVPNRouteLeakFromOtherServices `tfsdk:"route_leak_from_other_services"`
- Ipv4ImportRouteTargets []ServiceLANVPNIpv4ImportRouteTargets `tfsdk:"ipv4_import_route_targets"`
- Ipv4ExportRouteTargets []ServiceLANVPNIpv4ExportRouteTargets `tfsdk:"ipv4_export_route_targets"`
- Ipv6ImportRouteTargets []ServiceLANVPNIpv6ImportRouteTargets `tfsdk:"ipv6_import_route_targets"`
- Ipv6ExportRouteTargets []ServiceLANVPNIpv6ExportRouteTargets `tfsdk:"ipv6_export_route_targets"`
-}
-
-type ServiceLANVPNHostMappings struct {
- HostName types.String `tfsdk:"host_name"`
- HostNameVariable types.String `tfsdk:"host_name_variable"`
- ListOfIps types.Set `tfsdk:"list_of_ips"`
- ListOfIpsVariable types.String `tfsdk:"list_of_ips_variable"`
-}
-
-type ServiceLANVPNAdvertiseOmpIpv4s struct {
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
- RoutePolicyId types.String `tfsdk:"route_policy_id"`
- Prefixes []ServiceLANVPNAdvertiseOmpIpv4sPrefixes `tfsdk:"prefixes"`
-}
-
-type ServiceLANVPNAdvertiseOmpIpv6s struct {
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
- RoutePolicyId types.String `tfsdk:"route_policy_id"`
- ProtocolSubType types.String `tfsdk:"protocol_sub_type"`
- ProtocolSubTypeVariable types.String `tfsdk:"protocol_sub_type_variable"`
- Prefixes []ServiceLANVPNAdvertiseOmpIpv6sPrefixes `tfsdk:"prefixes"`
-}
-
-type ServiceLANVPNIpv4StaticRoutes struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- NextHops []ServiceLANVPNIpv4StaticRoutesNextHops `tfsdk:"next_hops"`
- NextHopWithTrackers []ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers `tfsdk:"next_hop_with_trackers"`
- Null0 types.Bool `tfsdk:"null0"`
- GatewayDhcp types.Bool `tfsdk:"gateway_dhcp"`
- Vpn types.Bool `tfsdk:"vpn"`
-}
-
-type ServiceLANVPNIpv6StaticRoutes struct {
- Prefix types.String `tfsdk:"prefix"`
- PrefixVariable types.String `tfsdk:"prefix_variable"`
- NextHops []ServiceLANVPNIpv6StaticRoutesNextHops `tfsdk:"next_hops"`
- Null0 types.Bool `tfsdk:"null0"`
- Nat types.String `tfsdk:"nat"`
- NatVariable types.String `tfsdk:"nat_variable"`
-}
-
-type ServiceLANVPNServices struct {
- ServiceType types.String `tfsdk:"service_type"`
- ServiceTypeVariable types.String `tfsdk:"service_type_variable"`
- Ipv4Addresses types.Set `tfsdk:"ipv4_addresses"`
- Ipv4AddressesVariable types.String `tfsdk:"ipv4_addresses_variable"`
- Tracking types.Bool `tfsdk:"tracking"`
- TrackingVariable types.String `tfsdk:"tracking_variable"`
-}
-
-type ServiceLANVPNServiceRoutes struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- Service types.String `tfsdk:"service"`
- ServiceVariable types.String `tfsdk:"service_variable"`
- Vpn types.Int64 `tfsdk:"vpn"`
-}
-
-type ServiceLANVPNGreRoutes struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- Interface types.Set `tfsdk:"interface"`
- InterfaceVariable types.String `tfsdk:"interface_variable"`
- Vpn types.Int64 `tfsdk:"vpn"`
-}
-
-type ServiceLANVPNIpsecRoutes struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- Interface types.Set `tfsdk:"interface"`
- InterfaceVariable types.String `tfsdk:"interface_variable"`
-}
-
-type ServiceLANVPNNatPools struct {
- NatPoolName types.Int64 `tfsdk:"nat_pool_name"`
- NatPoolNameVariable types.String `tfsdk:"nat_pool_name_variable"`
- PrefixLength types.Int64 `tfsdk:"prefix_length"`
- PrefixLengthVariable types.String `tfsdk:"prefix_length_variable"`
- RangeStart types.String `tfsdk:"range_start"`
- RangeStartVariable types.String `tfsdk:"range_start_variable"`
- RangeEnd types.String `tfsdk:"range_end"`
- RangeEndVariable types.String `tfsdk:"range_end_variable"`
- Overload types.Bool `tfsdk:"overload"`
- OverloadVariable types.String `tfsdk:"overload_variable"`
- Direction types.String `tfsdk:"direction"`
- DirectionVariable types.String `tfsdk:"direction_variable"`
- TrackerObjectId types.String `tfsdk:"tracker_object_id"`
-}
-
-type ServiceLANVPNNatPortForwards struct {
- NatPoolName types.Int64 `tfsdk:"nat_pool_name"`
- NatPoolNameVariable types.String `tfsdk:"nat_pool_name_variable"`
- SourcePort types.Int64 `tfsdk:"source_port"`
- SourcePortVariable types.String `tfsdk:"source_port_variable"`
- TranslatePort types.Int64 `tfsdk:"translate_port"`
- TranslatePortVariable types.String `tfsdk:"translate_port_variable"`
- SourceIp types.String `tfsdk:"source_ip"`
- SourceIpVariable types.String `tfsdk:"source_ip_variable"`
- TranslatedSourceIp types.String `tfsdk:"translated_source_ip"`
- TranslatedSourceIpVariable types.String `tfsdk:"translated_source_ip_variable"`
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
-}
-
-type ServiceLANVPNStaticNats struct {
- NatPoolName types.Int64 `tfsdk:"nat_pool_name"`
- NatPoolNameVariable types.String `tfsdk:"nat_pool_name_variable"`
- SourceIp types.String `tfsdk:"source_ip"`
- SourceIpVariable types.String `tfsdk:"source_ip_variable"`
- TranslatedSourceIp types.String `tfsdk:"translated_source_ip"`
- TranslatedSourceIpVariable types.String `tfsdk:"translated_source_ip_variable"`
- StaticNatDirection types.String `tfsdk:"static_nat_direction"`
- StaticNatDirectionVariable types.String `tfsdk:"static_nat_direction_variable"`
- TrackerObjectId types.String `tfsdk:"tracker_object_id"`
-}
-
-type ServiceLANVPNNat64V4Pools struct {
- Name types.String `tfsdk:"name"`
- NameVariable types.String `tfsdk:"name_variable"`
- RangeStart types.String `tfsdk:"range_start"`
- RangeStartVariable types.String `tfsdk:"range_start_variable"`
- RangeEnd types.String `tfsdk:"range_end"`
- RangeEndVariable types.String `tfsdk:"range_end_variable"`
- Overload types.Bool `tfsdk:"overload"`
- OverloadVariable types.String `tfsdk:"overload_variable"`
-}
-
-type ServiceLANVPNRouteLeakFromGlobalVpns struct {
- RouteProtocol types.String `tfsdk:"route_protocol"`
- RouteProtocolVariable types.String `tfsdk:"route_protocol_variable"`
- RoutePolicyId types.String `tfsdk:"route_policy_id"`
- Redistributions []ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions `tfsdk:"redistributions"`
-}
-
-type ServiceLANVPNRouteLeakToGlobalVpns struct {
- RouteProtocol types.String `tfsdk:"route_protocol"`
- RouteProtocolVariable types.String `tfsdk:"route_protocol_variable"`
- RoutePolicyId types.String `tfsdk:"route_policy_id"`
- Redistributions []ServiceLANVPNRouteLeakToGlobalVpnsRedistributions `tfsdk:"redistributions"`
-}
-
-type ServiceLANVPNRouteLeakFromOtherServices struct {
- SourceVpn types.Int64 `tfsdk:"source_vpn"`
- SourceVpnVariable types.String `tfsdk:"source_vpn_variable"`
- RouteProtocol types.String `tfsdk:"route_protocol"`
- RouteProtocolVariable types.String `tfsdk:"route_protocol_variable"`
- RoutePolicyId types.String `tfsdk:"route_policy_id"`
- Redistributions []ServiceLANVPNRouteLeakFromOtherServicesRedistributions `tfsdk:"redistributions"`
-}
-
-type ServiceLANVPNIpv4ImportRouteTargets struct {
- RouteTarget types.String `tfsdk:"route_target"`
- RouteTargetVariable types.String `tfsdk:"route_target_variable"`
-}
-
-type ServiceLANVPNIpv4ExportRouteTargets struct {
- RouteTarget types.String `tfsdk:"route_target"`
- RouteTargetVariable types.String `tfsdk:"route_target_variable"`
-}
-
-type ServiceLANVPNIpv6ImportRouteTargets struct {
- RouteTarget types.String `tfsdk:"route_target"`
- RouteTargetVariable types.String `tfsdk:"route_target_variable"`
-}
-
-type ServiceLANVPNIpv6ExportRouteTargets struct {
- RouteTarget types.String `tfsdk:"route_target"`
- RouteTargetVariable types.String `tfsdk:"route_target_variable"`
-}
-
-type ServiceLANVPNAdvertiseOmpIpv4sPrefixes struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- AggregateOnly types.Bool `tfsdk:"aggregate_only"`
- Region types.String `tfsdk:"region"`
- RegionVariable types.String `tfsdk:"region_variable"`
-}
-
-type ServiceLANVPNAdvertiseOmpIpv6sPrefixes struct {
- Prefix types.String `tfsdk:"prefix"`
- PrefixVariable types.String `tfsdk:"prefix_variable"`
- AggregateOnly types.Bool `tfsdk:"aggregate_only"`
-}
-
-type ServiceLANVPNIpv4StaticRoutesNextHops struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-type ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
- TrackerId types.String `tfsdk:"tracker_id"`
-}
-
-type ServiceLANVPNIpv6StaticRoutesNextHops struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-
-type ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions struct {
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
- RedistributionPolicyId types.String `tfsdk:"redistribution_policy_id"`
-}
-
-type ServiceLANVPNRouteLeakToGlobalVpnsRedistributions struct {
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
- RedistributionPolicyId types.String `tfsdk:"redistribution_policy_id"`
-}
-
-type ServiceLANVPNRouteLeakFromOtherServicesRedistributions struct {
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
- RedistributionPolicyId types.String `tfsdk:"redistribution_policy_id"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data ServiceLANVPN) getModel() string {
- return "service_lan_vpn"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data ServiceLANVPN) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/lan/vpn", 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 ServiceLANVPN) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.VpnVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"vpnId.optionType", "variable")
- body, _ = sjson.Set(body, path+"vpnId.value", data.VpnVariable.ValueString())
- }
- } else if data.Vpn.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"vpnId.optionType", "default")
- body, _ = sjson.Set(body, path+"vpnId.value", 0)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"vpnId.optionType", "global")
- body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64())
- }
- }
-
- if !data.ConfigDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"name.optionType", "variable")
- body, _ = sjson.Set(body, path+"name.value", data.ConfigDescriptionVariable.ValueString())
- }
- } else if data.ConfigDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"name.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"name.optionType", "global")
- body, _ = sjson.Set(body, path+"name.value", data.ConfigDescription.ValueString())
- }
- }
-
- if !data.OmpAdminDistanceIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "variable")
- body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4Variable.ValueString())
- }
- } else if data.OmpAdminDistanceIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "global")
- body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4.ValueInt64())
- }
- }
-
- if !data.OmpAdminDistanceIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6Variable.ValueString())
- }
- } else if data.OmpAdminDistanceIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64())
- }
- }
- if data.EnableSdwanRemoteAccess.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"enableSdra.optionType", "default")
- body, _ = sjson.Set(body, path+"enableSdra.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"enableSdra.optionType", "global")
- body, _ = sjson.Set(body, path+"enableSdra.value", data.EnableSdwanRemoteAccess.ValueBool())
- }
- }
-
- if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString())
- }
- } else if data.PrimaryDnsAddressIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString())
- }
- }
-
- if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString())
- }
- } else if !data.SecondaryDnsAddressIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString())
- }
- }
-
- if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString())
- }
- } else if data.PrimaryDnsAddressIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString())
- }
- }
-
- if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString())
- }
- } else if !data.SecondaryDnsAddressIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{})
- for _, item := range data.HostMappings {
- itemBody := ""
-
- if !item.HostNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString())
- }
- } else if !item.HostName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString())
- }
- }
-
- if !item.ListOfIpsVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpsVariable.ValueString())
- }
- } else if !item.ListOfIps.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global")
- var values []string
- item.ListOfIps.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ompAdvertiseIp4", []interface{}{})
- for _, item := range data.AdvertiseOmpIpv4s {
- itemBody := ""
-
- if !item.ProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString())
- }
- } else if !item.Protocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString())
- }
- }
- if !item.RoutePolicyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
- }
- }
- if true {
-
- for _, childItem := range item.Prefixes {
- itemChildBody := ""
-
- if !childItem.NetworkAddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddressVariable.ValueString())
- }
- } else if !childItem.NetworkAddress.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddress.ValueString())
- }
- }
-
- if !childItem.SubnetMaskVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMaskVariable.ValueString())
- }
- } else if !childItem.SubnetMask.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMask.ValueString())
- }
- }
- if childItem.AggregateOnly.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool())
- }
- }
-
- if !childItem.RegionVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.RegionVariable.ValueString())
- }
- } else if childItem.Region.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "region.value", "core-and-access")
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.Region.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"ompAdvertiseIp4.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ompAdvertiseIpv6", []interface{}{})
- for _, item := range data.AdvertiseOmpIpv6s {
- itemBody := ""
-
- if !item.ProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString())
- }
- } else if !item.Protocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString())
- }
- }
- if !item.RoutePolicyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
- }
- }
-
- if !item.ProtocolSubTypeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubTypeVariable.ValueString())
- }
- } else if item.ProtocolSubType.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubType.ValueString())
- }
- }
- if true {
-
- for _, childItem := range item.Prefixes {
- itemChildBody := ""
-
- if !childItem.PrefixVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString())
- }
- } else if !childItem.Prefix.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString())
- }
- }
- if childItem.AggregateOnly.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"ompAdvertiseIpv6.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{})
- for _, item := range data.Ipv4StaticRoutes {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
- }
- }
- if true {
-
- for _, childItem := range item.NextHops {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AdministrativeDistanceVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
- }
- } else if !childItem.AdministrativeDistance.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
- }
- }
- if true {
-
- for _, childItem := range item.NextHopWithTrackers {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AdministrativeDistanceVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
- }
- } else if !childItem.AdministrativeDistance.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
- }
- }
- if !childItem.TrackerId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.value", childItem.TrackerId.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHopWithTracker.-1", itemChildBody)
- }
- }
- if !item.Null0.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
- }
- }
- if !item.GatewayDhcp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.value", item.GatewayDhcp.ValueBool())
- }
- }
- if !item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.value", item.Vpn.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{})
- for _, item := range data.Ipv6StaticRoutes {
- itemBody := ""
-
- if !item.PrefixVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString())
- }
- } else if !item.Prefix.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString())
- }
- }
- if true {
-
- for _, childItem := range item.NextHops {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AdministrativeDistanceVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
- }
- } else if !childItem.AdministrativeDistance.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
- }
- }
- if !item.Null0.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
- }
- }
-
- if !item.NatVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString())
- }
- } else if !item.Nat.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"service", []interface{}{})
- for _, item := range data.Services {
- itemBody := ""
-
- if !item.ServiceTypeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceTypeVariable.ValueString())
- }
- } else if !item.ServiceType.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString())
- }
- }
-
- if !item.Ipv4AddressesVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", item.Ipv4AddressesVariable.ValueString())
- }
- } else if !item.Ipv4Addresses.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "global")
- var values []string
- item.Ipv4Addresses.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", values)
- }
- }
-
- if !item.TrackingVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tracking.value", item.TrackingVariable.ValueString())
- }
- } else if item.Tracking.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tracking.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tracking.value", item.Tracking.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"service.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"serviceRoute", []interface{}{})
- for _, item := range data.ServiceRoutes {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
- }
- }
-
- if !item.ServiceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "service.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "service.value", item.ServiceVariable.ValueString())
- }
- } else if item.Service.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "service.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "service.value", "SIG")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "service.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "service.value", item.Service.ValueString())
- }
- }
- if !item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"serviceRoute.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"greRoute", []interface{}{})
- for _, item := range data.GreRoutes {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
- }
- }
-
- if !item.InterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString())
- }
- } else if item.Interface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global")
- var values []string
- item.Interface.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "interface.value", values)
- }
- }
- if !item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"greRoute.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipsecRoute", []interface{}{})
- for _, item := range data.IpsecRoutes {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
- }
- }
-
- if !item.InterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString())
- }
- } else if item.Interface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global")
- var values []string
- item.Interface.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "interface.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipsecRoute.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"natPool", []interface{}{})
- for _, item := range data.NatPools {
- itemBody := ""
-
- if !item.NatPoolNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString())
- }
- } else if !item.NatPoolName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64())
- }
- }
-
- if !item.PrefixLengthVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLengthVariable.ValueString())
- }
- } else if !item.PrefixLength.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLength.ValueInt64())
- }
- }
-
- if !item.RangeStartVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStartVariable.ValueString())
- }
- } else if !item.RangeStart.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStart.ValueString())
- }
- }
-
- if !item.RangeEndVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEndVariable.ValueString())
- }
- } else if !item.RangeEnd.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEnd.ValueString())
- }
- }
-
- if !item.OverloadVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "overload.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "overload.value", item.OverloadVariable.ValueString())
- }
- } else if item.Overload.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "overload.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "overload.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "overload.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "overload.value", item.Overload.ValueBool())
- }
- }
-
- if !item.DirectionVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "direction.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "direction.value", item.DirectionVariable.ValueString())
- }
- } else if !item.Direction.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "direction.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "direction.value", item.Direction.ValueString())
- }
- }
- if !item.TrackerObjectId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"natPool.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"natPortForward", []interface{}{})
- for _, item := range data.NatPortForwards {
- itemBody := ""
-
- if !item.NatPoolNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString())
- }
- } else if item.NatPoolName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64())
- }
- }
-
- if !item.SourcePortVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePortVariable.ValueString())
- }
- } else if !item.SourcePort.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePort.ValueInt64())
- }
- }
-
- if !item.TranslatePortVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePortVariable.ValueString())
- }
- } else if !item.TranslatePort.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePort.ValueInt64())
- }
- }
-
- if !item.SourceIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
- }
- } else if !item.SourceIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
- }
- }
-
- if !item.TranslatedSourceIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString())
- }
- } else if !item.TranslatedSourceIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString())
- }
- }
-
- if !item.ProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
- }
- } else if !item.Protocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"natPortForward.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"staticNat", []interface{}{})
- for _, item := range data.StaticNats {
- itemBody := ""
-
- if !item.NatPoolNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString())
- }
- } else if item.NatPoolName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64())
- }
- }
-
- if !item.SourceIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
- }
- } else if !item.SourceIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
- }
- }
-
- if !item.TranslatedSourceIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString())
- }
- } else if !item.TranslatedSourceIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString())
- }
- }
-
- if !item.StaticNatDirectionVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirectionVariable.ValueString())
- }
- } else if !item.StaticNatDirection.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirection.ValueString())
- }
- }
- if !item.TrackerObjectId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"staticNat.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{})
- for _, item := range data.Nat64V4Pools {
- itemBody := ""
-
- if !item.NameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.NameVariable.ValueString())
- }
- } else if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Name.ValueString())
- }
- }
-
- if !item.RangeStartVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStartVariable.ValueString())
- }
- } else if !item.RangeStart.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStart.ValueString())
- }
- }
-
- if !item.RangeEndVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEndVariable.ValueString())
- }
- } else if !item.RangeEnd.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEnd.ValueString())
- }
- }
-
- if !item.OverloadVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.OverloadVariable.ValueString())
- }
- } else if item.Overload.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Overload.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"routeLeakFromGlobal", []interface{}{})
- for _, item := range data.RouteLeakFromGlobalVpns {
- itemBody := ""
-
- if !item.RouteProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString())
- }
- } else if !item.RouteProtocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString())
- }
- }
- if !item.RoutePolicyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{})
- for _, childItem := range item.Redistributions {
- itemChildBody := ""
-
- if !childItem.ProtocolVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString())
- }
- } else if !childItem.Protocol.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString())
- }
- }
- if !childItem.RedistributionPolicyId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"routeLeakFromGlobal.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"routeLeakFromService", []interface{}{})
- for _, item := range data.RouteLeakToGlobalVpns {
- itemBody := ""
-
- if !item.RouteProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString())
- }
- } else if !item.RouteProtocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString())
- }
- }
- if !item.RoutePolicyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{})
- for _, childItem := range item.Redistributions {
- itemChildBody := ""
-
- if !childItem.ProtocolVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString())
- }
- } else if !childItem.Protocol.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString())
- }
- }
- if !childItem.RedistributionPolicyId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"routeLeakFromService.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"routeLeakBetweenServices", []interface{}{})
- for _, item := range data.RouteLeakFromOtherServices {
- itemBody := ""
-
- if !item.SourceVpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString())
- }
- } else if !item.SourceVpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64())
- }
- }
-
- if !item.RouteProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString())
- }
- } else if !item.RouteProtocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString())
- }
- }
- if !item.RoutePolicyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{})
- for _, childItem := range item.Redistributions {
- itemChildBody := ""
-
- if !childItem.ProtocolVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString())
- }
- } else if !childItem.Protocol.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString())
- }
- }
- if !childItem.RedistributionPolicyId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"routeLeakBetweenServices.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.importRtList", []interface{}{})
- for _, item := range data.Ipv4ImportRouteTargets {
- itemBody := ""
-
- if !item.RouteTargetVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
- }
- } else if !item.RouteTarget.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.importRtList.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.exportRtList", []interface{}{})
- for _, item := range data.Ipv4ExportRouteTargets {
- itemBody := ""
-
- if !item.RouteTargetVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
- }
- } else if !item.RouteTarget.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.exportRtList.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.importRtList", []interface{}{})
- for _, item := range data.Ipv6ImportRouteTargets {
- itemBody := ""
-
- if !item.RouteTargetVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
- }
- } else if !item.RouteTarget.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.importRtList.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.exportRtList", []interface{}{})
- for _, item := range data.Ipv6ExportRouteTargets {
- itemBody := ""
-
- if !item.RouteTargetVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString())
- }
- } else if !item.RouteTarget.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.exportRtList.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *ServiceLANVPN) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Vpn = types.Int64Null()
- data.VpnVariable = types.StringNull()
- if t := res.Get(path + "vpnId.optionType"); t.Exists() {
- va := res.Get(path + "vpnId.value")
- if t.String() == "variable" {
- data.VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Vpn = types.Int64Value(va.Int())
- }
- }
- data.ConfigDescription = types.StringNull()
- data.ConfigDescriptionVariable = types.StringNull()
- if t := res.Get(path + "name.optionType"); t.Exists() {
- va := res.Get(path + "name.value")
- if t.String() == "variable" {
- data.ConfigDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ConfigDescription = types.StringValue(va.String())
- }
- }
- data.OmpAdminDistanceIpv4 = types.Int64Null()
- data.OmpAdminDistanceIpv4Variable = types.StringNull()
- if t := res.Get(path + "ompAdminDistance.optionType"); t.Exists() {
- va := res.Get(path + "ompAdminDistance.value")
- if t.String() == "variable" {
- data.OmpAdminDistanceIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OmpAdminDistanceIpv4 = types.Int64Value(va.Int())
- }
- }
- data.OmpAdminDistanceIpv6 = types.Int64Null()
- data.OmpAdminDistanceIpv6Variable = types.StringNull()
- if t := res.Get(path + "ompAdminDistanceIpv6.optionType"); t.Exists() {
- va := res.Get(path + "ompAdminDistanceIpv6.value")
- if t.String() == "variable" {
- data.OmpAdminDistanceIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OmpAdminDistanceIpv6 = types.Int64Value(va.Int())
- }
- }
- data.EnableSdwanRemoteAccess = types.BoolNull()
-
- if t := res.Get(path + "enableSdra.optionType"); t.Exists() {
- va := res.Get(path + "enableSdra.value")
- if t.String() == "global" {
- data.EnableSdwanRemoteAccess = types.BoolValue(va.Bool())
- }
- }
- data.PrimaryDnsAddressIpv4 = types.StringNull()
- data.PrimaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv4 = types.StringNull()
- data.SecondaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv6 = types.StringNull()
- data.PrimaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv6 = types.StringNull()
- data.SecondaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "newHostMapping"); value.Exists() {
- data.HostMappings = make([]ServiceLANVPNHostMappings, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNHostMappings{}
- item.HostName = types.StringNull()
- item.HostNameVariable = types.StringNull()
- if t := v.Get("hostName.optionType"); t.Exists() {
- va := v.Get("hostName.value")
- if t.String() == "variable" {
- item.HostNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HostName = types.StringValue(va.String())
- }
- }
- item.ListOfIps = types.SetNull(types.StringType)
- item.ListOfIpsVariable = types.StringNull()
- if t := v.Get("listOfIp.optionType"); t.Exists() {
- va := v.Get("listOfIp.value")
- if t.String() == "variable" {
- item.ListOfIpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.ListOfIps = helpers.GetStringSet(va.Array())
- }
- }
- data.HostMappings = append(data.HostMappings, item)
- return true
- })
- }
- if value := res.Get(path + "ompAdvertiseIp4"); value.Exists() {
- data.AdvertiseOmpIpv4s = make([]ServiceLANVPNAdvertiseOmpIpv4s, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNAdvertiseOmpIpv4s{}
- item.Protocol = types.StringNull()
- item.ProtocolVariable = types.StringNull()
- if t := v.Get("ompProtocol.optionType"); t.Exists() {
- va := v.Get("ompProtocol.value")
- if t.String() == "variable" {
- item.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Protocol = types.StringValue(va.String())
- }
- }
- item.RoutePolicyId = types.StringNull()
-
- if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
- va := v.Get("routePolicy.refId.value")
- if t.String() == "global" {
- item.RoutePolicyId = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("prefixList"); cValue.Exists() {
- item.Prefixes = make([]ServiceLANVPNAdvertiseOmpIpv4sPrefixes, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNAdvertiseOmpIpv4sPrefixes{}
- cItem.NetworkAddress = types.StringNull()
- cItem.NetworkAddressVariable = types.StringNull()
- if t := cv.Get("prefix.address.optionType"); t.Exists() {
- va := cv.Get("prefix.address.value")
- if t.String() == "variable" {
- cItem.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.NetworkAddress = types.StringValue(va.String())
- }
- }
- cItem.SubnetMask = types.StringNull()
- cItem.SubnetMaskVariable = types.StringNull()
- if t := cv.Get("prefix.mask.optionType"); t.Exists() {
- va := cv.Get("prefix.mask.value")
- if t.String() == "variable" {
- cItem.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.SubnetMask = types.StringValue(va.String())
- }
- }
- cItem.AggregateOnly = types.BoolNull()
-
- if t := cv.Get("aggregateOnly.optionType"); t.Exists() {
- va := cv.Get("aggregateOnly.value")
- if t.String() == "global" {
- cItem.AggregateOnly = types.BoolValue(va.Bool())
- }
- }
- cItem.Region = types.StringNull()
- cItem.RegionVariable = types.StringNull()
- if t := cv.Get("region.optionType"); t.Exists() {
- va := cv.Get("region.value")
- if t.String() == "variable" {
- cItem.RegionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Region = types.StringValue(va.String())
- }
- }
- item.Prefixes = append(item.Prefixes, cItem)
- return true
- })
- }
- data.AdvertiseOmpIpv4s = append(data.AdvertiseOmpIpv4s, item)
- return true
- })
- }
- if value := res.Get(path + "ompAdvertiseIpv6"); value.Exists() {
- data.AdvertiseOmpIpv6s = make([]ServiceLANVPNAdvertiseOmpIpv6s, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNAdvertiseOmpIpv6s{}
- item.Protocol = types.StringNull()
- item.ProtocolVariable = types.StringNull()
- if t := v.Get("ompProtocol.optionType"); t.Exists() {
- va := v.Get("ompProtocol.value")
- if t.String() == "variable" {
- item.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Protocol = types.StringValue(va.String())
- }
- }
- item.RoutePolicyId = types.StringNull()
-
- if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
- va := v.Get("routePolicy.refId.value")
- if t.String() == "global" {
- item.RoutePolicyId = types.StringValue(va.String())
- }
- }
- item.ProtocolSubType = types.StringNull()
- item.ProtocolSubTypeVariable = types.StringNull()
- if t := v.Get("protocolSubType.optionType"); t.Exists() {
- va := v.Get("protocolSubType.value")
- if t.String() == "variable" {
- item.ProtocolSubTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.ProtocolSubType = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("prefixList"); cValue.Exists() {
- item.Prefixes = make([]ServiceLANVPNAdvertiseOmpIpv6sPrefixes, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNAdvertiseOmpIpv6sPrefixes{}
- cItem.Prefix = types.StringNull()
- cItem.PrefixVariable = types.StringNull()
- if t := cv.Get("prefix.optionType"); t.Exists() {
- va := cv.Get("prefix.value")
- if t.String() == "variable" {
- cItem.PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Prefix = types.StringValue(va.String())
- }
- }
- cItem.AggregateOnly = types.BoolNull()
-
- if t := cv.Get("aggregateOnly.optionType"); t.Exists() {
- va := cv.Get("aggregateOnly.value")
- if t.String() == "global" {
- cItem.AggregateOnly = types.BoolValue(va.Bool())
- }
- }
- item.Prefixes = append(item.Prefixes, cItem)
- return true
- })
- }
- data.AdvertiseOmpIpv6s = append(data.AdvertiseOmpIpv6s, item)
- return true
- })
- }
- if value := res.Get(path + "ipv4Route"); value.Exists() {
- data.Ipv4StaticRoutes = make([]ServiceLANVPNIpv4StaticRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNIpv4StaticRoutes{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := v.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := v.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
- item.NextHops = make([]ServiceLANVPNIpv4StaticRoutesNextHops, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNIpv4StaticRoutesNextHops{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AdministrativeDistance = types.Int64Null()
- cItem.AdministrativeDistanceVariable = types.StringNull()
- if t := cv.Get("distance.optionType"); t.Exists() {
- va := cv.Get("distance.value")
- if t.String() == "variable" {
- cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- item.NextHops = append(item.NextHops, cItem)
- return true
- })
- }
- if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHopWithTracker"); cValue.Exists() {
- item.NextHopWithTrackers = make([]ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNIpv4StaticRoutesNextHopWithTrackers{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AdministrativeDistance = types.Int64Null()
- cItem.AdministrativeDistanceVariable = types.StringNull()
- if t := cv.Get("distance.optionType"); t.Exists() {
- va := cv.Get("distance.value")
- if t.String() == "variable" {
- cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- cItem.TrackerId = types.StringNull()
-
- if t := cv.Get("tracker.refId.optionType"); t.Exists() {
- va := cv.Get("tracker.refId.value")
- if t.String() == "global" {
- cItem.TrackerId = types.StringValue(va.String())
- }
- }
- item.NextHopWithTrackers = append(item.NextHopWithTrackers, cItem)
- return true
- })
- }
- item.Null0 = types.BoolNull()
-
- if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- item.Null0 = types.BoolValue(va.Bool())
- }
- }
- item.GatewayDhcp = types.BoolNull()
-
- if t := v.Get("oneOfIpRoute.dhcp.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.dhcp.value")
- if t.String() == "global" {
- item.GatewayDhcp = types.BoolValue(va.Bool())
- }
- }
- item.Vpn = types.BoolNull()
-
- if t := v.Get("oneOfIpRoute.vpn.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.vpn.value")
- if t.String() == "global" {
- item.Vpn = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4StaticRoutes = append(data.Ipv4StaticRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6Route"); value.Exists() {
- data.Ipv6StaticRoutes = make([]ServiceLANVPNIpv6StaticRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNIpv6StaticRoutes{}
- item.Prefix = types.StringNull()
- item.PrefixVariable = types.StringNull()
- if t := v.Get("prefix.optionType"); t.Exists() {
- va := v.Get("prefix.value")
- if t.String() == "variable" {
- item.PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Prefix = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
- item.NextHops = make([]ServiceLANVPNIpv6StaticRoutesNextHops, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNIpv6StaticRoutesNextHops{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AdministrativeDistance = types.Int64Null()
- cItem.AdministrativeDistanceVariable = types.StringNull()
- if t := cv.Get("distance.optionType"); t.Exists() {
- va := cv.Get("distance.value")
- if t.String() == "variable" {
- cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- item.NextHops = append(item.NextHops, cItem)
- return true
- })
- }
- item.Null0 = types.BoolNull()
-
- if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- item.Null0 = types.BoolValue(va.Bool())
- }
- }
- item.Nat = types.StringNull()
- item.NatVariable = types.StringNull()
- if t := v.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.nat.value")
- if t.String() == "variable" {
- item.NatVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Nat = types.StringValue(va.String())
- }
- }
- data.Ipv6StaticRoutes = append(data.Ipv6StaticRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "service"); value.Exists() {
- data.Services = make([]ServiceLANVPNServices, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNServices{}
- item.ServiceType = types.StringNull()
- item.ServiceTypeVariable = types.StringNull()
- if t := v.Get("serviceType.optionType"); t.Exists() {
- va := v.Get("serviceType.value")
- if t.String() == "variable" {
- item.ServiceTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.ServiceType = types.StringValue(va.String())
- }
- }
- item.Ipv4Addresses = types.SetNull(types.StringType)
- item.Ipv4AddressesVariable = types.StringNull()
- if t := v.Get("ipv4Addresses.optionType"); t.Exists() {
- va := v.Get("ipv4Addresses.value")
- if t.String() == "variable" {
- item.Ipv4AddressesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Ipv4Addresses = helpers.GetStringSet(va.Array())
- }
- }
- item.Tracking = types.BoolNull()
- item.TrackingVariable = types.StringNull()
- if t := v.Get("tracking.optionType"); t.Exists() {
- va := v.Get("tracking.value")
- if t.String() == "variable" {
- item.TrackingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Tracking = types.BoolValue(va.Bool())
- }
- }
- data.Services = append(data.Services, item)
- return true
- })
- }
- if value := res.Get(path + "serviceRoute"); value.Exists() {
- data.ServiceRoutes = make([]ServiceLANVPNServiceRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNServiceRoutes{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := v.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := v.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- item.Service = types.StringNull()
- item.ServiceVariable = types.StringNull()
- if t := v.Get("service.optionType"); t.Exists() {
- va := v.Get("service.value")
- if t.String() == "variable" {
- item.ServiceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Service = types.StringValue(va.String())
- }
- }
- item.Vpn = types.Int64Null()
-
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- data.ServiceRoutes = append(data.ServiceRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "greRoute"); value.Exists() {
- data.GreRoutes = make([]ServiceLANVPNGreRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNGreRoutes{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := v.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := v.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- item.Interface = types.SetNull(types.StringType)
- item.InterfaceVariable = types.StringNull()
- if t := v.Get("interface.optionType"); t.Exists() {
- va := v.Get("interface.value")
- if t.String() == "variable" {
- item.InterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Interface = helpers.GetStringSet(va.Array())
- }
- }
- item.Vpn = types.Int64Null()
-
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- data.GreRoutes = append(data.GreRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "ipsecRoute"); value.Exists() {
- data.IpsecRoutes = make([]ServiceLANVPNIpsecRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNIpsecRoutes{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := v.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := v.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- item.Interface = types.SetNull(types.StringType)
- item.InterfaceVariable = types.StringNull()
- if t := v.Get("interface.optionType"); t.Exists() {
- va := v.Get("interface.value")
- if t.String() == "variable" {
- item.InterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Interface = helpers.GetStringSet(va.Array())
- }
- }
- data.IpsecRoutes = append(data.IpsecRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "natPool"); value.Exists() {
- data.NatPools = make([]ServiceLANVPNNatPools, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNNatPools{}
- item.NatPoolName = types.Int64Null()
- item.NatPoolNameVariable = types.StringNull()
- if t := v.Get("natPoolName.optionType"); t.Exists() {
- va := v.Get("natPoolName.value")
- if t.String() == "variable" {
- item.NatPoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NatPoolName = types.Int64Value(va.Int())
- }
- }
- item.PrefixLength = types.Int64Null()
- item.PrefixLengthVariable = types.StringNull()
- if t := v.Get("prefixLength.optionType"); t.Exists() {
- va := v.Get("prefixLength.value")
- if t.String() == "variable" {
- item.PrefixLengthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.PrefixLength = types.Int64Value(va.Int())
- }
- }
- item.RangeStart = types.StringNull()
- item.RangeStartVariable = types.StringNull()
- if t := v.Get("rangeStart.optionType"); t.Exists() {
- va := v.Get("rangeStart.value")
- if t.String() == "variable" {
- item.RangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RangeStart = types.StringValue(va.String())
- }
- }
- item.RangeEnd = types.StringNull()
- item.RangeEndVariable = types.StringNull()
- if t := v.Get("rangeEnd.optionType"); t.Exists() {
- va := v.Get("rangeEnd.value")
- if t.String() == "variable" {
- item.RangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RangeEnd = types.StringValue(va.String())
- }
- }
- item.Overload = types.BoolNull()
- item.OverloadVariable = types.StringNull()
- if t := v.Get("overload.optionType"); t.Exists() {
- va := v.Get("overload.value")
- if t.String() == "variable" {
- item.OverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Overload = types.BoolValue(va.Bool())
- }
- }
- item.Direction = types.StringNull()
- item.DirectionVariable = types.StringNull()
- if t := v.Get("direction.optionType"); t.Exists() {
- va := v.Get("direction.value")
- if t.String() == "variable" {
- item.DirectionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Direction = types.StringValue(va.String())
- }
- }
- item.TrackerObjectId = types.StringNull()
-
- if t := v.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
- va := v.Get("trackingObject.trackerId.refId.value")
- if t.String() == "global" {
- item.TrackerObjectId = types.StringValue(va.String())
- }
- }
- data.NatPools = append(data.NatPools, item)
- return true
- })
- }
- if value := res.Get(path + "natPortForward"); value.Exists() {
- data.NatPortForwards = make([]ServiceLANVPNNatPortForwards, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNNatPortForwards{}
- item.NatPoolName = types.Int64Null()
- item.NatPoolNameVariable = types.StringNull()
- if t := v.Get("natPoolName.optionType"); t.Exists() {
- va := v.Get("natPoolName.value")
- if t.String() == "variable" {
- item.NatPoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NatPoolName = types.Int64Value(va.Int())
- }
- }
- item.SourcePort = types.Int64Null()
- item.SourcePortVariable = types.StringNull()
- if t := v.Get("sourcePort.optionType"); t.Exists() {
- va := v.Get("sourcePort.value")
- if t.String() == "variable" {
- item.SourcePortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourcePort = types.Int64Value(va.Int())
- }
- }
- item.TranslatePort = types.Int64Null()
- item.TranslatePortVariable = types.StringNull()
- if t := v.Get("translatePort.optionType"); t.Exists() {
- va := v.Get("translatePort.value")
- if t.String() == "variable" {
- item.TranslatePortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TranslatePort = types.Int64Value(va.Int())
- }
- }
- item.SourceIp = types.StringNull()
- item.SourceIpVariable = types.StringNull()
- if t := v.Get("sourceIp.optionType"); t.Exists() {
- va := v.Get("sourceIp.value")
- if t.String() == "variable" {
- item.SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceIp = types.StringValue(va.String())
- }
- }
- item.TranslatedSourceIp = types.StringNull()
- item.TranslatedSourceIpVariable = types.StringNull()
- if t := v.Get("TranslatedSourceIp.optionType"); t.Exists() {
- va := v.Get("TranslatedSourceIp.value")
- if t.String() == "variable" {
- item.TranslatedSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TranslatedSourceIp = types.StringValue(va.String())
- }
- }
- item.Protocol = types.StringNull()
- item.ProtocolVariable = types.StringNull()
- if t := v.Get("protocol.optionType"); t.Exists() {
- va := v.Get("protocol.value")
- if t.String() == "variable" {
- item.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Protocol = types.StringValue(va.String())
- }
- }
- data.NatPortForwards = append(data.NatPortForwards, item)
- return true
- })
- }
- if value := res.Get(path + "staticNat"); value.Exists() {
- data.StaticNats = make([]ServiceLANVPNStaticNats, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNStaticNats{}
- item.NatPoolName = types.Int64Null()
- item.NatPoolNameVariable = types.StringNull()
- if t := v.Get("natPoolName.optionType"); t.Exists() {
- va := v.Get("natPoolName.value")
- if t.String() == "variable" {
- item.NatPoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NatPoolName = types.Int64Value(va.Int())
- }
- }
- item.SourceIp = types.StringNull()
- item.SourceIpVariable = types.StringNull()
- if t := v.Get("sourceIp.optionType"); t.Exists() {
- va := v.Get("sourceIp.value")
- if t.String() == "variable" {
- item.SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceIp = types.StringValue(va.String())
- }
- }
- item.TranslatedSourceIp = types.StringNull()
- item.TranslatedSourceIpVariable = types.StringNull()
- if t := v.Get("TranslatedSourceIp.optionType"); t.Exists() {
- va := v.Get("TranslatedSourceIp.value")
- if t.String() == "variable" {
- item.TranslatedSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TranslatedSourceIp = types.StringValue(va.String())
- }
- }
- item.StaticNatDirection = types.StringNull()
- item.StaticNatDirectionVariable = types.StringNull()
- if t := v.Get("staticNatDirection.optionType"); t.Exists() {
- va := v.Get("staticNatDirection.value")
- if t.String() == "variable" {
- item.StaticNatDirectionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.StaticNatDirection = types.StringValue(va.String())
- }
- }
- item.TrackerObjectId = types.StringNull()
-
- if t := v.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
- va := v.Get("trackingObject.trackerId.refId.value")
- if t.String() == "global" {
- item.TrackerObjectId = types.StringValue(va.String())
- }
- }
- data.StaticNats = append(data.StaticNats, item)
- return true
- })
- }
- if value := res.Get(path + "nat64V4Pool"); value.Exists() {
- data.Nat64V4Pools = make([]ServiceLANVPNNat64V4Pools, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNNat64V4Pools{}
- item.Name = types.StringNull()
- item.NameVariable = types.StringNull()
- if t := v.Get("nat64V4PoolName.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolName.value")
- if t.String() == "variable" {
- item.NameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- item.RangeStart = types.StringNull()
- item.RangeStartVariable = types.StringNull()
- if t := v.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolRangeStart.value")
- if t.String() == "variable" {
- item.RangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RangeStart = types.StringValue(va.String())
- }
- }
- item.RangeEnd = types.StringNull()
- item.RangeEndVariable = types.StringNull()
- if t := v.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolRangeEnd.value")
- if t.String() == "variable" {
- item.RangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RangeEnd = types.StringValue(va.String())
- }
- }
- item.Overload = types.BoolNull()
- item.OverloadVariable = types.StringNull()
- if t := v.Get("nat64V4PoolOverload.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolOverload.value")
- if t.String() == "variable" {
- item.OverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Overload = types.BoolValue(va.Bool())
- }
- }
- data.Nat64V4Pools = append(data.Nat64V4Pools, item)
- return true
- })
- }
- if value := res.Get(path + "routeLeakFromGlobal"); value.Exists() {
- data.RouteLeakFromGlobalVpns = make([]ServiceLANVPNRouteLeakFromGlobalVpns, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNRouteLeakFromGlobalVpns{}
- item.RouteProtocol = types.StringNull()
- item.RouteProtocolVariable = types.StringNull()
- if t := v.Get("routeProtocol.optionType"); t.Exists() {
- va := v.Get("routeProtocol.value")
- if t.String() == "variable" {
- item.RouteProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RouteProtocol = types.StringValue(va.String())
- }
- }
- item.RoutePolicyId = types.StringNull()
-
- if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
- va := v.Get("routePolicy.refId.value")
- if t.String() == "global" {
- item.RoutePolicyId = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("redistributeToProtocol"); cValue.Exists() {
- item.Redistributions = make([]ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNRouteLeakFromGlobalVpnsRedistributions{}
- cItem.Protocol = types.StringNull()
- cItem.ProtocolVariable = types.StringNull()
- if t := cv.Get("protocol.optionType"); t.Exists() {
- va := cv.Get("protocol.value")
- if t.String() == "variable" {
- cItem.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Protocol = types.StringValue(va.String())
- }
- }
- cItem.RedistributionPolicyId = types.StringNull()
-
- if t := cv.Get("policy.refId.optionType"); t.Exists() {
- va := cv.Get("policy.refId.value")
- if t.String() == "global" {
- cItem.RedistributionPolicyId = types.StringValue(va.String())
- }
- }
- item.Redistributions = append(item.Redistributions, cItem)
- return true
- })
- }
- data.RouteLeakFromGlobalVpns = append(data.RouteLeakFromGlobalVpns, item)
- return true
- })
- }
- if value := res.Get(path + "routeLeakFromService"); value.Exists() {
- data.RouteLeakToGlobalVpns = make([]ServiceLANVPNRouteLeakToGlobalVpns, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNRouteLeakToGlobalVpns{}
- item.RouteProtocol = types.StringNull()
- item.RouteProtocolVariable = types.StringNull()
- if t := v.Get("routeProtocol.optionType"); t.Exists() {
- va := v.Get("routeProtocol.value")
- if t.String() == "variable" {
- item.RouteProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RouteProtocol = types.StringValue(va.String())
- }
- }
- item.RoutePolicyId = types.StringNull()
-
- if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
- va := v.Get("routePolicy.refId.value")
- if t.String() == "global" {
- item.RoutePolicyId = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("redistributeToProtocol"); cValue.Exists() {
- item.Redistributions = make([]ServiceLANVPNRouteLeakToGlobalVpnsRedistributions, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNRouteLeakToGlobalVpnsRedistributions{}
- cItem.Protocol = types.StringNull()
- cItem.ProtocolVariable = types.StringNull()
- if t := cv.Get("protocol.optionType"); t.Exists() {
- va := cv.Get("protocol.value")
- if t.String() == "variable" {
- cItem.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Protocol = types.StringValue(va.String())
- }
- }
- cItem.RedistributionPolicyId = types.StringNull()
-
- if t := cv.Get("policy.refId.optionType"); t.Exists() {
- va := cv.Get("policy.refId.value")
- if t.String() == "global" {
- cItem.RedistributionPolicyId = types.StringValue(va.String())
- }
- }
- item.Redistributions = append(item.Redistributions, cItem)
- return true
- })
- }
- data.RouteLeakToGlobalVpns = append(data.RouteLeakToGlobalVpns, item)
- return true
- })
- }
- if value := res.Get(path + "routeLeakBetweenServices"); value.Exists() {
- data.RouteLeakFromOtherServices = make([]ServiceLANVPNRouteLeakFromOtherServices, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNRouteLeakFromOtherServices{}
- item.SourceVpn = types.Int64Null()
- item.SourceVpnVariable = types.StringNull()
- if t := v.Get("sourceVpn.optionType"); t.Exists() {
- va := v.Get("sourceVpn.value")
- if t.String() == "variable" {
- item.SourceVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceVpn = types.Int64Value(va.Int())
- }
- }
- item.RouteProtocol = types.StringNull()
- item.RouteProtocolVariable = types.StringNull()
- if t := v.Get("routeProtocol.optionType"); t.Exists() {
- va := v.Get("routeProtocol.value")
- if t.String() == "variable" {
- item.RouteProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RouteProtocol = types.StringValue(va.String())
- }
- }
- item.RoutePolicyId = types.StringNull()
-
- if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
- va := v.Get("routePolicy.refId.value")
- if t.String() == "global" {
- item.RoutePolicyId = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("redistributeToProtocol"); cValue.Exists() {
- item.Redistributions = make([]ServiceLANVPNRouteLeakFromOtherServicesRedistributions, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := ServiceLANVPNRouteLeakFromOtherServicesRedistributions{}
- cItem.Protocol = types.StringNull()
- cItem.ProtocolVariable = types.StringNull()
- if t := cv.Get("protocol.optionType"); t.Exists() {
- va := cv.Get("protocol.value")
- if t.String() == "variable" {
- cItem.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Protocol = types.StringValue(va.String())
- }
- }
- cItem.RedistributionPolicyId = types.StringNull()
-
- if t := cv.Get("policy.refId.optionType"); t.Exists() {
- va := cv.Get("policy.refId.value")
- if t.String() == "global" {
- cItem.RedistributionPolicyId = types.StringValue(va.String())
- }
- }
- item.Redistributions = append(item.Redistributions, cItem)
- return true
- })
- }
- data.RouteLeakFromOtherServices = append(data.RouteLeakFromOtherServices, item)
- return true
- })
- }
- if value := res.Get(path + "mplsVpnIpv4RouteTarget.importRtList"); value.Exists() {
- data.Ipv4ImportRouteTargets = make([]ServiceLANVPNIpv4ImportRouteTargets, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNIpv4ImportRouteTargets{}
- item.RouteTarget = types.StringNull()
- item.RouteTargetVariable = types.StringNull()
- if t := v.Get("rt.optionType"); t.Exists() {
- va := v.Get("rt.value")
- if t.String() == "variable" {
- item.RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RouteTarget = types.StringValue(va.String())
- }
- }
- data.Ipv4ImportRouteTargets = append(data.Ipv4ImportRouteTargets, item)
- return true
- })
- }
- if value := res.Get(path + "mplsVpnIpv4RouteTarget.exportRtList"); value.Exists() {
- data.Ipv4ExportRouteTargets = make([]ServiceLANVPNIpv4ExportRouteTargets, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNIpv4ExportRouteTargets{}
- item.RouteTarget = types.StringNull()
- item.RouteTargetVariable = types.StringNull()
- if t := v.Get("rt.optionType"); t.Exists() {
- va := v.Get("rt.value")
- if t.String() == "variable" {
- item.RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RouteTarget = types.StringValue(va.String())
- }
- }
- data.Ipv4ExportRouteTargets = append(data.Ipv4ExportRouteTargets, item)
- return true
- })
- }
- if value := res.Get(path + "mplsVpnIpv6RouteTarget.importRtList"); value.Exists() {
- data.Ipv6ImportRouteTargets = make([]ServiceLANVPNIpv6ImportRouteTargets, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNIpv6ImportRouteTargets{}
- item.RouteTarget = types.StringNull()
- item.RouteTargetVariable = types.StringNull()
- if t := v.Get("rt.optionType"); t.Exists() {
- va := v.Get("rt.value")
- if t.String() == "variable" {
- item.RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RouteTarget = types.StringValue(va.String())
- }
- }
- data.Ipv6ImportRouteTargets = append(data.Ipv6ImportRouteTargets, item)
- return true
- })
- }
- if value := res.Get(path + "mplsVpnIpv6RouteTarget.exportRtList"); value.Exists() {
- data.Ipv6ExportRouteTargets = make([]ServiceLANVPNIpv6ExportRouteTargets, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := ServiceLANVPNIpv6ExportRouteTargets{}
- item.RouteTarget = types.StringNull()
- item.RouteTargetVariable = types.StringNull()
- if t := v.Get("rt.optionType"); t.Exists() {
- va := v.Get("rt.value")
- if t.String() == "variable" {
- item.RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RouteTarget = types.StringValue(va.String())
- }
- }
- data.Ipv6ExportRouteTargets = append(data.Ipv6ExportRouteTargets, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *ServiceLANVPN) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Vpn = types.Int64Null()
- data.VpnVariable = types.StringNull()
- if t := res.Get(path + "vpnId.optionType"); t.Exists() {
- va := res.Get(path + "vpnId.value")
- if t.String() == "variable" {
- data.VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Vpn = types.Int64Value(va.Int())
- }
- }
- data.ConfigDescription = types.StringNull()
- data.ConfigDescriptionVariable = types.StringNull()
- if t := res.Get(path + "name.optionType"); t.Exists() {
- va := res.Get(path + "name.value")
- if t.String() == "variable" {
- data.ConfigDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ConfigDescription = types.StringValue(va.String())
- }
- }
- data.OmpAdminDistanceIpv4 = types.Int64Null()
- data.OmpAdminDistanceIpv4Variable = types.StringNull()
- if t := res.Get(path + "ompAdminDistance.optionType"); t.Exists() {
- va := res.Get(path + "ompAdminDistance.value")
- if t.String() == "variable" {
- data.OmpAdminDistanceIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OmpAdminDistanceIpv4 = types.Int64Value(va.Int())
- }
- }
- data.OmpAdminDistanceIpv6 = types.Int64Null()
- data.OmpAdminDistanceIpv6Variable = types.StringNull()
- if t := res.Get(path + "ompAdminDistanceIpv6.optionType"); t.Exists() {
- va := res.Get(path + "ompAdminDistanceIpv6.value")
- if t.String() == "variable" {
- data.OmpAdminDistanceIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OmpAdminDistanceIpv6 = types.Int64Value(va.Int())
- }
- }
- data.EnableSdwanRemoteAccess = types.BoolNull()
-
- if t := res.Get(path + "enableSdra.optionType"); t.Exists() {
- va := res.Get(path + "enableSdra.value")
- if t.String() == "global" {
- data.EnableSdwanRemoteAccess = types.BoolValue(va.Bool())
- }
- }
- data.PrimaryDnsAddressIpv4 = types.StringNull()
- data.PrimaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv4 = types.StringNull()
- data.SecondaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv6 = types.StringNull()
- data.PrimaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv6 = types.StringNull()
- data.SecondaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- for i := range data.HostMappings {
- keys := [...]string{"hostName"}
- keyValues := [...]string{data.HostMappings[i].HostName.ValueString()}
- keyValuesVariables := [...]string{data.HostMappings[i].HostNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "newHostMapping").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.HostMappings[i].HostName = types.StringNull()
- data.HostMappings[i].HostNameVariable = types.StringNull()
- if t := r.Get("hostName.optionType"); t.Exists() {
- va := r.Get("hostName.value")
- if t.String() == "variable" {
- data.HostMappings[i].HostNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.HostMappings[i].HostName = types.StringValue(va.String())
- }
- }
- data.HostMappings[i].ListOfIps = types.SetNull(types.StringType)
- data.HostMappings[i].ListOfIpsVariable = types.StringNull()
- if t := r.Get("listOfIp.optionType"); t.Exists() {
- va := r.Get("listOfIp.value")
- if t.String() == "variable" {
- data.HostMappings[i].ListOfIpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.HostMappings[i].ListOfIps = helpers.GetStringSet(va.Array())
- }
- }
- }
- for i := range data.AdvertiseOmpIpv4s {
- keys := [...]string{"routePolicy.refId"}
- keyValues := [...]string{data.AdvertiseOmpIpv4s[i].RoutePolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "ompAdvertiseIp4").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.AdvertiseOmpIpv4s[i].Protocol = types.StringNull()
- data.AdvertiseOmpIpv4s[i].ProtocolVariable = types.StringNull()
- if t := r.Get("ompProtocol.optionType"); t.Exists() {
- va := r.Get("ompProtocol.value")
- if t.String() == "variable" {
- data.AdvertiseOmpIpv4s[i].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdvertiseOmpIpv4s[i].Protocol = types.StringValue(va.String())
- }
- }
- data.AdvertiseOmpIpv4s[i].RoutePolicyId = types.StringNull()
-
- if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
- va := r.Get("routePolicy.refId.value")
- if t.String() == "global" {
- data.AdvertiseOmpIpv4s[i].RoutePolicyId = types.StringValue(va.String())
- }
- }
- for ci := range data.AdvertiseOmpIpv4s[i].Prefixes {
- keys := [...]string{"prefix.address"}
- keyValues := [...]string{data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddress.ValueString()}
- keyValuesVariables := [...]string{data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("prefixList").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddress = types.StringNull()
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddressVariable = types.StringNull()
- if t := cr.Get("prefix.address.optionType"); t.Exists() {
- va := cr.Get("prefix.address.value")
- if t.String() == "variable" {
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMask = types.StringNull()
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMaskVariable = types.StringNull()
- if t := cr.Get("prefix.mask.optionType"); t.Exists() {
- va := cr.Get("prefix.mask.value")
- if t.String() == "variable" {
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].SubnetMask = types.StringValue(va.String())
- }
- }
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].AggregateOnly = types.BoolNull()
-
- if t := cr.Get("aggregateOnly.optionType"); t.Exists() {
- va := cr.Get("aggregateOnly.value")
- if t.String() == "global" {
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].AggregateOnly = types.BoolValue(va.Bool())
- }
- }
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].Region = types.StringNull()
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].RegionVariable = types.StringNull()
- if t := cr.Get("region.optionType"); t.Exists() {
- va := cr.Get("region.value")
- if t.String() == "variable" {
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].RegionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdvertiseOmpIpv4s[i].Prefixes[ci].Region = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.AdvertiseOmpIpv6s {
- keys := [...]string{"routePolicy.refId"}
- keyValues := [...]string{data.AdvertiseOmpIpv6s[i].RoutePolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "ompAdvertiseIpv6").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.AdvertiseOmpIpv6s[i].Protocol = types.StringNull()
- data.AdvertiseOmpIpv6s[i].ProtocolVariable = types.StringNull()
- if t := r.Get("ompProtocol.optionType"); t.Exists() {
- va := r.Get("ompProtocol.value")
- if t.String() == "variable" {
- data.AdvertiseOmpIpv6s[i].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdvertiseOmpIpv6s[i].Protocol = types.StringValue(va.String())
- }
- }
- data.AdvertiseOmpIpv6s[i].RoutePolicyId = types.StringNull()
-
- if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
- va := r.Get("routePolicy.refId.value")
- if t.String() == "global" {
- data.AdvertiseOmpIpv6s[i].RoutePolicyId = types.StringValue(va.String())
- }
- }
- data.AdvertiseOmpIpv6s[i].ProtocolSubType = types.StringNull()
- data.AdvertiseOmpIpv6s[i].ProtocolSubTypeVariable = types.StringNull()
- if t := r.Get("protocolSubType.optionType"); t.Exists() {
- va := r.Get("protocolSubType.value")
- if t.String() == "variable" {
- data.AdvertiseOmpIpv6s[i].ProtocolSubTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdvertiseOmpIpv6s[i].ProtocolSubType = types.StringValue(va.String())
- }
- }
- for ci := range data.AdvertiseOmpIpv6s[i].Prefixes {
- keys := [...]string{"prefix"}
- keyValues := [...]string{data.AdvertiseOmpIpv6s[i].Prefixes[ci].Prefix.ValueString()}
- keyValuesVariables := [...]string{data.AdvertiseOmpIpv6s[i].Prefixes[ci].PrefixVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("prefixList").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.AdvertiseOmpIpv6s[i].Prefixes[ci].Prefix = types.StringNull()
- data.AdvertiseOmpIpv6s[i].Prefixes[ci].PrefixVariable = types.StringNull()
- if t := cr.Get("prefix.optionType"); t.Exists() {
- va := cr.Get("prefix.value")
- if t.String() == "variable" {
- data.AdvertiseOmpIpv6s[i].Prefixes[ci].PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdvertiseOmpIpv6s[i].Prefixes[ci].Prefix = types.StringValue(va.String())
- }
- }
- data.AdvertiseOmpIpv6s[i].Prefixes[ci].AggregateOnly = types.BoolNull()
-
- if t := cr.Get("aggregateOnly.optionType"); t.Exists() {
- va := cr.Get("aggregateOnly.value")
- if t.String() == "global" {
- data.AdvertiseOmpIpv6s[i].Prefixes[ci].AggregateOnly = types.BoolValue(va.Bool())
- }
- }
- }
- }
- for i := range data.Ipv4StaticRoutes {
- keys := [...]string{"prefix.ipAddress"}
- keyValues := [...]string{data.Ipv4StaticRoutes[i].NetworkAddress.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NetworkAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv4Route").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4StaticRoutes[i].NetworkAddress = types.StringNull()
- data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := r.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].SubnetMask = types.StringNull()
- data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := r.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].SubnetMask = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv4StaticRoutes[i].NextHops {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringNull()
- data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
- if t := cr.Get("distance.optionType"); t.Exists() {
- va := cr.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- for ci := range data.Ipv4StaticRoutes[i].NextHopWithTrackers {
- keys := [...]string{}
- keyValues := [...]string{}
- keyValuesVariables := [...]string{}
-
- var cr gjson.Result
- r.Get("oneOfIpRoute.nextHopContainer.nextHopWithTracker").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].Address = types.StringNull()
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistance = types.Int64Null()
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistanceVariable = types.StringNull()
- if t := cr.Get("distance.optionType"); t.Exists() {
- va := cr.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].TrackerId = types.StringNull()
-
- if t := cr.Get("tracker.refId.optionType"); t.Exists() {
- va := cr.Get("tracker.refId.value")
- if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHopWithTrackers[ci].TrackerId = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4StaticRoutes[i].Null0 = types.BoolNull()
-
- if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- data.Ipv4StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4StaticRoutes[i].GatewayDhcp = types.BoolNull()
-
- if t := r.Get("oneOfIpRoute.dhcp.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.dhcp.value")
- if t.String() == "global" {
- data.Ipv4StaticRoutes[i].GatewayDhcp = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4StaticRoutes[i].Vpn = types.BoolNull()
-
- if t := r.Get("oneOfIpRoute.vpn.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.vpn.value")
- if t.String() == "global" {
- data.Ipv4StaticRoutes[i].Vpn = types.BoolValue(va.Bool())
- }
- }
- }
- for i := range data.Ipv6StaticRoutes {
- keys := [...]string{"prefix"}
- keyValues := [...]string{data.Ipv6StaticRoutes[i].Prefix.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].PrefixVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6Route").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6StaticRoutes[i].Prefix = types.StringNull()
- data.Ipv6StaticRoutes[i].PrefixVariable = types.StringNull()
- if t := r.Get("prefix.optionType"); t.Exists() {
- va := r.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Prefix = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv6StaticRoutes[i].NextHops {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringNull()
- data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
- if t := cr.Get("distance.optionType"); t.Exists() {
- va := cr.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- data.Ipv6StaticRoutes[i].Null0 = types.BoolNull()
-
- if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6StaticRoutes[i].Nat = types.StringNull()
- data.Ipv6StaticRoutes[i].NatVariable = types.StringNull()
- if t := r.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.nat.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NatVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Nat = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Services {
- keys := [...]string{"serviceType"}
- keyValues := [...]string{data.Services[i].ServiceType.ValueString()}
- keyValuesVariables := [...]string{data.Services[i].ServiceTypeVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "service").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Services[i].ServiceType = types.StringNull()
- data.Services[i].ServiceTypeVariable = types.StringNull()
- if t := r.Get("serviceType.optionType"); t.Exists() {
- va := r.Get("serviceType.value")
- if t.String() == "variable" {
- data.Services[i].ServiceTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Services[i].ServiceType = types.StringValue(va.String())
- }
- }
- data.Services[i].Ipv4Addresses = types.SetNull(types.StringType)
- data.Services[i].Ipv4AddressesVariable = types.StringNull()
- if t := r.Get("ipv4Addresses.optionType"); t.Exists() {
- va := r.Get("ipv4Addresses.value")
- if t.String() == "variable" {
- data.Services[i].Ipv4AddressesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Services[i].Ipv4Addresses = helpers.GetStringSet(va.Array())
- }
- }
- data.Services[i].Tracking = types.BoolNull()
- data.Services[i].TrackingVariable = types.StringNull()
- if t := r.Get("tracking.optionType"); t.Exists() {
- va := r.Get("tracking.value")
- if t.String() == "variable" {
- data.Services[i].TrackingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Services[i].Tracking = types.BoolValue(va.Bool())
- }
- }
- }
- for i := range data.ServiceRoutes {
- keys := [...]string{"prefix.ipAddress"}
- keyValues := [...]string{data.ServiceRoutes[i].NetworkAddress.ValueString()}
- keyValuesVariables := [...]string{data.ServiceRoutes[i].NetworkAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "serviceRoute").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.ServiceRoutes[i].NetworkAddress = types.StringNull()
- data.ServiceRoutes[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := r.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- data.ServiceRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ServiceRoutes[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.ServiceRoutes[i].SubnetMask = types.StringNull()
- data.ServiceRoutes[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := r.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- data.ServiceRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ServiceRoutes[i].SubnetMask = types.StringValue(va.String())
- }
- }
- data.ServiceRoutes[i].Service = types.StringNull()
- data.ServiceRoutes[i].ServiceVariable = types.StringNull()
- if t := r.Get("service.optionType"); t.Exists() {
- va := r.Get("service.value")
- if t.String() == "variable" {
- data.ServiceRoutes[i].ServiceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ServiceRoutes[i].Service = types.StringValue(va.String())
- }
- }
- data.ServiceRoutes[i].Vpn = types.Int64Null()
-
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "global" {
- data.ServiceRoutes[i].Vpn = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.GreRoutes {
- keys := [...]string{"prefix.ipAddress"}
- keyValues := [...]string{data.GreRoutes[i].NetworkAddress.ValueString()}
- keyValuesVariables := [...]string{data.GreRoutes[i].NetworkAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "greRoute").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.GreRoutes[i].NetworkAddress = types.StringNull()
- data.GreRoutes[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := r.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- data.GreRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GreRoutes[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.GreRoutes[i].SubnetMask = types.StringNull()
- data.GreRoutes[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := r.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- data.GreRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GreRoutes[i].SubnetMask = types.StringValue(va.String())
- }
- }
- data.GreRoutes[i].Interface = types.SetNull(types.StringType)
- data.GreRoutes[i].InterfaceVariable = types.StringNull()
- if t := r.Get("interface.optionType"); t.Exists() {
- va := r.Get("interface.value")
- if t.String() == "variable" {
- data.GreRoutes[i].InterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GreRoutes[i].Interface = helpers.GetStringSet(va.Array())
- }
- }
- data.GreRoutes[i].Vpn = types.Int64Null()
-
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "global" {
- data.GreRoutes[i].Vpn = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.IpsecRoutes {
- keys := [...]string{"prefix.ipAddress"}
- keyValues := [...]string{data.IpsecRoutes[i].NetworkAddress.ValueString()}
- keyValuesVariables := [...]string{data.IpsecRoutes[i].NetworkAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipsecRoute").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.IpsecRoutes[i].NetworkAddress = types.StringNull()
- data.IpsecRoutes[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := r.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- data.IpsecRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecRoutes[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.IpsecRoutes[i].SubnetMask = types.StringNull()
- data.IpsecRoutes[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := r.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- data.IpsecRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecRoutes[i].SubnetMask = types.StringValue(va.String())
- }
- }
- data.IpsecRoutes[i].Interface = types.SetNull(types.StringType)
- data.IpsecRoutes[i].InterfaceVariable = types.StringNull()
- if t := r.Get("interface.optionType"); t.Exists() {
- va := r.Get("interface.value")
- if t.String() == "variable" {
- data.IpsecRoutes[i].InterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecRoutes[i].Interface = helpers.GetStringSet(va.Array())
- }
- }
- }
- for i := range data.NatPools {
- keys := [...]string{"natPoolName"}
- keyValues := [...]string{strconv.FormatInt(data.NatPools[i].NatPoolName.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.NatPools[i].NatPoolNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "natPool").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.NatPools[i].NatPoolName = types.Int64Null()
- data.NatPools[i].NatPoolNameVariable = types.StringNull()
- if t := r.Get("natPoolName.optionType"); t.Exists() {
- va := r.Get("natPoolName.value")
- if t.String() == "variable" {
- data.NatPools[i].NatPoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPools[i].NatPoolName = types.Int64Value(va.Int())
- }
- }
- data.NatPools[i].PrefixLength = types.Int64Null()
- data.NatPools[i].PrefixLengthVariable = types.StringNull()
- if t := r.Get("prefixLength.optionType"); t.Exists() {
- va := r.Get("prefixLength.value")
- if t.String() == "variable" {
- data.NatPools[i].PrefixLengthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPools[i].PrefixLength = types.Int64Value(va.Int())
- }
- }
- data.NatPools[i].RangeStart = types.StringNull()
- data.NatPools[i].RangeStartVariable = types.StringNull()
- if t := r.Get("rangeStart.optionType"); t.Exists() {
- va := r.Get("rangeStart.value")
- if t.String() == "variable" {
- data.NatPools[i].RangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPools[i].RangeStart = types.StringValue(va.String())
- }
- }
- data.NatPools[i].RangeEnd = types.StringNull()
- data.NatPools[i].RangeEndVariable = types.StringNull()
- if t := r.Get("rangeEnd.optionType"); t.Exists() {
- va := r.Get("rangeEnd.value")
- if t.String() == "variable" {
- data.NatPools[i].RangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPools[i].RangeEnd = types.StringValue(va.String())
- }
- }
- data.NatPools[i].Overload = types.BoolNull()
- data.NatPools[i].OverloadVariable = types.StringNull()
- if t := r.Get("overload.optionType"); t.Exists() {
- va := r.Get("overload.value")
- if t.String() == "variable" {
- data.NatPools[i].OverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPools[i].Overload = types.BoolValue(va.Bool())
- }
- }
- data.NatPools[i].Direction = types.StringNull()
- data.NatPools[i].DirectionVariable = types.StringNull()
- if t := r.Get("direction.optionType"); t.Exists() {
- va := r.Get("direction.value")
- if t.String() == "variable" {
- data.NatPools[i].DirectionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPools[i].Direction = types.StringValue(va.String())
- }
- }
- data.NatPools[i].TrackerObjectId = types.StringNull()
-
- if t := r.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
- va := r.Get("trackingObject.trackerId.refId.value")
- if t.String() == "global" {
- data.NatPools[i].TrackerObjectId = types.StringValue(va.String())
- }
- }
- }
- for i := range data.NatPortForwards {
- keys := [...]string{"natPoolName"}
- keyValues := [...]string{strconv.FormatInt(data.NatPortForwards[i].NatPoolName.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.NatPortForwards[i].NatPoolNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "natPortForward").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.NatPortForwards[i].NatPoolName = types.Int64Null()
- data.NatPortForwards[i].NatPoolNameVariable = types.StringNull()
- if t := r.Get("natPoolName.optionType"); t.Exists() {
- va := r.Get("natPoolName.value")
- if t.String() == "variable" {
- data.NatPortForwards[i].NatPoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPortForwards[i].NatPoolName = types.Int64Value(va.Int())
- }
- }
- data.NatPortForwards[i].SourcePort = types.Int64Null()
- data.NatPortForwards[i].SourcePortVariable = types.StringNull()
- if t := r.Get("sourcePort.optionType"); t.Exists() {
- va := r.Get("sourcePort.value")
- if t.String() == "variable" {
- data.NatPortForwards[i].SourcePortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPortForwards[i].SourcePort = types.Int64Value(va.Int())
- }
- }
- data.NatPortForwards[i].TranslatePort = types.Int64Null()
- data.NatPortForwards[i].TranslatePortVariable = types.StringNull()
- if t := r.Get("translatePort.optionType"); t.Exists() {
- va := r.Get("translatePort.value")
- if t.String() == "variable" {
- data.NatPortForwards[i].TranslatePortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPortForwards[i].TranslatePort = types.Int64Value(va.Int())
- }
- }
- data.NatPortForwards[i].SourceIp = types.StringNull()
- data.NatPortForwards[i].SourceIpVariable = types.StringNull()
- if t := r.Get("sourceIp.optionType"); t.Exists() {
- va := r.Get("sourceIp.value")
- if t.String() == "variable" {
- data.NatPortForwards[i].SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPortForwards[i].SourceIp = types.StringValue(va.String())
- }
- }
- data.NatPortForwards[i].TranslatedSourceIp = types.StringNull()
- data.NatPortForwards[i].TranslatedSourceIpVariable = types.StringNull()
- if t := r.Get("TranslatedSourceIp.optionType"); t.Exists() {
- va := r.Get("TranslatedSourceIp.value")
- if t.String() == "variable" {
- data.NatPortForwards[i].TranslatedSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPortForwards[i].TranslatedSourceIp = types.StringValue(va.String())
- }
- }
- data.NatPortForwards[i].Protocol = types.StringNull()
- data.NatPortForwards[i].ProtocolVariable = types.StringNull()
- if t := r.Get("protocol.optionType"); t.Exists() {
- va := r.Get("protocol.value")
- if t.String() == "variable" {
- data.NatPortForwards[i].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPortForwards[i].Protocol = types.StringValue(va.String())
- }
- }
- }
- for i := range data.StaticNats {
- keys := [...]string{"natPoolName"}
- keyValues := [...]string{strconv.FormatInt(data.StaticNats[i].NatPoolName.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.StaticNats[i].NatPoolNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "staticNat").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.StaticNats[i].NatPoolName = types.Int64Null()
- data.StaticNats[i].NatPoolNameVariable = types.StringNull()
- if t := r.Get("natPoolName.optionType"); t.Exists() {
- va := r.Get("natPoolName.value")
- if t.String() == "variable" {
- data.StaticNats[i].NatPoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNats[i].NatPoolName = types.Int64Value(va.Int())
- }
- }
- data.StaticNats[i].SourceIp = types.StringNull()
- data.StaticNats[i].SourceIpVariable = types.StringNull()
- if t := r.Get("sourceIp.optionType"); t.Exists() {
- va := r.Get("sourceIp.value")
- if t.String() == "variable" {
- data.StaticNats[i].SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNats[i].SourceIp = types.StringValue(va.String())
- }
- }
- data.StaticNats[i].TranslatedSourceIp = types.StringNull()
- data.StaticNats[i].TranslatedSourceIpVariable = types.StringNull()
- if t := r.Get("TranslatedSourceIp.optionType"); t.Exists() {
- va := r.Get("TranslatedSourceIp.value")
- if t.String() == "variable" {
- data.StaticNats[i].TranslatedSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNats[i].TranslatedSourceIp = types.StringValue(va.String())
- }
- }
- data.StaticNats[i].StaticNatDirection = types.StringNull()
- data.StaticNats[i].StaticNatDirectionVariable = types.StringNull()
- if t := r.Get("staticNatDirection.optionType"); t.Exists() {
- va := r.Get("staticNatDirection.value")
- if t.String() == "variable" {
- data.StaticNats[i].StaticNatDirectionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNats[i].StaticNatDirection = types.StringValue(va.String())
- }
- }
- data.StaticNats[i].TrackerObjectId = types.StringNull()
-
- if t := r.Get("trackingObject.trackerId.refId.optionType"); t.Exists() {
- va := r.Get("trackingObject.trackerId.refId.value")
- if t.String() == "global" {
- data.StaticNats[i].TrackerObjectId = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Nat64V4Pools {
- keys := [...]string{"nat64V4PoolName"}
- keyValues := [...]string{data.Nat64V4Pools[i].Name.ValueString()}
- keyValuesVariables := [...]string{data.Nat64V4Pools[i].NameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "nat64V4Pool").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Nat64V4Pools[i].Name = types.StringNull()
- data.Nat64V4Pools[i].NameVariable = types.StringNull()
- if t := r.Get("nat64V4PoolName.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolName.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].NameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].Name = types.StringValue(va.String())
- }
- }
- data.Nat64V4Pools[i].RangeStart = types.StringNull()
- data.Nat64V4Pools[i].RangeStartVariable = types.StringNull()
- if t := r.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolRangeStart.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].RangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].RangeStart = types.StringValue(va.String())
- }
- }
- data.Nat64V4Pools[i].RangeEnd = types.StringNull()
- data.Nat64V4Pools[i].RangeEndVariable = types.StringNull()
- if t := r.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolRangeEnd.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].RangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].RangeEnd = types.StringValue(va.String())
- }
- }
- data.Nat64V4Pools[i].Overload = types.BoolNull()
- data.Nat64V4Pools[i].OverloadVariable = types.StringNull()
- if t := r.Get("nat64V4PoolOverload.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolOverload.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].OverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].Overload = types.BoolValue(va.Bool())
- }
- }
- }
- for i := range data.RouteLeakFromGlobalVpns {
- keys := [...]string{"routePolicy.refId"}
- keyValues := [...]string{data.RouteLeakFromGlobalVpns[i].RoutePolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "routeLeakFromGlobal").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.RouteLeakFromGlobalVpns[i].RouteProtocol = types.StringNull()
- data.RouteLeakFromGlobalVpns[i].RouteProtocolVariable = types.StringNull()
- if t := r.Get("routeProtocol.optionType"); t.Exists() {
- va := r.Get("routeProtocol.value")
- if t.String() == "variable" {
- data.RouteLeakFromGlobalVpns[i].RouteProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouteLeakFromGlobalVpns[i].RouteProtocol = types.StringValue(va.String())
- }
- }
- data.RouteLeakFromGlobalVpns[i].RoutePolicyId = types.StringNull()
-
- if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
- va := r.Get("routePolicy.refId.value")
- if t.String() == "global" {
- data.RouteLeakFromGlobalVpns[i].RoutePolicyId = types.StringValue(va.String())
- }
- }
- for ci := range data.RouteLeakFromGlobalVpns[i].Redistributions {
- keys := [...]string{"policy.refId"}
- keyValues := [...]string{data.RouteLeakFromGlobalVpns[i].Redistributions[ci].RedistributionPolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("redistributeToProtocol").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.RouteLeakFromGlobalVpns[i].Redistributions[ci].Protocol = types.StringNull()
- data.RouteLeakFromGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringNull()
- if t := cr.Get("protocol.optionType"); t.Exists() {
- va := cr.Get("protocol.value")
- if t.String() == "variable" {
- data.RouteLeakFromGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouteLeakFromGlobalVpns[i].Redistributions[ci].Protocol = types.StringValue(va.String())
- }
- }
- data.RouteLeakFromGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringNull()
-
- if t := cr.Get("policy.refId.optionType"); t.Exists() {
- va := cr.Get("policy.refId.value")
- if t.String() == "global" {
- data.RouteLeakFromGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.RouteLeakToGlobalVpns {
- keys := [...]string{"routePolicy.refId"}
- keyValues := [...]string{data.RouteLeakToGlobalVpns[i].RoutePolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "routeLeakFromService").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.RouteLeakToGlobalVpns[i].RouteProtocol = types.StringNull()
- data.RouteLeakToGlobalVpns[i].RouteProtocolVariable = types.StringNull()
- if t := r.Get("routeProtocol.optionType"); t.Exists() {
- va := r.Get("routeProtocol.value")
- if t.String() == "variable" {
- data.RouteLeakToGlobalVpns[i].RouteProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouteLeakToGlobalVpns[i].RouteProtocol = types.StringValue(va.String())
- }
- }
- data.RouteLeakToGlobalVpns[i].RoutePolicyId = types.StringNull()
-
- if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
- va := r.Get("routePolicy.refId.value")
- if t.String() == "global" {
- data.RouteLeakToGlobalVpns[i].RoutePolicyId = types.StringValue(va.String())
- }
- }
- for ci := range data.RouteLeakToGlobalVpns[i].Redistributions {
- keys := [...]string{"policy.refId"}
- keyValues := [...]string{data.RouteLeakToGlobalVpns[i].Redistributions[ci].RedistributionPolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("redistributeToProtocol").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.RouteLeakToGlobalVpns[i].Redistributions[ci].Protocol = types.StringNull()
- data.RouteLeakToGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringNull()
- if t := cr.Get("protocol.optionType"); t.Exists() {
- va := cr.Get("protocol.value")
- if t.String() == "variable" {
- data.RouteLeakToGlobalVpns[i].Redistributions[ci].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouteLeakToGlobalVpns[i].Redistributions[ci].Protocol = types.StringValue(va.String())
- }
- }
- data.RouteLeakToGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringNull()
-
- if t := cr.Get("policy.refId.optionType"); t.Exists() {
- va := cr.Get("policy.refId.value")
- if t.String() == "global" {
- data.RouteLeakToGlobalVpns[i].Redistributions[ci].RedistributionPolicyId = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.RouteLeakFromOtherServices {
- keys := [...]string{"routePolicy.refId"}
- keyValues := [...]string{data.RouteLeakFromOtherServices[i].RoutePolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "routeLeakBetweenServices").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.RouteLeakFromOtherServices[i].SourceVpn = types.Int64Null()
- data.RouteLeakFromOtherServices[i].SourceVpnVariable = types.StringNull()
- if t := r.Get("sourceVpn.optionType"); t.Exists() {
- va := r.Get("sourceVpn.value")
- if t.String() == "variable" {
- data.RouteLeakFromOtherServices[i].SourceVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouteLeakFromOtherServices[i].SourceVpn = types.Int64Value(va.Int())
- }
- }
- data.RouteLeakFromOtherServices[i].RouteProtocol = types.StringNull()
- data.RouteLeakFromOtherServices[i].RouteProtocolVariable = types.StringNull()
- if t := r.Get("routeProtocol.optionType"); t.Exists() {
- va := r.Get("routeProtocol.value")
- if t.String() == "variable" {
- data.RouteLeakFromOtherServices[i].RouteProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouteLeakFromOtherServices[i].RouteProtocol = types.StringValue(va.String())
- }
- }
- data.RouteLeakFromOtherServices[i].RoutePolicyId = types.StringNull()
-
- if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
- va := r.Get("routePolicy.refId.value")
- if t.String() == "global" {
- data.RouteLeakFromOtherServices[i].RoutePolicyId = types.StringValue(va.String())
- }
- }
- for ci := range data.RouteLeakFromOtherServices[i].Redistributions {
- keys := [...]string{"policy.refId"}
- keyValues := [...]string{data.RouteLeakFromOtherServices[i].Redistributions[ci].RedistributionPolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("redistributeToProtocol").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.RouteLeakFromOtherServices[i].Redistributions[ci].Protocol = types.StringNull()
- data.RouteLeakFromOtherServices[i].Redistributions[ci].ProtocolVariable = types.StringNull()
- if t := cr.Get("protocol.optionType"); t.Exists() {
- va := cr.Get("protocol.value")
- if t.String() == "variable" {
- data.RouteLeakFromOtherServices[i].Redistributions[ci].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouteLeakFromOtherServices[i].Redistributions[ci].Protocol = types.StringValue(va.String())
- }
- }
- data.RouteLeakFromOtherServices[i].Redistributions[ci].RedistributionPolicyId = types.StringNull()
-
- if t := cr.Get("policy.refId.optionType"); t.Exists() {
- va := cr.Get("policy.refId.value")
- if t.String() == "global" {
- data.RouteLeakFromOtherServices[i].Redistributions[ci].RedistributionPolicyId = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.Ipv4ImportRouteTargets {
- keys := [...]string{"rt"}
- keyValues := [...]string{data.Ipv4ImportRouteTargets[i].RouteTarget.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4ImportRouteTargets[i].RouteTargetVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "mplsVpnIpv4RouteTarget.importRtList").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4ImportRouteTargets[i].RouteTarget = types.StringNull()
- data.Ipv4ImportRouteTargets[i].RouteTargetVariable = types.StringNull()
- if t := r.Get("rt.optionType"); t.Exists() {
- va := r.Get("rt.value")
- if t.String() == "variable" {
- data.Ipv4ImportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4ImportRouteTargets[i].RouteTarget = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv4ExportRouteTargets {
- keys := [...]string{"rt"}
- keyValues := [...]string{data.Ipv4ExportRouteTargets[i].RouteTarget.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4ExportRouteTargets[i].RouteTargetVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "mplsVpnIpv4RouteTarget.exportRtList").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4ExportRouteTargets[i].RouteTarget = types.StringNull()
- data.Ipv4ExportRouteTargets[i].RouteTargetVariable = types.StringNull()
- if t := r.Get("rt.optionType"); t.Exists() {
- va := r.Get("rt.value")
- if t.String() == "variable" {
- data.Ipv4ExportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4ExportRouteTargets[i].RouteTarget = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv6ImportRouteTargets {
- keys := [...]string{"rt"}
- keyValues := [...]string{data.Ipv6ImportRouteTargets[i].RouteTarget.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6ImportRouteTargets[i].RouteTargetVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "mplsVpnIpv6RouteTarget.importRtList").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6ImportRouteTargets[i].RouteTarget = types.StringNull()
- data.Ipv6ImportRouteTargets[i].RouteTargetVariable = types.StringNull()
- if t := r.Get("rt.optionType"); t.Exists() {
- va := r.Get("rt.value")
- if t.String() == "variable" {
- data.Ipv6ImportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6ImportRouteTargets[i].RouteTarget = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv6ExportRouteTargets {
- keys := [...]string{"rt"}
- keyValues := [...]string{data.Ipv6ExportRouteTargets[i].RouteTarget.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6ExportRouteTargets[i].RouteTargetVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "mplsVpnIpv6RouteTarget.exportRtList").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6ExportRouteTargets[i].RouteTarget = types.StringNull()
- data.Ipv6ExportRouteTargets[i].RouteTargetVariable = types.StringNull()
- if t := r.Get("rt.optionType"); t.Exists() {
- va := r.Get("rt.value")
- if t.String() == "variable" {
- data.Ipv6ExportRouteTargets[i].RouteTargetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6ExportRouteTargets[i].RouteTarget = types.StringValue(va.String())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *ServiceLANVPN) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.Vpn.IsNull() {
- return false
- }
- if !data.VpnVariable.IsNull() {
- return false
- }
- if !data.ConfigDescription.IsNull() {
- return false
- }
- if !data.ConfigDescriptionVariable.IsNull() {
- return false
- }
- if !data.OmpAdminDistanceIpv4.IsNull() {
- return false
- }
- if !data.OmpAdminDistanceIpv4Variable.IsNull() {
- return false
- }
- if !data.OmpAdminDistanceIpv6.IsNull() {
- return false
- }
- if !data.OmpAdminDistanceIpv6Variable.IsNull() {
- return false
- }
- if !data.EnableSdwanRemoteAccess.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv4.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv4.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv6.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv6.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
- return false
- }
- if len(data.HostMappings) > 0 {
- return false
- }
- if len(data.AdvertiseOmpIpv4s) > 0 {
- return false
- }
- if len(data.AdvertiseOmpIpv6s) > 0 {
- return false
- }
- if len(data.Ipv4StaticRoutes) > 0 {
- return false
- }
- if len(data.Ipv6StaticRoutes) > 0 {
- return false
- }
- if len(data.Services) > 0 {
- return false
- }
- if len(data.ServiceRoutes) > 0 {
- return false
- }
- if len(data.GreRoutes) > 0 {
- return false
- }
- if len(data.IpsecRoutes) > 0 {
- return false
- }
- if len(data.NatPools) > 0 {
- return false
- }
- if len(data.NatPortForwards) > 0 {
- return false
- }
- if len(data.StaticNats) > 0 {
- return false
- }
- if len(data.Nat64V4Pools) > 0 {
- return false
- }
- if len(data.RouteLeakFromGlobalVpns) > 0 {
- return false
- }
- if len(data.RouteLeakToGlobalVpns) > 0 {
- return false
- }
- if len(data.RouteLeakFromOtherServices) > 0 {
- return false
- }
- if len(data.Ipv4ImportRouteTargets) > 0 {
- return false
- }
- if len(data.Ipv4ExportRouteTargets) > 0 {
- return false
- }
- if len(data.Ipv6ImportRouteTargets) > 0 {
- return false
- }
- if len(data.Ipv6ExportRouteTargets) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_object_tracker_feature.go b/internal/provider/model_sdwan_service_object_tracker_feature.go
new file mode 100644
index 000000000..61a342a4d
--- /dev/null
+++ b/internal/provider/model_sdwan_service_object_tracker_feature.go
@@ -0,0 +1,339 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceObjectTracker 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"`
+ ObjectTrackerId types.Int64 `tfsdk:"object_tracker_id"`
+ ObjectTrackerIdVariable types.String `tfsdk:"object_tracker_id_variable"`
+ ObjectTrackerType types.String `tfsdk:"object_tracker_type"`
+ Interface types.String `tfsdk:"interface"`
+ InterfaceVariable types.String `tfsdk:"interface_variable"`
+ RouteIp types.String `tfsdk:"route_ip"`
+ RouteIpVariable types.String `tfsdk:"route_ip_variable"`
+ RouteMask types.String `tfsdk:"route_mask"`
+ RouteMaskVariable types.String `tfsdk:"route_mask_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ VpnVariable types.String `tfsdk:"vpn_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceObjectTracker) getModel() string {
+ return "service_object_tracker"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceObjectTracker) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/objecttracker", 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 ServiceObjectTracker) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ObjectTrackerIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"objectId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerIdVariable.ValueString())
+ }
+ } else if !data.ObjectTrackerId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"objectId.optionType", "global")
+ body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerId.ValueInt64())
+ }
+ }
+ if !data.ObjectTrackerType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"objectTrackerType.optionType", "global")
+ body, _ = sjson.Set(body, path+"objectTrackerType.value", data.ObjectTrackerType.ValueString())
+ }
+ }
+
+ if !data.InterfaceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interface.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interface.value", data.InterfaceVariable.ValueString())
+ }
+ } else if !data.Interface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interface.optionType", "global")
+ body, _ = sjson.Set(body, path+"interface.value", data.Interface.ValueString())
+ }
+ }
+
+ if !data.RouteIpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routeIp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"routeIp.value", data.RouteIpVariable.ValueString())
+ }
+ } else if !data.RouteIp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routeIp.optionType", "global")
+ body, _ = sjson.Set(body, path+"routeIp.value", data.RouteIp.ValueString())
+ }
+ }
+
+ if !data.RouteMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routeMask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"routeMask.value", data.RouteMaskVariable.ValueString())
+ }
+ } else if data.RouteMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routeMask.optionType", "default")
+ body, _ = sjson.Set(body, path+"routeMask.value", "0.0.0.0")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"routeMask.optionType", "global")
+ body, _ = sjson.Set(body, path+"routeMask.value", data.RouteMask.ValueString())
+ }
+ }
+
+ if !data.VpnVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"vpn.optionType", "variable")
+ body, _ = sjson.Set(body, path+"vpn.value", data.VpnVariable.ValueString())
+ }
+ } else if data.Vpn.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"vpn.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"vpn.optionType", "global")
+ body, _ = sjson.Set(body, path+"vpn.value", data.Vpn.ValueInt64())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceObjectTracker) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.ObjectTrackerId = types.Int64Null()
+ data.ObjectTrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "objectId.optionType"); t.Exists() {
+ va := res.Get(path + "objectId.value")
+ if t.String() == "variable" {
+ data.ObjectTrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ObjectTrackerId = types.Int64Value(va.Int())
+ }
+ }
+ data.ObjectTrackerType = types.StringNull()
+
+ if t := res.Get(path + "objectTrackerType.optionType"); t.Exists() {
+ va := res.Get(path + "objectTrackerType.value")
+ if t.String() == "global" {
+ data.ObjectTrackerType = types.StringValue(va.String())
+ }
+ }
+ data.Interface = types.StringNull()
+ data.InterfaceVariable = types.StringNull()
+ if t := res.Get(path + "interface.optionType"); t.Exists() {
+ va := res.Get(path + "interface.value")
+ if t.String() == "variable" {
+ data.InterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interface = types.StringValue(va.String())
+ }
+ }
+ data.RouteIp = types.StringNull()
+ data.RouteIpVariable = types.StringNull()
+ if t := res.Get(path + "routeIp.optionType"); t.Exists() {
+ va := res.Get(path + "routeIp.value")
+ if t.String() == "variable" {
+ data.RouteIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteIp = types.StringValue(va.String())
+ }
+ }
+ data.RouteMask = types.StringNull()
+ data.RouteMaskVariable = types.StringNull()
+ if t := res.Get(path + "routeMask.optionType"); t.Exists() {
+ va := res.Get(path + "routeMask.value")
+ if t.String() == "variable" {
+ data.RouteMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteMask = types.StringValue(va.String())
+ }
+ }
+ data.Vpn = types.Int64Null()
+ data.VpnVariable = types.StringNull()
+ if t := res.Get(path + "vpn.optionType"); t.Exists() {
+ va := res.Get(path + "vpn.value")
+ if t.String() == "variable" {
+ data.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Vpn = types.Int64Value(va.Int())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceObjectTracker) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.ObjectTrackerId = types.Int64Null()
+ data.ObjectTrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "objectId.optionType"); t.Exists() {
+ va := res.Get(path + "objectId.value")
+ if t.String() == "variable" {
+ data.ObjectTrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ObjectTrackerId = types.Int64Value(va.Int())
+ }
+ }
+ data.ObjectTrackerType = types.StringNull()
+
+ if t := res.Get(path + "objectTrackerType.optionType"); t.Exists() {
+ va := res.Get(path + "objectTrackerType.value")
+ if t.String() == "global" {
+ data.ObjectTrackerType = types.StringValue(va.String())
+ }
+ }
+ data.Interface = types.StringNull()
+ data.InterfaceVariable = types.StringNull()
+ if t := res.Get(path + "interface.optionType"); t.Exists() {
+ va := res.Get(path + "interface.value")
+ if t.String() == "variable" {
+ data.InterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interface = types.StringValue(va.String())
+ }
+ }
+ data.RouteIp = types.StringNull()
+ data.RouteIpVariable = types.StringNull()
+ if t := res.Get(path + "routeIp.optionType"); t.Exists() {
+ va := res.Get(path + "routeIp.value")
+ if t.String() == "variable" {
+ data.RouteIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteIp = types.StringValue(va.String())
+ }
+ }
+ data.RouteMask = types.StringNull()
+ data.RouteMaskVariable = types.StringNull()
+ if t := res.Get(path + "routeMask.optionType"); t.Exists() {
+ va := res.Get(path + "routeMask.value")
+ if t.String() == "variable" {
+ data.RouteMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouteMask = types.StringValue(va.String())
+ }
+ }
+ data.Vpn = types.Int64Null()
+ data.VpnVariable = types.StringNull()
+ if t := res.Get(path + "vpn.optionType"); t.Exists() {
+ va := res.Get(path + "vpn.value")
+ if t.String() == "variable" {
+ data.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Vpn = types.Int64Value(va.Int())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceObjectTracker) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.ObjectTrackerId.IsNull() {
+ return false
+ }
+ if !data.ObjectTrackerIdVariable.IsNull() {
+ return false
+ }
+ if !data.ObjectTrackerType.IsNull() {
+ return false
+ }
+ if !data.Interface.IsNull() {
+ return false
+ }
+ if !data.InterfaceVariable.IsNull() {
+ return false
+ }
+ if !data.RouteIp.IsNull() {
+ return false
+ }
+ if !data.RouteIpVariable.IsNull() {
+ return false
+ }
+ if !data.RouteMask.IsNull() {
+ return false
+ }
+ if !data.RouteMaskVariable.IsNull() {
+ return false
+ }
+ if !data.Vpn.IsNull() {
+ return false
+ }
+ if !data.VpnVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_object_tracker_group_feature.go b/internal/provider/model_sdwan_service_object_tracker_group_feature.go
new file mode 100644
index 000000000..98cf89263
--- /dev/null
+++ b/internal/provider/model_sdwan_service_object_tracker_group_feature.go
@@ -0,0 +1,263 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceObjectTrackerGroup 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"`
+ ObjectTrackerId types.Int64 `tfsdk:"object_tracker_id"`
+ ObjectTrackerIdVariable types.String `tfsdk:"object_tracker_id_variable"`
+ TrackerElements []ServiceObjectTrackerGroupTrackerElements `tfsdk:"tracker_elements"`
+ Reachable types.String `tfsdk:"reachable"`
+ ReachableVariable types.String `tfsdk:"reachable_variable"`
+}
+
+type ServiceObjectTrackerGroupTrackerElements struct {
+ ObjectTrackerId types.String `tfsdk:"object_tracker_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceObjectTrackerGroup) getModel() string {
+ return "service_object_tracker_group"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceObjectTrackerGroup) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/objecttrackergroup", 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 ServiceObjectTrackerGroup) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ObjectTrackerIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"objectId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerIdVariable.ValueString())
+ }
+ } else if !data.ObjectTrackerId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"objectId.optionType", "global")
+ body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerId.ValueInt64())
+ }
+ }
+ if true {
+
+ for _, item := range data.TrackerElements {
+ itemBody := ""
+ if !item.ObjectTrackerId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.ObjectTrackerId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody)
+ }
+ }
+
+ if !data.ReachableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"criteria.optionType", "variable")
+ body, _ = sjson.Set(body, path+"criteria.value", data.ReachableVariable.ValueString())
+ }
+ } else if data.Reachable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"criteria.optionType", "default")
+ body, _ = sjson.Set(body, path+"criteria.value", "or")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"criteria.optionType", "global")
+ body, _ = sjson.Set(body, path+"criteria.value", data.Reachable.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceObjectTrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.ObjectTrackerId = types.Int64Null()
+ data.ObjectTrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "objectId.optionType"); t.Exists() {
+ va := res.Get(path + "objectId.value")
+ if t.String() == "variable" {
+ data.ObjectTrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ObjectTrackerId = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "trackerRefs"); value.Exists() {
+ data.TrackerElements = make([]ServiceObjectTrackerGroupTrackerElements, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceObjectTrackerGroupTrackerElements{}
+ item.ObjectTrackerId = types.StringNull()
+
+ if t := v.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := v.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ item.ObjectTrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TrackerElements = append(data.TrackerElements, item)
+ return true
+ })
+ }
+ data.Reachable = types.StringNull()
+ data.ReachableVariable = types.StringNull()
+ if t := res.Get(path + "criteria.optionType"); t.Exists() {
+ va := res.Get(path + "criteria.value")
+ if t.String() == "variable" {
+ data.ReachableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Reachable = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceObjectTrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.ObjectTrackerId = types.Int64Null()
+ data.ObjectTrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "objectId.optionType"); t.Exists() {
+ va := res.Get(path + "objectId.value")
+ if t.String() == "variable" {
+ data.ObjectTrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ObjectTrackerId = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.TrackerElements {
+ keys := [...]string{"trackerRef.refId"}
+ keyValues := [...]string{data.TrackerElements[i].ObjectTrackerId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "trackerRefs").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TrackerElements[i].ObjectTrackerId = types.StringNull()
+
+ if t := r.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := r.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ data.TrackerElements[i].ObjectTrackerId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Reachable = types.StringNull()
+ data.ReachableVariable = types.StringNull()
+ if t := res.Get(path + "criteria.optionType"); t.Exists() {
+ va := res.Get(path + "criteria.value")
+ if t.String() == "variable" {
+ data.ReachableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Reachable = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceObjectTrackerGroup) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.ObjectTrackerId.IsNull() {
+ return false
+ }
+ if !data.ObjectTrackerIdVariable.IsNull() {
+ return false
+ }
+ if len(data.TrackerElements) > 0 {
+ return false
+ }
+ if !data.Reachable.IsNull() {
+ return false
+ }
+ if !data.ReachableVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_route_policy_feature.go b/internal/provider/model_sdwan_service_route_policy_feature.go
new file mode 100644
index 000000000..b7f7f2ad0
--- /dev/null
+++ b/internal/provider/model_sdwan_service_route_policy_feature.go
@@ -0,0 +1,1035 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceRoutePolicy 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"`
+ DefaultAction types.String `tfsdk:"default_action"`
+ Sequences []ServiceRoutePolicySequences `tfsdk:"sequences"`
+}
+
+type ServiceRoutePolicySequences struct {
+ Id types.Int64 `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ BaseAction types.String `tfsdk:"base_action"`
+ Protocol types.String `tfsdk:"protocol"`
+ MatchEntries []ServiceRoutePolicySequencesMatchEntries `tfsdk:"match_entries"`
+ Actions []ServiceRoutePolicySequencesActions `tfsdk:"actions"`
+}
+
+type ServiceRoutePolicySequencesMatchEntries struct {
+ AsPathListId types.String `tfsdk:"as_path_list_id"`
+ StandardCommunityListCriteria types.String `tfsdk:"standard_community_list_criteria"`
+ StandardCommunityLists []ServiceRoutePolicySequencesMatchEntriesStandardCommunityLists `tfsdk:"standard_community_lists"`
+ ExpandedCommunityListId types.String `tfsdk:"expanded_community_list_id"`
+ ExtendedCommunityListId types.String `tfsdk:"extended_community_list_id"`
+ BgpLocalPreference types.Int64 `tfsdk:"bgp_local_preference"`
+ Metric types.Int64 `tfsdk:"metric"`
+ OmpTag types.Int64 `tfsdk:"omp_tag"`
+ OspfTag types.Int64 `tfsdk:"ospf_tag"`
+ Ipv4AddressPrefixListId types.String `tfsdk:"ipv4_address_prefix_list_id"`
+ Ipv4NextHopPrefixListId types.String `tfsdk:"ipv4_next_hop_prefix_list_id"`
+ Ipv6AddressPrefixListId types.String `tfsdk:"ipv6_address_prefix_list_id"`
+ Ipv6NextHopPrefixListId types.String `tfsdk:"ipv6_next_hop_prefix_list_id"`
+}
+type ServiceRoutePolicySequencesActions struct {
+ AsPathPrepend types.Set `tfsdk:"as_path_prepend"`
+ CommunityAdditive types.Bool `tfsdk:"community_additive"`
+ Community types.Set `tfsdk:"community"`
+ CommunityVariable types.String `tfsdk:"community_variable"`
+ LocalPreference types.Int64 `tfsdk:"local_preference"`
+ Metric types.Int64 `tfsdk:"metric"`
+ MetricType types.String `tfsdk:"metric_type"`
+ OmpTag types.Int64 `tfsdk:"omp_tag"`
+ Origin types.String `tfsdk:"origin"`
+ OspfTag types.Int64 `tfsdk:"ospf_tag"`
+ Weight types.Int64 `tfsdk:"weight"`
+ Ipv4NextHop types.String `tfsdk:"ipv4_next_hop"`
+ Ipv6NextHop types.String `tfsdk:"ipv6_next_hop"`
+}
+
+type ServiceRoutePolicySequencesMatchEntriesStandardCommunityLists struct {
+ Id types.String `tfsdk:"id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceRoutePolicy) getModel() string {
+ return "service_route_policy"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceRoutePolicy) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/route-policy", 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 ServiceRoutePolicy) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if data.DefaultAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "default")
+ body, _ = sjson.Set(body, path+"defaultAction.value", "reject")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "global")
+ body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"sequences", []interface{}{})
+ for _, item := range data.Sequences {
+ itemBody := ""
+ if !item.Id.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64())
+ }
+ }
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString())
+ }
+ }
+ if item.BaseAction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "baseAction.value", "reject")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString())
+ }
+ }
+ if item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", "IPV4")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.MatchEntries {
+ itemChildBody := ""
+ if !childItem.AsPathListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.value", childItem.AsPathListId.ValueString())
+ }
+ }
+ if !childItem.StandardCommunityListCriteria.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.value", childItem.StandardCommunityListCriteria.ValueString())
+ }
+ }
+ if true {
+
+ for _, childChildItem := range childItem.StandardCommunityLists {
+ itemChildChildBody := ""
+ if !childChildItem.Id.IsNull() {
+ if true {
+ itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.optionType", "global")
+ itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.value", childChildItem.Id.ValueString())
+ }
+ }
+ itemChildBody, _ = sjson.SetRaw(itemChildBody, "communityList.standardCommunityList.-1", itemChildChildBody)
+ }
+ }
+ if !childItem.ExpandedCommunityListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.value", childItem.ExpandedCommunityListId.ValueString())
+ }
+ }
+ if !childItem.ExtendedCommunityListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.value", childItem.ExtendedCommunityListId.ValueString())
+ }
+ }
+ if !childItem.BgpLocalPreference.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.value", childItem.BgpLocalPreference.ValueInt64())
+ }
+ }
+ if !childItem.Metric.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "metric.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "metric.value", childItem.Metric.ValueInt64())
+ }
+ }
+ if !childItem.OmpTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.value", childItem.OmpTag.ValueInt64())
+ }
+ }
+ if !childItem.OspfTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.value", childItem.OspfTag.ValueInt64())
+ }
+ }
+ if !childItem.Ipv4AddressPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.value", childItem.Ipv4AddressPrefixListId.ValueString())
+ }
+ }
+ if !childItem.Ipv4NextHopPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.value", childItem.Ipv4NextHopPrefixListId.ValueString())
+ }
+ }
+ if !childItem.Ipv6AddressPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.value", childItem.Ipv6AddressPrefixListId.ValueString())
+ }
+ }
+ if !childItem.Ipv6NextHopPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.value", childItem.Ipv6NextHopPrefixListId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "matchEntries.-1", itemChildBody)
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Actions {
+ itemChildBody := ""
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.value", true)
+ }
+ if !childItem.AsPathPrepend.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.optionType", "global")
+ var values []int64
+ childItem.AsPathPrepend.ElementsAs(ctx, &values, false)
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.value", values)
+ }
+ }
+ if childItem.CommunityAdditive.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", childItem.CommunityAdditive.ValueBool())
+ }
+ }
+
+ if !childItem.CommunityVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.value", childItem.CommunityVariable.ValueString())
+ }
+ } else if !childItem.Community.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.optionType", "global")
+ var values []string
+ childItem.Community.ElementsAs(ctx, &values, false)
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.value", values)
+ }
+ }
+ if !childItem.LocalPreference.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.value", childItem.LocalPreference.ValueInt64())
+ }
+ }
+ if !childItem.Metric.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.value", childItem.Metric.ValueInt64())
+ }
+ }
+ if !childItem.MetricType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.value", childItem.MetricType.ValueString())
+ }
+ }
+ if !childItem.OmpTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.value", childItem.OmpTag.ValueInt64())
+ }
+ }
+ if !childItem.Origin.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.value", childItem.Origin.ValueString())
+ }
+ }
+ if !childItem.OspfTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.value", childItem.OspfTag.ValueInt64())
+ }
+ }
+ if !childItem.Weight.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.value", childItem.Weight.ValueInt64())
+ }
+ }
+ if !childItem.Ipv4NextHop.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.value", childItem.Ipv4NextHop.ValueString())
+ }
+ }
+ if !childItem.Ipv6NextHop.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.value", childItem.Ipv6NextHop.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "actions.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceRoutePolicy) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "sequences"); value.Exists() {
+ data.Sequences = make([]ServiceRoutePolicySequences, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutePolicySequences{}
+ item.Id = types.Int64Null()
+
+ if t := v.Get("sequenceId.optionType"); t.Exists() {
+ va := v.Get("sequenceId.value")
+ if t.String() == "global" {
+ item.Id = types.Int64Value(va.Int())
+ }
+ }
+ item.Name = types.StringNull()
+
+ if t := v.Get("sequenceName.optionType"); t.Exists() {
+ va := v.Get("sequenceName.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.BaseAction = types.StringNull()
+
+ if t := v.Get("baseAction.optionType"); t.Exists() {
+ va := v.Get("baseAction.value")
+ if t.String() == "global" {
+ item.BaseAction = types.StringValue(va.String())
+ }
+ }
+ item.Protocol = types.StringNull()
+
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("matchEntries"); cValue.Exists() {
+ item.MatchEntries = make([]ServiceRoutePolicySequencesMatchEntries, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutePolicySequencesMatchEntries{}
+ cItem.AsPathListId = types.StringNull()
+
+ if t := cv.Get("asPathList.refId.optionType"); t.Exists() {
+ va := cv.Get("asPathList.refId.value")
+ if t.String() == "global" {
+ cItem.AsPathListId = types.StringValue(va.String())
+ }
+ }
+ cItem.StandardCommunityListCriteria = types.StringNull()
+
+ if t := cv.Get("communityList.criteria.optionType"); t.Exists() {
+ va := cv.Get("communityList.criteria.value")
+ if t.String() == "global" {
+ cItem.StandardCommunityListCriteria = types.StringValue(va.String())
+ }
+ }
+ if ccValue := cv.Get("communityList.standardCommunityList"); ccValue.Exists() {
+ cItem.StandardCommunityLists = make([]ServiceRoutePolicySequencesMatchEntriesStandardCommunityLists, 0)
+ ccValue.ForEach(func(cck, ccv gjson.Result) bool {
+ ccItem := ServiceRoutePolicySequencesMatchEntriesStandardCommunityLists{}
+ ccItem.Id = types.StringNull()
+
+ if t := ccv.Get("refId.optionType"); t.Exists() {
+ va := ccv.Get("refId.value")
+ if t.String() == "global" {
+ ccItem.Id = types.StringValue(va.String())
+ }
+ }
+ cItem.StandardCommunityLists = append(cItem.StandardCommunityLists, ccItem)
+ return true
+ })
+ }
+ cItem.ExpandedCommunityListId = types.StringNull()
+
+ if t := cv.Get("communityList.expandedCommunityList.refId.optionType"); t.Exists() {
+ va := cv.Get("communityList.expandedCommunityList.refId.value")
+ if t.String() == "global" {
+ cItem.ExpandedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ cItem.ExtendedCommunityListId = types.StringNull()
+
+ if t := cv.Get("extCommunityList.refId.optionType"); t.Exists() {
+ va := cv.Get("extCommunityList.refId.value")
+ if t.String() == "global" {
+ cItem.ExtendedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ cItem.BgpLocalPreference = types.Int64Null()
+
+ if t := cv.Get("bgpLocalPreference.optionType"); t.Exists() {
+ va := cv.Get("bgpLocalPreference.value")
+ if t.String() == "global" {
+ cItem.BgpLocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Metric = types.Int64Null()
+
+ if t := cv.Get("metric.optionType"); t.Exists() {
+ va := cv.Get("metric.value")
+ if t.String() == "global" {
+ cItem.Metric = types.Int64Value(va.Int())
+ }
+ }
+ cItem.OmpTag = types.Int64Null()
+
+ if t := cv.Get("ompTag.optionType"); t.Exists() {
+ va := cv.Get("ompTag.value")
+ if t.String() == "global" {
+ cItem.OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.OspfTag = types.Int64Null()
+
+ if t := cv.Get("ospfTag.optionType"); t.Exists() {
+ va := cv.Get("ospfTag.value")
+ if t.String() == "global" {
+ cItem.OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Ipv4AddressPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv4Address.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv4Address.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv4AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv4NextHopPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv4NextHop.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv4NextHop.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv4NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv6AddressPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv6Address.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv6Address.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv6AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv6NextHopPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv6NextHop.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv6NextHop.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv6NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ item.MatchEntries = append(item.MatchEntries, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("actions"); cValue.Exists() {
+ item.Actions = make([]ServiceRoutePolicySequencesActions, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutePolicySequencesActions{}
+ cItem.AsPathPrepend = types.SetNull(types.Int64Type)
+
+ if t := cv.Get("accept.setAsPath.prepend.optionType"); t.Exists() {
+ va := cv.Get("accept.setAsPath.prepend.value")
+ if t.String() == "global" {
+ cItem.AsPathPrepend = helpers.GetInt64Set(va.Array())
+ }
+ }
+ cItem.CommunityAdditive = types.BoolNull()
+
+ if t := cv.Get("accept.setCommunity.additive.optionType"); t.Exists() {
+ va := cv.Get("accept.setCommunity.additive.value")
+ if t.String() == "global" {
+ cItem.CommunityAdditive = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.Community = types.SetNull(types.StringType)
+ cItem.CommunityVariable = types.StringNull()
+ if t := cv.Get("accept.setCommunity.community.optionType"); t.Exists() {
+ va := cv.Get("accept.setCommunity.community.value")
+ if t.String() == "variable" {
+ cItem.CommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Community = helpers.GetStringSet(va.Array())
+ }
+ }
+ cItem.LocalPreference = types.Int64Null()
+
+ if t := cv.Get("accept.setLocalPreference.optionType"); t.Exists() {
+ va := cv.Get("accept.setLocalPreference.value")
+ if t.String() == "global" {
+ cItem.LocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Metric = types.Int64Null()
+
+ if t := cv.Get("accept.setMetric.optionType"); t.Exists() {
+ va := cv.Get("accept.setMetric.value")
+ if t.String() == "global" {
+ cItem.Metric = types.Int64Value(va.Int())
+ }
+ }
+ cItem.MetricType = types.StringNull()
+
+ if t := cv.Get("accept.setMetricType.optionType"); t.Exists() {
+ va := cv.Get("accept.setMetricType.value")
+ if t.String() == "global" {
+ cItem.MetricType = types.StringValue(va.String())
+ }
+ }
+ cItem.OmpTag = types.Int64Null()
+
+ if t := cv.Get("accept.setOmpTag.optionType"); t.Exists() {
+ va := cv.Get("accept.setOmpTag.value")
+ if t.String() == "global" {
+ cItem.OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Origin = types.StringNull()
+
+ if t := cv.Get("accept.setOrigin.optionType"); t.Exists() {
+ va := cv.Get("accept.setOrigin.value")
+ if t.String() == "global" {
+ cItem.Origin = types.StringValue(va.String())
+ }
+ }
+ cItem.OspfTag = types.Int64Null()
+
+ if t := cv.Get("accept.setOspfTag.optionType"); t.Exists() {
+ va := cv.Get("accept.setOspfTag.value")
+ if t.String() == "global" {
+ cItem.OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Weight = types.Int64Null()
+
+ if t := cv.Get("accept.setWeight.optionType"); t.Exists() {
+ va := cv.Get("accept.setWeight.value")
+ if t.String() == "global" {
+ cItem.Weight = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Ipv4NextHop = types.StringNull()
+
+ if t := cv.Get("accept.setIpv4NextHop.optionType"); t.Exists() {
+ va := cv.Get("accept.setIpv4NextHop.value")
+ if t.String() == "global" {
+ cItem.Ipv4NextHop = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv6NextHop = types.StringNull()
+
+ if t := cv.Get("accept.setIpv6NextHop.optionType"); t.Exists() {
+ va := cv.Get("accept.setIpv6NextHop.value")
+ if t.String() == "global" {
+ cItem.Ipv6NextHop = types.StringValue(va.String())
+ }
+ }
+ item.Actions = append(item.Actions, cItem)
+ return true
+ })
+ }
+ data.Sequences = append(data.Sequences, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceRoutePolicy) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Sequences {
+ keys := [...]string{"sequenceId"}
+ keyValues := [...]string{strconv.FormatInt(data.Sequences[i].Id.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "sequences").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].Id = types.Int64Null()
+
+ if t := r.Get("sequenceId.optionType"); t.Exists() {
+ va := r.Get("sequenceId.value")
+ if t.String() == "global" {
+ data.Sequences[i].Id = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Name = types.StringNull()
+
+ if t := r.Get("sequenceName.optionType"); t.Exists() {
+ va := r.Get("sequenceName.value")
+ if t.String() == "global" {
+ data.Sequences[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].BaseAction = types.StringNull()
+
+ if t := r.Get("baseAction.optionType"); t.Exists() {
+ va := r.Get("baseAction.value")
+ if t.String() == "global" {
+ data.Sequences[i].BaseAction = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Protocol = types.StringNull()
+
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "global" {
+ data.Sequences[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Sequences[i].MatchEntries {
+ keys := [...]string{"asPathList.refId", "communityList.criteria", "communityList.expandedCommunityList.refId", "extCommunityList.refId", "bgpLocalPreference", "metric", "ompTag", "ospfTag", "ipv4Address.refId", "ipv4NextHop.refId", "ipv6Address.refId", "ipv6NextHop.refId"}
+ keyValues := [...]string{data.Sequences[i].MatchEntries[ci].AsPathListId.ValueString(), data.Sequences[i].MatchEntries[ci].StandardCommunityListCriteria.ValueString(), data.Sequences[i].MatchEntries[ci].ExpandedCommunityListId.ValueString(), data.Sequences[i].MatchEntries[ci].ExtendedCommunityListId.ValueString(), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].BgpLocalPreference.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].Metric.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].OmpTag.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].OspfTag.ValueInt64(), 10), data.Sequences[i].MatchEntries[ci].Ipv4AddressPrefixListId.ValueString(), data.Sequences[i].MatchEntries[ci].Ipv4NextHopPrefixListId.ValueString(), data.Sequences[i].MatchEntries[ci].Ipv6AddressPrefixListId.ValueString(), data.Sequences[i].MatchEntries[ci].Ipv6NextHopPrefixListId.ValueString()}
+ keyValuesVariables := [...]string{"", "", "", "", "", "", "", "", "", "", "", "", ""}
+
+ var cr gjson.Result
+ r.Get("matchEntries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].MatchEntries[ci].AsPathListId = types.StringNull()
+
+ if t := cr.Get("asPathList.refId.optionType"); t.Exists() {
+ va := cr.Get("asPathList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].AsPathListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].StandardCommunityListCriteria = types.StringNull()
+
+ if t := cr.Get("communityList.criteria.optionType"); t.Exists() {
+ va := cr.Get("communityList.criteria.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].StandardCommunityListCriteria = types.StringValue(va.String())
+ }
+ }
+ for cci := range data.Sequences[i].MatchEntries[ci].StandardCommunityLists {
+ keys := [...]string{"refId"}
+ keyValues := [...]string{data.Sequences[i].MatchEntries[ci].StandardCommunityLists[cci].Id.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var ccr gjson.Result
+ cr.Get("communityList.standardCommunityList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ ccr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].MatchEntries[ci].StandardCommunityLists[cci].Id = types.StringNull()
+
+ if t := ccr.Get("refId.optionType"); t.Exists() {
+ va := ccr.Get("refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].StandardCommunityLists[cci].Id = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].ExpandedCommunityListId = types.StringNull()
+
+ if t := cr.Get("communityList.expandedCommunityList.refId.optionType"); t.Exists() {
+ va := cr.Get("communityList.expandedCommunityList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].ExpandedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].ExtendedCommunityListId = types.StringNull()
+
+ if t := cr.Get("extCommunityList.refId.optionType"); t.Exists() {
+ va := cr.Get("extCommunityList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].ExtendedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].BgpLocalPreference = types.Int64Null()
+
+ if t := cr.Get("bgpLocalPreference.optionType"); t.Exists() {
+ va := cr.Get("bgpLocalPreference.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].BgpLocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Metric = types.Int64Null()
+
+ if t := cr.Get("metric.optionType"); t.Exists() {
+ va := cr.Get("metric.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Metric = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].OmpTag = types.Int64Null()
+
+ if t := cr.Get("ompTag.optionType"); t.Exists() {
+ va := cr.Get("ompTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].OspfTag = types.Int64Null()
+
+ if t := cr.Get("ospfTag.optionType"); t.Exists() {
+ va := cr.Get("ospfTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv4AddressPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv4Address.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv4Address.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv4AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv4NextHopPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv4NextHop.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv4NextHop.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv4NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv6AddressPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv6Address.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv6Address.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv6AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv6NextHopPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv6NextHop.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv6NextHop.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv6NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ }
+ for ci := range data.Sequences[i].Actions {
+ keys := [...]string{"accept.setCommunity.additive", "accept.setLocalPreference", "accept.setMetric", "accept.setMetricType", "accept.setOmpTag", "accept.setOrigin", "accept.setOspfTag", "accept.setWeight", "accept.setIpv4NextHop", "accept.setIpv6NextHop"}
+ keyValues := [...]string{strconv.FormatBool(data.Sequences[i].Actions[ci].CommunityAdditive.ValueBool()), strconv.FormatInt(data.Sequences[i].Actions[ci].LocalPreference.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].Actions[ci].Metric.ValueInt64(), 10), data.Sequences[i].Actions[ci].MetricType.ValueString(), strconv.FormatInt(data.Sequences[i].Actions[ci].OmpTag.ValueInt64(), 10), data.Sequences[i].Actions[ci].Origin.ValueString(), strconv.FormatInt(data.Sequences[i].Actions[ci].OspfTag.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].Actions[ci].Weight.ValueInt64(), 10), data.Sequences[i].Actions[ci].Ipv4NextHop.ValueString(), data.Sequences[i].Actions[ci].Ipv6NextHop.ValueString()}
+ keyValuesVariables := [...]string{"", "", "", data.Sequences[i].Actions[ci].CommunityVariable.ValueString(), "", "", "", "", "", "", "", "", ""}
+
+ var cr gjson.Result
+ r.Get("actions").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].Actions[ci].AsPathPrepend = types.SetNull(types.Int64Type)
+
+ if t := cr.Get("accept.setAsPath.prepend.optionType"); t.Exists() {
+ va := cr.Get("accept.setAsPath.prepend.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].AsPathPrepend = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.Sequences[i].Actions[ci].CommunityAdditive = types.BoolNull()
+
+ if t := cr.Get("accept.setCommunity.additive.optionType"); t.Exists() {
+ va := cr.Get("accept.setCommunity.additive.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].CommunityAdditive = types.BoolValue(va.Bool())
+ }
+ }
+ data.Sequences[i].Actions[ci].Community = types.SetNull(types.StringType)
+ data.Sequences[i].Actions[ci].CommunityVariable = types.StringNull()
+ if t := cr.Get("accept.setCommunity.community.optionType"); t.Exists() {
+ va := cr.Get("accept.setCommunity.community.value")
+ if t.String() == "variable" {
+ data.Sequences[i].Actions[ci].CommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Community = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Sequences[i].Actions[ci].LocalPreference = types.Int64Null()
+
+ if t := cr.Get("accept.setLocalPreference.optionType"); t.Exists() {
+ va := cr.Get("accept.setLocalPreference.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].LocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Metric = types.Int64Null()
+
+ if t := cr.Get("accept.setMetric.optionType"); t.Exists() {
+ va := cr.Get("accept.setMetric.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Metric = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].MetricType = types.StringNull()
+
+ if t := cr.Get("accept.setMetricType.optionType"); t.Exists() {
+ va := cr.Get("accept.setMetricType.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].MetricType = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Actions[ci].OmpTag = types.Int64Null()
+
+ if t := cr.Get("accept.setOmpTag.optionType"); t.Exists() {
+ va := cr.Get("accept.setOmpTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Origin = types.StringNull()
+
+ if t := cr.Get("accept.setOrigin.optionType"); t.Exists() {
+ va := cr.Get("accept.setOrigin.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Origin = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Actions[ci].OspfTag = types.Int64Null()
+
+ if t := cr.Get("accept.setOspfTag.optionType"); t.Exists() {
+ va := cr.Get("accept.setOspfTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Weight = types.Int64Null()
+
+ if t := cr.Get("accept.setWeight.optionType"); t.Exists() {
+ va := cr.Get("accept.setWeight.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Weight = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Ipv4NextHop = types.StringNull()
+
+ if t := cr.Get("accept.setIpv4NextHop.optionType"); t.Exists() {
+ va := cr.Get("accept.setIpv4NextHop.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Ipv4NextHop = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Actions[ci].Ipv6NextHop = types.StringNull()
+
+ if t := cr.Get("accept.setIpv6NextHop.optionType"); t.Exists() {
+ va := cr.Get("accept.setIpv6NextHop.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Ipv6NextHop = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceRoutePolicy) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.DefaultAction.IsNull() {
+ return false
+ }
+ if len(data.Sequences) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_routing_bgp_feature.go b/internal/provider/model_sdwan_service_routing_bgp_feature.go
new file mode 100644
index 000000000..60d6732eb
--- /dev/null
+++ b/internal/provider/model_sdwan_service_routing_bgp_feature.go
@@ -0,0 +1,3589 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceRoutingBGP 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"`
+ AsNumber types.Int64 `tfsdk:"as_number"`
+ AsNumberVariable types.String `tfsdk:"as_number_variable"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ PropagateAsPath types.Bool `tfsdk:"propagate_as_path"`
+ PropagateAsPathVariable types.String `tfsdk:"propagate_as_path_variable"`
+ PropagateCommunity types.Bool `tfsdk:"propagate_community"`
+ PropagateCommunityVariable types.String `tfsdk:"propagate_community_variable"`
+ ExternalRoutesDistance types.Int64 `tfsdk:"external_routes_distance"`
+ ExternalRoutesDistanceVariable types.String `tfsdk:"external_routes_distance_variable"`
+ InternalRoutesDistance types.Int64 `tfsdk:"internal_routes_distance"`
+ InternalRoutesDistanceVariable types.String `tfsdk:"internal_routes_distance_variable"`
+ LocalRoutesDistance types.Int64 `tfsdk:"local_routes_distance"`
+ LocalRoutesDistanceVariable types.String `tfsdk:"local_routes_distance_variable"`
+ KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
+ KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
+ HoldTime types.Int64 `tfsdk:"hold_time"`
+ HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
+ AlwaysCompareMed types.Bool `tfsdk:"always_compare_med"`
+ AlwaysCompareMedVariable types.String `tfsdk:"always_compare_med_variable"`
+ DeterministicMed types.Bool `tfsdk:"deterministic_med"`
+ DeterministicMedVariable types.String `tfsdk:"deterministic_med_variable"`
+ MissingMedAsWorst types.Bool `tfsdk:"missing_med_as_worst"`
+ MissingMedAsWorstVariable types.String `tfsdk:"missing_med_as_worst_variable"`
+ CompareRouterId types.Bool `tfsdk:"compare_router_id"`
+ CompareRouterIdVariable types.String `tfsdk:"compare_router_id_variable"`
+ MultipathRelax types.Bool `tfsdk:"multipath_relax"`
+ MultipathRelaxVariable types.String `tfsdk:"multipath_relax_variable"`
+ Ipv4Neighbors []ServiceRoutingBGPIpv4Neighbors `tfsdk:"ipv4_neighbors"`
+ Ipv6Neighbors []ServiceRoutingBGPIpv6Neighbors `tfsdk:"ipv6_neighbors"`
+ Ipv4AggregateAddresses []ServiceRoutingBGPIpv4AggregateAddresses `tfsdk:"ipv4_aggregate_addresses"`
+ Ipv4Networks []ServiceRoutingBGPIpv4Networks `tfsdk:"ipv4_networks"`
+ Ipv4EibgpMaximumPaths types.Int64 `tfsdk:"ipv4_eibgp_maximum_paths"`
+ Ipv4EibgpMaximumPathsVariable types.String `tfsdk:"ipv4_eibgp_maximum_paths_variable"`
+ Ipv4Originate types.Bool `tfsdk:"ipv4_originate"`
+ Ipv4OriginateVariable types.String `tfsdk:"ipv4_originate_variable"`
+ Ipv4TableMapRoutePolicyId types.String `tfsdk:"ipv4_table_map_route_policy_id"`
+ Ipv4TableMapFilter types.Bool `tfsdk:"ipv4_table_map_filter"`
+ Ipv4TableMapFilterVariable types.String `tfsdk:"ipv4_table_map_filter_variable"`
+ Ipv4Redistributes []ServiceRoutingBGPIpv4Redistributes `tfsdk:"ipv4_redistributes"`
+ Ipv6AggregateAddresses []ServiceRoutingBGPIpv6AggregateAddresses `tfsdk:"ipv6_aggregate_addresses"`
+ Ipv6Networks []ServiceRoutingBGPIpv6Networks `tfsdk:"ipv6_networks"`
+ Ipv6EibgpMaximumPaths types.Int64 `tfsdk:"ipv6_eibgp_maximum_paths"`
+ Ipv6EibgpMaximumPathsVariable types.String `tfsdk:"ipv6_eibgp_maximum_paths_variable"`
+ Ipv6Originate types.Bool `tfsdk:"ipv6_originate"`
+ Ipv6OriginateVariable types.String `tfsdk:"ipv6_originate_variable"`
+ Ipv6TableMapRoutePolicyId types.String `tfsdk:"ipv6_table_map_route_policy_id"`
+ Ipv6TableMapFilter types.Bool `tfsdk:"ipv6_table_map_filter"`
+ Ipv6TableMapFilterVariable types.String `tfsdk:"ipv6_table_map_filter_variable"`
+ Ipv6Redistributes []ServiceRoutingBGPIpv6Redistributes `tfsdk:"ipv6_redistributes"`
+}
+
+type ServiceRoutingBGPIpv4Neighbors struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ Description types.String `tfsdk:"description"`
+ DescriptionVariable types.String `tfsdk:"description_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ RemoteAs types.Int64 `tfsdk:"remote_as"`
+ RemoteAsVariable types.String `tfsdk:"remote_as_variable"`
+ LocalAs types.Int64 `tfsdk:"local_as"`
+ LocalAsVariable types.String `tfsdk:"local_as_variable"`
+ KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
+ KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
+ HoldTime types.Int64 `tfsdk:"hold_time"`
+ HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
+ UpdateSourceInterface types.String `tfsdk:"update_source_interface"`
+ UpdateSourceInterfaceVariable types.String `tfsdk:"update_source_interface_variable"`
+ NextHopSelf types.Bool `tfsdk:"next_hop_self"`
+ NextHopSelfVariable types.String `tfsdk:"next_hop_self_variable"`
+ SendCommunity types.Bool `tfsdk:"send_community"`
+ SendCommunityVariable types.String `tfsdk:"send_community_variable"`
+ SendExtendedCommunity types.Bool `tfsdk:"send_extended_community"`
+ SendExtendedCommunityVariable types.String `tfsdk:"send_extended_community_variable"`
+ EbgpMultihop types.Int64 `tfsdk:"ebgp_multihop"`
+ EbgpMultihopVariable types.String `tfsdk:"ebgp_multihop_variable"`
+ Password types.String `tfsdk:"password"`
+ PasswordVariable types.String `tfsdk:"password_variable"`
+ SendLabel types.Bool `tfsdk:"send_label"`
+ SendLabelVariable types.String `tfsdk:"send_label_variable"`
+ AsOverride types.Bool `tfsdk:"as_override"`
+ AsOverrideVariable types.String `tfsdk:"as_override_variable"`
+ AllowasInNumber types.Int64 `tfsdk:"allowas_in_number"`
+ AllowasInNumberVariable types.String `tfsdk:"allowas_in_number_variable"`
+ AddressFamilies []ServiceRoutingBGPIpv4NeighborsAddressFamilies `tfsdk:"address_families"`
+}
+
+type ServiceRoutingBGPIpv6Neighbors struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ Description types.String `tfsdk:"description"`
+ DescriptionVariable types.String `tfsdk:"description_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ RemoteAs types.Int64 `tfsdk:"remote_as"`
+ RemoteAsVariable types.String `tfsdk:"remote_as_variable"`
+ LocalAs types.Int64 `tfsdk:"local_as"`
+ LocalAsVariable types.String `tfsdk:"local_as_variable"`
+ KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
+ KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
+ HoldTime types.Int64 `tfsdk:"hold_time"`
+ HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
+ UpdateSourceInterface types.String `tfsdk:"update_source_interface"`
+ UpdateSourceInterfaceVariable types.String `tfsdk:"update_source_interface_variable"`
+ NextHopSelf types.Bool `tfsdk:"next_hop_self"`
+ NextHopSelfVariable types.String `tfsdk:"next_hop_self_variable"`
+ SendCommunity types.Bool `tfsdk:"send_community"`
+ SendCommunityVariable types.String `tfsdk:"send_community_variable"`
+ SendExtendedCommunity types.Bool `tfsdk:"send_extended_community"`
+ SendExtendedCommunityVariable types.String `tfsdk:"send_extended_community_variable"`
+ EbgpMultihop types.Int64 `tfsdk:"ebgp_multihop"`
+ EbgpMultihopVariable types.String `tfsdk:"ebgp_multihop_variable"`
+ Password types.String `tfsdk:"password"`
+ PasswordVariable types.String `tfsdk:"password_variable"`
+ AsOverride types.Bool `tfsdk:"as_override"`
+ AsOverrideVariable types.String `tfsdk:"as_override_variable"`
+ AllowasInNumber types.Int64 `tfsdk:"allowas_in_number"`
+ AllowasInNumberVariable types.String `tfsdk:"allowas_in_number_variable"`
+ AddressFamilies []ServiceRoutingBGPIpv6NeighborsAddressFamilies `tfsdk:"address_families"`
+}
+
+type ServiceRoutingBGPIpv4AggregateAddresses struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ AsSetPath types.Bool `tfsdk:"as_set_path"`
+ AsSetPathVariable types.String `tfsdk:"as_set_path_variable"`
+ SummaryOnly types.Bool `tfsdk:"summary_only"`
+ SummaryOnlyVariable types.String `tfsdk:"summary_only_variable"`
+}
+
+type ServiceRoutingBGPIpv4Networks struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+}
+
+type ServiceRoutingBGPIpv4Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type ServiceRoutingBGPIpv6AggregateAddresses struct {
+ AggregatePrefix types.String `tfsdk:"aggregate_prefix"`
+ AggregatePrefixVariable types.String `tfsdk:"aggregate_prefix_variable"`
+ AsSetPath types.Bool `tfsdk:"as_set_path"`
+ AsSetPathVariable types.String `tfsdk:"as_set_path_variable"`
+ SummaryOnly types.Bool `tfsdk:"summary_only"`
+ SummaryOnlyVariable types.String `tfsdk:"summary_only_variable"`
+}
+
+type ServiceRoutingBGPIpv6Networks struct {
+ NetworkPrefix types.String `tfsdk:"network_prefix"`
+ NetworkPrefixVariable types.String `tfsdk:"network_prefix_variable"`
+}
+
+type ServiceRoutingBGPIpv6Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type ServiceRoutingBGPIpv4NeighborsAddressFamilies struct {
+ FamilyType types.String `tfsdk:"family_type"`
+ MaxNumberOfPrefixes types.Int64 `tfsdk:"max_number_of_prefixes"`
+ MaxNumberOfPrefixesVariable types.String `tfsdk:"max_number_of_prefixes_variable"`
+ Threshold types.Int64 `tfsdk:"threshold"`
+ ThresholdVariable types.String `tfsdk:"threshold_variable"`
+ PolicyType types.String `tfsdk:"policy_type"`
+ RestartInterval types.Int64 `tfsdk:"restart_interval"`
+ RestartIntervalVariable types.String `tfsdk:"restart_interval_variable"`
+ InRoutePolicyId types.String `tfsdk:"in_route_policy_id"`
+ OutRoutePolicyId types.String `tfsdk:"out_route_policy_id"`
+}
+
+type ServiceRoutingBGPIpv6NeighborsAddressFamilies struct {
+ FamilyType types.String `tfsdk:"family_type"`
+ MaxNumberOfPrefixes types.Int64 `tfsdk:"max_number_of_prefixes"`
+ MaxNumberOfPrefixesVariable types.String `tfsdk:"max_number_of_prefixes_variable"`
+ Threshold types.Int64 `tfsdk:"threshold"`
+ ThresholdVariable types.String `tfsdk:"threshold_variable"`
+ PolicyType types.String `tfsdk:"policy_type"`
+ RestartInterval types.Int64 `tfsdk:"restart_interval"`
+ RestartIntervalVariable types.String `tfsdk:"restart_interval_variable"`
+ InRoutePolicyId types.String `tfsdk:"in_route_policy_id"`
+ OutRoutePolicyId types.String `tfsdk:"out_route_policy_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceRoutingBGP) getModel() string {
+ return "service_routing_bgp"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceRoutingBGP) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/routing/bgp", 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 ServiceRoutingBGP) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.AsNumberVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"asNum.optionType", "variable")
+ body, _ = sjson.Set(body, path+"asNum.value", data.AsNumberVariable.ValueString())
+ }
+ } else if !data.AsNumber.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"asNum.optionType", "global")
+ body, _ = sjson.Set(body, path+"asNum.value", data.AsNumber.ValueInt64())
+ }
+ }
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.PropagateAsPathVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateAspath.optionType", "variable")
+ body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPathVariable.ValueString())
+ }
+ } else if data.PropagateAsPath.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateAspath.optionType", "default")
+ body, _ = sjson.Set(body, path+"propagateAspath.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateAspath.optionType", "global")
+ body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPath.ValueBool())
+ }
+ }
+
+ if !data.PropagateCommunityVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "variable")
+ body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunityVariable.ValueString())
+ }
+ } else if data.PropagateCommunity.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "default")
+ body, _ = sjson.Set(body, path+"propagateCommunity.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "global")
+ body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunity.ValueBool())
+ }
+ }
+
+ if !data.ExternalRoutesDistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "variable")
+ body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistanceVariable.ValueString())
+ }
+ } else if data.ExternalRoutesDistance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "default")
+ body, _ = sjson.Set(body, path+"external.value", 20)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "global")
+ body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistance.ValueInt64())
+ }
+ }
+
+ if !data.InternalRoutesDistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"internal.optionType", "variable")
+ body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistanceVariable.ValueString())
+ }
+ } else if data.InternalRoutesDistance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"internal.optionType", "default")
+ body, _ = sjson.Set(body, path+"internal.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"internal.optionType", "global")
+ body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistance.ValueInt64())
+ }
+ }
+
+ if !data.LocalRoutesDistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"local.optionType", "variable")
+ body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistanceVariable.ValueString())
+ }
+ } else if data.LocalRoutesDistance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"local.optionType", "default")
+ body, _ = sjson.Set(body, path+"local.value", 20)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"local.optionType", "global")
+ body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistance.ValueInt64())
+ }
+ }
+
+ if !data.KeepaliveTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"keepalive.optionType", "variable")
+ body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTimeVariable.ValueString())
+ }
+ } else if data.KeepaliveTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"keepalive.optionType", "default")
+ body, _ = sjson.Set(body, path+"keepalive.value", 60)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"keepalive.optionType", "global")
+ body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTime.ValueInt64())
+ }
+ }
+
+ if !data.HoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"holdtime.optionType", "variable")
+ body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTimeVariable.ValueString())
+ }
+ } else if data.HoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"holdtime.optionType", "default")
+ body, _ = sjson.Set(body, path+"holdtime.value", 180)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"holdtime.optionType", "global")
+ body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTime.ValueInt64())
+ }
+ }
+
+ if !data.AlwaysCompareMedVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "variable")
+ body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMedVariable.ValueString())
+ }
+ } else if data.AlwaysCompareMed.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "default")
+ body, _ = sjson.Set(body, path+"alwaysCompare.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "global")
+ body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMed.ValueBool())
+ }
+ }
+
+ if !data.DeterministicMedVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"deterministic.optionType", "variable")
+ body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMedVariable.ValueString())
+ }
+ } else if data.DeterministicMed.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"deterministic.optionType", "default")
+ body, _ = sjson.Set(body, path+"deterministic.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"deterministic.optionType", "global")
+ body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMed.ValueBool())
+ }
+ }
+
+ if !data.MissingMedAsWorstVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "variable")
+ body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorstVariable.ValueString())
+ }
+ } else if data.MissingMedAsWorst.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "default")
+ body, _ = sjson.Set(body, path+"missingAsWorst.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "global")
+ body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorst.ValueBool())
+ }
+ }
+
+ if !data.CompareRouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"compareRouterId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterIdVariable.ValueString())
+ }
+ } else if data.CompareRouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"compareRouterId.optionType", "default")
+ body, _ = sjson.Set(body, path+"compareRouterId.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"compareRouterId.optionType", "global")
+ body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterId.ValueBool())
+ }
+ }
+
+ if !data.MultipathRelaxVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multipathRelax.optionType", "variable")
+ body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelaxVariable.ValueString())
+ }
+ } else if data.MultipathRelax.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multipathRelax.optionType", "default")
+ body, _ = sjson.Set(body, path+"multipathRelax.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"multipathRelax.optionType", "global")
+ body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelax.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"neighbor", []interface{}{})
+ for _, item := range data.Ipv4Neighbors {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.DescriptionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString())
+ }
+ } else if item.Description.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString())
+ }
+ }
+
+ if !item.ShutdownVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString())
+ }
+ } else if item.Shutdown.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool())
+ }
+ }
+
+ if !item.RemoteAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString())
+ }
+ } else if !item.RemoteAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64())
+ }
+ }
+
+ if !item.LocalAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString())
+ }
+ } else if item.LocalAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64())
+ }
+ }
+
+ if !item.KeepaliveTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString())
+ }
+ } else if item.KeepaliveTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64())
+ }
+ }
+
+ if !item.HoldTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString())
+ }
+ } else if item.HoldTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64())
+ }
+ }
+
+ if !item.UpdateSourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString())
+ }
+ } else if item.UpdateSourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString())
+ }
+ }
+
+ if !item.NextHopSelfVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString())
+ }
+ } else if item.NextHopSelf.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool())
+ }
+ }
+
+ if !item.SendCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString())
+ }
+ } else if item.SendCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool())
+ }
+ }
+
+ if !item.SendExtendedCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString())
+ }
+ } else if item.SendExtendedCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool())
+ }
+ }
+
+ if !item.EbgpMultihopVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString())
+ }
+ } else if item.EbgpMultihop.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64())
+ }
+ }
+
+ if !item.PasswordVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
+ }
+ } else if item.Password.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
+ }
+ }
+
+ if !item.SendLabelVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabelVariable.ValueString())
+ }
+ } else if item.SendLabel.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabel.ValueBool())
+ }
+ }
+
+ if !item.AsOverrideVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString())
+ }
+ } else if item.AsOverride.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool())
+ }
+ }
+
+ if !item.AllowasInNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString())
+ }
+ } else if item.AllowasInNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{})
+ for _, childItem := range item.AddressFamilies {
+ itemChildBody := ""
+ if !childItem.FamilyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString())
+ }
+ }
+
+ if !childItem.MaxNumberOfPrefixesVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString())
+ }
+ } else if !childItem.MaxNumberOfPrefixes.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64())
+ }
+ }
+
+ if !childItem.ThresholdVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString())
+ }
+ } else if childItem.Threshold.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64())
+ }
+ }
+ if !childItem.PolicyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString())
+ }
+ }
+
+ if !childItem.RestartIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString())
+ }
+ } else if !childItem.RestartInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64())
+ }
+ }
+ if !childItem.InRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString())
+ }
+ }
+ if !childItem.OutRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"neighbor.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6Neighbor", []interface{}{})
+ for _, item := range data.Ipv6Neighbors {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.DescriptionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString())
+ }
+ } else if item.Description.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString())
+ }
+ }
+
+ if !item.ShutdownVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString())
+ }
+ } else if item.Shutdown.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool())
+ }
+ }
+
+ if !item.RemoteAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString())
+ }
+ } else if !item.RemoteAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64())
+ }
+ }
+
+ if !item.LocalAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString())
+ }
+ } else if item.LocalAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64())
+ }
+ }
+
+ if !item.KeepaliveTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString())
+ }
+ } else if item.KeepaliveTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64())
+ }
+ }
+
+ if !item.HoldTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString())
+ }
+ } else if item.HoldTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64())
+ }
+ }
+
+ if !item.UpdateSourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString())
+ }
+ } else if item.UpdateSourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString())
+ }
+ }
+
+ if !item.NextHopSelfVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString())
+ }
+ } else if item.NextHopSelf.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool())
+ }
+ }
+
+ if !item.SendCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString())
+ }
+ } else if item.SendCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool())
+ }
+ }
+
+ if !item.SendExtendedCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString())
+ }
+ } else if item.SendExtendedCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool())
+ }
+ }
+
+ if !item.EbgpMultihopVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString())
+ }
+ } else if item.EbgpMultihop.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64())
+ }
+ }
+
+ if !item.PasswordVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
+ }
+ } else if item.Password.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
+ }
+ }
+
+ if !item.AsOverrideVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString())
+ }
+ } else if item.AsOverride.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool())
+ }
+ }
+
+ if !item.AllowasInNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString())
+ }
+ } else if item.AllowasInNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{})
+ for _, childItem := range item.AddressFamilies {
+ itemChildBody := ""
+ if !childItem.FamilyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString())
+ }
+ }
+
+ if !childItem.MaxNumberOfPrefixesVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString())
+ }
+ } else if !childItem.MaxNumberOfPrefixes.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64())
+ }
+ }
+
+ if !childItem.ThresholdVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString())
+ }
+ } else if childItem.Threshold.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64())
+ }
+ }
+ if !childItem.PolicyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString())
+ }
+ }
+
+ if !childItem.RestartIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString())
+ }
+ } else if !childItem.RestartInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64())
+ }
+ }
+ if !childItem.InRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString())
+ }
+ }
+ if !childItem.OutRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6Neighbor.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.aggregateAddress", []interface{}{})
+ for _, item := range data.Ipv4AggregateAddresses {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString())
+ }
+ }
+
+ if !item.AsSetPathVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString())
+ }
+ } else if item.AsSetPath.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool())
+ }
+ }
+
+ if !item.SummaryOnlyVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString())
+ }
+ } else if item.SummaryOnly.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"addressFamily.aggregateAddress.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.network", []interface{}{})
+ for _, item := range data.Ipv4Networks {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"addressFamily.network.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv4EibgpMaximumPathsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPathsVariable.ValueString())
+ }
+ } else if data.Ipv4EibgpMaximumPaths.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPaths.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4OriginateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4OriginateVariable.ValueString())
+ }
+ } else if data.Ipv4Originate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "default")
+ body, _ = sjson.Set(body, path+"addressFamily.originate.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4Originate.ValueBool())
+ }
+ }
+ if data.Ipv4TableMapRoutePolicyId.IsNull() {
+ body, _ = sjson.Set(body, path+"addressFamily.name.optionType", "default")
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.name.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.name.refId.value", data.Ipv4TableMapRoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.Ipv4TableMapFilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilterVariable.ValueString())
+ }
+ } else if data.Ipv4TableMapFilter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"addressFamily.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.redistribute", []interface{}{})
+ for _, item := range data.Ipv4Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"addressFamily.redistribute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6AggregateAddress", []interface{}{})
+ for _, item := range data.Ipv6AggregateAddresses {
+ itemBody := ""
+
+ if !item.AggregatePrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefixVariable.ValueString())
+ }
+ } else if !item.AggregatePrefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefix.ValueString())
+ }
+ }
+
+ if !item.AsSetPathVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString())
+ }
+ } else if item.AsSetPath.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool())
+ }
+ }
+
+ if !item.SummaryOnlyVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString())
+ }
+ } else if item.SummaryOnly.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6AggregateAddress.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6Network", []interface{}{})
+ for _, item := range data.Ipv6Networks {
+ itemBody := ""
+
+ if !item.NetworkPrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefixVariable.ValueString())
+ }
+ } else if !item.NetworkPrefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefix.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6Network.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv6EibgpMaximumPathsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPathsVariable.ValueString())
+ }
+ } else if data.Ipv6EibgpMaximumPaths.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPaths.ValueInt64())
+ }
+ }
+
+ if !data.Ipv6OriginateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6OriginateVariable.ValueString())
+ }
+ } else if data.Ipv6Originate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6Originate.ValueBool())
+ }
+ }
+ if data.Ipv6TableMapRoutePolicyId.IsNull() {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.optionType", "default")
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.value", data.Ipv6TableMapRoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.Ipv6TableMapFilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilterVariable.ValueString())
+ }
+ } else if data.Ipv6TableMapFilter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.redistribute", []interface{}{})
+ for _, item := range data.Ipv6Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.redistribute.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceRoutingBGP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AsNumber = types.Int64Null()
+ data.AsNumberVariable = types.StringNull()
+ if t := res.Get(path + "asNum.optionType"); t.Exists() {
+ va := res.Get(path + "asNum.value")
+ if t.String() == "variable" {
+ data.AsNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AsNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.PropagateAsPath = types.BoolNull()
+ data.PropagateAsPathVariable = types.StringNull()
+ if t := res.Get(path + "propagateAspath.optionType"); t.Exists() {
+ va := res.Get(path + "propagateAspath.value")
+ if t.String() == "variable" {
+ data.PropagateAsPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateAsPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.PropagateCommunity = types.BoolNull()
+ data.PropagateCommunityVariable = types.StringNull()
+ if t := res.Get(path + "propagateCommunity.optionType"); t.Exists() {
+ va := res.Get(path + "propagateCommunity.value")
+ if t.String() == "variable" {
+ data.PropagateCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.ExternalRoutesDistance = types.Int64Null()
+ data.ExternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.ExternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.InternalRoutesDistance = types.Int64Null()
+ data.InternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "internal.optionType"); t.Exists() {
+ va := res.Get(path + "internal.value")
+ if t.String() == "variable" {
+ data.InternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.LocalRoutesDistance = types.Int64Null()
+ data.LocalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "local.optionType"); t.Exists() {
+ va := res.Get(path + "local.value")
+ if t.String() == "variable" {
+ data.LocalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LocalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.KeepaliveTime = types.Int64Null()
+ data.KeepaliveTimeVariable = types.StringNull()
+ if t := res.Get(path + "keepalive.optionType"); t.Exists() {
+ va := res.Get(path + "keepalive.value")
+ if t.String() == "variable" {
+ data.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.HoldTime = types.Int64Null()
+ data.HoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "holdtime.optionType"); t.Exists() {
+ va := res.Get(path + "holdtime.value")
+ if t.String() == "variable" {
+ data.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.AlwaysCompareMed = types.BoolNull()
+ data.AlwaysCompareMedVariable = types.StringNull()
+ if t := res.Get(path + "alwaysCompare.optionType"); t.Exists() {
+ va := res.Get(path + "alwaysCompare.value")
+ if t.String() == "variable" {
+ data.AlwaysCompareMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AlwaysCompareMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.DeterministicMed = types.BoolNull()
+ data.DeterministicMedVariable = types.StringNull()
+ if t := res.Get(path + "deterministic.optionType"); t.Exists() {
+ va := res.Get(path + "deterministic.value")
+ if t.String() == "variable" {
+ data.DeterministicMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DeterministicMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.MissingMedAsWorst = types.BoolNull()
+ data.MissingMedAsWorstVariable = types.StringNull()
+ if t := res.Get(path + "missingAsWorst.optionType"); t.Exists() {
+ va := res.Get(path + "missingAsWorst.value")
+ if t.String() == "variable" {
+ data.MissingMedAsWorstVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MissingMedAsWorst = types.BoolValue(va.Bool())
+ }
+ }
+ data.CompareRouterId = types.BoolNull()
+ data.CompareRouterIdVariable = types.StringNull()
+ if t := res.Get(path + "compareRouterId.optionType"); t.Exists() {
+ va := res.Get(path + "compareRouterId.value")
+ if t.String() == "variable" {
+ data.CompareRouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.CompareRouterId = types.BoolValue(va.Bool())
+ }
+ }
+ data.MultipathRelax = types.BoolNull()
+ data.MultipathRelaxVariable = types.StringNull()
+ if t := res.Get(path + "multipathRelax.optionType"); t.Exists() {
+ va := res.Get(path + "multipathRelax.value")
+ if t.String() == "variable" {
+ data.MultipathRelaxVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MultipathRelax = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "neighbor"); value.Exists() {
+ data.Ipv4Neighbors = make([]ServiceRoutingBGPIpv4Neighbors, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv4Neighbors{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.Description = types.StringNull()
+ item.DescriptionVariable = types.StringNull()
+ if t := v.Get("description.optionType"); t.Exists() {
+ va := v.Get("description.value")
+ if t.String() == "variable" {
+ item.DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Description = types.StringValue(va.String())
+ }
+ }
+ item.Shutdown = types.BoolNull()
+ item.ShutdownVariable = types.StringNull()
+ if t := v.Get("shutdown.optionType"); t.Exists() {
+ va := v.Get("shutdown.value")
+ if t.String() == "variable" {
+ item.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ item.RemoteAs = types.Int64Null()
+ item.RemoteAsVariable = types.StringNull()
+ if t := v.Get("remoteAs.optionType"); t.Exists() {
+ va := v.Get("remoteAs.value")
+ if t.String() == "variable" {
+ item.RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ item.LocalAs = types.Int64Null()
+ item.LocalAsVariable = types.StringNull()
+ if t := v.Get("localAs.optionType"); t.Exists() {
+ va := v.Get("localAs.value")
+ if t.String() == "variable" {
+ item.LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ item.KeepaliveTime = types.Int64Null()
+ item.KeepaliveTimeVariable = types.StringNull()
+ if t := v.Get("keepalive.optionType"); t.Exists() {
+ va := v.Get("keepalive.value")
+ if t.String() == "variable" {
+ item.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ item.HoldTime = types.Int64Null()
+ item.HoldTimeVariable = types.StringNull()
+ if t := v.Get("holdtime.optionType"); t.Exists() {
+ va := v.Get("holdtime.value")
+ if t.String() == "variable" {
+ item.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ item.UpdateSourceInterface = types.StringNull()
+ item.UpdateSourceInterfaceVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ item.NextHopSelf = types.BoolNull()
+ item.NextHopSelfVariable = types.StringNull()
+ if t := v.Get("nextHopSelf.optionType"); t.Exists() {
+ va := v.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ item.NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendCommunity = types.BoolNull()
+ item.SendCommunityVariable = types.StringNull()
+ if t := v.Get("sendCommunity.optionType"); t.Exists() {
+ va := v.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ item.SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendExtendedCommunity = types.BoolNull()
+ item.SendExtendedCommunityVariable = types.StringNull()
+ if t := v.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := v.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ item.SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.EbgpMultihop = types.Int64Null()
+ item.EbgpMultihopVariable = types.StringNull()
+ if t := v.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := v.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ item.EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ item.SendLabel = types.BoolNull()
+ item.SendLabelVariable = types.StringNull()
+ if t := v.Get("sendLabel.optionType"); t.Exists() {
+ va := v.Get("sendLabel.value")
+ if t.String() == "variable" {
+ item.SendLabelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendLabel = types.BoolValue(va.Bool())
+ }
+ }
+ item.AsOverride = types.BoolNull()
+ item.AsOverrideVariable = types.StringNull()
+ if t := v.Get("asOverride.optionType"); t.Exists() {
+ va := v.Get("asOverride.value")
+ if t.String() == "variable" {
+ item.AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ item.AllowasInNumber = types.Int64Null()
+ item.AllowasInNumberVariable = types.StringNull()
+ if t := v.Get("asNumber.optionType"); t.Exists() {
+ va := v.Get("asNumber.value")
+ if t.String() == "variable" {
+ item.AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ if cValue := v.Get("addressFamily"); cValue.Exists() {
+ item.AddressFamilies = make([]ServiceRoutingBGPIpv4NeighborsAddressFamilies, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingBGPIpv4NeighborsAddressFamilies{}
+ cItem.FamilyType = types.StringNull()
+
+ if t := cv.Get("familyType.optionType"); t.Exists() {
+ va := cv.Get("familyType.value")
+ if t.String() == "global" {
+ cItem.FamilyType = types.StringValue(va.String())
+ }
+ }
+ cItem.MaxNumberOfPrefixes = types.Int64Null()
+ cItem.MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ cItem.MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Threshold = types.Int64Null()
+ cItem.ThresholdVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ cItem.ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Threshold = types.Int64Value(va.Int())
+ }
+ }
+ cItem.PolicyType = types.StringNull()
+
+ if t := cv.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ cItem.PolicyType = types.StringValue(va.String())
+ }
+ }
+ cItem.RestartInterval = types.Int64Null()
+ cItem.RestartIntervalVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ cItem.RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.InRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ cItem.OutRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ item.AddressFamilies = append(item.AddressFamilies, cItem)
+ return true
+ })
+ }
+ data.Ipv4Neighbors = append(data.Ipv4Neighbors, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6Neighbor"); value.Exists() {
+ data.Ipv6Neighbors = make([]ServiceRoutingBGPIpv6Neighbors, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv6Neighbors{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.Description = types.StringNull()
+ item.DescriptionVariable = types.StringNull()
+ if t := v.Get("description.optionType"); t.Exists() {
+ va := v.Get("description.value")
+ if t.String() == "variable" {
+ item.DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Description = types.StringValue(va.String())
+ }
+ }
+ item.Shutdown = types.BoolNull()
+ item.ShutdownVariable = types.StringNull()
+ if t := v.Get("shutdown.optionType"); t.Exists() {
+ va := v.Get("shutdown.value")
+ if t.String() == "variable" {
+ item.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ item.RemoteAs = types.Int64Null()
+ item.RemoteAsVariable = types.StringNull()
+ if t := v.Get("remoteAs.optionType"); t.Exists() {
+ va := v.Get("remoteAs.value")
+ if t.String() == "variable" {
+ item.RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ item.LocalAs = types.Int64Null()
+ item.LocalAsVariable = types.StringNull()
+ if t := v.Get("localAs.optionType"); t.Exists() {
+ va := v.Get("localAs.value")
+ if t.String() == "variable" {
+ item.LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ item.KeepaliveTime = types.Int64Null()
+ item.KeepaliveTimeVariable = types.StringNull()
+ if t := v.Get("keepalive.optionType"); t.Exists() {
+ va := v.Get("keepalive.value")
+ if t.String() == "variable" {
+ item.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ item.HoldTime = types.Int64Null()
+ item.HoldTimeVariable = types.StringNull()
+ if t := v.Get("holdtime.optionType"); t.Exists() {
+ va := v.Get("holdtime.value")
+ if t.String() == "variable" {
+ item.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ item.UpdateSourceInterface = types.StringNull()
+ item.UpdateSourceInterfaceVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ item.NextHopSelf = types.BoolNull()
+ item.NextHopSelfVariable = types.StringNull()
+ if t := v.Get("nextHopSelf.optionType"); t.Exists() {
+ va := v.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ item.NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendCommunity = types.BoolNull()
+ item.SendCommunityVariable = types.StringNull()
+ if t := v.Get("sendCommunity.optionType"); t.Exists() {
+ va := v.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ item.SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendExtendedCommunity = types.BoolNull()
+ item.SendExtendedCommunityVariable = types.StringNull()
+ if t := v.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := v.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ item.SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.EbgpMultihop = types.Int64Null()
+ item.EbgpMultihopVariable = types.StringNull()
+ if t := v.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := v.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ item.EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ item.AsOverride = types.BoolNull()
+ item.AsOverrideVariable = types.StringNull()
+ if t := v.Get("asOverride.optionType"); t.Exists() {
+ va := v.Get("asOverride.value")
+ if t.String() == "variable" {
+ item.AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ item.AllowasInNumber = types.Int64Null()
+ item.AllowasInNumberVariable = types.StringNull()
+ if t := v.Get("asNumber.optionType"); t.Exists() {
+ va := v.Get("asNumber.value")
+ if t.String() == "variable" {
+ item.AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ if cValue := v.Get("addressFamily"); cValue.Exists() {
+ item.AddressFamilies = make([]ServiceRoutingBGPIpv6NeighborsAddressFamilies, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingBGPIpv6NeighborsAddressFamilies{}
+ cItem.FamilyType = types.StringNull()
+
+ if t := cv.Get("familyType.optionType"); t.Exists() {
+ va := cv.Get("familyType.value")
+ if t.String() == "global" {
+ cItem.FamilyType = types.StringValue(va.String())
+ }
+ }
+ cItem.MaxNumberOfPrefixes = types.Int64Null()
+ cItem.MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ cItem.MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Threshold = types.Int64Null()
+ cItem.ThresholdVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ cItem.ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Threshold = types.Int64Value(va.Int())
+ }
+ }
+ cItem.PolicyType = types.StringNull()
+
+ if t := cv.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ cItem.PolicyType = types.StringValue(va.String())
+ }
+ }
+ cItem.RestartInterval = types.Int64Null()
+ cItem.RestartIntervalVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ cItem.RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.InRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ cItem.OutRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ item.AddressFamilies = append(item.AddressFamilies, cItem)
+ return true
+ })
+ }
+ data.Ipv6Neighbors = append(data.Ipv6Neighbors, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "addressFamily.aggregateAddress"); value.Exists() {
+ data.Ipv4AggregateAddresses = make([]ServiceRoutingBGPIpv4AggregateAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv4AggregateAddresses{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.address.optionType"); t.Exists() {
+ va := v.Get("prefix.address.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.mask.optionType"); t.Exists() {
+ va := v.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.AsSetPath = types.BoolNull()
+ item.AsSetPathVariable = types.StringNull()
+ if t := v.Get("asSet.optionType"); t.Exists() {
+ va := v.Get("asSet.value")
+ if t.String() == "variable" {
+ item.AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ item.SummaryOnly = types.BoolNull()
+ item.SummaryOnlyVariable = types.StringNull()
+ if t := v.Get("summaryOnly.optionType"); t.Exists() {
+ va := v.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ item.SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4AggregateAddresses = append(data.Ipv4AggregateAddresses, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "addressFamily.network"); value.Exists() {
+ data.Ipv4Networks = make([]ServiceRoutingBGPIpv4Networks, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv4Networks{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.address.optionType"); t.Exists() {
+ va := v.Get("prefix.address.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.mask.optionType"); t.Exists() {
+ va := v.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Networks = append(data.Ipv4Networks, item)
+ return true
+ })
+ }
+ data.Ipv4EibgpMaximumPaths = types.Int64Null()
+ data.Ipv4EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv4EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Originate = types.BoolNull()
+ data.Ipv4OriginateVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv4OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "addressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv4TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4TableMapFilter = types.BoolNull()
+ data.Ipv4TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv4TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "addressFamily.redistribute"); value.Exists() {
+ data.Ipv4Redistributes = make([]ServiceRoutingBGPIpv4Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv4Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Redistributes = append(data.Ipv4Redistributes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6AddressFamily.ipv6AggregateAddress"); value.Exists() {
+ data.Ipv6AggregateAddresses = make([]ServiceRoutingBGPIpv6AggregateAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv6AggregateAddresses{}
+ item.AggregatePrefix = types.StringNull()
+ item.AggregatePrefixVariable = types.StringNull()
+ if t := v.Get("prefix.optionType"); t.Exists() {
+ va := v.Get("prefix.value")
+ if t.String() == "variable" {
+ item.AggregatePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AggregatePrefix = types.StringValue(va.String())
+ }
+ }
+ item.AsSetPath = types.BoolNull()
+ item.AsSetPathVariable = types.StringNull()
+ if t := v.Get("asSet.optionType"); t.Exists() {
+ va := v.Get("asSet.value")
+ if t.String() == "variable" {
+ item.AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ item.SummaryOnly = types.BoolNull()
+ item.SummaryOnlyVariable = types.StringNull()
+ if t := v.Get("summaryOnly.optionType"); t.Exists() {
+ va := v.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ item.SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6AggregateAddresses = append(data.Ipv6AggregateAddresses, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6AddressFamily.ipv6Network"); value.Exists() {
+ data.Ipv6Networks = make([]ServiceRoutingBGPIpv6Networks, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv6Networks{}
+ item.NetworkPrefix = types.StringNull()
+ item.NetworkPrefixVariable = types.StringNull()
+ if t := v.Get("prefix.optionType"); t.Exists() {
+ va := v.Get("prefix.value")
+ if t.String() == "variable" {
+ item.NetworkPrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkPrefix = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Networks = append(data.Ipv6Networks, item)
+ return true
+ })
+ }
+ data.Ipv6EibgpMaximumPaths = types.Int64Null()
+ data.Ipv6EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv6EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Originate = types.BoolNull()
+ data.Ipv6OriginateVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv6OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "ipv6AddressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv6TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6TableMapFilter = types.BoolNull()
+ data.Ipv6TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv6TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "ipv6AddressFamily.redistribute"); value.Exists() {
+ data.Ipv6Redistributes = make([]ServiceRoutingBGPIpv6Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingBGPIpv6Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Redistributes = append(data.Ipv6Redistributes, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceRoutingBGP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AsNumber = types.Int64Null()
+ data.AsNumberVariable = types.StringNull()
+ if t := res.Get(path + "asNum.optionType"); t.Exists() {
+ va := res.Get(path + "asNum.value")
+ if t.String() == "variable" {
+ data.AsNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AsNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.PropagateAsPath = types.BoolNull()
+ data.PropagateAsPathVariable = types.StringNull()
+ if t := res.Get(path + "propagateAspath.optionType"); t.Exists() {
+ va := res.Get(path + "propagateAspath.value")
+ if t.String() == "variable" {
+ data.PropagateAsPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateAsPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.PropagateCommunity = types.BoolNull()
+ data.PropagateCommunityVariable = types.StringNull()
+ if t := res.Get(path + "propagateCommunity.optionType"); t.Exists() {
+ va := res.Get(path + "propagateCommunity.value")
+ if t.String() == "variable" {
+ data.PropagateCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.ExternalRoutesDistance = types.Int64Null()
+ data.ExternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.ExternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.InternalRoutesDistance = types.Int64Null()
+ data.InternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "internal.optionType"); t.Exists() {
+ va := res.Get(path + "internal.value")
+ if t.String() == "variable" {
+ data.InternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.LocalRoutesDistance = types.Int64Null()
+ data.LocalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "local.optionType"); t.Exists() {
+ va := res.Get(path + "local.value")
+ if t.String() == "variable" {
+ data.LocalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LocalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.KeepaliveTime = types.Int64Null()
+ data.KeepaliveTimeVariable = types.StringNull()
+ if t := res.Get(path + "keepalive.optionType"); t.Exists() {
+ va := res.Get(path + "keepalive.value")
+ if t.String() == "variable" {
+ data.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.HoldTime = types.Int64Null()
+ data.HoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "holdtime.optionType"); t.Exists() {
+ va := res.Get(path + "holdtime.value")
+ if t.String() == "variable" {
+ data.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.AlwaysCompareMed = types.BoolNull()
+ data.AlwaysCompareMedVariable = types.StringNull()
+ if t := res.Get(path + "alwaysCompare.optionType"); t.Exists() {
+ va := res.Get(path + "alwaysCompare.value")
+ if t.String() == "variable" {
+ data.AlwaysCompareMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AlwaysCompareMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.DeterministicMed = types.BoolNull()
+ data.DeterministicMedVariable = types.StringNull()
+ if t := res.Get(path + "deterministic.optionType"); t.Exists() {
+ va := res.Get(path + "deterministic.value")
+ if t.String() == "variable" {
+ data.DeterministicMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DeterministicMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.MissingMedAsWorst = types.BoolNull()
+ data.MissingMedAsWorstVariable = types.StringNull()
+ if t := res.Get(path + "missingAsWorst.optionType"); t.Exists() {
+ va := res.Get(path + "missingAsWorst.value")
+ if t.String() == "variable" {
+ data.MissingMedAsWorstVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MissingMedAsWorst = types.BoolValue(va.Bool())
+ }
+ }
+ data.CompareRouterId = types.BoolNull()
+ data.CompareRouterIdVariable = types.StringNull()
+ if t := res.Get(path + "compareRouterId.optionType"); t.Exists() {
+ va := res.Get(path + "compareRouterId.value")
+ if t.String() == "variable" {
+ data.CompareRouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.CompareRouterId = types.BoolValue(va.Bool())
+ }
+ }
+ data.MultipathRelax = types.BoolNull()
+ data.MultipathRelaxVariable = types.StringNull()
+ if t := res.Get(path + "multipathRelax.optionType"); t.Exists() {
+ va := res.Get(path + "multipathRelax.value")
+ if t.String() == "variable" {
+ data.MultipathRelaxVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MultipathRelax = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv4Neighbors {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv4Neighbors[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Neighbors[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "neighbor").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Neighbors[i].Address = types.StringNull()
+ data.Ipv4Neighbors[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].Description = types.StringNull()
+ data.Ipv4Neighbors[i].DescriptionVariable = types.StringNull()
+ if t := r.Get("description.optionType"); t.Exists() {
+ va := r.Get("description.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].Description = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].Shutdown = types.BoolNull()
+ data.Ipv4Neighbors[i].ShutdownVariable = types.StringNull()
+ if t := r.Get("shutdown.optionType"); t.Exists() {
+ va := r.Get("shutdown.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].RemoteAs = types.Int64Null()
+ data.Ipv4Neighbors[i].RemoteAsVariable = types.StringNull()
+ if t := r.Get("remoteAs.optionType"); t.Exists() {
+ va := r.Get("remoteAs.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].LocalAs = types.Int64Null()
+ data.Ipv4Neighbors[i].LocalAsVariable = types.StringNull()
+ if t := r.Get("localAs.optionType"); t.Exists() {
+ va := r.Get("localAs.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].KeepaliveTime = types.Int64Null()
+ data.Ipv4Neighbors[i].KeepaliveTimeVariable = types.StringNull()
+ if t := r.Get("keepalive.optionType"); t.Exists() {
+ va := r.Get("keepalive.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].HoldTime = types.Int64Null()
+ data.Ipv4Neighbors[i].HoldTimeVariable = types.StringNull()
+ if t := r.Get("holdtime.optionType"); t.Exists() {
+ va := r.Get("holdtime.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].UpdateSourceInterface = types.StringNull()
+ data.Ipv4Neighbors[i].UpdateSourceInterfaceVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].NextHopSelf = types.BoolNull()
+ data.Ipv4Neighbors[i].NextHopSelfVariable = types.StringNull()
+ if t := r.Get("nextHopSelf.optionType"); t.Exists() {
+ va := r.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].SendCommunity = types.BoolNull()
+ data.Ipv4Neighbors[i].SendCommunityVariable = types.StringNull()
+ if t := r.Get("sendCommunity.optionType"); t.Exists() {
+ va := r.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].SendExtendedCommunity = types.BoolNull()
+ data.Ipv4Neighbors[i].SendExtendedCommunityVariable = types.StringNull()
+ if t := r.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := r.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].EbgpMultihop = types.Int64Null()
+ data.Ipv4Neighbors[i].EbgpMultihopVariable = types.StringNull()
+ if t := r.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := r.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].SendLabel = types.BoolNull()
+ data.Ipv4Neighbors[i].SendLabelVariable = types.StringNull()
+ if t := r.Get("sendLabel.optionType"); t.Exists() {
+ va := r.Get("sendLabel.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].SendLabelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].SendLabel = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].AsOverride = types.BoolNull()
+ data.Ipv4Neighbors[i].AsOverrideVariable = types.StringNull()
+ if t := r.Get("asOverride.optionType"); t.Exists() {
+ va := r.Get("asOverride.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].AllowasInNumber = types.Int64Null()
+ data.Ipv4Neighbors[i].AllowasInNumberVariable = types.StringNull()
+ if t := r.Get("asNumber.optionType"); t.Exists() {
+ va := r.Get("asNumber.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ for ci := range data.Ipv4Neighbors[i].AddressFamilies {
+ keys := [...]string{"familyType"}
+ keyValues := [...]string{data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("addressFamily").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType = types.StringNull()
+
+ if t := cr.Get("familyType.optionType"); t.Exists() {
+ va := cr.Get("familyType.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Null()
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Null()
+ data.Ipv4Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].PolicyType = types.StringNull()
+
+ if t := cr.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].PolicyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Null()
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.Ipv6Neighbors {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6Neighbors[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Neighbors[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6Neighbor").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Neighbors[i].Address = types.StringNull()
+ data.Ipv6Neighbors[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].Description = types.StringNull()
+ data.Ipv6Neighbors[i].DescriptionVariable = types.StringNull()
+ if t := r.Get("description.optionType"); t.Exists() {
+ va := r.Get("description.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].Description = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].Shutdown = types.BoolNull()
+ data.Ipv6Neighbors[i].ShutdownVariable = types.StringNull()
+ if t := r.Get("shutdown.optionType"); t.Exists() {
+ va := r.Get("shutdown.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].RemoteAs = types.Int64Null()
+ data.Ipv6Neighbors[i].RemoteAsVariable = types.StringNull()
+ if t := r.Get("remoteAs.optionType"); t.Exists() {
+ va := r.Get("remoteAs.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].LocalAs = types.Int64Null()
+ data.Ipv6Neighbors[i].LocalAsVariable = types.StringNull()
+ if t := r.Get("localAs.optionType"); t.Exists() {
+ va := r.Get("localAs.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].KeepaliveTime = types.Int64Null()
+ data.Ipv6Neighbors[i].KeepaliveTimeVariable = types.StringNull()
+ if t := r.Get("keepalive.optionType"); t.Exists() {
+ va := r.Get("keepalive.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].HoldTime = types.Int64Null()
+ data.Ipv6Neighbors[i].HoldTimeVariable = types.StringNull()
+ if t := r.Get("holdtime.optionType"); t.Exists() {
+ va := r.Get("holdtime.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].UpdateSourceInterface = types.StringNull()
+ data.Ipv6Neighbors[i].UpdateSourceInterfaceVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].NextHopSelf = types.BoolNull()
+ data.Ipv6Neighbors[i].NextHopSelfVariable = types.StringNull()
+ if t := r.Get("nextHopSelf.optionType"); t.Exists() {
+ va := r.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].SendCommunity = types.BoolNull()
+ data.Ipv6Neighbors[i].SendCommunityVariable = types.StringNull()
+ if t := r.Get("sendCommunity.optionType"); t.Exists() {
+ va := r.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].SendExtendedCommunity = types.BoolNull()
+ data.Ipv6Neighbors[i].SendExtendedCommunityVariable = types.StringNull()
+ if t := r.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := r.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].EbgpMultihop = types.Int64Null()
+ data.Ipv6Neighbors[i].EbgpMultihopVariable = types.StringNull()
+ if t := r.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := r.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AsOverride = types.BoolNull()
+ data.Ipv6Neighbors[i].AsOverrideVariable = types.StringNull()
+ if t := r.Get("asOverride.optionType"); t.Exists() {
+ va := r.Get("asOverride.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].AllowasInNumber = types.Int64Null()
+ data.Ipv6Neighbors[i].AllowasInNumberVariable = types.StringNull()
+ if t := r.Get("asNumber.optionType"); t.Exists() {
+ va := r.Get("asNumber.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ for ci := range data.Ipv6Neighbors[i].AddressFamilies {
+ keys := [...]string{"familyType"}
+ keyValues := [...]string{data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("addressFamily").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType = types.StringNull()
+
+ if t := cr.Get("familyType.optionType"); t.Exists() {
+ va := cr.Get("familyType.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Null()
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Null()
+ data.Ipv6Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].PolicyType = types.StringNull()
+
+ if t := cr.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].PolicyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Null()
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.Ipv4AggregateAddresses {
+ keys := [...]string{"prefix.address"}
+ keyValues := [...]string{data.Ipv4AggregateAddresses[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4AggregateAddresses[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "addressFamily.aggregateAddress").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4AggregateAddresses[i].NetworkAddress = types.StringNull()
+ data.Ipv4AggregateAddresses[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.address.optionType"); t.Exists() {
+ va := r.Get("prefix.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4AggregateAddresses[i].SubnetMask = types.StringNull()
+ data.Ipv4AggregateAddresses[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.mask.optionType"); t.Exists() {
+ va := r.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4AggregateAddresses[i].AsSetPath = types.BoolNull()
+ data.Ipv4AggregateAddresses[i].AsSetPathVariable = types.StringNull()
+ if t := r.Get("asSet.optionType"); t.Exists() {
+ va := r.Get("asSet.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4AggregateAddresses[i].SummaryOnly = types.BoolNull()
+ data.Ipv4AggregateAddresses[i].SummaryOnlyVariable = types.StringNull()
+ if t := r.Get("summaryOnly.optionType"); t.Exists() {
+ va := r.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.Ipv4Networks {
+ keys := [...]string{"prefix.address"}
+ keyValues := [...]string{data.Ipv4Networks[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Networks[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "addressFamily.network").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Networks[i].NetworkAddress = types.StringNull()
+ data.Ipv4Networks[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.address.optionType"); t.Exists() {
+ va := r.Get("prefix.address.value")
+ if t.String() == "variable" {
+ data.Ipv4Networks[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Networks[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Networks[i].SubnetMask = types.StringNull()
+ data.Ipv4Networks[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.mask.optionType"); t.Exists() {
+ va := r.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4Networks[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Networks[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4EibgpMaximumPaths = types.Int64Null()
+ data.Ipv4EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv4EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Originate = types.BoolNull()
+ data.Ipv4OriginateVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv4OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "addressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv4TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4TableMapFilter = types.BoolNull()
+ data.Ipv4TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv4TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv4Redistributes {
+ keys := [...]string{"protocol", "routePolicy.refId"}
+ keyValues := [...]string{data.Ipv4Redistributes[i].Protocol.ValueString(), data.Ipv4Redistributes[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Redistributes[i].ProtocolVariable.ValueString(), ""}
+
+ var r gjson.Result
+ res.Get(path + "addressFamily.redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Redistributes[i].Protocol = types.StringNull()
+ data.Ipv4Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Ipv4Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv4Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv6AggregateAddresses {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6AggregateAddresses[i].AggregatePrefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6AggregateAddresses[i].AggregatePrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6AddressFamily.ipv6AggregateAddress").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6AggregateAddresses[i].AggregatePrefix = types.StringNull()
+ data.Ipv6AggregateAddresses[i].AggregatePrefixVariable = types.StringNull()
+ if t := r.Get("prefix.optionType"); t.Exists() {
+ va := r.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6AggregateAddresses[i].AggregatePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6AggregateAddresses[i].AggregatePrefix = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6AggregateAddresses[i].AsSetPath = types.BoolNull()
+ data.Ipv6AggregateAddresses[i].AsSetPathVariable = types.StringNull()
+ if t := r.Get("asSet.optionType"); t.Exists() {
+ va := r.Get("asSet.value")
+ if t.String() == "variable" {
+ data.Ipv6AggregateAddresses[i].AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6AggregateAddresses[i].AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6AggregateAddresses[i].SummaryOnly = types.BoolNull()
+ data.Ipv6AggregateAddresses[i].SummaryOnlyVariable = types.StringNull()
+ if t := r.Get("summaryOnly.optionType"); t.Exists() {
+ va := r.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ data.Ipv6AggregateAddresses[i].SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6AggregateAddresses[i].SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.Ipv6Networks {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6Networks[i].NetworkPrefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Networks[i].NetworkPrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6AddressFamily.ipv6Network").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Networks[i].NetworkPrefix = types.StringNull()
+ data.Ipv6Networks[i].NetworkPrefixVariable = types.StringNull()
+ if t := r.Get("prefix.optionType"); t.Exists() {
+ va := r.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6Networks[i].NetworkPrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Networks[i].NetworkPrefix = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv6EibgpMaximumPaths = types.Int64Null()
+ data.Ipv6EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv6EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Originate = types.BoolNull()
+ data.Ipv6OriginateVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv6OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "ipv6AddressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv6TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6TableMapFilter = types.BoolNull()
+ data.Ipv6TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv6TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv6Redistributes {
+ keys := [...]string{"protocol", "routePolicy.refId"}
+ keyValues := [...]string{data.Ipv6Redistributes[i].Protocol.ValueString(), data.Ipv6Redistributes[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Redistributes[i].ProtocolVariable.ValueString(), ""}
+
+ var r gjson.Result
+ res.Get(path + "ipv6AddressFamily.redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Redistributes[i].Protocol = types.StringNull()
+ data.Ipv6Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Ipv6Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv6Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceRoutingBGP) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.AsNumber.IsNull() {
+ return false
+ }
+ if !data.AsNumberVariable.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.PropagateAsPath.IsNull() {
+ return false
+ }
+ if !data.PropagateAsPathVariable.IsNull() {
+ return false
+ }
+ if !data.PropagateCommunity.IsNull() {
+ return false
+ }
+ if !data.PropagateCommunityVariable.IsNull() {
+ return false
+ }
+ if !data.ExternalRoutesDistance.IsNull() {
+ return false
+ }
+ if !data.ExternalRoutesDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.InternalRoutesDistance.IsNull() {
+ return false
+ }
+ if !data.InternalRoutesDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.LocalRoutesDistance.IsNull() {
+ return false
+ }
+ if !data.LocalRoutesDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.KeepaliveTime.IsNull() {
+ return false
+ }
+ if !data.KeepaliveTimeVariable.IsNull() {
+ return false
+ }
+ if !data.HoldTime.IsNull() {
+ return false
+ }
+ if !data.HoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.AlwaysCompareMed.IsNull() {
+ return false
+ }
+ if !data.AlwaysCompareMedVariable.IsNull() {
+ return false
+ }
+ if !data.DeterministicMed.IsNull() {
+ return false
+ }
+ if !data.DeterministicMedVariable.IsNull() {
+ return false
+ }
+ if !data.MissingMedAsWorst.IsNull() {
+ return false
+ }
+ if !data.MissingMedAsWorstVariable.IsNull() {
+ return false
+ }
+ if !data.CompareRouterId.IsNull() {
+ return false
+ }
+ if !data.CompareRouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.MultipathRelax.IsNull() {
+ return false
+ }
+ if !data.MultipathRelaxVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4Neighbors) > 0 {
+ return false
+ }
+ if len(data.Ipv6Neighbors) > 0 {
+ return false
+ }
+ if len(data.Ipv4AggregateAddresses) > 0 {
+ return false
+ }
+ if len(data.Ipv4Networks) > 0 {
+ return false
+ }
+ if !data.Ipv4EibgpMaximumPaths.IsNull() {
+ return false
+ }
+ if !data.Ipv4EibgpMaximumPathsVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Originate.IsNull() {
+ return false
+ }
+ if !data.Ipv4OriginateVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4TableMapRoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Ipv4TableMapFilter.IsNull() {
+ return false
+ }
+ if !data.Ipv4TableMapFilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4Redistributes) > 0 {
+ return false
+ }
+ if len(data.Ipv6AggregateAddresses) > 0 {
+ return false
+ }
+ if len(data.Ipv6Networks) > 0 {
+ return false
+ }
+ if !data.Ipv6EibgpMaximumPaths.IsNull() {
+ return false
+ }
+ if !data.Ipv6EibgpMaximumPathsVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6Originate.IsNull() {
+ return false
+ }
+ if !data.Ipv6OriginateVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6TableMapRoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Ipv6TableMapFilter.IsNull() {
+ return false
+ }
+ if !data.Ipv6TableMapFilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv6Redistributes) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_routing_ospf_feature.go b/internal/provider/model_sdwan_service_routing_ospf_feature.go
new file mode 100644
index 000000000..44d2d0b22
--- /dev/null
+++ b/internal/provider/model_sdwan_service_routing_ospf_feature.go
@@ -0,0 +1,1758 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceRoutingOSPF 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"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ ReferenceBandwidth types.Int64 `tfsdk:"reference_bandwidth"`
+ ReferenceBandwidthVariable types.String `tfsdk:"reference_bandwidth_variable"`
+ Rfc1583Compatible types.Bool `tfsdk:"rfc_1583_compatible"`
+ Rfc1583CompatibleVariable types.String `tfsdk:"rfc_1583_compatible_variable"`
+ DefaultInformationOriginate types.Bool `tfsdk:"default_information_originate"`
+ DefaultInformationOriginateAlways types.Bool `tfsdk:"default_information_originate_always"`
+ DefaultInformationOriginateAlwaysVariable types.String `tfsdk:"default_information_originate_always_variable"`
+ DefaultInformationOriginateMetric types.Int64 `tfsdk:"default_information_originate_metric"`
+ DefaultInformationOriginateMetricVariable types.String `tfsdk:"default_information_originate_metric_variable"`
+ DefaultInformationOriginateMetricType types.String `tfsdk:"default_information_originate_metric_type"`
+ DefaultInformationOriginateMetricTypeVariable types.String `tfsdk:"default_information_originate_metric_type_variable"`
+ DistanceExternal types.Int64 `tfsdk:"distance_external"`
+ DistanceExternalVariable types.String `tfsdk:"distance_external_variable"`
+ DistanceInterArea types.Int64 `tfsdk:"distance_inter_area"`
+ DistanceInterAreaVariable types.String `tfsdk:"distance_inter_area_variable"`
+ DistanceIntraArea types.Int64 `tfsdk:"distance_intra_area"`
+ DistanceIntraAreaVariable types.String `tfsdk:"distance_intra_area_variable"`
+ SpfCalculationDelay types.Int64 `tfsdk:"spf_calculation_delay"`
+ SpfCalculationDelayVariable types.String `tfsdk:"spf_calculation_delay_variable"`
+ SpfInitialHoldTime types.Int64 `tfsdk:"spf_initial_hold_time"`
+ SpfInitialHoldTimeVariable types.String `tfsdk:"spf_initial_hold_time_variable"`
+ SpfMaximumHoldTime types.Int64 `tfsdk:"spf_maximum_hold_time"`
+ SpfMaximumHoldTimeVariable types.String `tfsdk:"spf_maximum_hold_time_variable"`
+ Redistributes []ServiceRoutingOSPFRedistributes `tfsdk:"redistributes"`
+ RouterLsas []ServiceRoutingOSPFRouterLsas `tfsdk:"router_lsas"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Areas []ServiceRoutingOSPFAreas `tfsdk:"areas"`
+}
+
+type ServiceRoutingOSPFRedistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ NatDia types.Bool `tfsdk:"nat_dia"`
+ NatDiaVariable types.String `tfsdk:"nat_dia_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type ServiceRoutingOSPFRouterLsas struct {
+ Type types.String `tfsdk:"type"`
+ Time types.Int64 `tfsdk:"time"`
+ TimeVariable types.String `tfsdk:"time_variable"`
+}
+
+type ServiceRoutingOSPFAreas struct {
+ AreaNumber types.Int64 `tfsdk:"area_number"`
+ AreaNumberVariable types.String `tfsdk:"area_number_variable"`
+ AreaType types.String `tfsdk:"area_type"`
+ NoSummary types.Bool `tfsdk:"no_summary"`
+ NoSummaryVariable types.String `tfsdk:"no_summary_variable"`
+ Interfaces []ServiceRoutingOSPFAreasInterfaces `tfsdk:"interfaces"`
+ Ranges []ServiceRoutingOSPFAreasRanges `tfsdk:"ranges"`
+}
+
+type ServiceRoutingOSPFAreasInterfaces struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ HelloInterval types.Int64 `tfsdk:"hello_interval"`
+ HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
+ DeadInterval types.Int64 `tfsdk:"dead_interval"`
+ DeadIntervalVariable types.String `tfsdk:"dead_interval_variable"`
+ LsaRetransmitInterval types.Int64 `tfsdk:"lsa_retransmit_interval"`
+ LsaRetransmitIntervalVariable types.String `tfsdk:"lsa_retransmit_interval_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ DesignatedRouterPriority types.Int64 `tfsdk:"designated_router_priority"`
+ DesignatedRouterPriorityVariable types.String `tfsdk:"designated_router_priority_variable"`
+ NetworkType types.String `tfsdk:"network_type"`
+ NetworkTypeVariable types.String `tfsdk:"network_type_variable"`
+ PassiveInterface types.Bool `tfsdk:"passive_interface"`
+ PassiveInterfaceVariable types.String `tfsdk:"passive_interface_variable"`
+ AuthenticationType types.String `tfsdk:"authentication_type"`
+ AuthenticationTypeVariable types.String `tfsdk:"authentication_type_variable"`
+ MessageDigestKeyId types.Int64 `tfsdk:"message_digest_key_id"`
+ MessageDigestKeyIdVariable types.String `tfsdk:"message_digest_key_id_variable"`
+ MessageDigestKey types.String `tfsdk:"message_digest_key"`
+ MessageDigestKeyVariable types.String `tfsdk:"message_digest_key_variable"`
+}
+type ServiceRoutingOSPFAreasRanges struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NoAdvertise types.Bool `tfsdk:"no_advertise"`
+ NoAdvertiseVariable types.String `tfsdk:"no_advertise_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceRoutingOSPF) getModel() string {
+ return "service_routing_ospf"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceRoutingOSPF) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/routing/ospf", 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 ServiceRoutingOSPF) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString())
+ }
+ } else if data.ReferenceBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"referenceBandwidth.value", 100)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64())
+ }
+ }
+
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"rfc1583.optionType", "variable")
+ body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583CompatibleVariable.ValueString())
+ }
+ } else if data.Rfc1583Compatible.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"rfc1583.optionType", "default")
+ body, _ = sjson.Set(body, path+"rfc1583.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"rfc1583.optionType", "global")
+ body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583Compatible.ValueBool())
+ }
+ }
+ if data.DefaultInformationOriginate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"originate.optionType", "default")
+ body, _ = sjson.Set(body, path+"originate.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"originate.value", data.DefaultInformationOriginate.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"always.optionType", "variable")
+ body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString())
+ }
+ } else if data.DefaultInformationOriginateAlways.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"always.optionType", "default")
+ body, _ = sjson.Set(body, path+"always.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"always.optionType", "global")
+ body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlways.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metric.optionType", "variable")
+ body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetricVariable.ValueString())
+ }
+ } else if data.DefaultInformationOriginateMetric.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metric.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"metric.optionType", "global")
+ body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetric.ValueInt64())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metricType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString())
+ }
+ } else if data.DefaultInformationOriginateMetricType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metricType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"metricType.optionType", "global")
+ body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricType.ValueString())
+ }
+ }
+
+ if !data.DistanceExternalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "variable")
+ body, _ = sjson.Set(body, path+"external.value", data.DistanceExternalVariable.ValueString())
+ }
+ } else if data.DistanceExternal.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "default")
+ body, _ = sjson.Set(body, path+"external.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "global")
+ body, _ = sjson.Set(body, path+"external.value", data.DistanceExternal.ValueInt64())
+ }
+ }
+
+ if !data.DistanceInterAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interArea.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterAreaVariable.ValueString())
+ }
+ } else if data.DistanceInterArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interArea.optionType", "default")
+ body, _ = sjson.Set(body, path+"interArea.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"interArea.optionType", "global")
+ body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterArea.ValueInt64())
+ }
+ }
+
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intraArea.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraAreaVariable.ValueString())
+ }
+ } else if data.DistanceIntraArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intraArea.optionType", "default")
+ body, _ = sjson.Set(body, path+"intraArea.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"intraArea.optionType", "global")
+ body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraArea.ValueInt64())
+ }
+ }
+
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"delay.optionType", "variable")
+ body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelayVariable.ValueString())
+ }
+ } else if data.SpfCalculationDelay.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"delay.optionType", "default")
+ body, _ = sjson.Set(body, path+"delay.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"delay.optionType", "global")
+ body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelay.ValueInt64())
+ }
+ }
+
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"initialHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfInitialHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"initialHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"initialHold.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"initialHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTime.ValueInt64())
+ }
+ }
+
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfMaximumHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"maxHold.value", 10000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"maxHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTime.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"redistribute", []interface{}{})
+ for _, item := range data.Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+
+ if !item.NatDiaVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dia.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDiaVariable.ValueString())
+ }
+ } else if item.NatDia.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dia.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "dia.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dia.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDia.ValueBool())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"routerLsa", []interface{}{})
+ for _, item := range data.RouterLsas {
+ itemBody := ""
+ if !item.Type.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "adType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "adType.value", item.Type.ValueString())
+ }
+ }
+
+ if !item.TimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "time.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "time.value", item.TimeVariable.ValueString())
+ }
+ } else if !item.Time.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "time.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "time.value", item.Time.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"routerLsa.-1", itemBody)
+ }
+ }
+ if !data.RoutePolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routePolicy.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"routePolicy.refId.value", data.RoutePolicyId.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"area", []interface{}{})
+ for _, item := range data.Areas {
+ itemBody := ""
+
+ if !item.AreaNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumberVariable.ValueString())
+ }
+ } else if !item.AreaNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumber.ValueInt64())
+ }
+ }
+ if item.AreaType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "aType.value", item.AreaType.ValueString())
+ }
+ }
+
+ if !item.NoSummaryVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummaryVariable.ValueString())
+ }
+ } else if item.NoSummary.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "noSummary.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummary.ValueBool())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface", []interface{}{})
+ for _, childItem := range item.Interfaces {
+ itemChildBody := ""
+
+ if !childItem.NameVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.NameVariable.ValueString())
+ }
+ } else if !childItem.Name.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.Name.ValueString())
+ }
+ }
+
+ if !childItem.HelloIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString())
+ }
+ } else if childItem.HelloInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.DeadIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString())
+ }
+ } else if childItem.DeadInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.LsaRetransmitIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString())
+ }
+ } else if childItem.LsaRetransmitInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.DesignatedRouterPriorityVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriorityVariable.ValueString())
+ }
+ } else if childItem.DesignatedRouterPriority.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", 1)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriority.ValueInt64())
+ }
+ }
+
+ if !childItem.NetworkTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkTypeVariable.ValueString())
+ }
+ } else if childItem.NetworkType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", "broadcast")
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkType.ValueString())
+ }
+ }
+
+ if !childItem.PassiveInterfaceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString())
+ }
+ } else if childItem.PassiveInterface.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool())
+ }
+ }
+
+ if !childItem.AuthenticationTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationTypeVariable.ValueString())
+ }
+ } else if childItem.AuthenticationType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationType.ValueString())
+ }
+ }
+
+ if !childItem.MessageDigestKeyIdVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyIdVariable.ValueString())
+ }
+ } else if childItem.MessageDigestKeyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyId.ValueInt64())
+ }
+ }
+
+ if !childItem.MessageDigestKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKeyVariable.ValueString())
+ }
+ } else if childItem.MessageDigestKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKey.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "interface.-1", itemChildBody)
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "range", []interface{}{})
+ for _, childItem := range item.Ranges {
+ itemChildBody := ""
+
+ if !childItem.IpAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddressVariable.ValueString())
+ }
+ } else if !childItem.IpAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddress.ValueString())
+ }
+ }
+
+ if !childItem.SubnetMaskVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMaskVariable.ValueString())
+ }
+ } else if !childItem.SubnetMask.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMask.ValueString())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NoAdvertiseVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString())
+ }
+ } else if childItem.NoAdvertise.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "range.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"area.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceRoutingOSPF) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "rfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "rfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "originate.optionType"); t.Exists() {
+ va := res.Get(path + "originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "always.optionType"); t.Exists() {
+ va := res.Get(path + "always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "metric.optionType"); t.Exists() {
+ va := res.Get(path + "metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "metricType.optionType"); t.Exists() {
+ va := res.Get(path + "metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "interArea.optionType"); t.Exists() {
+ va := res.Get(path + "interArea.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "intraArea.optionType"); t.Exists() {
+ va := res.Get(path + "intraArea.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "delay.optionType"); t.Exists() {
+ va := res.Get(path + "delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "redistribute"); value.Exists() {
+ data.Redistributes = make([]ServiceRoutingOSPFRedistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingOSPFRedistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.NatDia = types.BoolNull()
+ item.NatDiaVariable = types.StringNull()
+ if t := v.Get("dia.optionType"); t.Exists() {
+ va := v.Get("dia.value")
+ if t.String() == "variable" {
+ item.NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes = append(data.Redistributes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "routerLsa"); value.Exists() {
+ data.RouterLsas = make([]ServiceRoutingOSPFRouterLsas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingOSPFRouterLsas{}
+ item.Type = types.StringNull()
+
+ if t := v.Get("adType.optionType"); t.Exists() {
+ va := v.Get("adType.value")
+ if t.String() == "global" {
+ item.Type = types.StringValue(va.String())
+ }
+ }
+ item.Time = types.Int64Null()
+ item.TimeVariable = types.StringNull()
+ if t := v.Get("time.optionType"); t.Exists() {
+ va := v.Get("time.value")
+ if t.String() == "variable" {
+ item.TimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Time = types.Int64Value(va.Int())
+ }
+ }
+ data.RouterLsas = append(data.RouterLsas, item)
+ return true
+ })
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "routePolicy.refId.optionType"); t.Exists() {
+ va := res.Get(path + "routePolicy.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "area"); value.Exists() {
+ data.Areas = make([]ServiceRoutingOSPFAreas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingOSPFAreas{}
+ item.AreaNumber = types.Int64Null()
+ item.AreaNumberVariable = types.StringNull()
+ if t := v.Get("aNum.optionType"); t.Exists() {
+ va := v.Get("aNum.value")
+ if t.String() == "variable" {
+ item.AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ item.AreaType = types.StringNull()
+
+ if t := v.Get("aType.optionType"); t.Exists() {
+ va := v.Get("aType.value")
+ if t.String() == "global" {
+ item.AreaType = types.StringValue(va.String())
+ }
+ }
+ item.NoSummary = types.BoolNull()
+ item.NoSummaryVariable = types.StringNull()
+ if t := v.Get("noSummary.optionType"); t.Exists() {
+ va := v.Get("noSummary.value")
+ if t.String() == "variable" {
+ item.NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ if cValue := v.Get("interface"); cValue.Exists() {
+ item.Interfaces = make([]ServiceRoutingOSPFAreasInterfaces, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingOSPFAreasInterfaces{}
+ cItem.Name = types.StringNull()
+ cItem.NameVariable = types.StringNull()
+ if t := cv.Get("name.optionType"); t.Exists() {
+ va := cv.Get("name.value")
+ if t.String() == "variable" {
+ cItem.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Name = types.StringValue(va.String())
+ }
+ }
+ cItem.HelloInterval = types.Int64Null()
+ cItem.HelloIntervalVariable = types.StringNull()
+ if t := cv.Get("helloInterval.optionType"); t.Exists() {
+ va := cv.Get("helloInterval.value")
+ if t.String() == "variable" {
+ cItem.HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DeadInterval = types.Int64Null()
+ cItem.DeadIntervalVariable = types.StringNull()
+ if t := cv.Get("deadInterval.optionType"); t.Exists() {
+ va := cv.Get("deadInterval.value")
+ if t.String() == "variable" {
+ cItem.DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.LsaRetransmitInterval = types.Int64Null()
+ cItem.LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cv.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cv.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ cItem.LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DesignatedRouterPriority = types.Int64Null()
+ cItem.DesignatedRouterPriorityVariable = types.StringNull()
+ if t := cv.Get("priority.optionType"); t.Exists() {
+ va := cv.Get("priority.value")
+ if t.String() == "variable" {
+ cItem.DesignatedRouterPriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DesignatedRouterPriority = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NetworkType = types.StringNull()
+ cItem.NetworkTypeVariable = types.StringNull()
+ if t := cv.Get("network.optionType"); t.Exists() {
+ va := cv.Get("network.value")
+ if t.String() == "variable" {
+ cItem.NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NetworkType = types.StringValue(va.String())
+ }
+ }
+ cItem.PassiveInterface = types.BoolNull()
+ cItem.PassiveInterfaceVariable = types.StringNull()
+ if t := cv.Get("passiveInterface.optionType"); t.Exists() {
+ va := cv.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ cItem.PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.AuthenticationType = types.StringNull()
+ cItem.AuthenticationTypeVariable = types.StringNull()
+ if t := cv.Get("type.optionType"); t.Exists() {
+ va := cv.Get("type.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ cItem.MessageDigestKeyId = types.Int64Null()
+ cItem.MessageDigestKeyIdVariable = types.StringNull()
+ if t := cv.Get("messageDigestKey.optionType"); t.Exists() {
+ va := cv.Get("messageDigestKey.value")
+ if t.String() == "variable" {
+ cItem.MessageDigestKeyIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.MessageDigestKeyId = types.Int64Value(va.Int())
+ }
+ }
+ item.Interfaces = append(item.Interfaces, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("range"); cValue.Exists() {
+ item.Ranges = make([]ServiceRoutingOSPFAreasRanges, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingOSPFAreasRanges{}
+ cItem.IpAddress = types.StringNull()
+ cItem.IpAddressVariable = types.StringNull()
+ if t := cv.Get("address.ipAddress.optionType"); t.Exists() {
+ va := cv.Get("address.ipAddress.value")
+ if t.String() == "variable" {
+ cItem.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.IpAddress = types.StringValue(va.String())
+ }
+ }
+ cItem.SubnetMask = types.StringNull()
+ cItem.SubnetMaskVariable = types.StringNull()
+ if t := cv.Get("address.subnetMask.optionType"); t.Exists() {
+ va := cv.Get("address.subnetMask.value")
+ if t.String() == "variable" {
+ cItem.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NoAdvertise = types.BoolNull()
+ cItem.NoAdvertiseVariable = types.StringNull()
+ if t := cv.Get("noAdvertise.optionType"); t.Exists() {
+ va := cv.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ cItem.NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ item.Ranges = append(item.Ranges, cItem)
+ return true
+ })
+ }
+ data.Areas = append(data.Areas, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceRoutingOSPF) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "rfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "rfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "originate.optionType"); t.Exists() {
+ va := res.Get(path + "originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "always.optionType"); t.Exists() {
+ va := res.Get(path + "always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "metric.optionType"); t.Exists() {
+ va := res.Get(path + "metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "metricType.optionType"); t.Exists() {
+ va := res.Get(path + "metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "interArea.optionType"); t.Exists() {
+ va := res.Get(path + "interArea.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "intraArea.optionType"); t.Exists() {
+ va := res.Get(path + "intraArea.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "delay.optionType"); t.Exists() {
+ va := res.Get(path + "delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Redistributes {
+ keys := [...]string{"protocol"}
+ keyValues := [...]string{data.Redistributes[i].Protocol.ValueString()}
+ keyValuesVariables := [...]string{data.Redistributes[i].ProtocolVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Redistributes[i].Protocol = types.StringNull()
+ data.Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes[i].NatDia = types.BoolNull()
+ data.Redistributes[i].NatDiaVariable = types.StringNull()
+ if t := r.Get("dia.optionType"); t.Exists() {
+ va := r.Get("dia.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ data.Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.RouterLsas {
+ keys := [...]string{"adType"}
+ keyValues := [...]string{data.RouterLsas[i].Type.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "routerLsa").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouterLsas[i].Type = types.StringNull()
+
+ if t := r.Get("adType.optionType"); t.Exists() {
+ va := r.Get("adType.value")
+ if t.String() == "global" {
+ data.RouterLsas[i].Type = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsas[i].Time = types.Int64Null()
+ data.RouterLsas[i].TimeVariable = types.StringNull()
+ if t := r.Get("time.optionType"); t.Exists() {
+ va := r.Get("time.value")
+ if t.String() == "variable" {
+ data.RouterLsas[i].TimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsas[i].Time = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "routePolicy.refId.optionType"); t.Exists() {
+ va := res.Get(path + "routePolicy.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Areas {
+ keys := [...]string{"aNum"}
+ keyValues := [...]string{strconv.FormatInt(data.Areas[i].AreaNumber.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Areas[i].AreaNumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "area").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].AreaNumber = types.Int64Null()
+ data.Areas[i].AreaNumberVariable = types.StringNull()
+ if t := r.Get("aNum.optionType"); t.Exists() {
+ va := r.Get("aNum.value")
+ if t.String() == "variable" {
+ data.Areas[i].AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].AreaType = types.StringNull()
+
+ if t := r.Get("aType.optionType"); t.Exists() {
+ va := r.Get("aType.value")
+ if t.String() == "global" {
+ data.Areas[i].AreaType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].NoSummary = types.BoolNull()
+ data.Areas[i].NoSummaryVariable = types.StringNull()
+ if t := r.Get("noSummary.optionType"); t.Exists() {
+ va := r.Get("noSummary.value")
+ if t.String() == "variable" {
+ data.Areas[i].NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ for ci := range data.Areas[i].Interfaces {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Areas[i].Interfaces[ci].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Interfaces[ci].NameVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("interface").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Interfaces[ci].Name = types.StringNull()
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringNull()
+ if t := cr.Get("name.optionType"); t.Exists() {
+ va := cr.Get("name.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Name = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringNull()
+ if t := cr.Get("helloInterval.optionType"); t.Exists() {
+ va := cr.Get("helloInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringNull()
+ if t := cr.Get("deadInterval.optionType"); t.Exists() {
+ va := cr.Get("deadInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cr.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cr.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Null()
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriority = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriorityVariable = types.StringNull()
+ if t := cr.Get("priority.optionType"); t.Exists() {
+ va := cr.Get("priority.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriority = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringNull()
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringNull()
+ if t := cr.Get("network.optionType"); t.Exists() {
+ va := cr.Get("network.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolNull()
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringNull()
+ if t := cr.Get("passiveInterface.optionType"); t.Exists() {
+ va := cr.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringNull()
+ data.Areas[i].Interfaces[ci].AuthenticationTypeVariable = types.StringNull()
+ if t := cr.Get("type.optionType"); t.Exists() {
+ va := cr.Get("type.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].MessageDigestKeyId = types.Int64Null()
+ data.Areas[i].Interfaces[ci].MessageDigestKeyIdVariable = types.StringNull()
+ if t := cr.Get("messageDigestKey.optionType"); t.Exists() {
+ va := cr.Get("messageDigestKey.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].MessageDigestKeyIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].MessageDigestKeyId = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for ci := range data.Areas[i].Ranges {
+ keys := [...]string{"address.ipAddress"}
+ keyValues := [...]string{data.Areas[i].Ranges[ci].IpAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Ranges[ci].IpAddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("range").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Ranges[ci].IpAddress = types.StringNull()
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringNull()
+ if t := cr.Get("address.ipAddress.optionType"); t.Exists() {
+ va := cr.Get("address.ipAddress.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringNull()
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringNull()
+ if t := cr.Get("address.subnetMask.optionType"); t.Exists() {
+ va := cr.Get("address.subnetMask.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].Cost = types.Int64Null()
+ data.Areas[i].Ranges[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolNull()
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringNull()
+ if t := cr.Get("noAdvertise.optionType"); t.Exists() {
+ va := cr.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceRoutingOSPF) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidth.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.Rfc1583Compatible.IsNull() {
+ return false
+ }
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlways.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetric.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricType.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceExternal.IsNull() {
+ return false
+ }
+ if !data.DistanceExternalVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceInterArea.IsNull() {
+ return false
+ }
+ if !data.DistanceInterAreaVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraArea.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelay.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ return false
+ }
+ if len(data.Redistributes) > 0 {
+ return false
+ }
+ if len(data.RouterLsas) > 0 {
+ return false
+ }
+ if !data.RoutePolicyId.IsNull() {
+ return false
+ }
+ if len(data.Areas) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_routing_ospfv3_ipv4_feature.go b/internal/provider/model_sdwan_service_routing_ospfv3_ipv4_feature.go
new file mode 100644
index 000000000..14feeb275
--- /dev/null
+++ b/internal/provider/model_sdwan_service_routing_ospfv3_ipv4_feature.go
@@ -0,0 +1,1764 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceRoutingOSPFv3IPv4 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"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ Distance types.Int64 `tfsdk:"distance"`
+ DistanceVariable types.String `tfsdk:"distance_variable"`
+ DistanceExternal types.Int64 `tfsdk:"distance_external"`
+ DistanceExternalVariable types.String `tfsdk:"distance_external_variable"`
+ DistanceInterArea types.Int64 `tfsdk:"distance_inter_area"`
+ DistanceInterAreaVariable types.String `tfsdk:"distance_inter_area_variable"`
+ DistanceIntraArea types.Int64 `tfsdk:"distance_intra_area"`
+ DistanceIntraAreaVariable types.String `tfsdk:"distance_intra_area_variable"`
+ ReferenceBandwidth types.Int64 `tfsdk:"reference_bandwidth"`
+ ReferenceBandwidthVariable types.String `tfsdk:"reference_bandwidth_variable"`
+ Rfc1583Compatible types.Bool `tfsdk:"rfc_1583_compatible"`
+ Rfc1583CompatibleVariable types.String `tfsdk:"rfc_1583_compatible_variable"`
+ DefaultInformationOriginate types.Bool `tfsdk:"default_information_originate"`
+ DefaultInformationOriginateAlways types.Bool `tfsdk:"default_information_originate_always"`
+ DefaultInformationOriginateAlwaysVariable types.String `tfsdk:"default_information_originate_always_variable"`
+ DefaultInformationOriginateMetric types.Int64 `tfsdk:"default_information_originate_metric"`
+ DefaultInformationOriginateMetricVariable types.String `tfsdk:"default_information_originate_metric_variable"`
+ DefaultInformationOriginateMetricType types.String `tfsdk:"default_information_originate_metric_type"`
+ DefaultInformationOriginateMetricTypeVariable types.String `tfsdk:"default_information_originate_metric_type_variable"`
+ SpfCalculationDelay types.Int64 `tfsdk:"spf_calculation_delay"`
+ SpfCalculationDelayVariable types.String `tfsdk:"spf_calculation_delay_variable"`
+ SpfInitialHoldTime types.Int64 `tfsdk:"spf_initial_hold_time"`
+ SpfInitialHoldTimeVariable types.String `tfsdk:"spf_initial_hold_time_variable"`
+ SpfMaximumHoldTime types.Int64 `tfsdk:"spf_maximum_hold_time"`
+ SpfMaximumHoldTimeVariable types.String `tfsdk:"spf_maximum_hold_time_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Filter types.Bool `tfsdk:"filter"`
+ FilterVariable types.String `tfsdk:"filter_variable"`
+ Redistributes []ServiceRoutingOSPFv3IPv4Redistributes `tfsdk:"redistributes"`
+ RouterLsaAction types.String `tfsdk:"router_lsa_action"`
+ RouterLsaOnStartupTime types.Int64 `tfsdk:"router_lsa_on_startup_time"`
+ RouterLsaOnStartupTimeVariable types.String `tfsdk:"router_lsa_on_startup_time_variable"`
+ Areas []ServiceRoutingOSPFv3IPv4Areas `tfsdk:"areas"`
+}
+
+type ServiceRoutingOSPFv3IPv4Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ NatDia types.Bool `tfsdk:"nat_dia"`
+ NatDiaVariable types.String `tfsdk:"nat_dia_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type ServiceRoutingOSPFv3IPv4Areas struct {
+ AreaNumber types.Int64 `tfsdk:"area_number"`
+ AreaNumberVariable types.String `tfsdk:"area_number_variable"`
+ AreaType types.String `tfsdk:"area_type"`
+ NoSummary types.Bool `tfsdk:"no_summary"`
+ NoSummaryVariable types.String `tfsdk:"no_summary_variable"`
+ AlwaysTranslate types.Bool `tfsdk:"always_translate"`
+ AlwaysTranslateVariable types.String `tfsdk:"always_translate_variable"`
+ Interfaces []ServiceRoutingOSPFv3IPv4AreasInterfaces `tfsdk:"interfaces"`
+ Ranges []ServiceRoutingOSPFv3IPv4AreasRanges `tfsdk:"ranges"`
+}
+
+type ServiceRoutingOSPFv3IPv4AreasInterfaces struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ HelloInterval types.Int64 `tfsdk:"hello_interval"`
+ HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
+ DeadInterval types.Int64 `tfsdk:"dead_interval"`
+ DeadIntervalVariable types.String `tfsdk:"dead_interval_variable"`
+ LsaRetransmitInterval types.Int64 `tfsdk:"lsa_retransmit_interval"`
+ LsaRetransmitIntervalVariable types.String `tfsdk:"lsa_retransmit_interval_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NetworkType types.String `tfsdk:"network_type"`
+ NetworkTypeVariable types.String `tfsdk:"network_type_variable"`
+ PassiveInterface types.Bool `tfsdk:"passive_interface"`
+ PassiveInterfaceVariable types.String `tfsdk:"passive_interface_variable"`
+ AuthenticationType types.String `tfsdk:"authentication_type"`
+ AuthenticationSpi types.Int64 `tfsdk:"authentication_spi"`
+ AuthenticationSpiVariable types.String `tfsdk:"authentication_spi_variable"`
+ AuthenticationKey types.String `tfsdk:"authentication_key"`
+ AuthenticationKeyVariable types.String `tfsdk:"authentication_key_variable"`
+}
+type ServiceRoutingOSPFv3IPv4AreasRanges struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NoAdvertise types.Bool `tfsdk:"no_advertise"`
+ NoAdvertiseVariable types.String `tfsdk:"no_advertise_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceRoutingOSPFv3IPv4) getModel() string {
+ return "service_routing_ospfv3_ipv4"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceRoutingOSPFv3IPv4) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/routing/ospfv3/ipv4", 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 ServiceRoutingOSPFv3IPv4) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.DistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString())
+ }
+ } else if data.Distance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.distance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64())
+ }
+ }
+
+ if !data.DistanceExternalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString())
+ }
+ } else if data.DistanceExternal.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64())
+ }
+ }
+
+ if !data.DistanceInterAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString())
+ }
+ } else if data.DistanceInterArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64())
+ }
+ }
+
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString())
+ }
+ } else if data.DistanceIntraArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64())
+ }
+ }
+
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString())
+ }
+ } else if data.ReferenceBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64())
+ }
+ }
+
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString())
+ }
+ } else if data.Rfc1583Compatible.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool())
+ }
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateAlways.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetric.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetricType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString())
+ }
+ }
+
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString())
+ }
+ } else if data.SpfCalculationDelay.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64())
+ }
+ }
+
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfInitialHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64())
+ }
+ }
+
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfMaximumHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64())
+ }
+ }
+ if !data.RoutePolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.FilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString())
+ }
+ } else if data.Filter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"redistribute", []interface{}{})
+ for _, item := range data.Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+
+ if !item.NatDiaVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDiaVariable.ValueString())
+ }
+ } else if item.NatDia.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "natDia.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDia.ValueBool())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody)
+ }
+ }
+ if !data.RouterLsaAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString())
+ }
+ }
+
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString())
+ }
+ } else if !data.RouterLsaOnStartupTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64())
+ }
+ }
+ if true {
+
+ for _, item := range data.Areas {
+ itemBody := ""
+
+ if !item.AreaNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString())
+ }
+ } else if !item.AreaNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64())
+ }
+ }
+ if !item.AreaType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString())
+ }
+ }
+
+ if !item.NoSummaryVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString())
+ }
+ } else if !item.NoSummary.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool())
+ }
+ }
+
+ if !item.AlwaysTranslateVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString())
+ }
+ } else if !item.AlwaysTranslate.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Interfaces {
+ itemChildBody := ""
+
+ if !childItem.NameVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString())
+ }
+ } else if !childItem.Name.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString())
+ }
+ }
+
+ if !childItem.HelloIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString())
+ }
+ } else if childItem.HelloInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.DeadIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString())
+ }
+ } else if childItem.DeadInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.LsaRetransmitIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString())
+ }
+ } else if childItem.LsaRetransmitInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NetworkTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString())
+ }
+ } else if childItem.NetworkType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString())
+ }
+ }
+
+ if !childItem.PassiveInterfaceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString())
+ }
+ } else if childItem.PassiveInterface.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool())
+ }
+ }
+ if !childItem.AuthenticationType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString())
+ }
+ }
+
+ if !childItem.AuthenticationSpiVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationSpi.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64())
+ }
+ }
+
+ if !childItem.AuthenticationKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody)
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{})
+ for _, childItem := range item.Ranges {
+ itemChildBody := ""
+
+ if !childItem.IpAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddressVariable.ValueString())
+ }
+ } else if !childItem.IpAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddress.ValueString())
+ }
+ }
+
+ if !childItem.SubnetMaskVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMaskVariable.ValueString())
+ }
+ } else if !childItem.SubnetMask.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMask.ValueString())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NoAdvertiseVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString())
+ }
+ } else if childItem.NoAdvertise.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"area.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceRoutingOSPFv3IPv4) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "redistribute"); value.Exists() {
+ data.Redistributes = make([]ServiceRoutingOSPFv3IPv4Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingOSPFv3IPv4Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.NatDia = types.BoolNull()
+ item.NatDiaVariable = types.StringNull()
+ if t := v.Get("natDia.optionType"); t.Exists() {
+ va := v.Get("natDia.value")
+ if t.String() == "variable" {
+ item.NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes = append(data.Redistributes, item)
+ return true
+ })
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "area"); value.Exists() {
+ data.Areas = make([]ServiceRoutingOSPFv3IPv4Areas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingOSPFv3IPv4Areas{}
+ item.AreaNumber = types.Int64Null()
+ item.AreaNumberVariable = types.StringNull()
+ if t := v.Get("areaNum.optionType"); t.Exists() {
+ va := v.Get("areaNum.value")
+ if t.String() == "variable" {
+ item.AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ item.AreaType = types.StringNull()
+
+ if t := v.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ item.AreaType = types.StringValue(va.String())
+ }
+ }
+ item.NoSummary = types.BoolNull()
+ item.NoSummaryVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ item.NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ item.AlwaysTranslate = types.BoolNull()
+ item.AlwaysTranslateVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ item.AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ if cValue := v.Get("interfaces"); cValue.Exists() {
+ item.Interfaces = make([]ServiceRoutingOSPFv3IPv4AreasInterfaces, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingOSPFv3IPv4AreasInterfaces{}
+ cItem.Name = types.StringNull()
+ cItem.NameVariable = types.StringNull()
+ if t := cv.Get("ifName.optionType"); t.Exists() {
+ va := cv.Get("ifName.value")
+ if t.String() == "variable" {
+ cItem.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Name = types.StringValue(va.String())
+ }
+ }
+ cItem.HelloInterval = types.Int64Null()
+ cItem.HelloIntervalVariable = types.StringNull()
+ if t := cv.Get("helloInterval.optionType"); t.Exists() {
+ va := cv.Get("helloInterval.value")
+ if t.String() == "variable" {
+ cItem.HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DeadInterval = types.Int64Null()
+ cItem.DeadIntervalVariable = types.StringNull()
+ if t := cv.Get("deadInterval.optionType"); t.Exists() {
+ va := cv.Get("deadInterval.value")
+ if t.String() == "variable" {
+ cItem.DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.LsaRetransmitInterval = types.Int64Null()
+ cItem.LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cv.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cv.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ cItem.LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NetworkType = types.StringNull()
+ cItem.NetworkTypeVariable = types.StringNull()
+ if t := cv.Get("networkType.optionType"); t.Exists() {
+ va := cv.Get("networkType.value")
+ if t.String() == "variable" {
+ cItem.NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NetworkType = types.StringValue(va.String())
+ }
+ }
+ cItem.PassiveInterface = types.BoolNull()
+ cItem.PassiveInterfaceVariable = types.StringNull()
+ if t := cv.Get("passiveInterface.optionType"); t.Exists() {
+ va := cv.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ cItem.PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.AuthenticationType = types.StringNull()
+
+ if t := cv.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ cItem.AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ cItem.AuthenticationSpi = types.Int64Null()
+ cItem.AuthenticationSpiVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ cItem.AuthenticationKey = types.StringNull()
+ cItem.AuthenticationKeyVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ item.Interfaces = append(item.Interfaces, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("ranges"); cValue.Exists() {
+ item.Ranges = make([]ServiceRoutingOSPFv3IPv4AreasRanges, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingOSPFv3IPv4AreasRanges{}
+ cItem.IpAddress = types.StringNull()
+ cItem.IpAddressVariable = types.StringNull()
+ if t := cv.Get("network.address.optionType"); t.Exists() {
+ va := cv.Get("network.address.value")
+ if t.String() == "variable" {
+ cItem.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.IpAddress = types.StringValue(va.String())
+ }
+ }
+ cItem.SubnetMask = types.StringNull()
+ cItem.SubnetMaskVariable = types.StringNull()
+ if t := cv.Get("network.mask.optionType"); t.Exists() {
+ va := cv.Get("network.mask.value")
+ if t.String() == "variable" {
+ cItem.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NoAdvertise = types.BoolNull()
+ cItem.NoAdvertiseVariable = types.StringNull()
+ if t := cv.Get("noAdvertise.optionType"); t.Exists() {
+ va := cv.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ cItem.NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ item.Ranges = append(item.Ranges, cItem)
+ return true
+ })
+ }
+ data.Areas = append(data.Areas, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceRoutingOSPFv3IPv4) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Redistributes {
+ keys := [...]string{"protocol"}
+ keyValues := [...]string{data.Redistributes[i].Protocol.ValueString()}
+ keyValuesVariables := [...]string{data.Redistributes[i].ProtocolVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Redistributes[i].Protocol = types.StringNull()
+ data.Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes[i].NatDia = types.BoolNull()
+ data.Redistributes[i].NatDiaVariable = types.StringNull()
+ if t := r.Get("natDia.optionType"); t.Exists() {
+ va := r.Get("natDia.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ data.Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Areas {
+ keys := [...]string{"areaNum"}
+ keyValues := [...]string{strconv.FormatInt(data.Areas[i].AreaNumber.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Areas[i].AreaNumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "area").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].AreaNumber = types.Int64Null()
+ data.Areas[i].AreaNumberVariable = types.StringNull()
+ if t := r.Get("areaNum.optionType"); t.Exists() {
+ va := r.Get("areaNum.value")
+ if t.String() == "variable" {
+ data.Areas[i].AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].AreaType = types.StringNull()
+
+ if t := r.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ data.Areas[i].AreaType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].NoSummary = types.BoolNull()
+ data.Areas[i].NoSummaryVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ data.Areas[i].NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].AlwaysTranslate = types.BoolNull()
+ data.Areas[i].AlwaysTranslateVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ data.Areas[i].AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ for ci := range data.Areas[i].Interfaces {
+ keys := [...]string{"ifName"}
+ keyValues := [...]string{data.Areas[i].Interfaces[ci].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Interfaces[ci].NameVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("interfaces").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Interfaces[ci].Name = types.StringNull()
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringNull()
+ if t := cr.Get("ifName.optionType"); t.Exists() {
+ va := cr.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Name = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringNull()
+ if t := cr.Get("helloInterval.optionType"); t.Exists() {
+ va := cr.Get("helloInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringNull()
+ if t := cr.Get("deadInterval.optionType"); t.Exists() {
+ va := cr.Get("deadInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cr.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cr.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Null()
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringNull()
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringNull()
+ if t := cr.Get("networkType.optionType"); t.Exists() {
+ va := cr.Get("networkType.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolNull()
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringNull()
+ if t := cr.Get("passiveInterface.optionType"); t.Exists() {
+ va := cr.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringNull()
+
+ if t := cr.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Null()
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringNull()
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ }
+ for ci := range data.Areas[i].Ranges {
+ keys := [...]string{"network.address"}
+ keyValues := [...]string{data.Areas[i].Ranges[ci].IpAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Ranges[ci].IpAddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ranges").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Ranges[ci].IpAddress = types.StringNull()
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringNull()
+ if t := cr.Get("network.address.optionType"); t.Exists() {
+ va := cr.Get("network.address.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringNull()
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringNull()
+ if t := cr.Get("network.mask.optionType"); t.Exists() {
+ va := cr.Get("network.mask.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].Cost = types.Int64Null()
+ data.Areas[i].Ranges[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolNull()
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringNull()
+ if t := cr.Get("noAdvertise.optionType"); t.Exists() {
+ va := cr.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceRoutingOSPFv3IPv4) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.Distance.IsNull() {
+ return false
+ }
+ if !data.DistanceVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceExternal.IsNull() {
+ return false
+ }
+ if !data.DistanceExternalVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceInterArea.IsNull() {
+ return false
+ }
+ if !data.DistanceInterAreaVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraArea.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidth.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.Rfc1583Compatible.IsNull() {
+ return false
+ }
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlways.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetric.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricType.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelay.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.RoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Filter.IsNull() {
+ return false
+ }
+ if !data.FilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Redistributes) > 0 {
+ return false
+ }
+ if !data.RouterLsaAction.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTime.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ return false
+ }
+ if len(data.Areas) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_routing_ospfv3_ipv6_feature.go b/internal/provider/model_sdwan_service_routing_ospfv3_ipv6_feature.go
new file mode 100644
index 000000000..9d9d1a65e
--- /dev/null
+++ b/internal/provider/model_sdwan_service_routing_ospfv3_ipv6_feature.go
@@ -0,0 +1,1691 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceRoutingOSPFv3IPv6 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"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ Distance types.Int64 `tfsdk:"distance"`
+ DistanceVariable types.String `tfsdk:"distance_variable"`
+ DistanceExternal types.Int64 `tfsdk:"distance_external"`
+ DistanceExternalVariable types.String `tfsdk:"distance_external_variable"`
+ DistanceInterArea types.Int64 `tfsdk:"distance_inter_area"`
+ DistanceInterAreaVariable types.String `tfsdk:"distance_inter_area_variable"`
+ DistanceIntraArea types.Int64 `tfsdk:"distance_intra_area"`
+ DistanceIntraAreaVariable types.String `tfsdk:"distance_intra_area_variable"`
+ ReferenceBandwidth types.Int64 `tfsdk:"reference_bandwidth"`
+ ReferenceBandwidthVariable types.String `tfsdk:"reference_bandwidth_variable"`
+ Rfc1583Compatible types.Bool `tfsdk:"rfc_1583_compatible"`
+ Rfc1583CompatibleVariable types.String `tfsdk:"rfc_1583_compatible_variable"`
+ DefaultInformationOriginate types.Bool `tfsdk:"default_information_originate"`
+ DefaultInformationOriginateAlways types.Bool `tfsdk:"default_information_originate_always"`
+ DefaultInformationOriginateAlwaysVariable types.String `tfsdk:"default_information_originate_always_variable"`
+ DefaultInformationOriginateMetric types.Int64 `tfsdk:"default_information_originate_metric"`
+ DefaultInformationOriginateMetricVariable types.String `tfsdk:"default_information_originate_metric_variable"`
+ DefaultInformationOriginateMetricType types.String `tfsdk:"default_information_originate_metric_type"`
+ DefaultInformationOriginateMetricTypeVariable types.String `tfsdk:"default_information_originate_metric_type_variable"`
+ SpfCalculationDelay types.Int64 `tfsdk:"spf_calculation_delay"`
+ SpfCalculationDelayVariable types.String `tfsdk:"spf_calculation_delay_variable"`
+ SpfInitialHoldTime types.Int64 `tfsdk:"spf_initial_hold_time"`
+ SpfInitialHoldTimeVariable types.String `tfsdk:"spf_initial_hold_time_variable"`
+ SpfMaximumHoldTime types.Int64 `tfsdk:"spf_maximum_hold_time"`
+ SpfMaximumHoldTimeVariable types.String `tfsdk:"spf_maximum_hold_time_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Filter types.Bool `tfsdk:"filter"`
+ FilterVariable types.String `tfsdk:"filter_variable"`
+ Redistributes []ServiceRoutingOSPFv3IPv6Redistributes `tfsdk:"redistributes"`
+ RouterLsaAction types.String `tfsdk:"router_lsa_action"`
+ RouterLsaOnStartupTime types.Int64 `tfsdk:"router_lsa_on_startup_time"`
+ RouterLsaOnStartupTimeVariable types.String `tfsdk:"router_lsa_on_startup_time_variable"`
+ Areas []ServiceRoutingOSPFv3IPv6Areas `tfsdk:"areas"`
+}
+
+type ServiceRoutingOSPFv3IPv6Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type ServiceRoutingOSPFv3IPv6Areas struct {
+ AreaNumber types.Int64 `tfsdk:"area_number"`
+ AreaNumberVariable types.String `tfsdk:"area_number_variable"`
+ AreaType types.String `tfsdk:"area_type"`
+ NoSummary types.Bool `tfsdk:"no_summary"`
+ NoSummaryVariable types.String `tfsdk:"no_summary_variable"`
+ AlwaysTranslate types.Bool `tfsdk:"always_translate"`
+ AlwaysTranslateVariable types.String `tfsdk:"always_translate_variable"`
+ Interfaces []ServiceRoutingOSPFv3IPv6AreasInterfaces `tfsdk:"interfaces"`
+ Ranges []ServiceRoutingOSPFv3IPv6AreasRanges `tfsdk:"ranges"`
+}
+
+type ServiceRoutingOSPFv3IPv6AreasInterfaces struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ HelloInterval types.Int64 `tfsdk:"hello_interval"`
+ HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
+ DeadInterval types.Int64 `tfsdk:"dead_interval"`
+ DeadIntervalVariable types.String `tfsdk:"dead_interval_variable"`
+ LsaRetransmitInterval types.Int64 `tfsdk:"lsa_retransmit_interval"`
+ LsaRetransmitIntervalVariable types.String `tfsdk:"lsa_retransmit_interval_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NetworkType types.String `tfsdk:"network_type"`
+ NetworkTypeVariable types.String `tfsdk:"network_type_variable"`
+ PassiveInterface types.Bool `tfsdk:"passive_interface"`
+ PassiveInterfaceVariable types.String `tfsdk:"passive_interface_variable"`
+ AuthenticationType types.String `tfsdk:"authentication_type"`
+ AuthenticationSpi types.Int64 `tfsdk:"authentication_spi"`
+ AuthenticationSpiVariable types.String `tfsdk:"authentication_spi_variable"`
+ AuthenticationKey types.String `tfsdk:"authentication_key"`
+ AuthenticationKeyVariable types.String `tfsdk:"authentication_key_variable"`
+}
+type ServiceRoutingOSPFv3IPv6AreasRanges struct {
+ Prefix types.String `tfsdk:"prefix"`
+ PrefixVariable types.String `tfsdk:"prefix_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NoAdvertise types.Bool `tfsdk:"no_advertise"`
+ NoAdvertiseVariable types.String `tfsdk:"no_advertise_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceRoutingOSPFv3IPv6) getModel() string {
+ return "service_routing_ospfv3_ipv6"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceRoutingOSPFv3IPv6) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/routing/ospfv3/ipv6", 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 ServiceRoutingOSPFv3IPv6) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.DistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString())
+ }
+ } else if data.Distance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.distance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64())
+ }
+ }
+
+ if !data.DistanceExternalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString())
+ }
+ } else if data.DistanceExternal.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64())
+ }
+ }
+
+ if !data.DistanceInterAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString())
+ }
+ } else if data.DistanceInterArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64())
+ }
+ }
+
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString())
+ }
+ } else if data.DistanceIntraArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64())
+ }
+ }
+
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString())
+ }
+ } else if data.ReferenceBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64())
+ }
+ }
+
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString())
+ }
+ } else if data.Rfc1583Compatible.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool())
+ }
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateAlways.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetric.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetricType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString())
+ }
+ }
+
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString())
+ }
+ } else if data.SpfCalculationDelay.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64())
+ }
+ }
+
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfInitialHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64())
+ }
+ }
+
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfMaximumHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64())
+ }
+ }
+ if !data.RoutePolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.FilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString())
+ }
+ } else if data.Filter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"redistribute", []interface{}{})
+ for _, item := range data.Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody)
+ }
+ }
+ if !data.RouterLsaAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString())
+ }
+ }
+
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString())
+ }
+ } else if !data.RouterLsaOnStartupTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64())
+ }
+ }
+ if true {
+
+ for _, item := range data.Areas {
+ itemBody := ""
+
+ if !item.AreaNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString())
+ }
+ } else if !item.AreaNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64())
+ }
+ }
+ if !item.AreaType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString())
+ }
+ }
+
+ if !item.NoSummaryVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString())
+ }
+ } else if !item.NoSummary.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool())
+ }
+ }
+
+ if !item.AlwaysTranslateVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString())
+ }
+ } else if !item.AlwaysTranslate.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Interfaces {
+ itemChildBody := ""
+
+ if !childItem.NameVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString())
+ }
+ } else if !childItem.Name.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString())
+ }
+ }
+
+ if !childItem.HelloIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString())
+ }
+ } else if childItem.HelloInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.DeadIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString())
+ }
+ } else if childItem.DeadInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.LsaRetransmitIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString())
+ }
+ } else if childItem.LsaRetransmitInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NetworkTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString())
+ }
+ } else if childItem.NetworkType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString())
+ }
+ }
+
+ if !childItem.PassiveInterfaceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString())
+ }
+ } else if childItem.PassiveInterface.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool())
+ }
+ }
+ if !childItem.AuthenticationType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString())
+ }
+ }
+
+ if !childItem.AuthenticationSpiVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationSpi.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64())
+ }
+ }
+
+ if !childItem.AuthenticationKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody)
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{})
+ for _, childItem := range item.Ranges {
+ itemChildBody := ""
+
+ if !childItem.PrefixVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.PrefixVariable.ValueString())
+ }
+ } else if !childItem.Prefix.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.Prefix.ValueString())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NoAdvertiseVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString())
+ }
+ } else if childItem.NoAdvertise.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"area.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceRoutingOSPFv3IPv6) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "redistribute"); value.Exists() {
+ data.Redistributes = make([]ServiceRoutingOSPFv3IPv6Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingOSPFv3IPv6Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes = append(data.Redistributes, item)
+ return true
+ })
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "area"); value.Exists() {
+ data.Areas = make([]ServiceRoutingOSPFv3IPv6Areas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceRoutingOSPFv3IPv6Areas{}
+ item.AreaNumber = types.Int64Null()
+ item.AreaNumberVariable = types.StringNull()
+ if t := v.Get("areaNum.optionType"); t.Exists() {
+ va := v.Get("areaNum.value")
+ if t.String() == "variable" {
+ item.AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ item.AreaType = types.StringNull()
+
+ if t := v.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ item.AreaType = types.StringValue(va.String())
+ }
+ }
+ item.NoSummary = types.BoolNull()
+ item.NoSummaryVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ item.NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ item.AlwaysTranslate = types.BoolNull()
+ item.AlwaysTranslateVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ item.AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ if cValue := v.Get("interfaces"); cValue.Exists() {
+ item.Interfaces = make([]ServiceRoutingOSPFv3IPv6AreasInterfaces, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingOSPFv3IPv6AreasInterfaces{}
+ cItem.Name = types.StringNull()
+ cItem.NameVariable = types.StringNull()
+ if t := cv.Get("ifName.optionType"); t.Exists() {
+ va := cv.Get("ifName.value")
+ if t.String() == "variable" {
+ cItem.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Name = types.StringValue(va.String())
+ }
+ }
+ cItem.HelloInterval = types.Int64Null()
+ cItem.HelloIntervalVariable = types.StringNull()
+ if t := cv.Get("helloInterval.optionType"); t.Exists() {
+ va := cv.Get("helloInterval.value")
+ if t.String() == "variable" {
+ cItem.HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DeadInterval = types.Int64Null()
+ cItem.DeadIntervalVariable = types.StringNull()
+ if t := cv.Get("deadInterval.optionType"); t.Exists() {
+ va := cv.Get("deadInterval.value")
+ if t.String() == "variable" {
+ cItem.DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.LsaRetransmitInterval = types.Int64Null()
+ cItem.LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cv.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cv.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ cItem.LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NetworkType = types.StringNull()
+ cItem.NetworkTypeVariable = types.StringNull()
+ if t := cv.Get("networkType.optionType"); t.Exists() {
+ va := cv.Get("networkType.value")
+ if t.String() == "variable" {
+ cItem.NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NetworkType = types.StringValue(va.String())
+ }
+ }
+ cItem.PassiveInterface = types.BoolNull()
+ cItem.PassiveInterfaceVariable = types.StringNull()
+ if t := cv.Get("passiveInterface.optionType"); t.Exists() {
+ va := cv.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ cItem.PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.AuthenticationType = types.StringNull()
+
+ if t := cv.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ cItem.AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ cItem.AuthenticationSpi = types.Int64Null()
+ cItem.AuthenticationSpiVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ cItem.AuthenticationKey = types.StringNull()
+ cItem.AuthenticationKeyVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ item.Interfaces = append(item.Interfaces, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("ranges"); cValue.Exists() {
+ item.Ranges = make([]ServiceRoutingOSPFv3IPv6AreasRanges, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := ServiceRoutingOSPFv3IPv6AreasRanges{}
+ cItem.Prefix = types.StringNull()
+ cItem.PrefixVariable = types.StringNull()
+ if t := cv.Get("network.optionType"); t.Exists() {
+ va := cv.Get("network.value")
+ if t.String() == "variable" {
+ cItem.PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Prefix = types.StringValue(va.String())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NoAdvertise = types.BoolNull()
+ cItem.NoAdvertiseVariable = types.StringNull()
+ if t := cv.Get("noAdvertise.optionType"); t.Exists() {
+ va := cv.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ cItem.NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ item.Ranges = append(item.Ranges, cItem)
+ return true
+ })
+ }
+ data.Areas = append(data.Areas, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceRoutingOSPFv3IPv6) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Redistributes {
+ keys := [...]string{"protocol"}
+ keyValues := [...]string{data.Redistributes[i].Protocol.ValueString()}
+ keyValuesVariables := [...]string{data.Redistributes[i].ProtocolVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Redistributes[i].Protocol = types.StringNull()
+ data.Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Areas {
+ keys := [...]string{"areaNum"}
+ keyValues := [...]string{strconv.FormatInt(data.Areas[i].AreaNumber.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Areas[i].AreaNumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "area").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].AreaNumber = types.Int64Null()
+ data.Areas[i].AreaNumberVariable = types.StringNull()
+ if t := r.Get("areaNum.optionType"); t.Exists() {
+ va := r.Get("areaNum.value")
+ if t.String() == "variable" {
+ data.Areas[i].AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].AreaType = types.StringNull()
+
+ if t := r.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ data.Areas[i].AreaType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].NoSummary = types.BoolNull()
+ data.Areas[i].NoSummaryVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ data.Areas[i].NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].AlwaysTranslate = types.BoolNull()
+ data.Areas[i].AlwaysTranslateVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ data.Areas[i].AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ for ci := range data.Areas[i].Interfaces {
+ keys := [...]string{"ifName"}
+ keyValues := [...]string{data.Areas[i].Interfaces[ci].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Interfaces[ci].NameVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("interfaces").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Interfaces[ci].Name = types.StringNull()
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringNull()
+ if t := cr.Get("ifName.optionType"); t.Exists() {
+ va := cr.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Name = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringNull()
+ if t := cr.Get("helloInterval.optionType"); t.Exists() {
+ va := cr.Get("helloInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringNull()
+ if t := cr.Get("deadInterval.optionType"); t.Exists() {
+ va := cr.Get("deadInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cr.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cr.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Null()
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringNull()
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringNull()
+ if t := cr.Get("networkType.optionType"); t.Exists() {
+ va := cr.Get("networkType.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolNull()
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringNull()
+ if t := cr.Get("passiveInterface.optionType"); t.Exists() {
+ va := cr.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringNull()
+
+ if t := cr.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Null()
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringNull()
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ }
+ for ci := range data.Areas[i].Ranges {
+ keys := [...]string{"network"}
+ keyValues := [...]string{data.Areas[i].Ranges[ci].Prefix.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Ranges[ci].PrefixVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ranges").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Ranges[ci].Prefix = types.StringNull()
+ data.Areas[i].Ranges[ci].PrefixVariable = types.StringNull()
+ if t := cr.Get("network.optionType"); t.Exists() {
+ va := cr.Get("network.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Prefix = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].Cost = types.Int64Null()
+ data.Areas[i].Ranges[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolNull()
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringNull()
+ if t := cr.Get("noAdvertise.optionType"); t.Exists() {
+ va := cr.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceRoutingOSPFv3IPv6) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.Distance.IsNull() {
+ return false
+ }
+ if !data.DistanceVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceExternal.IsNull() {
+ return false
+ }
+ if !data.DistanceExternalVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceInterArea.IsNull() {
+ return false
+ }
+ if !data.DistanceInterAreaVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraArea.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidth.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.Rfc1583Compatible.IsNull() {
+ return false
+ }
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlways.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetric.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricType.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelay.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.RoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Filter.IsNull() {
+ return false
+ }
+ if !data.FilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Redistributes) > 0 {
+ return false
+ }
+ if !data.RouterLsaAction.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTime.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ return false
+ }
+ if len(data.Areas) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_switchport_feature.go b/internal/provider/model_sdwan_service_switchport_feature.go
new file mode 100644
index 000000000..273e11f68
--- /dev/null
+++ b/internal/provider/model_sdwan_service_switchport_feature.go
@@ -0,0 +1,1153 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceSwitchport 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"`
+ Interfaces []ServiceSwitchportInterfaces `tfsdk:"interfaces"`
+ AgeOutTime types.Int64 `tfsdk:"age_out_time"`
+ AgeOutTimeVariable types.String `tfsdk:"age_out_time_variable"`
+ StaticMacAddresses []ServiceSwitchportStaticMacAddresses `tfsdk:"static_mac_addresses"`
+}
+
+type ServiceSwitchportInterfaces struct {
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ Mode types.String `tfsdk:"mode"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ Speed types.String `tfsdk:"speed"`
+ SpeedVariable types.String `tfsdk:"speed_variable"`
+ Duplex types.String `tfsdk:"duplex"`
+ DuplexVariable types.String `tfsdk:"duplex_variable"`
+ SwitchportAccessVlan types.Int64 `tfsdk:"switchport_access_vlan"`
+ SwitchportAccessVlanVariable types.String `tfsdk:"switchport_access_vlan_variable"`
+ SwitchportTrunkAllowedVlans types.String `tfsdk:"switchport_trunk_allowed_vlans"`
+ SwitchportTrunkAllowedVlansVariable types.String `tfsdk:"switchport_trunk_allowed_vlans_variable"`
+ SwitchportTrunkNativeVlan types.Int64 `tfsdk:"switchport_trunk_native_vlan"`
+ SwitchportTrunkNativeVlanVariable types.String `tfsdk:"switchport_trunk_native_vlan_variable"`
+ PortControl types.String `tfsdk:"port_control"`
+ PortControlVariable types.String `tfsdk:"port_control_variable"`
+ VoiceVlan types.Int64 `tfsdk:"voice_vlan"`
+ VoiceVlanVariable types.String `tfsdk:"voice_vlan_variable"`
+ PaeEnable types.Bool `tfsdk:"pae_enable"`
+ PaeEnableVariable types.String `tfsdk:"pae_enable_variable"`
+ MacAuthenticationBypass types.Bool `tfsdk:"mac_authentication_bypass"`
+ MacAuthenticationBypassVariable types.String `tfsdk:"mac_authentication_bypass_variable"`
+ HostMode types.String `tfsdk:"host_mode"`
+ HostModeVariable types.String `tfsdk:"host_mode_variable"`
+ EnablePeriodicReauth types.Bool `tfsdk:"enable_periodic_reauth"`
+ EnablePeriodicReauthVariable types.String `tfsdk:"enable_periodic_reauth_variable"`
+ Inactivity types.Int64 `tfsdk:"inactivity"`
+ InactivityVariable types.String `tfsdk:"inactivity_variable"`
+ Reauthentication types.Int64 `tfsdk:"reauthentication"`
+ ReauthenticationVariable types.String `tfsdk:"reauthentication_variable"`
+ ControlDirection types.String `tfsdk:"control_direction"`
+ ControlDirectionVariable types.String `tfsdk:"control_direction_variable"`
+ RestrictedVlan types.Int64 `tfsdk:"restricted_vlan"`
+ RestrictedVlanVariable types.String `tfsdk:"restricted_vlan_variable"`
+ GuestVlan types.Int64 `tfsdk:"guest_vlan"`
+ GuestVlanVariable types.String `tfsdk:"guest_vlan_variable"`
+ CriticalVlan types.Int64 `tfsdk:"critical_vlan"`
+ CriticalVlanVariable types.String `tfsdk:"critical_vlan_variable"`
+ EnableVoice types.Bool `tfsdk:"enable_voice"`
+ EnableVoiceVariable types.String `tfsdk:"enable_voice_variable"`
+}
+
+type ServiceSwitchportStaticMacAddresses struct {
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+ VlanId types.Int64 `tfsdk:"vlan_id"`
+ VlanIdVariable types.String `tfsdk:"vlan_id_variable"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceSwitchport) getModel() string {
+ return "service_switchport"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceSwitchport) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/switchport", 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 ServiceSwitchport) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+ body, _ = sjson.Set(body, path+"interface", []interface{}{})
+ for _, item := range data.Interfaces {
+ itemBody := ""
+
+ if !item.InterfaceNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString())
+ }
+ } else if !item.InterfaceName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString())
+ }
+ }
+ if !item.Mode.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "mode.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "mode.value", item.Mode.ValueString())
+ }
+ }
+
+ if !item.ShutdownVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString())
+ }
+ } else if item.Shutdown.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool())
+ }
+ }
+
+ if !item.SpeedVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "speed.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "speed.value", item.SpeedVariable.ValueString())
+ }
+ } else if item.Speed.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "speed.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "speed.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "speed.value", item.Speed.ValueString())
+ }
+ }
+
+ if !item.DuplexVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "duplex.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "duplex.value", item.DuplexVariable.ValueString())
+ }
+ } else if item.Duplex.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "duplex.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "duplex.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "duplex.value", item.Duplex.ValueString())
+ }
+ }
+
+ if !item.SwitchportAccessVlanVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportAccessVlan.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "switchportAccessVlan.value", item.SwitchportAccessVlanVariable.ValueString())
+ }
+ } else if item.SwitchportAccessVlan.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportAccessVlan.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportAccessVlan.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "switchportAccessVlan.value", item.SwitchportAccessVlan.ValueInt64())
+ }
+ }
+
+ if !item.SwitchportTrunkAllowedVlansVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkAllowedVlans.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkAllowedVlans.value", item.SwitchportTrunkAllowedVlansVariable.ValueString())
+ }
+ } else if item.SwitchportTrunkAllowedVlans.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkAllowedVlans.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkAllowedVlans.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkAllowedVlans.value", item.SwitchportTrunkAllowedVlans.ValueString())
+ }
+ }
+
+ if !item.SwitchportTrunkNativeVlanVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkNativeVlan.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkNativeVlan.value", item.SwitchportTrunkNativeVlanVariable.ValueString())
+ }
+ } else if item.SwitchportTrunkNativeVlan.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkNativeVlan.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkNativeVlan.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "switchportTrunkNativeVlan.value", item.SwitchportTrunkNativeVlan.ValueInt64())
+ }
+ }
+
+ if !item.PortControlVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "portControl.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "portControl.value", item.PortControlVariable.ValueString())
+ }
+ } else if item.PortControl.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "portControl.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "portControl.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "portControl.value", item.PortControl.ValueString())
+ }
+ }
+
+ if !item.VoiceVlanVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "voiceVlan.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "voiceVlan.value", item.VoiceVlanVariable.ValueString())
+ }
+ } else if item.VoiceVlan.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "voiceVlan.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "voiceVlan.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "voiceVlan.value", item.VoiceVlan.ValueInt64())
+ }
+ }
+
+ if !item.PaeEnableVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "paeEnable.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "paeEnable.value", item.PaeEnableVariable.ValueString())
+ }
+ } else if item.PaeEnable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "paeEnable.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "paeEnable.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "paeEnable.value", item.PaeEnable.ValueBool())
+ }
+ }
+
+ if !item.MacAuthenticationBypassVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAuthenticationBypass.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "macAuthenticationBypass.value", item.MacAuthenticationBypassVariable.ValueString())
+ }
+ } else if item.MacAuthenticationBypass.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAuthenticationBypass.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAuthenticationBypass.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "macAuthenticationBypass.value", item.MacAuthenticationBypass.ValueBool())
+ }
+ }
+
+ if !item.HostModeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostMode.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "hostMode.value", item.HostModeVariable.ValueString())
+ }
+ } else if item.HostMode.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostMode.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostMode.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "hostMode.value", item.HostMode.ValueString())
+ }
+ }
+
+ if !item.EnablePeriodicReauthVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "enablePeriodicReauth.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "enablePeriodicReauth.value", item.EnablePeriodicReauthVariable.ValueString())
+ }
+ } else if item.EnablePeriodicReauth.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "enablePeriodicReauth.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "enablePeriodicReauth.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "enablePeriodicReauth.value", item.EnablePeriodicReauth.ValueBool())
+ }
+ }
+
+ if !item.InactivityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "inactivity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "inactivity.value", item.InactivityVariable.ValueString())
+ }
+ } else if item.Inactivity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "inactivity.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "inactivity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "inactivity.value", item.Inactivity.ValueInt64())
+ }
+ }
+
+ if !item.ReauthenticationVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "reauthentication.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "reauthentication.value", item.ReauthenticationVariable.ValueString())
+ }
+ } else if item.Reauthentication.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "reauthentication.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "reauthentication.value", 3600)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "reauthentication.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "reauthentication.value", item.Reauthentication.ValueInt64())
+ }
+ }
+
+ if !item.ControlDirectionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "controlDirection.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "controlDirection.value", item.ControlDirectionVariable.ValueString())
+ }
+ } else if item.ControlDirection.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "controlDirection.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "controlDirection.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "controlDirection.value", item.ControlDirection.ValueString())
+ }
+ }
+
+ if !item.RestrictedVlanVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "restrictedVlan.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "restrictedVlan.value", item.RestrictedVlanVariable.ValueString())
+ }
+ } else if item.RestrictedVlan.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "restrictedVlan.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "restrictedVlan.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "restrictedVlan.value", item.RestrictedVlan.ValueInt64())
+ }
+ }
+
+ if !item.GuestVlanVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "guestVlan.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "guestVlan.value", item.GuestVlanVariable.ValueString())
+ }
+ } else if item.GuestVlan.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "guestVlan.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "guestVlan.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "guestVlan.value", item.GuestVlan.ValueInt64())
+ }
+ }
+
+ if !item.CriticalVlanVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "criticalVlan.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "criticalVlan.value", item.CriticalVlanVariable.ValueString())
+ }
+ } else if item.CriticalVlan.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "criticalVlan.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "criticalVlan.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "criticalVlan.value", item.CriticalVlan.ValueInt64())
+ }
+ }
+
+ if !item.EnableVoiceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "enableVoice.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "enableVoice.value", item.EnableVoiceVariable.ValueString())
+ }
+ } else if item.EnableVoice.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "enableVoice.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "enableVoice.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "enableVoice.value", item.EnableVoice.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"interface.-1", itemBody)
+ }
+ }
+
+ if !data.AgeOutTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ageTime.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ageTime.value", data.AgeOutTimeVariable.ValueString())
+ }
+ } else if data.AgeOutTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ageTime.optionType", "default")
+ body, _ = sjson.Set(body, path+"ageTime.value", 300)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ageTime.optionType", "global")
+ body, _ = sjson.Set(body, path+"ageTime.value", data.AgeOutTime.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"staticMacAddress", []interface{}{})
+ for _, item := range data.StaticMacAddresses {
+ itemBody := ""
+
+ if !item.MacAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macaddr.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "macaddr.value", item.MacAddressVariable.ValueString())
+ }
+ } else if !item.MacAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macaddr.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "macaddr.value", item.MacAddress.ValueString())
+ }
+ }
+
+ if !item.VlanIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vlan.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vlan.value", item.VlanIdVariable.ValueString())
+ }
+ } else if !item.VlanId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vlan.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vlan.value", item.VlanId.ValueInt64())
+ }
+ }
+
+ if !item.InterfaceNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString())
+ }
+ } else if !item.InterfaceName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"staticMacAddress.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceSwitchport) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "interface"); value.Exists() {
+ data.Interfaces = make([]ServiceSwitchportInterfaces, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceSwitchportInterfaces{}
+ item.InterfaceName = types.StringNull()
+ item.InterfaceNameVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ item.Mode = types.StringNull()
+
+ if t := v.Get("mode.optionType"); t.Exists() {
+ va := v.Get("mode.value")
+ if t.String() == "global" {
+ item.Mode = types.StringValue(va.String())
+ }
+ }
+ item.Shutdown = types.BoolNull()
+ item.ShutdownVariable = types.StringNull()
+ if t := v.Get("shutdown.optionType"); t.Exists() {
+ va := v.Get("shutdown.value")
+ if t.String() == "variable" {
+ item.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ item.Speed = types.StringNull()
+ item.SpeedVariable = types.StringNull()
+ if t := v.Get("speed.optionType"); t.Exists() {
+ va := v.Get("speed.value")
+ if t.String() == "variable" {
+ item.SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Speed = types.StringValue(va.String())
+ }
+ }
+ item.Duplex = types.StringNull()
+ item.DuplexVariable = types.StringNull()
+ if t := v.Get("duplex.optionType"); t.Exists() {
+ va := v.Get("duplex.value")
+ if t.String() == "variable" {
+ item.DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Duplex = types.StringValue(va.String())
+ }
+ }
+ item.SwitchportAccessVlan = types.Int64Null()
+ item.SwitchportAccessVlanVariable = types.StringNull()
+ if t := v.Get("switchportAccessVlan.optionType"); t.Exists() {
+ va := v.Get("switchportAccessVlan.value")
+ if t.String() == "variable" {
+ item.SwitchportAccessVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SwitchportAccessVlan = types.Int64Value(va.Int())
+ }
+ }
+ item.SwitchportTrunkAllowedVlans = types.StringNull()
+ item.SwitchportTrunkAllowedVlansVariable = types.StringNull()
+ if t := v.Get("switchportTrunkAllowedVlans.optionType"); t.Exists() {
+ va := v.Get("switchportTrunkAllowedVlans.value")
+ if t.String() == "variable" {
+ item.SwitchportTrunkAllowedVlansVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SwitchportTrunkAllowedVlans = types.StringValue(va.String())
+ }
+ }
+ item.SwitchportTrunkNativeVlan = types.Int64Null()
+ item.SwitchportTrunkNativeVlanVariable = types.StringNull()
+ if t := v.Get("switchportTrunkNativeVlan.optionType"); t.Exists() {
+ va := v.Get("switchportTrunkNativeVlan.value")
+ if t.String() == "variable" {
+ item.SwitchportTrunkNativeVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SwitchportTrunkNativeVlan = types.Int64Value(va.Int())
+ }
+ }
+ item.PortControl = types.StringNull()
+ item.PortControlVariable = types.StringNull()
+ if t := v.Get("portControl.optionType"); t.Exists() {
+ va := v.Get("portControl.value")
+ if t.String() == "variable" {
+ item.PortControlVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PortControl = types.StringValue(va.String())
+ }
+ }
+ item.VoiceVlan = types.Int64Null()
+ item.VoiceVlanVariable = types.StringNull()
+ if t := v.Get("voiceVlan.optionType"); t.Exists() {
+ va := v.Get("voiceVlan.value")
+ if t.String() == "variable" {
+ item.VoiceVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.VoiceVlan = types.Int64Value(va.Int())
+ }
+ }
+ item.PaeEnable = types.BoolNull()
+ item.PaeEnableVariable = types.StringNull()
+ if t := v.Get("paeEnable.optionType"); t.Exists() {
+ va := v.Get("paeEnable.value")
+ if t.String() == "variable" {
+ item.PaeEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PaeEnable = types.BoolValue(va.Bool())
+ }
+ }
+ item.MacAuthenticationBypass = types.BoolNull()
+ item.MacAuthenticationBypassVariable = types.StringNull()
+ if t := v.Get("macAuthenticationBypass.optionType"); t.Exists() {
+ va := v.Get("macAuthenticationBypass.value")
+ if t.String() == "variable" {
+ item.MacAuthenticationBypassVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.MacAuthenticationBypass = types.BoolValue(va.Bool())
+ }
+ }
+ item.HostMode = types.StringNull()
+ item.HostModeVariable = types.StringNull()
+ if t := v.Get("hostMode.optionType"); t.Exists() {
+ va := v.Get("hostMode.value")
+ if t.String() == "variable" {
+ item.HostModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HostMode = types.StringValue(va.String())
+ }
+ }
+ item.EnablePeriodicReauth = types.BoolNull()
+ item.EnablePeriodicReauthVariable = types.StringNull()
+ if t := v.Get("enablePeriodicReauth.optionType"); t.Exists() {
+ va := v.Get("enablePeriodicReauth.value")
+ if t.String() == "variable" {
+ item.EnablePeriodicReauthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.EnablePeriodicReauth = types.BoolValue(va.Bool())
+ }
+ }
+ item.Inactivity = types.Int64Null()
+ item.InactivityVariable = types.StringNull()
+ if t := v.Get("inactivity.optionType"); t.Exists() {
+ va := v.Get("inactivity.value")
+ if t.String() == "variable" {
+ item.InactivityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Inactivity = types.Int64Value(va.Int())
+ }
+ }
+ item.Reauthentication = types.Int64Null()
+ item.ReauthenticationVariable = types.StringNull()
+ if t := v.Get("reauthentication.optionType"); t.Exists() {
+ va := v.Get("reauthentication.value")
+ if t.String() == "variable" {
+ item.ReauthenticationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Reauthentication = types.Int64Value(va.Int())
+ }
+ }
+ item.ControlDirection = types.StringNull()
+ item.ControlDirectionVariable = types.StringNull()
+ if t := v.Get("controlDirection.optionType"); t.Exists() {
+ va := v.Get("controlDirection.value")
+ if t.String() == "variable" {
+ item.ControlDirectionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ControlDirection = types.StringValue(va.String())
+ }
+ }
+ item.RestrictedVlan = types.Int64Null()
+ item.RestrictedVlanVariable = types.StringNull()
+ if t := v.Get("restrictedVlan.optionType"); t.Exists() {
+ va := v.Get("restrictedVlan.value")
+ if t.String() == "variable" {
+ item.RestrictedVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RestrictedVlan = types.Int64Value(va.Int())
+ }
+ }
+ item.GuestVlan = types.Int64Null()
+ item.GuestVlanVariable = types.StringNull()
+ if t := v.Get("guestVlan.optionType"); t.Exists() {
+ va := v.Get("guestVlan.value")
+ if t.String() == "variable" {
+ item.GuestVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.GuestVlan = types.Int64Value(va.Int())
+ }
+ }
+ item.CriticalVlan = types.Int64Null()
+ item.CriticalVlanVariable = types.StringNull()
+ if t := v.Get("criticalVlan.optionType"); t.Exists() {
+ va := v.Get("criticalVlan.value")
+ if t.String() == "variable" {
+ item.CriticalVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.CriticalVlan = types.Int64Value(va.Int())
+ }
+ }
+ item.EnableVoice = types.BoolNull()
+ item.EnableVoiceVariable = types.StringNull()
+ if t := v.Get("enableVoice.optionType"); t.Exists() {
+ va := v.Get("enableVoice.value")
+ if t.String() == "variable" {
+ item.EnableVoiceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.EnableVoice = types.BoolValue(va.Bool())
+ }
+ }
+ data.Interfaces = append(data.Interfaces, item)
+ return true
+ })
+ }
+ data.AgeOutTime = types.Int64Null()
+ data.AgeOutTimeVariable = types.StringNull()
+ if t := res.Get(path + "ageTime.optionType"); t.Exists() {
+ va := res.Get(path + "ageTime.value")
+ if t.String() == "variable" {
+ data.AgeOutTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AgeOutTime = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "staticMacAddress"); value.Exists() {
+ data.StaticMacAddresses = make([]ServiceSwitchportStaticMacAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceSwitchportStaticMacAddresses{}
+ item.MacAddress = types.StringNull()
+ item.MacAddressVariable = types.StringNull()
+ if t := v.Get("macaddr.optionType"); t.Exists() {
+ va := v.Get("macaddr.value")
+ if t.String() == "variable" {
+ item.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.MacAddress = types.StringValue(va.String())
+ }
+ }
+ item.VlanId = types.Int64Null()
+ item.VlanIdVariable = types.StringNull()
+ if t := v.Get("vlan.optionType"); t.Exists() {
+ va := v.Get("vlan.value")
+ if t.String() == "variable" {
+ item.VlanIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.VlanId = types.Int64Value(va.Int())
+ }
+ }
+ item.InterfaceName = types.StringNull()
+ item.InterfaceNameVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.StaticMacAddresses = append(data.StaticMacAddresses, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceSwitchport) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Interfaces {
+ keys := [...]string{"ifName"}
+ keyValues := [...]string{data.Interfaces[i].InterfaceName.ValueString()}
+ keyValuesVariables := [...]string{data.Interfaces[i].InterfaceNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "interface").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Interfaces[i].InterfaceName = types.StringNull()
+ data.Interfaces[i].InterfaceNameVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].Mode = types.StringNull()
+
+ if t := r.Get("mode.optionType"); t.Exists() {
+ va := r.Get("mode.value")
+ if t.String() == "global" {
+ data.Interfaces[i].Mode = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].Shutdown = types.BoolNull()
+ data.Interfaces[i].ShutdownVariable = types.StringNull()
+ if t := r.Get("shutdown.optionType"); t.Exists() {
+ va := r.Get("shutdown.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.Interfaces[i].Speed = types.StringNull()
+ data.Interfaces[i].SpeedVariable = types.StringNull()
+ if t := r.Get("speed.optionType"); t.Exists() {
+ va := r.Get("speed.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].Speed = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].Duplex = types.StringNull()
+ data.Interfaces[i].DuplexVariable = types.StringNull()
+ if t := r.Get("duplex.optionType"); t.Exists() {
+ va := r.Get("duplex.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].Duplex = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].SwitchportAccessVlan = types.Int64Null()
+ data.Interfaces[i].SwitchportAccessVlanVariable = types.StringNull()
+ if t := r.Get("switchportAccessVlan.optionType"); t.Exists() {
+ va := r.Get("switchportAccessVlan.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].SwitchportAccessVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].SwitchportAccessVlan = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].SwitchportTrunkAllowedVlans = types.StringNull()
+ data.Interfaces[i].SwitchportTrunkAllowedVlansVariable = types.StringNull()
+ if t := r.Get("switchportTrunkAllowedVlans.optionType"); t.Exists() {
+ va := r.Get("switchportTrunkAllowedVlans.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].SwitchportTrunkAllowedVlansVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].SwitchportTrunkAllowedVlans = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].SwitchportTrunkNativeVlan = types.Int64Null()
+ data.Interfaces[i].SwitchportTrunkNativeVlanVariable = types.StringNull()
+ if t := r.Get("switchportTrunkNativeVlan.optionType"); t.Exists() {
+ va := r.Get("switchportTrunkNativeVlan.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].SwitchportTrunkNativeVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].SwitchportTrunkNativeVlan = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].PortControl = types.StringNull()
+ data.Interfaces[i].PortControlVariable = types.StringNull()
+ if t := r.Get("portControl.optionType"); t.Exists() {
+ va := r.Get("portControl.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].PortControlVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].PortControl = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].VoiceVlan = types.Int64Null()
+ data.Interfaces[i].VoiceVlanVariable = types.StringNull()
+ if t := r.Get("voiceVlan.optionType"); t.Exists() {
+ va := r.Get("voiceVlan.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].VoiceVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].VoiceVlan = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].PaeEnable = types.BoolNull()
+ data.Interfaces[i].PaeEnableVariable = types.StringNull()
+ if t := r.Get("paeEnable.optionType"); t.Exists() {
+ va := r.Get("paeEnable.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].PaeEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].PaeEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.Interfaces[i].MacAuthenticationBypass = types.BoolNull()
+ data.Interfaces[i].MacAuthenticationBypassVariable = types.StringNull()
+ if t := r.Get("macAuthenticationBypass.optionType"); t.Exists() {
+ va := r.Get("macAuthenticationBypass.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].MacAuthenticationBypassVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].MacAuthenticationBypass = types.BoolValue(va.Bool())
+ }
+ }
+ data.Interfaces[i].HostMode = types.StringNull()
+ data.Interfaces[i].HostModeVariable = types.StringNull()
+ if t := r.Get("hostMode.optionType"); t.Exists() {
+ va := r.Get("hostMode.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].HostModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].HostMode = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].EnablePeriodicReauth = types.BoolNull()
+ data.Interfaces[i].EnablePeriodicReauthVariable = types.StringNull()
+ if t := r.Get("enablePeriodicReauth.optionType"); t.Exists() {
+ va := r.Get("enablePeriodicReauth.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].EnablePeriodicReauthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].EnablePeriodicReauth = types.BoolValue(va.Bool())
+ }
+ }
+ data.Interfaces[i].Inactivity = types.Int64Null()
+ data.Interfaces[i].InactivityVariable = types.StringNull()
+ if t := r.Get("inactivity.optionType"); t.Exists() {
+ va := r.Get("inactivity.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].InactivityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].Inactivity = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].Reauthentication = types.Int64Null()
+ data.Interfaces[i].ReauthenticationVariable = types.StringNull()
+ if t := r.Get("reauthentication.optionType"); t.Exists() {
+ va := r.Get("reauthentication.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].ReauthenticationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].Reauthentication = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].ControlDirection = types.StringNull()
+ data.Interfaces[i].ControlDirectionVariable = types.StringNull()
+ if t := r.Get("controlDirection.optionType"); t.Exists() {
+ va := r.Get("controlDirection.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].ControlDirectionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].ControlDirection = types.StringValue(va.String())
+ }
+ }
+ data.Interfaces[i].RestrictedVlan = types.Int64Null()
+ data.Interfaces[i].RestrictedVlanVariable = types.StringNull()
+ if t := r.Get("restrictedVlan.optionType"); t.Exists() {
+ va := r.Get("restrictedVlan.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].RestrictedVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].RestrictedVlan = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].GuestVlan = types.Int64Null()
+ data.Interfaces[i].GuestVlanVariable = types.StringNull()
+ if t := r.Get("guestVlan.optionType"); t.Exists() {
+ va := r.Get("guestVlan.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].GuestVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].GuestVlan = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].CriticalVlan = types.Int64Null()
+ data.Interfaces[i].CriticalVlanVariable = types.StringNull()
+ if t := r.Get("criticalVlan.optionType"); t.Exists() {
+ va := r.Get("criticalVlan.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].CriticalVlanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].CriticalVlan = types.Int64Value(va.Int())
+ }
+ }
+ data.Interfaces[i].EnableVoice = types.BoolNull()
+ data.Interfaces[i].EnableVoiceVariable = types.StringNull()
+ if t := r.Get("enableVoice.optionType"); t.Exists() {
+ va := r.Get("enableVoice.value")
+ if t.String() == "variable" {
+ data.Interfaces[i].EnableVoiceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interfaces[i].EnableVoice = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ data.AgeOutTime = types.Int64Null()
+ data.AgeOutTimeVariable = types.StringNull()
+ if t := res.Get(path + "ageTime.optionType"); t.Exists() {
+ va := res.Get(path + "ageTime.value")
+ if t.String() == "variable" {
+ data.AgeOutTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AgeOutTime = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.StaticMacAddresses {
+ keys := [...]string{"vlan"}
+ keyValues := [...]string{strconv.FormatInt(data.StaticMacAddresses[i].VlanId.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.StaticMacAddresses[i].VlanIdVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "staticMacAddress").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.StaticMacAddresses[i].MacAddress = types.StringNull()
+ data.StaticMacAddresses[i].MacAddressVariable = types.StringNull()
+ if t := r.Get("macaddr.optionType"); t.Exists() {
+ va := r.Get("macaddr.value")
+ if t.String() == "variable" {
+ data.StaticMacAddresses[i].MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticMacAddresses[i].MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.StaticMacAddresses[i].VlanId = types.Int64Null()
+ data.StaticMacAddresses[i].VlanIdVariable = types.StringNull()
+ if t := r.Get("vlan.optionType"); t.Exists() {
+ va := r.Get("vlan.value")
+ if t.String() == "variable" {
+ data.StaticMacAddresses[i].VlanIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticMacAddresses[i].VlanId = types.Int64Value(va.Int())
+ }
+ }
+ data.StaticMacAddresses[i].InterfaceName = types.StringNull()
+ data.StaticMacAddresses[i].InterfaceNameVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.StaticMacAddresses[i].InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticMacAddresses[i].InterfaceName = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceSwitchport) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Interfaces) > 0 {
+ return false
+ }
+ if !data.AgeOutTime.IsNull() {
+ return false
+ }
+ if !data.AgeOutTimeVariable.IsNull() {
+ return false
+ }
+ if len(data.StaticMacAddresses) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_service_tracker_profile_parcel.go b/internal/provider/model_sdwan_service_tracker_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_service_tracker_profile_parcel.go
rename to internal/provider/model_sdwan_service_tracker_feature.go
diff --git a/internal/provider/model_sdwan_service_tracker_group_feature.go b/internal/provider/model_sdwan_service_tracker_group_feature.go
new file mode 100644
index 000000000..fc0ab5d5a
--- /dev/null
+++ b/internal/provider/model_sdwan_service_tracker_group_feature.go
@@ -0,0 +1,223 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type ServiceTrackerGroup 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"`
+ TrackerElements []ServiceTrackerGroupTrackerElements `tfsdk:"tracker_elements"`
+ TrackerBoolean types.String `tfsdk:"tracker_boolean"`
+ TrackerBooleanVariable types.String `tfsdk:"tracker_boolean_variable"`
+}
+
+type ServiceTrackerGroupTrackerElements struct {
+ TrackerId types.String `tfsdk:"tracker_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data ServiceTrackerGroup) getModel() string {
+ return "service_tracker_group"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data ServiceTrackerGroup) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/service/%v/trackergroup", 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 ServiceTrackerGroup) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.TrackerElements {
+ itemBody := ""
+ if !item.TrackerId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody)
+ }
+ }
+
+ if !data.TrackerBooleanVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString())
+ }
+ } else if data.TrackerBoolean.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", "or")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *ServiceTrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "trackerRefs"); value.Exists() {
+ data.TrackerElements = make([]ServiceTrackerGroupTrackerElements, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := ServiceTrackerGroupTrackerElements{}
+ item.TrackerId = types.StringNull()
+
+ if t := v.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := v.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ item.TrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TrackerElements = append(data.TrackerElements, item)
+ return true
+ })
+ }
+ data.TrackerBoolean = types.StringNull()
+ data.TrackerBooleanVariable = types.StringNull()
+ if t := res.Get(path + "combineBoolean.optionType"); t.Exists() {
+ va := res.Get(path + "combineBoolean.value")
+ if t.String() == "variable" {
+ data.TrackerBooleanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerBoolean = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *ServiceTrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.TrackerElements {
+ keys := [...]string{"trackerRef.refId"}
+ keyValues := [...]string{data.TrackerElements[i].TrackerId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "trackerRefs").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TrackerElements[i].TrackerId = types.StringNull()
+
+ if t := r.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := r.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ data.TrackerElements[i].TrackerId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.TrackerBoolean = types.StringNull()
+ data.TrackerBooleanVariable = types.StringNull()
+ if t := res.Get(path + "combineBoolean.optionType"); t.Exists() {
+ va := res.Get(path + "combineBoolean.value")
+ if t.String() == "variable" {
+ data.TrackerBooleanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerBoolean = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *ServiceTrackerGroup) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.TrackerElements) > 0 {
+ return false
+ }
+ if !data.TrackerBoolean.IsNull() {
+ return false
+ }
+ if !data.TrackerBooleanVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_sig_security_feature_profile.go b/internal/provider/model_sdwan_sig_security_feature_profile.go
new file mode 100644
index 000000000..2da2501a1
--- /dev/null
+++ b/internal/provider/model_sdwan_sig_security_feature_profile.go
@@ -0,0 +1,93 @@
+// 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"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SIGSecurityFeatureProfile struct {
+ Id types.String `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ Description types.String `tfsdk:"description"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SIGSecurityFeatureProfile) getPath() string {
+ return "/v1/feature-profile/sdwan/sig-security/"
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data SIGSecurityFeatureProfile) toBody(ctx context.Context) string {
+ body := ""
+ if !data.Name.IsNull() {
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ }
+ if !data.Description.IsNull() {
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SIGSecurityFeatureProfile) fromBody(ctx context.Context, res gjson.Result) {
+ if value := res.Get("profileName"); value.Exists() {
+ data.Name = types.StringValue(value.String())
+ } else {
+ data.Name = types.StringNull()
+ }
+ if value := res.Get("description"); value.Exists() {
+ data.Description = types.StringValue(value.String())
+ } else {
+ data.Description = types.StringNull()
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin hasChanges
+func (data *SIGSecurityFeatureProfile) hasChanges(ctx context.Context, state *SIGSecurityFeatureProfile) bool {
+ hasChanges := false
+ if !data.Name.Equal(state.Name) {
+ hasChanges = true
+ }
+ if !data.Description.Equal(state.Description) {
+ hasChanges = true
+ }
+ return hasChanges
+}
+
+// End of section. //template:end hasChanges
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateVersions
+
+// End of section. //template:end updateVersions
diff --git a/internal/provider/model_sdwan_system_aaa_feature.go b/internal/provider/model_sdwan_system_aaa_feature.go
new file mode 100644
index 000000000..d1dd9ad3f
--- /dev/null
+++ b/internal/provider/model_sdwan_system_aaa_feature.go
@@ -0,0 +1,1770 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemAAA 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"`
+ AuthenticationGroup types.Bool `tfsdk:"authentication_group"`
+ AuthenticationGroupVariable types.String `tfsdk:"authentication_group_variable"`
+ AccountingGroup types.Bool `tfsdk:"accounting_group"`
+ AccountingGroupVariable types.String `tfsdk:"accounting_group_variable"`
+ ServerAuthOrder types.Set `tfsdk:"server_auth_order"`
+ Users []SystemAAAUsers `tfsdk:"users"`
+ RadiusGroups []SystemAAARadiusGroups `tfsdk:"radius_groups"`
+ TacacsGroups []SystemAAATacacsGroups `tfsdk:"tacacs_groups"`
+ AccountingRules []SystemAAAAccountingRules `tfsdk:"accounting_rules"`
+ AuthorizationConsole types.Bool `tfsdk:"authorization_console"`
+ AuthorizationConsoleVariable types.String `tfsdk:"authorization_console_variable"`
+ AuthorizationConfigCommands types.Bool `tfsdk:"authorization_config_commands"`
+ AuthorizationConfigCommandsVariable types.String `tfsdk:"authorization_config_commands_variable"`
+ AuthorizationRules []SystemAAAAuthorizationRules `tfsdk:"authorization_rules"`
+}
+
+type SystemAAAUsers struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ Password types.String `tfsdk:"password"`
+ PasswordVariable types.String `tfsdk:"password_variable"`
+ Privilege types.String `tfsdk:"privilege"`
+ PrivilegeVariable types.String `tfsdk:"privilege_variable"`
+ PublicKeys []SystemAAAUsersPublicKeys `tfsdk:"public_keys"`
+}
+
+type SystemAAARadiusGroups struct {
+ GroupName types.String `tfsdk:"group_name"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ SourceInterface types.String `tfsdk:"source_interface"`
+ SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
+ Servers []SystemAAARadiusGroupsServers `tfsdk:"servers"`
+}
+
+type SystemAAATacacsGroups struct {
+ GroupName types.String `tfsdk:"group_name"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ SourceInterface types.String `tfsdk:"source_interface"`
+ SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
+ Servers []SystemAAATacacsGroupsServers `tfsdk:"servers"`
+}
+
+type SystemAAAAccountingRules struct {
+ RuleId types.String `tfsdk:"rule_id"`
+ Method types.String `tfsdk:"method"`
+ Level types.String `tfsdk:"level"`
+ StartStop types.Bool `tfsdk:"start_stop"`
+ StartStopVariable types.String `tfsdk:"start_stop_variable"`
+ Group types.Set `tfsdk:"group"`
+}
+
+type SystemAAAAuthorizationRules struct {
+ RuleId types.String `tfsdk:"rule_id"`
+ Method types.String `tfsdk:"method"`
+ Level types.String `tfsdk:"level"`
+ Group types.Set `tfsdk:"group"`
+ IfAuthenticated types.Bool `tfsdk:"if_authenticated"`
+}
+
+type SystemAAAUsersPublicKeys struct {
+ KeyString types.String `tfsdk:"key_string"`
+ KeyType types.String `tfsdk:"key_type"`
+ KeyTypeVariable types.String `tfsdk:"key_type_variable"`
+}
+
+type SystemAAARadiusGroupsServers struct {
+ Address types.String `tfsdk:"address"`
+ AuthPort types.Int64 `tfsdk:"auth_port"`
+ AuthPortVariable types.String `tfsdk:"auth_port_variable"`
+ AcctPort types.Int64 `tfsdk:"acct_port"`
+ AcctPortVariable types.String `tfsdk:"acct_port_variable"`
+ Timeout types.Int64 `tfsdk:"timeout"`
+ TimeoutVariable types.String `tfsdk:"timeout_variable"`
+ Retransmit types.Int64 `tfsdk:"retransmit"`
+ RetransmitVariable types.String `tfsdk:"retransmit_variable"`
+ Key types.String `tfsdk:"key"`
+ SecretKey types.String `tfsdk:"secret_key"`
+ SecretKeyVariable types.String `tfsdk:"secret_key_variable"`
+ KeyEnum types.String `tfsdk:"key_enum"`
+ KeyType types.String `tfsdk:"key_type"`
+ KeyTypeVariable types.String `tfsdk:"key_type_variable"`
+}
+
+type SystemAAATacacsGroupsServers struct {
+ Address types.String `tfsdk:"address"`
+ Port types.Int64 `tfsdk:"port"`
+ PortVariable types.String `tfsdk:"port_variable"`
+ Timeout types.Int64 `tfsdk:"timeout"`
+ TimeoutVariable types.String `tfsdk:"timeout_variable"`
+ Key types.String `tfsdk:"key"`
+ SecretKey types.String `tfsdk:"secret_key"`
+ SecretKeyVariable types.String `tfsdk:"secret_key_variable"`
+ KeyEnum types.String `tfsdk:"key_enum"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemAAA) getModel() string {
+ return "system_aaa"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemAAA) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/aaa", 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 SystemAAA) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.AuthenticationGroupVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "variable")
+ body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroupVariable.ValueString())
+ }
+ } else if data.AuthenticationGroup.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "default")
+ body, _ = sjson.Set(body, path+"authenticationGroup.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "global")
+ body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroup.ValueBool())
+ }
+ }
+
+ if !data.AccountingGroupVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"accountingGroup.optionType", "variable")
+ body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroupVariable.ValueString())
+ }
+ } else if data.AccountingGroup.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"accountingGroup.optionType", "default")
+ body, _ = sjson.Set(body, path+"accountingGroup.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"accountingGroup.optionType", "global")
+ body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroup.ValueBool())
+ }
+ }
+ if !data.ServerAuthOrder.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"serverAuthOrder.optionType", "global")
+ var values []string
+ data.ServerAuthOrder.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"serverAuthOrder.value", values)
+ }
+ }
+ if true {
+
+ for _, item := range data.Users {
+ itemBody := ""
+
+ if !item.NameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.NameVariable.ValueString())
+ }
+ } else if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
+ }
+ }
+
+ if !item.PasswordVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
+ }
+ } else if !item.Password.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
+ }
+ }
+
+ if !item.PrivilegeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "privilege.value", item.PrivilegeVariable.ValueString())
+ }
+ } else if item.Privilege.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "privilege.value", "15")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "privilege.value", item.Privilege.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "pubkeyChain", []interface{}{})
+ for _, childItem := range item.PublicKeys {
+ itemChildBody := ""
+ if !childItem.KeyString.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyString.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyString.value", childItem.KeyString.ValueString())
+ }
+ }
+
+ if !childItem.KeyTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString())
+ }
+ } else if childItem.KeyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "pubkeyChain.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"user.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"radius", []interface{}{})
+ for _, item := range data.RadiusGroups {
+ itemBody := ""
+ if !item.GroupName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString())
+ }
+ }
+ if item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+
+ if !item.SourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
+ }
+ } else if item.SourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "server", []interface{}{})
+ for _, childItem := range item.Servers {
+ itemChildBody := ""
+ if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AuthPortVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPortVariable.ValueString())
+ }
+ } else if childItem.AuthPort.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", 1812)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPort.ValueInt64())
+ }
+ }
+
+ if !childItem.AcctPortVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPortVariable.ValueString())
+ }
+ } else if childItem.AcctPort.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", 1813)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPort.ValueInt64())
+ }
+ }
+
+ if !childItem.TimeoutVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString())
+ }
+ } else if childItem.Timeout.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64())
+ }
+ }
+
+ if !childItem.RetransmitVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.RetransmitVariable.ValueString())
+ }
+ } else if childItem.Retransmit.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", 3)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.Retransmit.ValueInt64())
+ }
+ }
+ if !childItem.Key.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString())
+ }
+ }
+
+ if !childItem.SecretKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString())
+ }
+ } else if childItem.SecretKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString())
+ }
+ }
+ if childItem.KeyEnum.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString())
+ }
+ }
+
+ if !childItem.KeyTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString())
+ }
+ } else if childItem.KeyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", "key")
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"radius.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"tacacs", []interface{}{})
+ for _, item := range data.TacacsGroups {
+ itemBody := ""
+ if !item.GroupName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString())
+ }
+ }
+ if item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+
+ if !item.SourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
+ }
+ } else if item.SourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "server", []interface{}{})
+ for _, childItem := range item.Servers {
+ itemChildBody := ""
+ if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.PortVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.PortVariable.ValueString())
+ }
+ } else if childItem.Port.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "port.value", 49)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.Port.ValueInt64())
+ }
+ }
+
+ if !childItem.TimeoutVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString())
+ }
+ } else if childItem.Timeout.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64())
+ }
+ }
+ if !childItem.Key.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString())
+ }
+ }
+
+ if !childItem.SecretKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString())
+ }
+ } else if !childItem.SecretKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString())
+ }
+ }
+ if childItem.KeyEnum.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"tacacs.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"accountingRule", []interface{}{})
+ for _, item := range data.AccountingRules {
+ itemBody := ""
+ if !item.RuleId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString())
+ }
+ }
+ if !item.Method.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "method.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString())
+ }
+ }
+ if item.Level.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "level.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "level.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString())
+ }
+ }
+
+ if !item.StartStopVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStopVariable.ValueString())
+ }
+ } else if item.StartStop.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "startStop.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStop.ValueBool())
+ }
+ }
+ if !item.Group.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group.optionType", "global")
+ var values []string
+ item.Group.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "group.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"accountingRule.-1", itemBody)
+ }
+ }
+
+ if !data.AuthorizationConsoleVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "variable")
+ body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsoleVariable.ValueString())
+ }
+ } else if data.AuthorizationConsole.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "default")
+ body, _ = sjson.Set(body, path+"authorizationConsole.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "global")
+ body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsole.ValueBool())
+ }
+ }
+
+ if !data.AuthorizationConfigCommandsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "variable")
+ body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommandsVariable.ValueString())
+ }
+ } else if data.AuthorizationConfigCommands.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "default")
+ body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "global")
+ body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommands.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"authorizationRule", []interface{}{})
+ for _, item := range data.AuthorizationRules {
+ itemBody := ""
+ if !item.RuleId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString())
+ }
+ }
+ if !item.Method.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "method.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString())
+ }
+ }
+ if !item.Level.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "level.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString())
+ }
+ }
+ if !item.Group.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group.optionType", "global")
+ var values []string
+ item.Group.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "group.value", values)
+ }
+ }
+ if item.IfAuthenticated.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", item.IfAuthenticated.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"authorizationRule.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemAAA) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AuthenticationGroup = types.BoolNull()
+ data.AuthenticationGroupVariable = types.StringNull()
+ if t := res.Get(path + "authenticationGroup.optionType"); t.Exists() {
+ va := res.Get(path + "authenticationGroup.value")
+ if t.String() == "variable" {
+ data.AuthenticationGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthenticationGroup = types.BoolValue(va.Bool())
+ }
+ }
+ data.AccountingGroup = types.BoolNull()
+ data.AccountingGroupVariable = types.StringNull()
+ if t := res.Get(path + "accountingGroup.optionType"); t.Exists() {
+ va := res.Get(path + "accountingGroup.value")
+ if t.String() == "variable" {
+ data.AccountingGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AccountingGroup = types.BoolValue(va.Bool())
+ }
+ }
+ data.ServerAuthOrder = types.SetNull(types.StringType)
+
+ if t := res.Get(path + "serverAuthOrder.optionType"); t.Exists() {
+ va := res.Get(path + "serverAuthOrder.value")
+ if t.String() == "global" {
+ data.ServerAuthOrder = helpers.GetStringSet(va.Array())
+ }
+ }
+ if value := res.Get(path + "user"); value.Exists() {
+ data.Users = make([]SystemAAAUsers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemAAAUsers{}
+ item.Name = types.StringNull()
+ item.NameVariable = types.StringNull()
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "variable" {
+ item.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.Privilege = types.StringNull()
+ item.PrivilegeVariable = types.StringNull()
+ if t := v.Get("privilege.optionType"); t.Exists() {
+ va := v.Get("privilege.value")
+ if t.String() == "variable" {
+ item.PrivilegeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Privilege = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("pubkeyChain"); cValue.Exists() {
+ item.PublicKeys = make([]SystemAAAUsersPublicKeys, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := SystemAAAUsersPublicKeys{}
+ cItem.KeyString = types.StringNull()
+
+ if t := cv.Get("keyString.optionType"); t.Exists() {
+ va := cv.Get("keyString.value")
+ if t.String() == "global" {
+ cItem.KeyString = types.StringValue(va.String())
+ }
+ }
+ cItem.KeyType = types.StringNull()
+ cItem.KeyTypeVariable = types.StringNull()
+ if t := cv.Get("keyType.optionType"); t.Exists() {
+ va := cv.Get("keyType.value")
+ if t.String() == "variable" {
+ cItem.KeyTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.KeyType = types.StringValue(va.String())
+ }
+ }
+ item.PublicKeys = append(item.PublicKeys, cItem)
+ return true
+ })
+ }
+ data.Users = append(data.Users, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "radius"); value.Exists() {
+ data.RadiusGroups = make([]SystemAAARadiusGroups, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemAAARadiusGroups{}
+ item.GroupName = types.StringNull()
+
+ if t := v.Get("groupName.optionType"); t.Exists() {
+ va := v.Get("groupName.value")
+ if t.String() == "global" {
+ item.GroupName = types.StringValue(va.String())
+ }
+ }
+ item.Vpn = types.Int64Null()
+
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ item.SourceInterface = types.StringNull()
+ item.SourceInterfaceVariable = types.StringNull()
+ if t := v.Get("sourceInterface.optionType"); t.Exists() {
+ va := v.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ item.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceInterface = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("server"); cValue.Exists() {
+ item.Servers = make([]SystemAAARadiusGroupsServers, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := SystemAAARadiusGroupsServers{}
+ cItem.Address = types.StringNull()
+
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AuthPort = types.Int64Null()
+ cItem.AuthPortVariable = types.StringNull()
+ if t := cv.Get("authPort.optionType"); t.Exists() {
+ va := cv.Get("authPort.value")
+ if t.String() == "variable" {
+ cItem.AuthPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthPort = types.Int64Value(va.Int())
+ }
+ }
+ cItem.AcctPort = types.Int64Null()
+ cItem.AcctPortVariable = types.StringNull()
+ if t := cv.Get("acctPort.optionType"); t.Exists() {
+ va := cv.Get("acctPort.value")
+ if t.String() == "variable" {
+ cItem.AcctPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AcctPort = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Timeout = types.Int64Null()
+ cItem.TimeoutVariable = types.StringNull()
+ if t := cv.Get("timeout.optionType"); t.Exists() {
+ va := cv.Get("timeout.value")
+ if t.String() == "variable" {
+ cItem.TimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Timeout = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Retransmit = types.Int64Null()
+ cItem.RetransmitVariable = types.StringNull()
+ if t := cv.Get("retransmit.optionType"); t.Exists() {
+ va := cv.Get("retransmit.value")
+ if t.String() == "variable" {
+ cItem.RetransmitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Retransmit = types.Int64Value(va.Int())
+ }
+ }
+ cItem.SecretKey = types.StringNull()
+ cItem.SecretKeyVariable = types.StringNull()
+ if t := cv.Get("secretKey.optionType"); t.Exists() {
+ va := cv.Get("secretKey.value")
+ if t.String() == "variable" {
+ cItem.SecretKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SecretKey = types.StringValue(va.String())
+ }
+ }
+ cItem.KeyEnum = types.StringNull()
+
+ if t := cv.Get("keyEnum.optionType"); t.Exists() {
+ va := cv.Get("keyEnum.value")
+ if t.String() == "global" {
+ cItem.KeyEnum = types.StringValue(va.String())
+ }
+ }
+ cItem.KeyType = types.StringNull()
+ cItem.KeyTypeVariable = types.StringNull()
+ if t := cv.Get("keyType.optionType"); t.Exists() {
+ va := cv.Get("keyType.value")
+ if t.String() == "variable" {
+ cItem.KeyTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.KeyType = types.StringValue(va.String())
+ }
+ }
+ item.Servers = append(item.Servers, cItem)
+ return true
+ })
+ }
+ data.RadiusGroups = append(data.RadiusGroups, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "tacacs"); value.Exists() {
+ data.TacacsGroups = make([]SystemAAATacacsGroups, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemAAATacacsGroups{}
+ item.GroupName = types.StringNull()
+
+ if t := v.Get("groupName.optionType"); t.Exists() {
+ va := v.Get("groupName.value")
+ if t.String() == "global" {
+ item.GroupName = types.StringValue(va.String())
+ }
+ }
+ item.Vpn = types.Int64Null()
+
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ item.SourceInterface = types.StringNull()
+ item.SourceInterfaceVariable = types.StringNull()
+ if t := v.Get("sourceInterface.optionType"); t.Exists() {
+ va := v.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ item.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceInterface = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("server"); cValue.Exists() {
+ item.Servers = make([]SystemAAATacacsGroupsServers, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := SystemAAATacacsGroupsServers{}
+ cItem.Address = types.StringNull()
+
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.Port = types.Int64Null()
+ cItem.PortVariable = types.StringNull()
+ if t := cv.Get("port.optionType"); t.Exists() {
+ va := cv.Get("port.value")
+ if t.String() == "variable" {
+ cItem.PortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Port = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Timeout = types.Int64Null()
+ cItem.TimeoutVariable = types.StringNull()
+ if t := cv.Get("timeout.optionType"); t.Exists() {
+ va := cv.Get("timeout.value")
+ if t.String() == "variable" {
+ cItem.TimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Timeout = types.Int64Value(va.Int())
+ }
+ }
+ cItem.SecretKey = types.StringNull()
+ cItem.SecretKeyVariable = types.StringNull()
+ if t := cv.Get("secretKey.optionType"); t.Exists() {
+ va := cv.Get("secretKey.value")
+ if t.String() == "variable" {
+ cItem.SecretKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SecretKey = types.StringValue(va.String())
+ }
+ }
+ cItem.KeyEnum = types.StringNull()
+
+ if t := cv.Get("keyEnum.optionType"); t.Exists() {
+ va := cv.Get("keyEnum.value")
+ if t.String() == "global" {
+ cItem.KeyEnum = types.StringValue(va.String())
+ }
+ }
+ item.Servers = append(item.Servers, cItem)
+ return true
+ })
+ }
+ data.TacacsGroups = append(data.TacacsGroups, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "accountingRule"); value.Exists() {
+ data.AccountingRules = make([]SystemAAAAccountingRules, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemAAAAccountingRules{}
+ item.RuleId = types.StringNull()
+
+ if t := v.Get("ruleId.optionType"); t.Exists() {
+ va := v.Get("ruleId.value")
+ if t.String() == "global" {
+ item.RuleId = types.StringValue(va.String())
+ }
+ }
+ item.Method = types.StringNull()
+
+ if t := v.Get("method.optionType"); t.Exists() {
+ va := v.Get("method.value")
+ if t.String() == "global" {
+ item.Method = types.StringValue(va.String())
+ }
+ }
+ item.Level = types.StringNull()
+
+ if t := v.Get("level.optionType"); t.Exists() {
+ va := v.Get("level.value")
+ if t.String() == "global" {
+ item.Level = types.StringValue(va.String())
+ }
+ }
+ item.StartStop = types.BoolNull()
+ item.StartStopVariable = types.StringNull()
+ if t := v.Get("startStop.optionType"); t.Exists() {
+ va := v.Get("startStop.value")
+ if t.String() == "variable" {
+ item.StartStopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.StartStop = types.BoolValue(va.Bool())
+ }
+ }
+ item.Group = types.SetNull(types.StringType)
+
+ if t := v.Get("group.optionType"); t.Exists() {
+ va := v.Get("group.value")
+ if t.String() == "global" {
+ item.Group = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.AccountingRules = append(data.AccountingRules, item)
+ return true
+ })
+ }
+ data.AuthorizationConsole = types.BoolNull()
+ data.AuthorizationConsoleVariable = types.StringNull()
+ if t := res.Get(path + "authorizationConsole.optionType"); t.Exists() {
+ va := res.Get(path + "authorizationConsole.value")
+ if t.String() == "variable" {
+ data.AuthorizationConsoleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthorizationConsole = types.BoolValue(va.Bool())
+ }
+ }
+ data.AuthorizationConfigCommands = types.BoolNull()
+ data.AuthorizationConfigCommandsVariable = types.StringNull()
+ if t := res.Get(path + "authorizationConfigCommands.optionType"); t.Exists() {
+ va := res.Get(path + "authorizationConfigCommands.value")
+ if t.String() == "variable" {
+ data.AuthorizationConfigCommandsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthorizationConfigCommands = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "authorizationRule"); value.Exists() {
+ data.AuthorizationRules = make([]SystemAAAAuthorizationRules, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemAAAAuthorizationRules{}
+ item.RuleId = types.StringNull()
+
+ if t := v.Get("ruleId.optionType"); t.Exists() {
+ va := v.Get("ruleId.value")
+ if t.String() == "global" {
+ item.RuleId = types.StringValue(va.String())
+ }
+ }
+ item.Method = types.StringNull()
+
+ if t := v.Get("method.optionType"); t.Exists() {
+ va := v.Get("method.value")
+ if t.String() == "global" {
+ item.Method = types.StringValue(va.String())
+ }
+ }
+ item.Level = types.StringNull()
+
+ if t := v.Get("level.optionType"); t.Exists() {
+ va := v.Get("level.value")
+ if t.String() == "global" {
+ item.Level = types.StringValue(va.String())
+ }
+ }
+ item.Group = types.SetNull(types.StringType)
+
+ if t := v.Get("group.optionType"); t.Exists() {
+ va := v.Get("group.value")
+ if t.String() == "global" {
+ item.Group = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.IfAuthenticated = types.BoolNull()
+
+ if t := v.Get("ifAuthenticated.optionType"); t.Exists() {
+ va := v.Get("ifAuthenticated.value")
+ if t.String() == "global" {
+ item.IfAuthenticated = types.BoolValue(va.Bool())
+ }
+ }
+ data.AuthorizationRules = append(data.AuthorizationRules, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemAAA) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AuthenticationGroup = types.BoolNull()
+ data.AuthenticationGroupVariable = types.StringNull()
+ if t := res.Get(path + "authenticationGroup.optionType"); t.Exists() {
+ va := res.Get(path + "authenticationGroup.value")
+ if t.String() == "variable" {
+ data.AuthenticationGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthenticationGroup = types.BoolValue(va.Bool())
+ }
+ }
+ data.AccountingGroup = types.BoolNull()
+ data.AccountingGroupVariable = types.StringNull()
+ if t := res.Get(path + "accountingGroup.optionType"); t.Exists() {
+ va := res.Get(path + "accountingGroup.value")
+ if t.String() == "variable" {
+ data.AccountingGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AccountingGroup = types.BoolValue(va.Bool())
+ }
+ }
+ data.ServerAuthOrder = types.SetNull(types.StringType)
+
+ if t := res.Get(path + "serverAuthOrder.optionType"); t.Exists() {
+ va := res.Get(path + "serverAuthOrder.value")
+ if t.String() == "global" {
+ data.ServerAuthOrder = helpers.GetStringSet(va.Array())
+ }
+ }
+ for i := range data.Users {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Users[i].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Users[i].NameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "user").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Users[i].Name = types.StringNull()
+ data.Users[i].NameVariable = types.StringNull()
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "variable" {
+ data.Users[i].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Users[i].Privilege = types.StringNull()
+ data.Users[i].PrivilegeVariable = types.StringNull()
+ if t := r.Get("privilege.optionType"); t.Exists() {
+ va := r.Get("privilege.value")
+ if t.String() == "variable" {
+ data.Users[i].PrivilegeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].Privilege = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Users[i].PublicKeys {
+ keys := [...]string{"keyString"}
+ keyValues := [...]string{data.Users[i].PublicKeys[ci].KeyString.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("pubkeyChain").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Users[i].PublicKeys[ci].KeyString = types.StringNull()
+
+ if t := cr.Get("keyString.optionType"); t.Exists() {
+ va := cr.Get("keyString.value")
+ if t.String() == "global" {
+ data.Users[i].PublicKeys[ci].KeyString = types.StringValue(va.String())
+ }
+ }
+ data.Users[i].PublicKeys[ci].KeyType = types.StringNull()
+ data.Users[i].PublicKeys[ci].KeyTypeVariable = types.StringNull()
+ if t := cr.Get("keyType.optionType"); t.Exists() {
+ va := cr.Get("keyType.value")
+ if t.String() == "variable" {
+ data.Users[i].PublicKeys[ci].KeyTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].PublicKeys[ci].KeyType = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.RadiusGroups {
+ keys := [...]string{"groupName"}
+ keyValues := [...]string{data.RadiusGroups[i].GroupName.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "radius").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RadiusGroups[i].GroupName = types.StringNull()
+
+ if t := r.Get("groupName.optionType"); t.Exists() {
+ va := r.Get("groupName.value")
+ if t.String() == "global" {
+ data.RadiusGroups[i].GroupName = types.StringValue(va.String())
+ }
+ }
+ data.RadiusGroups[i].Vpn = types.Int64Null()
+
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "global" {
+ data.RadiusGroups[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.RadiusGroups[i].SourceInterface = types.StringNull()
+ data.RadiusGroups[i].SourceInterfaceVariable = types.StringNull()
+ if t := r.Get("sourceInterface.optionType"); t.Exists() {
+ va := r.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ data.RadiusGroups[i].SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RadiusGroups[i].SourceInterface = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.RadiusGroups[i].Servers {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.RadiusGroups[i].Servers[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("server").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RadiusGroups[i].Servers[ci].Address = types.StringNull()
+
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.RadiusGroups[i].Servers[ci].AuthPort = types.Int64Null()
+ data.RadiusGroups[i].Servers[ci].AuthPortVariable = types.StringNull()
+ if t := cr.Get("authPort.optionType"); t.Exists() {
+ va := cr.Get("authPort.value")
+ if t.String() == "variable" {
+ data.RadiusGroups[i].Servers[ci].AuthPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].AuthPort = types.Int64Value(va.Int())
+ }
+ }
+ data.RadiusGroups[i].Servers[ci].AcctPort = types.Int64Null()
+ data.RadiusGroups[i].Servers[ci].AcctPortVariable = types.StringNull()
+ if t := cr.Get("acctPort.optionType"); t.Exists() {
+ va := cr.Get("acctPort.value")
+ if t.String() == "variable" {
+ data.RadiusGroups[i].Servers[ci].AcctPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].AcctPort = types.Int64Value(va.Int())
+ }
+ }
+ data.RadiusGroups[i].Servers[ci].Timeout = types.Int64Null()
+ data.RadiusGroups[i].Servers[ci].TimeoutVariable = types.StringNull()
+ if t := cr.Get("timeout.optionType"); t.Exists() {
+ va := cr.Get("timeout.value")
+ if t.String() == "variable" {
+ data.RadiusGroups[i].Servers[ci].TimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].Timeout = types.Int64Value(va.Int())
+ }
+ }
+ data.RadiusGroups[i].Servers[ci].Retransmit = types.Int64Null()
+ data.RadiusGroups[i].Servers[ci].RetransmitVariable = types.StringNull()
+ if t := cr.Get("retransmit.optionType"); t.Exists() {
+ va := cr.Get("retransmit.value")
+ if t.String() == "variable" {
+ data.RadiusGroups[i].Servers[ci].RetransmitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].Retransmit = types.Int64Value(va.Int())
+ }
+ }
+ data.RadiusGroups[i].Servers[ci].SecretKey = types.StringNull()
+ data.RadiusGroups[i].Servers[ci].SecretKeyVariable = types.StringNull()
+ if t := cr.Get("secretKey.optionType"); t.Exists() {
+ va := cr.Get("secretKey.value")
+ if t.String() == "variable" {
+ data.RadiusGroups[i].Servers[ci].SecretKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].SecretKey = types.StringValue(va.String())
+ }
+ }
+ data.RadiusGroups[i].Servers[ci].KeyEnum = types.StringNull()
+
+ if t := cr.Get("keyEnum.optionType"); t.Exists() {
+ va := cr.Get("keyEnum.value")
+ if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].KeyEnum = types.StringValue(va.String())
+ }
+ }
+ data.RadiusGroups[i].Servers[ci].KeyType = types.StringNull()
+ data.RadiusGroups[i].Servers[ci].KeyTypeVariable = types.StringNull()
+ if t := cr.Get("keyType.optionType"); t.Exists() {
+ va := cr.Get("keyType.value")
+ if t.String() == "variable" {
+ data.RadiusGroups[i].Servers[ci].KeyTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RadiusGroups[i].Servers[ci].KeyType = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.TacacsGroups {
+ keys := [...]string{"groupName"}
+ keyValues := [...]string{data.TacacsGroups[i].GroupName.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "tacacs").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TacacsGroups[i].GroupName = types.StringNull()
+
+ if t := r.Get("groupName.optionType"); t.Exists() {
+ va := r.Get("groupName.value")
+ if t.String() == "global" {
+ data.TacacsGroups[i].GroupName = types.StringValue(va.String())
+ }
+ }
+ data.TacacsGroups[i].Vpn = types.Int64Null()
+
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "global" {
+ data.TacacsGroups[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.TacacsGroups[i].SourceInterface = types.StringNull()
+ data.TacacsGroups[i].SourceInterfaceVariable = types.StringNull()
+ if t := r.Get("sourceInterface.optionType"); t.Exists() {
+ va := r.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ data.TacacsGroups[i].SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TacacsGroups[i].SourceInterface = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.TacacsGroups[i].Servers {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.TacacsGroups[i].Servers[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("server").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TacacsGroups[i].Servers[ci].Address = types.StringNull()
+
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "global" {
+ data.TacacsGroups[i].Servers[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.TacacsGroups[i].Servers[ci].Port = types.Int64Null()
+ data.TacacsGroups[i].Servers[ci].PortVariable = types.StringNull()
+ if t := cr.Get("port.optionType"); t.Exists() {
+ va := cr.Get("port.value")
+ if t.String() == "variable" {
+ data.TacacsGroups[i].Servers[ci].PortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TacacsGroups[i].Servers[ci].Port = types.Int64Value(va.Int())
+ }
+ }
+ data.TacacsGroups[i].Servers[ci].Timeout = types.Int64Null()
+ data.TacacsGroups[i].Servers[ci].TimeoutVariable = types.StringNull()
+ if t := cr.Get("timeout.optionType"); t.Exists() {
+ va := cr.Get("timeout.value")
+ if t.String() == "variable" {
+ data.TacacsGroups[i].Servers[ci].TimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TacacsGroups[i].Servers[ci].Timeout = types.Int64Value(va.Int())
+ }
+ }
+ data.TacacsGroups[i].Servers[ci].SecretKey = types.StringNull()
+ data.TacacsGroups[i].Servers[ci].SecretKeyVariable = types.StringNull()
+ if t := cr.Get("secretKey.optionType"); t.Exists() {
+ va := cr.Get("secretKey.value")
+ if t.String() == "variable" {
+ data.TacacsGroups[i].Servers[ci].SecretKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TacacsGroups[i].Servers[ci].SecretKey = types.StringValue(va.String())
+ }
+ }
+ data.TacacsGroups[i].Servers[ci].KeyEnum = types.StringNull()
+
+ if t := cr.Get("keyEnum.optionType"); t.Exists() {
+ va := cr.Get("keyEnum.value")
+ if t.String() == "global" {
+ data.TacacsGroups[i].Servers[ci].KeyEnum = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.AccountingRules {
+ keys := [...]string{"ruleId"}
+ keyValues := [...]string{data.AccountingRules[i].RuleId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "accountingRule").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AccountingRules[i].RuleId = types.StringNull()
+
+ if t := r.Get("ruleId.optionType"); t.Exists() {
+ va := r.Get("ruleId.value")
+ if t.String() == "global" {
+ data.AccountingRules[i].RuleId = types.StringValue(va.String())
+ }
+ }
+ data.AccountingRules[i].Method = types.StringNull()
+
+ if t := r.Get("method.optionType"); t.Exists() {
+ va := r.Get("method.value")
+ if t.String() == "global" {
+ data.AccountingRules[i].Method = types.StringValue(va.String())
+ }
+ }
+ data.AccountingRules[i].Level = types.StringNull()
+
+ if t := r.Get("level.optionType"); t.Exists() {
+ va := r.Get("level.value")
+ if t.String() == "global" {
+ data.AccountingRules[i].Level = types.StringValue(va.String())
+ }
+ }
+ data.AccountingRules[i].StartStop = types.BoolNull()
+ data.AccountingRules[i].StartStopVariable = types.StringNull()
+ if t := r.Get("startStop.optionType"); t.Exists() {
+ va := r.Get("startStop.value")
+ if t.String() == "variable" {
+ data.AccountingRules[i].StartStopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AccountingRules[i].StartStop = types.BoolValue(va.Bool())
+ }
+ }
+ data.AccountingRules[i].Group = types.SetNull(types.StringType)
+
+ if t := r.Get("group.optionType"); t.Exists() {
+ va := r.Get("group.value")
+ if t.String() == "global" {
+ data.AccountingRules[i].Group = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+ data.AuthorizationConsole = types.BoolNull()
+ data.AuthorizationConsoleVariable = types.StringNull()
+ if t := res.Get(path + "authorizationConsole.optionType"); t.Exists() {
+ va := res.Get(path + "authorizationConsole.value")
+ if t.String() == "variable" {
+ data.AuthorizationConsoleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthorizationConsole = types.BoolValue(va.Bool())
+ }
+ }
+ data.AuthorizationConfigCommands = types.BoolNull()
+ data.AuthorizationConfigCommandsVariable = types.StringNull()
+ if t := res.Get(path + "authorizationConfigCommands.optionType"); t.Exists() {
+ va := res.Get(path + "authorizationConfigCommands.value")
+ if t.String() == "variable" {
+ data.AuthorizationConfigCommandsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthorizationConfigCommands = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.AuthorizationRules {
+ keys := [...]string{"ruleId"}
+ keyValues := [...]string{data.AuthorizationRules[i].RuleId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "authorizationRule").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AuthorizationRules[i].RuleId = types.StringNull()
+
+ if t := r.Get("ruleId.optionType"); t.Exists() {
+ va := r.Get("ruleId.value")
+ if t.String() == "global" {
+ data.AuthorizationRules[i].RuleId = types.StringValue(va.String())
+ }
+ }
+ data.AuthorizationRules[i].Method = types.StringNull()
+
+ if t := r.Get("method.optionType"); t.Exists() {
+ va := r.Get("method.value")
+ if t.String() == "global" {
+ data.AuthorizationRules[i].Method = types.StringValue(va.String())
+ }
+ }
+ data.AuthorizationRules[i].Level = types.StringNull()
+
+ if t := r.Get("level.optionType"); t.Exists() {
+ va := r.Get("level.value")
+ if t.String() == "global" {
+ data.AuthorizationRules[i].Level = types.StringValue(va.String())
+ }
+ }
+ data.AuthorizationRules[i].Group = types.SetNull(types.StringType)
+
+ if t := r.Get("group.optionType"); t.Exists() {
+ va := r.Get("group.value")
+ if t.String() == "global" {
+ data.AuthorizationRules[i].Group = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.AuthorizationRules[i].IfAuthenticated = types.BoolNull()
+
+ if t := r.Get("ifAuthenticated.optionType"); t.Exists() {
+ va := r.Get("ifAuthenticated.value")
+ if t.String() == "global" {
+ data.AuthorizationRules[i].IfAuthenticated = types.BoolValue(va.Bool())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemAAA) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.AuthenticationGroup.IsNull() {
+ return false
+ }
+ if !data.AuthenticationGroupVariable.IsNull() {
+ return false
+ }
+ if !data.AccountingGroup.IsNull() {
+ return false
+ }
+ if !data.AccountingGroupVariable.IsNull() {
+ return false
+ }
+ if !data.ServerAuthOrder.IsNull() {
+ return false
+ }
+ if len(data.Users) > 0 {
+ return false
+ }
+ if len(data.RadiusGroups) > 0 {
+ return false
+ }
+ if len(data.TacacsGroups) > 0 {
+ return false
+ }
+ if len(data.AccountingRules) > 0 {
+ return false
+ }
+ if !data.AuthorizationConsole.IsNull() {
+ return false
+ }
+ if !data.AuthorizationConsoleVariable.IsNull() {
+ return false
+ }
+ if !data.AuthorizationConfigCommands.IsNull() {
+ return false
+ }
+ if !data.AuthorizationConfigCommandsVariable.IsNull() {
+ return false
+ }
+ if len(data.AuthorizationRules) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_aaa_profile_parcel.go b/internal/provider/model_sdwan_system_aaa_profile_parcel.go
deleted file mode 100644
index 86d267026..000000000
--- a/internal/provider/model_sdwan_system_aaa_profile_parcel.go
+++ /dev/null
@@ -1,1746 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemAAA 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"`
- AuthenticationGroup types.Bool `tfsdk:"authentication_group"`
- AuthenticationGroupVariable types.String `tfsdk:"authentication_group_variable"`
- AccountingGroup types.Bool `tfsdk:"accounting_group"`
- AccountingGroupVariable types.String `tfsdk:"accounting_group_variable"`
- ServerAuthOrder types.Set `tfsdk:"server_auth_order"`
- Users []SystemAAAUsers `tfsdk:"users"`
- RadiusGroups []SystemAAARadiusGroups `tfsdk:"radius_groups"`
- TacacsGroups []SystemAAATacacsGroups `tfsdk:"tacacs_groups"`
- AccountingRules []SystemAAAAccountingRules `tfsdk:"accounting_rules"`
- AuthorizationConsole types.Bool `tfsdk:"authorization_console"`
- AuthorizationConsoleVariable types.String `tfsdk:"authorization_console_variable"`
- AuthorizationConfigCommands types.Bool `tfsdk:"authorization_config_commands"`
- AuthorizationConfigCommandsVariable types.String `tfsdk:"authorization_config_commands_variable"`
- AuthorizationRules []SystemAAAAuthorizationRules `tfsdk:"authorization_rules"`
-}
-
-type SystemAAAUsers struct {
- Name types.String `tfsdk:"name"`
- NameVariable types.String `tfsdk:"name_variable"`
- Password types.String `tfsdk:"password"`
- PasswordVariable types.String `tfsdk:"password_variable"`
- Privilege types.String `tfsdk:"privilege"`
- PrivilegeVariable types.String `tfsdk:"privilege_variable"`
- PublicKeys []SystemAAAUsersPublicKeys `tfsdk:"public_keys"`
-}
-
-type SystemAAARadiusGroups struct {
- GroupName types.String `tfsdk:"group_name"`
- Vpn types.Int64 `tfsdk:"vpn"`
- SourceInterface types.String `tfsdk:"source_interface"`
- SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
- Servers []SystemAAARadiusGroupsServers `tfsdk:"servers"`
-}
-
-type SystemAAATacacsGroups struct {
- GroupName types.String `tfsdk:"group_name"`
- Vpn types.Int64 `tfsdk:"vpn"`
- SourceInterface types.String `tfsdk:"source_interface"`
- SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
- Servers []SystemAAATacacsGroupsServers `tfsdk:"servers"`
-}
-
-type SystemAAAAccountingRules struct {
- RuleId types.String `tfsdk:"rule_id"`
- Method types.String `tfsdk:"method"`
- Level types.String `tfsdk:"level"`
- StartStop types.Bool `tfsdk:"start_stop"`
- StartStopVariable types.String `tfsdk:"start_stop_variable"`
- Group types.Set `tfsdk:"group"`
-}
-
-type SystemAAAAuthorizationRules struct {
- RuleId types.String `tfsdk:"rule_id"`
- Method types.String `tfsdk:"method"`
- Level types.String `tfsdk:"level"`
- Group types.Set `tfsdk:"group"`
- IfAuthenticated types.Bool `tfsdk:"if_authenticated"`
-}
-
-type SystemAAAUsersPublicKeys struct {
- KeyString types.String `tfsdk:"key_string"`
- KeyType types.String `tfsdk:"key_type"`
- KeyTypeVariable types.String `tfsdk:"key_type_variable"`
-}
-
-type SystemAAARadiusGroupsServers struct {
- Address types.String `tfsdk:"address"`
- AuthPort types.Int64 `tfsdk:"auth_port"`
- AuthPortVariable types.String `tfsdk:"auth_port_variable"`
- AcctPort types.Int64 `tfsdk:"acct_port"`
- AcctPortVariable types.String `tfsdk:"acct_port_variable"`
- Timeout types.Int64 `tfsdk:"timeout"`
- TimeoutVariable types.String `tfsdk:"timeout_variable"`
- Retransmit types.Int64 `tfsdk:"retransmit"`
- RetransmitVariable types.String `tfsdk:"retransmit_variable"`
- Key types.String `tfsdk:"key"`
- SecretKey types.String `tfsdk:"secret_key"`
- SecretKeyVariable types.String `tfsdk:"secret_key_variable"`
- KeyEnum types.String `tfsdk:"key_enum"`
- KeyType types.String `tfsdk:"key_type"`
- KeyTypeVariable types.String `tfsdk:"key_type_variable"`
-}
-
-type SystemAAATacacsGroupsServers struct {
- Address types.String `tfsdk:"address"`
- Port types.Int64 `tfsdk:"port"`
- PortVariable types.String `tfsdk:"port_variable"`
- Timeout types.Int64 `tfsdk:"timeout"`
- TimeoutVariable types.String `tfsdk:"timeout_variable"`
- Key types.String `tfsdk:"key"`
- SecretKey types.String `tfsdk:"secret_key"`
- SecretKeyVariable types.String `tfsdk:"secret_key_variable"`
- KeyEnum types.String `tfsdk:"key_enum"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemAAA) getModel() string {
- return "system_aaa"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemAAA) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/aaa", 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 SystemAAA) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.AuthenticationGroupVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "variable")
- body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroupVariable.ValueString())
- }
- } else if data.AuthenticationGroup.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "default")
- body, _ = sjson.Set(body, path+"authenticationGroup.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "global")
- body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroup.ValueBool())
- }
- }
-
- if !data.AccountingGroupVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"accountingGroup.optionType", "variable")
- body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroupVariable.ValueString())
- }
- } else if data.AccountingGroup.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"accountingGroup.optionType", "default")
- body, _ = sjson.Set(body, path+"accountingGroup.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"accountingGroup.optionType", "global")
- body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroup.ValueBool())
- }
- }
- if !data.ServerAuthOrder.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"serverAuthOrder.optionType", "global")
- var values []string
- data.ServerAuthOrder.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"serverAuthOrder.value", values)
- }
- }
- if true {
-
- for _, item := range data.Users {
- itemBody := ""
-
- if !item.NameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.NameVariable.ValueString())
- }
- } else if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
- }
- }
-
- if !item.PasswordVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
- }
- } else if !item.Password.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
- }
- }
-
- if !item.PrivilegeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "privilege.value", item.PrivilegeVariable.ValueString())
- }
- } else if item.Privilege.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "privilege.value", "15")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "privilege.value", item.Privilege.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "pubkeyChain", []interface{}{})
- for _, childItem := range item.PublicKeys {
- itemChildBody := ""
- if !childItem.KeyString.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyString.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyString.value", childItem.KeyString.ValueString())
- }
- }
-
- if !childItem.KeyTypeVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString())
- }
- } else if childItem.KeyType.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default")
-
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "pubkeyChain.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"user.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"radius", []interface{}{})
- for _, item := range data.RadiusGroups {
- itemBody := ""
- if !item.GroupName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString())
- }
- }
- if item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
-
- if !item.SourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
- }
- } else if item.SourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "server", []interface{}{})
- for _, childItem := range item.Servers {
- itemChildBody := ""
- if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AuthPortVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPortVariable.ValueString())
- }
- } else if childItem.AuthPort.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", 1812)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPort.ValueInt64())
- }
- }
-
- if !childItem.AcctPortVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPortVariable.ValueString())
- }
- } else if childItem.AcctPort.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", 1813)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPort.ValueInt64())
- }
- }
-
- if !childItem.TimeoutVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString())
- }
- } else if childItem.Timeout.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64())
- }
- }
-
- if !childItem.RetransmitVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.RetransmitVariable.ValueString())
- }
- } else if childItem.Retransmit.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", 3)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.Retransmit.ValueInt64())
- }
- }
- if !childItem.Key.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString())
- }
- }
-
- if !childItem.SecretKeyVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString())
- }
- } else if childItem.SecretKey.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "default")
-
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString())
- }
- }
- if childItem.KeyEnum.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default")
-
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString())
- }
- }
-
- if !childItem.KeyTypeVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString())
- }
- } else if childItem.KeyType.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", "key")
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"radius.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"tacacs", []interface{}{})
- for _, item := range data.TacacsGroups {
- itemBody := ""
- if !item.GroupName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString())
- }
- }
- if item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
-
- if !item.SourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
- }
- } else if item.SourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "server", []interface{}{})
- for _, childItem := range item.Servers {
- itemChildBody := ""
- if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.PortVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.PortVariable.ValueString())
- }
- } else if childItem.Port.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "port.value", 49)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.Port.ValueInt64())
- }
- }
-
- if !childItem.TimeoutVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString())
- }
- } else if childItem.Timeout.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64())
- }
- }
- if !childItem.Key.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString())
- }
- }
-
- if !childItem.SecretKeyVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString())
- }
- } else if !childItem.SecretKey.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString())
- }
- }
- if childItem.KeyEnum.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default")
-
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"tacacs.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"accountingRule", []interface{}{})
- for _, item := range data.AccountingRules {
- itemBody := ""
- if !item.RuleId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString())
- }
- }
- if !item.Method.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "method.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString())
- }
- }
- if item.Level.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "level.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "level.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString())
- }
- }
-
- if !item.StartStopVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStopVariable.ValueString())
- }
- } else if item.StartStop.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "startStop.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStop.ValueBool())
- }
- }
- if !item.Group.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group.optionType", "global")
- var values []string
- item.Group.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "group.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"accountingRule.-1", itemBody)
- }
- }
-
- if !data.AuthorizationConsoleVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "variable")
- body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsoleVariable.ValueString())
- }
- } else if data.AuthorizationConsole.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "default")
- body, _ = sjson.Set(body, path+"authorizationConsole.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "global")
- body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsole.ValueBool())
- }
- }
-
- if !data.AuthorizationConfigCommandsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "variable")
- body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommandsVariable.ValueString())
- }
- } else if data.AuthorizationConfigCommands.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "default")
- body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "global")
- body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommands.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"authorizationRule", []interface{}{})
- for _, item := range data.AuthorizationRules {
- itemBody := ""
- if !item.RuleId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString())
- }
- }
- if !item.Method.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "method.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString())
- }
- }
- if !item.Level.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "level.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString())
- }
- }
- if !item.Group.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group.optionType", "global")
- var values []string
- item.Group.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "group.value", values)
- }
- }
- if item.IfAuthenticated.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", item.IfAuthenticated.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"authorizationRule.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemAAA) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.AuthenticationGroup = types.BoolNull()
- data.AuthenticationGroupVariable = types.StringNull()
- if t := res.Get(path + "authenticationGroup.optionType"); t.Exists() {
- va := res.Get(path + "authenticationGroup.value")
- if t.String() == "variable" {
- data.AuthenticationGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthenticationGroup = types.BoolValue(va.Bool())
- }
- }
- data.AccountingGroup = types.BoolNull()
- data.AccountingGroupVariable = types.StringNull()
- if t := res.Get(path + "accountingGroup.optionType"); t.Exists() {
- va := res.Get(path + "accountingGroup.value")
- if t.String() == "variable" {
- data.AccountingGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AccountingGroup = types.BoolValue(va.Bool())
- }
- }
- data.ServerAuthOrder = types.SetNull(types.StringType)
-
- if t := res.Get(path + "serverAuthOrder.optionType"); t.Exists() {
- va := res.Get(path + "serverAuthOrder.value")
- if t.String() == "global" {
- data.ServerAuthOrder = helpers.GetStringSet(va.Array())
- }
- }
- if value := res.Get(path + "user"); value.Exists() {
- data.Users = make([]SystemAAAUsers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemAAAUsers{}
- item.Name = types.StringNull()
- item.NameVariable = types.StringNull()
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "variable" {
- item.NameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- item.Privilege = types.StringNull()
- item.PrivilegeVariable = types.StringNull()
- if t := v.Get("privilege.optionType"); t.Exists() {
- va := v.Get("privilege.value")
- if t.String() == "variable" {
- item.PrivilegeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Privilege = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("pubkeyChain"); cValue.Exists() {
- item.PublicKeys = make([]SystemAAAUsersPublicKeys, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := SystemAAAUsersPublicKeys{}
- cItem.KeyString = types.StringNull()
-
- if t := cv.Get("keyString.optionType"); t.Exists() {
- va := cv.Get("keyString.value")
- if t.String() == "global" {
- cItem.KeyString = types.StringValue(va.String())
- }
- }
- cItem.KeyType = types.StringNull()
- cItem.KeyTypeVariable = types.StringNull()
- if t := cv.Get("keyType.optionType"); t.Exists() {
- va := cv.Get("keyType.value")
- if t.String() == "variable" {
- cItem.KeyTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.KeyType = types.StringValue(va.String())
- }
- }
- item.PublicKeys = append(item.PublicKeys, cItem)
- return true
- })
- }
- data.Users = append(data.Users, item)
- return true
- })
- }
- if value := res.Get(path + "radius"); value.Exists() {
- data.RadiusGroups = make([]SystemAAARadiusGroups, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemAAARadiusGroups{}
- item.GroupName = types.StringNull()
-
- if t := v.Get("groupName.optionType"); t.Exists() {
- va := v.Get("groupName.value")
- if t.String() == "global" {
- item.GroupName = types.StringValue(va.String())
- }
- }
- item.Vpn = types.Int64Null()
-
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- item.SourceInterface = types.StringNull()
- item.SourceInterfaceVariable = types.StringNull()
- if t := v.Get("sourceInterface.optionType"); t.Exists() {
- va := v.Get("sourceInterface.value")
- if t.String() == "variable" {
- item.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceInterface = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("server"); cValue.Exists() {
- item.Servers = make([]SystemAAARadiusGroupsServers, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := SystemAAARadiusGroupsServers{}
- cItem.Address = types.StringNull()
-
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AuthPort = types.Int64Null()
- cItem.AuthPortVariable = types.StringNull()
- if t := cv.Get("authPort.optionType"); t.Exists() {
- va := cv.Get("authPort.value")
- if t.String() == "variable" {
- cItem.AuthPortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AuthPort = types.Int64Value(va.Int())
- }
- }
- cItem.AcctPort = types.Int64Null()
- cItem.AcctPortVariable = types.StringNull()
- if t := cv.Get("acctPort.optionType"); t.Exists() {
- va := cv.Get("acctPort.value")
- if t.String() == "variable" {
- cItem.AcctPortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AcctPort = types.Int64Value(va.Int())
- }
- }
- cItem.Timeout = types.Int64Null()
- cItem.TimeoutVariable = types.StringNull()
- if t := cv.Get("timeout.optionType"); t.Exists() {
- va := cv.Get("timeout.value")
- if t.String() == "variable" {
- cItem.TimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Timeout = types.Int64Value(va.Int())
- }
- }
- cItem.Retransmit = types.Int64Null()
- cItem.RetransmitVariable = types.StringNull()
- if t := cv.Get("retransmit.optionType"); t.Exists() {
- va := cv.Get("retransmit.value")
- if t.String() == "variable" {
- cItem.RetransmitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Retransmit = types.Int64Value(va.Int())
- }
- }
- cItem.SecretKey = types.StringNull()
- cItem.SecretKeyVariable = types.StringNull()
- if t := cv.Get("secretKey.optionType"); t.Exists() {
- va := cv.Get("secretKey.value")
- if t.String() == "variable" {
- cItem.SecretKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.SecretKey = types.StringValue(va.String())
- }
- }
- cItem.KeyEnum = types.StringNull()
-
- if t := cv.Get("keyEnum.optionType"); t.Exists() {
- va := cv.Get("keyEnum.value")
- if t.String() == "global" {
- cItem.KeyEnum = types.StringValue(va.String())
- }
- }
- cItem.KeyType = types.StringNull()
- cItem.KeyTypeVariable = types.StringNull()
- if t := cv.Get("keyType.optionType"); t.Exists() {
- va := cv.Get("keyType.value")
- if t.String() == "variable" {
- cItem.KeyTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.KeyType = types.StringValue(va.String())
- }
- }
- item.Servers = append(item.Servers, cItem)
- return true
- })
- }
- data.RadiusGroups = append(data.RadiusGroups, item)
- return true
- })
- }
- if value := res.Get(path + "tacacs"); value.Exists() {
- data.TacacsGroups = make([]SystemAAATacacsGroups, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemAAATacacsGroups{}
- item.GroupName = types.StringNull()
-
- if t := v.Get("groupName.optionType"); t.Exists() {
- va := v.Get("groupName.value")
- if t.String() == "global" {
- item.GroupName = types.StringValue(va.String())
- }
- }
- item.Vpn = types.Int64Null()
-
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- item.SourceInterface = types.StringNull()
- item.SourceInterfaceVariable = types.StringNull()
- if t := v.Get("sourceInterface.optionType"); t.Exists() {
- va := v.Get("sourceInterface.value")
- if t.String() == "variable" {
- item.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceInterface = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("server"); cValue.Exists() {
- item.Servers = make([]SystemAAATacacsGroupsServers, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := SystemAAATacacsGroupsServers{}
- cItem.Address = types.StringNull()
-
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.Port = types.Int64Null()
- cItem.PortVariable = types.StringNull()
- if t := cv.Get("port.optionType"); t.Exists() {
- va := cv.Get("port.value")
- if t.String() == "variable" {
- cItem.PortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Port = types.Int64Value(va.Int())
- }
- }
- cItem.Timeout = types.Int64Null()
- cItem.TimeoutVariable = types.StringNull()
- if t := cv.Get("timeout.optionType"); t.Exists() {
- va := cv.Get("timeout.value")
- if t.String() == "variable" {
- cItem.TimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Timeout = types.Int64Value(va.Int())
- }
- }
- cItem.SecretKey = types.StringNull()
- cItem.SecretKeyVariable = types.StringNull()
- if t := cv.Get("secretKey.optionType"); t.Exists() {
- va := cv.Get("secretKey.value")
- if t.String() == "variable" {
- cItem.SecretKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.SecretKey = types.StringValue(va.String())
- }
- }
- cItem.KeyEnum = types.StringNull()
-
- if t := cv.Get("keyEnum.optionType"); t.Exists() {
- va := cv.Get("keyEnum.value")
- if t.String() == "global" {
- cItem.KeyEnum = types.StringValue(va.String())
- }
- }
- item.Servers = append(item.Servers, cItem)
- return true
- })
- }
- data.TacacsGroups = append(data.TacacsGroups, item)
- return true
- })
- }
- if value := res.Get(path + "accountingRule"); value.Exists() {
- data.AccountingRules = make([]SystemAAAAccountingRules, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemAAAAccountingRules{}
- item.RuleId = types.StringNull()
-
- if t := v.Get("ruleId.optionType"); t.Exists() {
- va := v.Get("ruleId.value")
- if t.String() == "global" {
- item.RuleId = types.StringValue(va.String())
- }
- }
- item.Method = types.StringNull()
-
- if t := v.Get("method.optionType"); t.Exists() {
- va := v.Get("method.value")
- if t.String() == "global" {
- item.Method = types.StringValue(va.String())
- }
- }
- item.Level = types.StringNull()
-
- if t := v.Get("level.optionType"); t.Exists() {
- va := v.Get("level.value")
- if t.String() == "global" {
- item.Level = types.StringValue(va.String())
- }
- }
- item.StartStop = types.BoolNull()
- item.StartStopVariable = types.StringNull()
- if t := v.Get("startStop.optionType"); t.Exists() {
- va := v.Get("startStop.value")
- if t.String() == "variable" {
- item.StartStopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.StartStop = types.BoolValue(va.Bool())
- }
- }
- item.Group = types.SetNull(types.StringType)
-
- if t := v.Get("group.optionType"); t.Exists() {
- va := v.Get("group.value")
- if t.String() == "global" {
- item.Group = helpers.GetStringSet(va.Array())
- }
- }
- data.AccountingRules = append(data.AccountingRules, item)
- return true
- })
- }
- data.AuthorizationConsole = types.BoolNull()
- data.AuthorizationConsoleVariable = types.StringNull()
- if t := res.Get(path + "authorizationConsole.optionType"); t.Exists() {
- va := res.Get(path + "authorizationConsole.value")
- if t.String() == "variable" {
- data.AuthorizationConsoleVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthorizationConsole = types.BoolValue(va.Bool())
- }
- }
- data.AuthorizationConfigCommands = types.BoolNull()
- data.AuthorizationConfigCommandsVariable = types.StringNull()
- if t := res.Get(path + "authorizationConfigCommands.optionType"); t.Exists() {
- va := res.Get(path + "authorizationConfigCommands.value")
- if t.String() == "variable" {
- data.AuthorizationConfigCommandsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthorizationConfigCommands = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "authorizationRule"); value.Exists() {
- data.AuthorizationRules = make([]SystemAAAAuthorizationRules, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemAAAAuthorizationRules{}
- item.RuleId = types.StringNull()
-
- if t := v.Get("ruleId.optionType"); t.Exists() {
- va := v.Get("ruleId.value")
- if t.String() == "global" {
- item.RuleId = types.StringValue(va.String())
- }
- }
- item.Method = types.StringNull()
-
- if t := v.Get("method.optionType"); t.Exists() {
- va := v.Get("method.value")
- if t.String() == "global" {
- item.Method = types.StringValue(va.String())
- }
- }
- item.Level = types.StringNull()
-
- if t := v.Get("level.optionType"); t.Exists() {
- va := v.Get("level.value")
- if t.String() == "global" {
- item.Level = types.StringValue(va.String())
- }
- }
- item.Group = types.SetNull(types.StringType)
-
- if t := v.Get("group.optionType"); t.Exists() {
- va := v.Get("group.value")
- if t.String() == "global" {
- item.Group = helpers.GetStringSet(va.Array())
- }
- }
- item.IfAuthenticated = types.BoolNull()
-
- if t := v.Get("ifAuthenticated.optionType"); t.Exists() {
- va := v.Get("ifAuthenticated.value")
- if t.String() == "global" {
- item.IfAuthenticated = types.BoolValue(va.Bool())
- }
- }
- data.AuthorizationRules = append(data.AuthorizationRules, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemAAA) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.AuthenticationGroup = types.BoolNull()
- data.AuthenticationGroupVariable = types.StringNull()
- if t := res.Get(path + "authenticationGroup.optionType"); t.Exists() {
- va := res.Get(path + "authenticationGroup.value")
- if t.String() == "variable" {
- data.AuthenticationGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthenticationGroup = types.BoolValue(va.Bool())
- }
- }
- data.AccountingGroup = types.BoolNull()
- data.AccountingGroupVariable = types.StringNull()
- if t := res.Get(path + "accountingGroup.optionType"); t.Exists() {
- va := res.Get(path + "accountingGroup.value")
- if t.String() == "variable" {
- data.AccountingGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AccountingGroup = types.BoolValue(va.Bool())
- }
- }
- data.ServerAuthOrder = types.SetNull(types.StringType)
-
- if t := res.Get(path + "serverAuthOrder.optionType"); t.Exists() {
- va := res.Get(path + "serverAuthOrder.value")
- if t.String() == "global" {
- data.ServerAuthOrder = helpers.GetStringSet(va.Array())
- }
- }
- for i := range data.Users {
- keys := [...]string{"name"}
- keyValues := [...]string{data.Users[i].Name.ValueString()}
- keyValuesVariables := [...]string{data.Users[i].NameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "user").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Users[i].Name = types.StringNull()
- data.Users[i].NameVariable = types.StringNull()
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "variable" {
- data.Users[i].NameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].Name = types.StringValue(va.String())
- }
- }
- data.Users[i].Privilege = types.StringNull()
- data.Users[i].PrivilegeVariable = types.StringNull()
- if t := r.Get("privilege.optionType"); t.Exists() {
- va := r.Get("privilege.value")
- if t.String() == "variable" {
- data.Users[i].PrivilegeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].Privilege = types.StringValue(va.String())
- }
- }
- for ci := range data.Users[i].PublicKeys {
- keys := [...]string{"keyString"}
- keyValues := [...]string{data.Users[i].PublicKeys[ci].KeyString.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("pubkeyChain").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Users[i].PublicKeys[ci].KeyString = types.StringNull()
-
- if t := cr.Get("keyString.optionType"); t.Exists() {
- va := cr.Get("keyString.value")
- if t.String() == "global" {
- data.Users[i].PublicKeys[ci].KeyString = types.StringValue(va.String())
- }
- }
- data.Users[i].PublicKeys[ci].KeyType = types.StringNull()
- data.Users[i].PublicKeys[ci].KeyTypeVariable = types.StringNull()
- if t := cr.Get("keyType.optionType"); t.Exists() {
- va := cr.Get("keyType.value")
- if t.String() == "variable" {
- data.Users[i].PublicKeys[ci].KeyTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].PublicKeys[ci].KeyType = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.RadiusGroups {
- keys := [...]string{"groupName"}
- keyValues := [...]string{data.RadiusGroups[i].GroupName.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "radius").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.RadiusGroups[i].GroupName = types.StringNull()
-
- if t := r.Get("groupName.optionType"); t.Exists() {
- va := r.Get("groupName.value")
- if t.String() == "global" {
- data.RadiusGroups[i].GroupName = types.StringValue(va.String())
- }
- }
- data.RadiusGroups[i].Vpn = types.Int64Null()
-
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "global" {
- data.RadiusGroups[i].Vpn = types.Int64Value(va.Int())
- }
- }
- data.RadiusGroups[i].SourceInterface = types.StringNull()
- data.RadiusGroups[i].SourceInterfaceVariable = types.StringNull()
- if t := r.Get("sourceInterface.optionType"); t.Exists() {
- va := r.Get("sourceInterface.value")
- if t.String() == "variable" {
- data.RadiusGroups[i].SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RadiusGroups[i].SourceInterface = types.StringValue(va.String())
- }
- }
- for ci := range data.RadiusGroups[i].Servers {
- keys := [...]string{"address"}
- keyValues := [...]string{data.RadiusGroups[i].Servers[ci].Address.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("server").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.RadiusGroups[i].Servers[ci].Address = types.StringNull()
-
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].Address = types.StringValue(va.String())
- }
- }
- data.RadiusGroups[i].Servers[ci].AuthPort = types.Int64Null()
- data.RadiusGroups[i].Servers[ci].AuthPortVariable = types.StringNull()
- if t := cr.Get("authPort.optionType"); t.Exists() {
- va := cr.Get("authPort.value")
- if t.String() == "variable" {
- data.RadiusGroups[i].Servers[ci].AuthPortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].AuthPort = types.Int64Value(va.Int())
- }
- }
- data.RadiusGroups[i].Servers[ci].AcctPort = types.Int64Null()
- data.RadiusGroups[i].Servers[ci].AcctPortVariable = types.StringNull()
- if t := cr.Get("acctPort.optionType"); t.Exists() {
- va := cr.Get("acctPort.value")
- if t.String() == "variable" {
- data.RadiusGroups[i].Servers[ci].AcctPortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].AcctPort = types.Int64Value(va.Int())
- }
- }
- data.RadiusGroups[i].Servers[ci].Timeout = types.Int64Null()
- data.RadiusGroups[i].Servers[ci].TimeoutVariable = types.StringNull()
- if t := cr.Get("timeout.optionType"); t.Exists() {
- va := cr.Get("timeout.value")
- if t.String() == "variable" {
- data.RadiusGroups[i].Servers[ci].TimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].Timeout = types.Int64Value(va.Int())
- }
- }
- data.RadiusGroups[i].Servers[ci].Retransmit = types.Int64Null()
- data.RadiusGroups[i].Servers[ci].RetransmitVariable = types.StringNull()
- if t := cr.Get("retransmit.optionType"); t.Exists() {
- va := cr.Get("retransmit.value")
- if t.String() == "variable" {
- data.RadiusGroups[i].Servers[ci].RetransmitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].Retransmit = types.Int64Value(va.Int())
- }
- }
- data.RadiusGroups[i].Servers[ci].SecretKey = types.StringNull()
- data.RadiusGroups[i].Servers[ci].SecretKeyVariable = types.StringNull()
- if t := cr.Get("secretKey.optionType"); t.Exists() {
- va := cr.Get("secretKey.value")
- if t.String() == "variable" {
- data.RadiusGroups[i].Servers[ci].SecretKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].SecretKey = types.StringValue(va.String())
- }
- }
- data.RadiusGroups[i].Servers[ci].KeyEnum = types.StringNull()
-
- if t := cr.Get("keyEnum.optionType"); t.Exists() {
- va := cr.Get("keyEnum.value")
- if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].KeyEnum = types.StringValue(va.String())
- }
- }
- data.RadiusGroups[i].Servers[ci].KeyType = types.StringNull()
- data.RadiusGroups[i].Servers[ci].KeyTypeVariable = types.StringNull()
- if t := cr.Get("keyType.optionType"); t.Exists() {
- va := cr.Get("keyType.value")
- if t.String() == "variable" {
- data.RadiusGroups[i].Servers[ci].KeyTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RadiusGroups[i].Servers[ci].KeyType = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.TacacsGroups {
- keys := [...]string{"groupName"}
- keyValues := [...]string{data.TacacsGroups[i].GroupName.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "tacacs").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.TacacsGroups[i].GroupName = types.StringNull()
-
- if t := r.Get("groupName.optionType"); t.Exists() {
- va := r.Get("groupName.value")
- if t.String() == "global" {
- data.TacacsGroups[i].GroupName = types.StringValue(va.String())
- }
- }
- data.TacacsGroups[i].Vpn = types.Int64Null()
-
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "global" {
- data.TacacsGroups[i].Vpn = types.Int64Value(va.Int())
- }
- }
- data.TacacsGroups[i].SourceInterface = types.StringNull()
- data.TacacsGroups[i].SourceInterfaceVariable = types.StringNull()
- if t := r.Get("sourceInterface.optionType"); t.Exists() {
- va := r.Get("sourceInterface.value")
- if t.String() == "variable" {
- data.TacacsGroups[i].SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TacacsGroups[i].SourceInterface = types.StringValue(va.String())
- }
- }
- for ci := range data.TacacsGroups[i].Servers {
- keys := [...]string{"address"}
- keyValues := [...]string{data.TacacsGroups[i].Servers[ci].Address.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("server").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.TacacsGroups[i].Servers[ci].Address = types.StringNull()
-
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "global" {
- data.TacacsGroups[i].Servers[ci].Address = types.StringValue(va.String())
- }
- }
- data.TacacsGroups[i].Servers[ci].Port = types.Int64Null()
- data.TacacsGroups[i].Servers[ci].PortVariable = types.StringNull()
- if t := cr.Get("port.optionType"); t.Exists() {
- va := cr.Get("port.value")
- if t.String() == "variable" {
- data.TacacsGroups[i].Servers[ci].PortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TacacsGroups[i].Servers[ci].Port = types.Int64Value(va.Int())
- }
- }
- data.TacacsGroups[i].Servers[ci].Timeout = types.Int64Null()
- data.TacacsGroups[i].Servers[ci].TimeoutVariable = types.StringNull()
- if t := cr.Get("timeout.optionType"); t.Exists() {
- va := cr.Get("timeout.value")
- if t.String() == "variable" {
- data.TacacsGroups[i].Servers[ci].TimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TacacsGroups[i].Servers[ci].Timeout = types.Int64Value(va.Int())
- }
- }
- data.TacacsGroups[i].Servers[ci].SecretKey = types.StringNull()
- data.TacacsGroups[i].Servers[ci].SecretKeyVariable = types.StringNull()
- if t := cr.Get("secretKey.optionType"); t.Exists() {
- va := cr.Get("secretKey.value")
- if t.String() == "variable" {
- data.TacacsGroups[i].Servers[ci].SecretKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TacacsGroups[i].Servers[ci].SecretKey = types.StringValue(va.String())
- }
- }
- data.TacacsGroups[i].Servers[ci].KeyEnum = types.StringNull()
-
- if t := cr.Get("keyEnum.optionType"); t.Exists() {
- va := cr.Get("keyEnum.value")
- if t.String() == "global" {
- data.TacacsGroups[i].Servers[ci].KeyEnum = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.AccountingRules {
- keys := [...]string{"ruleId"}
- keyValues := [...]string{data.AccountingRules[i].RuleId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "accountingRule").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.AccountingRules[i].RuleId = types.StringNull()
-
- if t := r.Get("ruleId.optionType"); t.Exists() {
- va := r.Get("ruleId.value")
- if t.String() == "global" {
- data.AccountingRules[i].RuleId = types.StringValue(va.String())
- }
- }
- data.AccountingRules[i].Method = types.StringNull()
-
- if t := r.Get("method.optionType"); t.Exists() {
- va := r.Get("method.value")
- if t.String() == "global" {
- data.AccountingRules[i].Method = types.StringValue(va.String())
- }
- }
- data.AccountingRules[i].Level = types.StringNull()
-
- if t := r.Get("level.optionType"); t.Exists() {
- va := r.Get("level.value")
- if t.String() == "global" {
- data.AccountingRules[i].Level = types.StringValue(va.String())
- }
- }
- data.AccountingRules[i].StartStop = types.BoolNull()
- data.AccountingRules[i].StartStopVariable = types.StringNull()
- if t := r.Get("startStop.optionType"); t.Exists() {
- va := r.Get("startStop.value")
- if t.String() == "variable" {
- data.AccountingRules[i].StartStopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AccountingRules[i].StartStop = types.BoolValue(va.Bool())
- }
- }
- data.AccountingRules[i].Group = types.SetNull(types.StringType)
-
- if t := r.Get("group.optionType"); t.Exists() {
- va := r.Get("group.value")
- if t.String() == "global" {
- data.AccountingRules[i].Group = helpers.GetStringSet(va.Array())
- }
- }
- }
- data.AuthorizationConsole = types.BoolNull()
- data.AuthorizationConsoleVariable = types.StringNull()
- if t := res.Get(path + "authorizationConsole.optionType"); t.Exists() {
- va := res.Get(path + "authorizationConsole.value")
- if t.String() == "variable" {
- data.AuthorizationConsoleVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthorizationConsole = types.BoolValue(va.Bool())
- }
- }
- data.AuthorizationConfigCommands = types.BoolNull()
- data.AuthorizationConfigCommandsVariable = types.StringNull()
- if t := res.Get(path + "authorizationConfigCommands.optionType"); t.Exists() {
- va := res.Get(path + "authorizationConfigCommands.value")
- if t.String() == "variable" {
- data.AuthorizationConfigCommandsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthorizationConfigCommands = types.BoolValue(va.Bool())
- }
- }
- for i := range data.AuthorizationRules {
- keys := [...]string{"ruleId"}
- keyValues := [...]string{data.AuthorizationRules[i].RuleId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "authorizationRule").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.AuthorizationRules[i].RuleId = types.StringNull()
-
- if t := r.Get("ruleId.optionType"); t.Exists() {
- va := r.Get("ruleId.value")
- if t.String() == "global" {
- data.AuthorizationRules[i].RuleId = types.StringValue(va.String())
- }
- }
- data.AuthorizationRules[i].Method = types.StringNull()
-
- if t := r.Get("method.optionType"); t.Exists() {
- va := r.Get("method.value")
- if t.String() == "global" {
- data.AuthorizationRules[i].Method = types.StringValue(va.String())
- }
- }
- data.AuthorizationRules[i].Level = types.StringNull()
-
- if t := r.Get("level.optionType"); t.Exists() {
- va := r.Get("level.value")
- if t.String() == "global" {
- data.AuthorizationRules[i].Level = types.StringValue(va.String())
- }
- }
- data.AuthorizationRules[i].Group = types.SetNull(types.StringType)
-
- if t := r.Get("group.optionType"); t.Exists() {
- va := r.Get("group.value")
- if t.String() == "global" {
- data.AuthorizationRules[i].Group = helpers.GetStringSet(va.Array())
- }
- }
- data.AuthorizationRules[i].IfAuthenticated = types.BoolNull()
-
- if t := r.Get("ifAuthenticated.optionType"); t.Exists() {
- va := r.Get("ifAuthenticated.value")
- if t.String() == "global" {
- data.AuthorizationRules[i].IfAuthenticated = types.BoolValue(va.Bool())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemAAA) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.AuthenticationGroup.IsNull() {
- return false
- }
- if !data.AuthenticationGroupVariable.IsNull() {
- return false
- }
- if !data.AccountingGroup.IsNull() {
- return false
- }
- if !data.AccountingGroupVariable.IsNull() {
- return false
- }
- if !data.ServerAuthOrder.IsNull() {
- return false
- }
- if len(data.Users) > 0 {
- return false
- }
- if len(data.RadiusGroups) > 0 {
- return false
- }
- if len(data.TacacsGroups) > 0 {
- return false
- }
- if len(data.AccountingRules) > 0 {
- return false
- }
- if !data.AuthorizationConsole.IsNull() {
- return false
- }
- if !data.AuthorizationConsoleVariable.IsNull() {
- return false
- }
- if !data.AuthorizationConfigCommands.IsNull() {
- return false
- }
- if !data.AuthorizationConfigCommandsVariable.IsNull() {
- return false
- }
- if len(data.AuthorizationRules) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_banner_profile_parcel.go b/internal/provider/model_sdwan_system_banner_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_system_banner_profile_parcel.go
rename to internal/provider/model_sdwan_system_banner_feature.go
diff --git a/internal/provider/model_sdwan_system_basic_feature.go b/internal/provider/model_sdwan_system_basic_feature.go
new file mode 100644
index 000000000..17c5fabc5
--- /dev/null
+++ b/internal/provider/model_sdwan_system_basic_feature.go
@@ -0,0 +1,1651 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemBasic 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"`
+ Timezone types.String `tfsdk:"timezone"`
+ TimezoneVariable types.String `tfsdk:"timezone_variable"`
+ ConfigDescription types.String `tfsdk:"config_description"`
+ ConfigDescriptionVariable types.String `tfsdk:"config_description_variable"`
+ Location types.String `tfsdk:"location"`
+ LocationVariable types.String `tfsdk:"location_variable"`
+ GpsLongitude types.Float64 `tfsdk:"gps_longitude"`
+ GpsLongitudeVariable types.String `tfsdk:"gps_longitude_variable"`
+ GpsLatitude types.Float64 `tfsdk:"gps_latitude"`
+ GpsLatitudeVariable types.String `tfsdk:"gps_latitude_variable"`
+ GpsGeoFencingEnable types.Bool `tfsdk:"gps_geo_fencing_enable"`
+ GpsGeoFencingRange types.Int64 `tfsdk:"gps_geo_fencing_range"`
+ GpsGeoFencingRangeVariable types.String `tfsdk:"gps_geo_fencing_range_variable"`
+ GpsSmsEnable types.Bool `tfsdk:"gps_sms_enable"`
+ GpsSmsMobileNumbers []SystemBasicGpsSmsMobileNumbers `tfsdk:"gps_sms_mobile_numbers"`
+ DeviceGroups types.Set `tfsdk:"device_groups"`
+ DeviceGroupsVariable types.String `tfsdk:"device_groups_variable"`
+ ControllerGroups types.Set `tfsdk:"controller_groups"`
+ ControllerGroupsVariable types.String `tfsdk:"controller_groups_variable"`
+ OverlayId types.Int64 `tfsdk:"overlay_id"`
+ OverlayIdVariable types.String `tfsdk:"overlay_id_variable"`
+ PortOffset types.Int64 `tfsdk:"port_offset"`
+ PortOffsetVariable types.String `tfsdk:"port_offset_variable"`
+ PortHopping types.Bool `tfsdk:"port_hopping"`
+ PortHoppingVariable types.String `tfsdk:"port_hopping_variable"`
+ ControlSessionPps types.Int64 `tfsdk:"control_session_pps"`
+ ControlSessionPpsVariable types.String `tfsdk:"control_session_pps_variable"`
+ TrackTransport types.Bool `tfsdk:"track_transport"`
+ TrackTransportVariable types.String `tfsdk:"track_transport_variable"`
+ TrackInterfaceTag types.Int64 `tfsdk:"track_interface_tag"`
+ TrackInterfaceTagVariable types.String `tfsdk:"track_interface_tag_variable"`
+ ConsoleBaudRate types.String `tfsdk:"console_baud_rate"`
+ ConsoleBaudRateVariable types.String `tfsdk:"console_baud_rate_variable"`
+ MaxOmpSessions types.Int64 `tfsdk:"max_omp_sessions"`
+ MaxOmpSessionsVariable types.String `tfsdk:"max_omp_sessions_variable"`
+ MultiTenant types.Bool `tfsdk:"multi_tenant"`
+ MultiTenantVariable types.String `tfsdk:"multi_tenant_variable"`
+ TrackDefaultGateway types.Bool `tfsdk:"track_default_gateway"`
+ TrackDefaultGatewayVariable types.String `tfsdk:"track_default_gateway_variable"`
+ AdminTechOnFailure types.Bool `tfsdk:"admin_tech_on_failure"`
+ AdminTechOnFailureVariable types.String `tfsdk:"admin_tech_on_failure_variable"`
+ IdleTimeout types.Int64 `tfsdk:"idle_timeout"`
+ IdleTimeoutVariable types.String `tfsdk:"idle_timeout_variable"`
+ OnDemandEnable types.Bool `tfsdk:"on_demand_enable"`
+ OnDemandEnableVariable types.String `tfsdk:"on_demand_enable_variable"`
+ OnDemandIdleTimeout types.Int64 `tfsdk:"on_demand_idle_timeout"`
+ OnDemandIdleTimeoutVariable types.String `tfsdk:"on_demand_idle_timeout_variable"`
+ TransportGateway types.Bool `tfsdk:"transport_gateway"`
+ TransportGatewayVariable types.String `tfsdk:"transport_gateway_variable"`
+ EnhancedAppAwareRouting types.String `tfsdk:"enhanced_app_aware_routing"`
+ EnhancedAppAwareRoutingVariable types.String `tfsdk:"enhanced_app_aware_routing_variable"`
+ SiteTypes types.Set `tfsdk:"site_types"`
+ SiteTypesVariable types.String `tfsdk:"site_types_variable"`
+ AffinityGroupNumber types.Int64 `tfsdk:"affinity_group_number"`
+ AffinityGroupNumberVariable types.String `tfsdk:"affinity_group_number_variable"`
+ AffinityGroupPreferences types.Set `tfsdk:"affinity_group_preferences"`
+ AffinityGroupPreferencesVariable types.String `tfsdk:"affinity_group_preferences_variable"`
+ AffinityPreferenceAuto types.Bool `tfsdk:"affinity_preference_auto"`
+ AffinityPreferenceAutoVariable types.String `tfsdk:"affinity_preference_auto_variable"`
+ AffinityPerVrfs []SystemBasicAffinityPerVrfs `tfsdk:"affinity_per_vrfs"`
+}
+
+type SystemBasicGpsSmsMobileNumbers struct {
+ Number types.String `tfsdk:"number"`
+ NumberVariable types.String `tfsdk:"number_variable"`
+}
+
+type SystemBasicAffinityPerVrfs struct {
+ AffinityGroupNumber types.Int64 `tfsdk:"affinity_group_number"`
+ AffinityGroupNumberVariable types.String `tfsdk:"affinity_group_number_variable"`
+ VrfRange types.String `tfsdk:"vrf_range"`
+ VrfRangeVariable types.String `tfsdk:"vrf_range_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemBasic) getModel() string {
+ return "system_basic"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemBasic) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/basic", 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 SystemBasic) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.TimezoneVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clock.timezone.optionType", "variable")
+ body, _ = sjson.Set(body, path+"clock.timezone.value", data.TimezoneVariable.ValueString())
+ }
+ } else if data.Timezone.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clock.timezone.optionType", "default")
+ body, _ = sjson.Set(body, path+"clock.timezone.value", "UTC")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"clock.timezone.optionType", "global")
+ body, _ = sjson.Set(body, path+"clock.timezone.value", data.Timezone.ValueString())
+ }
+ }
+
+ if !data.ConfigDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.ConfigDescriptionVariable.ValueString())
+ }
+ } else if data.ConfigDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.ConfigDescription.ValueString())
+ }
+ }
+
+ if !data.LocationVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"location.optionType", "variable")
+ body, _ = sjson.Set(body, path+"location.value", data.LocationVariable.ValueString())
+ }
+ } else if data.Location.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"location.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"location.optionType", "global")
+ body, _ = sjson.Set(body, path+"location.value", data.Location.ValueString())
+ }
+ }
+
+ if !data.GpsLongitudeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "variable")
+ body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitudeVariable.ValueString())
+ }
+ } else if data.GpsLongitude.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "global")
+ body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitude.ValueFloat64())
+ }
+ }
+
+ if !data.GpsLatitudeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "variable")
+ body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitudeVariable.ValueString())
+ }
+ } else if data.GpsLatitude.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "global")
+ body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitude.ValueFloat64())
+ }
+ }
+ if data.GpsGeoFencingEnable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "default")
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "global")
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", data.GpsGeoFencingEnable.ValueBool())
+ }
+ }
+
+ if !data.GpsGeoFencingRangeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "variable")
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRangeVariable.ValueString())
+ }
+ } else if data.GpsGeoFencingRange.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "default")
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", 100)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "global")
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRange.ValueInt64())
+ }
+ }
+ if data.GpsSmsEnable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "default")
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "global")
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", data.GpsSmsEnable.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.mobileNumber", []interface{}{})
+ for _, item := range data.GpsSmsMobileNumbers {
+ itemBody := ""
+
+ if !item.NumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "number.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "number.value", item.NumberVariable.ValueString())
+ }
+ } else if !item.Number.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "number.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "number.value", item.Number.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"gpsLocation.geoFencing.sms.mobileNumber.-1", itemBody)
+ }
+ }
+
+ if !data.DeviceGroupsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"deviceGroups.optionType", "variable")
+ body, _ = sjson.Set(body, path+"deviceGroups.value", data.DeviceGroupsVariable.ValueString())
+ }
+ } else if data.DeviceGroups.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"deviceGroups.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"deviceGroups.optionType", "global")
+ var values []string
+ data.DeviceGroups.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"deviceGroups.value", values)
+ }
+ }
+
+ if !data.ControllerGroupsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "variable")
+ body, _ = sjson.Set(body, path+"controllerGroupList.value", data.ControllerGroupsVariable.ValueString())
+ }
+ } else if data.ControllerGroups.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "global")
+ var values []int64
+ data.ControllerGroups.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"controllerGroupList.value", values)
+ }
+ }
+
+ if !data.OverlayIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"overlayId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayIdVariable.ValueString())
+ }
+ } else if data.OverlayId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"overlayId.optionType", "default")
+ body, _ = sjson.Set(body, path+"overlayId.value", 1)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"overlayId.optionType", "global")
+ body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayId.ValueInt64())
+ }
+ }
+
+ if !data.PortOffsetVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"portOffset.optionType", "variable")
+ body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffsetVariable.ValueString())
+ }
+ } else if data.PortOffset.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"portOffset.optionType", "default")
+ body, _ = sjson.Set(body, path+"portOffset.value", 0)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"portOffset.optionType", "global")
+ body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffset.ValueInt64())
+ }
+ }
+
+ if !data.PortHoppingVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"portHop.optionType", "variable")
+ body, _ = sjson.Set(body, path+"portHop.value", data.PortHoppingVariable.ValueString())
+ }
+ } else if data.PortHopping.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"portHop.optionType", "default")
+ body, _ = sjson.Set(body, path+"portHop.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"portHop.optionType", "global")
+ body, _ = sjson.Set(body, path+"portHop.value", data.PortHopping.ValueBool())
+ }
+ }
+
+ if !data.ControlSessionPpsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "variable")
+ body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPpsVariable.ValueString())
+ }
+ } else if data.ControlSessionPps.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "default")
+ body, _ = sjson.Set(body, path+"controlSessionPps.value", 300)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "global")
+ body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPps.ValueInt64())
+ }
+ }
+
+ if !data.TrackTransportVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackTransport.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransportVariable.ValueString())
+ }
+ } else if data.TrackTransport.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackTransport.optionType", "default")
+ body, _ = sjson.Set(body, path+"trackTransport.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trackTransport.optionType", "global")
+ body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransport.ValueBool())
+ }
+ }
+
+ if !data.TrackInterfaceTagVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTagVariable.ValueString())
+ }
+ } else if data.TrackInterfaceTag.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "global")
+ body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTag.ValueInt64())
+ }
+ }
+
+ if !data.ConsoleBaudRateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRateVariable.ValueString())
+ }
+ } else if data.ConsoleBaudRate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "default")
+ body, _ = sjson.Set(body, path+"consoleBaudRate.value", "9600")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "global")
+ body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRate.ValueString())
+ }
+ }
+
+ if !data.MaxOmpSessionsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "variable")
+ body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessionsVariable.ValueString())
+ }
+ } else if data.MaxOmpSessions.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessions.ValueInt64())
+ }
+ }
+
+ if !data.MultiTenantVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multiTenant.optionType", "variable")
+ body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenantVariable.ValueString())
+ }
+ } else if data.MultiTenant.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multiTenant.optionType", "default")
+ body, _ = sjson.Set(body, path+"multiTenant.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"multiTenant.optionType", "global")
+ body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenant.ValueBool())
+ }
+ }
+
+ if !data.TrackDefaultGatewayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGatewayVariable.ValueString())
+ }
+ } else if data.TrackDefaultGateway.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "default")
+ body, _ = sjson.Set(body, path+"trackDefaultGateway.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "global")
+ body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGateway.ValueBool())
+ }
+ }
+
+ if !data.AdminTechOnFailureVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "variable")
+ body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailureVariable.ValueString())
+ }
+ } else if data.AdminTechOnFailure.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "default")
+ body, _ = sjson.Set(body, path+"adminTechOnFailure.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "global")
+ body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailure.ValueBool())
+ }
+ }
+
+ if !data.IdleTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"idleTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeoutVariable.ValueString())
+ }
+ } else if data.IdleTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"idleTimeout.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"idleTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeout.ValueInt64())
+ }
+ }
+
+ if !data.OnDemandEnableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnableVariable.ValueString())
+ }
+ } else if data.OnDemandEnable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "default")
+ body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "global")
+ body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnable.ValueBool())
+ }
+ }
+
+ if !data.OnDemandIdleTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeoutVariable.ValueString())
+ }
+ } else if data.OnDemandIdleTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", 10)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeout.ValueInt64())
+ }
+ }
+
+ if !data.TransportGatewayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"transportGateway.optionType", "variable")
+ body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGatewayVariable.ValueString())
+ }
+ } else if data.TransportGateway.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"transportGateway.optionType", "default")
+ body, _ = sjson.Set(body, path+"transportGateway.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"transportGateway.optionType", "global")
+ body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueBool())
+ }
+ }
+
+ if !data.EnhancedAppAwareRoutingVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"epfr.optionType", "variable")
+ body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRoutingVariable.ValueString())
+ }
+ } else if data.EnhancedAppAwareRouting.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"epfr.optionType", "default")
+ body, _ = sjson.Set(body, path+"epfr.value", "disabled")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"epfr.optionType", "global")
+ body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRouting.ValueString())
+ }
+ }
+
+ if !data.SiteTypesVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"siteType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"siteType.value", data.SiteTypesVariable.ValueString())
+ }
+ } else if data.SiteTypes.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"siteType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"siteType.optionType", "global")
+ var values []string
+ data.SiteTypes.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"siteType.value", values)
+ }
+ }
+
+ if !data.AffinityGroupNumberVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "variable")
+ body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumberVariable.ValueString())
+ }
+ } else if data.AffinityGroupNumber.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "global")
+ body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumber.ValueInt64())
+ }
+ }
+
+ if !data.AffinityGroupPreferencesVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "variable")
+ body, _ = sjson.Set(body, path+"affinityGroupPreference.value", data.AffinityGroupPreferencesVariable.ValueString())
+ }
+ } else if data.AffinityGroupPreferences.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "global")
+ var values []int64
+ data.AffinityGroupPreferences.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"affinityGroupPreference.value", values)
+ }
+ }
+
+ if !data.AffinityPreferenceAutoVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "variable")
+ body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAutoVariable.ValueString())
+ }
+ } else if data.AffinityPreferenceAuto.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "default")
+ body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "global")
+ body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAuto.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"affinityPerVrf", []interface{}{})
+ for _, item := range data.AffinityPerVrfs {
+ itemBody := ""
+
+ if !item.AffinityGroupNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumberVariable.ValueString())
+ }
+ } else if item.AffinityGroupNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumber.ValueInt64())
+ }
+ }
+
+ if !item.VrfRangeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRangeVariable.ValueString())
+ }
+ } else if item.VrfRange.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRange.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"affinityPerVrf.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemBasic) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Timezone = types.StringNull()
+ data.TimezoneVariable = types.StringNull()
+ if t := res.Get(path + "clock.timezone.optionType"); t.Exists() {
+ va := res.Get(path + "clock.timezone.value")
+ if t.String() == "variable" {
+ data.TimezoneVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Timezone = types.StringValue(va.String())
+ }
+ }
+ data.ConfigDescription = types.StringNull()
+ data.ConfigDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.ConfigDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ConfigDescription = types.StringValue(va.String())
+ }
+ }
+ data.Location = types.StringNull()
+ data.LocationVariable = types.StringNull()
+ if t := res.Get(path + "location.optionType"); t.Exists() {
+ va := res.Get(path + "location.value")
+ if t.String() == "variable" {
+ data.LocationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Location = types.StringValue(va.String())
+ }
+ }
+ data.GpsLongitude = types.Float64Null()
+ data.GpsLongitudeVariable = types.StringNull()
+ if t := res.Get(path + "gpsLocation.longitude.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.longitude.value")
+ if t.String() == "variable" {
+ data.GpsLongitudeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsLongitude = types.Float64Value(va.Float())
+ }
+ }
+ data.GpsLatitude = types.Float64Null()
+ data.GpsLatitudeVariable = types.StringNull()
+ if t := res.Get(path + "gpsLocation.latitude.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.latitude.value")
+ if t.String() == "variable" {
+ data.GpsLatitudeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsLatitude = types.Float64Value(va.Float())
+ }
+ }
+ data.GpsGeoFencingEnable = types.BoolNull()
+
+ if t := res.Get(path + "gpsLocation.geoFencing.enable.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.geoFencing.enable.value")
+ if t.String() == "global" {
+ data.GpsGeoFencingEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.GpsGeoFencingRange = types.Int64Null()
+ data.GpsGeoFencingRangeVariable = types.StringNull()
+ if t := res.Get(path + "gpsLocation.geoFencing.range.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.geoFencing.range.value")
+ if t.String() == "variable" {
+ data.GpsGeoFencingRangeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsGeoFencingRange = types.Int64Value(va.Int())
+ }
+ }
+ data.GpsSmsEnable = types.BoolNull()
+
+ if t := res.Get(path + "gpsLocation.geoFencing.sms.enable.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.geoFencing.sms.enable.value")
+ if t.String() == "global" {
+ data.GpsSmsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "gpsLocation.geoFencing.sms.mobileNumber"); value.Exists() {
+ data.GpsSmsMobileNumbers = make([]SystemBasicGpsSmsMobileNumbers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemBasicGpsSmsMobileNumbers{}
+ item.Number = types.StringNull()
+ item.NumberVariable = types.StringNull()
+ if t := v.Get("number.optionType"); t.Exists() {
+ va := v.Get("number.value")
+ if t.String() == "variable" {
+ item.NumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Number = types.StringValue(va.String())
+ }
+ }
+ data.GpsSmsMobileNumbers = append(data.GpsSmsMobileNumbers, item)
+ return true
+ })
+ }
+ data.DeviceGroups = types.SetNull(types.StringType)
+ data.DeviceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "deviceGroups.optionType"); t.Exists() {
+ va := res.Get(path + "deviceGroups.value")
+ if t.String() == "variable" {
+ data.DeviceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DeviceGroups = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.ControllerGroups = types.SetNull(types.Int64Type)
+ data.ControllerGroupsVariable = types.StringNull()
+ if t := res.Get(path + "controllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "controllerGroupList.value")
+ if t.String() == "variable" {
+ data.ControllerGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ControllerGroups = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.OverlayId = types.Int64Null()
+ data.OverlayIdVariable = types.StringNull()
+ if t := res.Get(path + "overlayId.optionType"); t.Exists() {
+ va := res.Get(path + "overlayId.value")
+ if t.String() == "variable" {
+ data.OverlayIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OverlayId = types.Int64Value(va.Int())
+ }
+ }
+ data.PortOffset = types.Int64Null()
+ data.PortOffsetVariable = types.StringNull()
+ if t := res.Get(path + "portOffset.optionType"); t.Exists() {
+ va := res.Get(path + "portOffset.value")
+ if t.String() == "variable" {
+ data.PortOffsetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PortOffset = types.Int64Value(va.Int())
+ }
+ }
+ data.PortHopping = types.BoolNull()
+ data.PortHoppingVariable = types.StringNull()
+ if t := res.Get(path + "portHop.optionType"); t.Exists() {
+ va := res.Get(path + "portHop.value")
+ if t.String() == "variable" {
+ data.PortHoppingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PortHopping = types.BoolValue(va.Bool())
+ }
+ }
+ data.ControlSessionPps = types.Int64Null()
+ data.ControlSessionPpsVariable = types.StringNull()
+ if t := res.Get(path + "controlSessionPps.optionType"); t.Exists() {
+ va := res.Get(path + "controlSessionPps.value")
+ if t.String() == "variable" {
+ data.ControlSessionPpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ControlSessionPps = types.Int64Value(va.Int())
+ }
+ }
+ data.TrackTransport = types.BoolNull()
+ data.TrackTransportVariable = types.StringNull()
+ if t := res.Get(path + "trackTransport.optionType"); t.Exists() {
+ va := res.Get(path + "trackTransport.value")
+ if t.String() == "variable" {
+ data.TrackTransportVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackTransport = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrackInterfaceTag = types.Int64Null()
+ data.TrackInterfaceTagVariable = types.StringNull()
+ if t := res.Get(path + "trackInterfaceTag.optionType"); t.Exists() {
+ va := res.Get(path + "trackInterfaceTag.value")
+ if t.String() == "variable" {
+ data.TrackInterfaceTagVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackInterfaceTag = types.Int64Value(va.Int())
+ }
+ }
+ data.ConsoleBaudRate = types.StringNull()
+ data.ConsoleBaudRateVariable = types.StringNull()
+ if t := res.Get(path + "consoleBaudRate.optionType"); t.Exists() {
+ va := res.Get(path + "consoleBaudRate.value")
+ if t.String() == "variable" {
+ data.ConsoleBaudRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ConsoleBaudRate = types.StringValue(va.String())
+ }
+ }
+ data.MaxOmpSessions = types.Int64Null()
+ data.MaxOmpSessionsVariable = types.StringNull()
+ if t := res.Get(path + "maxOmpSessions.optionType"); t.Exists() {
+ va := res.Get(path + "maxOmpSessions.value")
+ if t.String() == "variable" {
+ data.MaxOmpSessionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MaxOmpSessions = types.Int64Value(va.Int())
+ }
+ }
+ data.MultiTenant = types.BoolNull()
+ data.MultiTenantVariable = types.StringNull()
+ if t := res.Get(path + "multiTenant.optionType"); t.Exists() {
+ va := res.Get(path + "multiTenant.value")
+ if t.String() == "variable" {
+ data.MultiTenantVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MultiTenant = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrackDefaultGateway = types.BoolNull()
+ data.TrackDefaultGatewayVariable = types.StringNull()
+ if t := res.Get(path + "trackDefaultGateway.optionType"); t.Exists() {
+ va := res.Get(path + "trackDefaultGateway.value")
+ if t.String() == "variable" {
+ data.TrackDefaultGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackDefaultGateway = types.BoolValue(va.Bool())
+ }
+ }
+ data.AdminTechOnFailure = types.BoolNull()
+ data.AdminTechOnFailureVariable = types.StringNull()
+ if t := res.Get(path + "adminTechOnFailure.optionType"); t.Exists() {
+ va := res.Get(path + "adminTechOnFailure.value")
+ if t.String() == "variable" {
+ data.AdminTechOnFailureVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdminTechOnFailure = types.BoolValue(va.Bool())
+ }
+ }
+ data.IdleTimeout = types.Int64Null()
+ data.IdleTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "idleTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "idleTimeout.value")
+ if t.String() == "variable" {
+ data.IdleTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IdleTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.OnDemandEnable = types.BoolNull()
+ data.OnDemandEnableVariable = types.StringNull()
+ if t := res.Get(path + "onDemand.onDemandEnable.optionType"); t.Exists() {
+ va := res.Get(path + "onDemand.onDemandEnable.value")
+ if t.String() == "variable" {
+ data.OnDemandEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OnDemandEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.OnDemandIdleTimeout = types.Int64Null()
+ data.OnDemandIdleTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "onDemand.onDemandIdleTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "onDemand.onDemandIdleTimeout.value")
+ if t.String() == "variable" {
+ data.OnDemandIdleTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OnDemandIdleTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.TransportGateway = types.BoolNull()
+ data.TransportGatewayVariable = types.StringNull()
+ if t := res.Get(path + "transportGateway.optionType"); t.Exists() {
+ va := res.Get(path + "transportGateway.value")
+ if t.String() == "variable" {
+ data.TransportGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TransportGateway = types.BoolValue(va.Bool())
+ }
+ }
+ data.EnhancedAppAwareRouting = types.StringNull()
+ data.EnhancedAppAwareRoutingVariable = types.StringNull()
+ if t := res.Get(path + "epfr.optionType"); t.Exists() {
+ va := res.Get(path + "epfr.value")
+ if t.String() == "variable" {
+ data.EnhancedAppAwareRoutingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EnhancedAppAwareRouting = types.StringValue(va.String())
+ }
+ }
+ data.SiteTypes = types.SetNull(types.StringType)
+ data.SiteTypesVariable = types.StringNull()
+ if t := res.Get(path + "siteType.optionType"); t.Exists() {
+ va := res.Get(path + "siteType.value")
+ if t.String() == "variable" {
+ data.SiteTypesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SiteTypes = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.AffinityGroupNumber = types.Int64Null()
+ data.AffinityGroupNumberVariable = types.StringNull()
+ if t := res.Get(path + "affinityGroupNumber.optionType"); t.Exists() {
+ va := res.Get(path + "affinityGroupNumber.value")
+ if t.String() == "variable" {
+ data.AffinityGroupNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityGroupNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.AffinityGroupPreferences = types.SetNull(types.Int64Type)
+ data.AffinityGroupPreferencesVariable = types.StringNull()
+ if t := res.Get(path + "affinityGroupPreference.optionType"); t.Exists() {
+ va := res.Get(path + "affinityGroupPreference.value")
+ if t.String() == "variable" {
+ data.AffinityGroupPreferencesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityGroupPreferences = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.AffinityPreferenceAuto = types.BoolNull()
+ data.AffinityPreferenceAutoVariable = types.StringNull()
+ if t := res.Get(path + "affinityPreferenceAuto.optionType"); t.Exists() {
+ va := res.Get(path + "affinityPreferenceAuto.value")
+ if t.String() == "variable" {
+ data.AffinityPreferenceAutoVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityPreferenceAuto = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "affinityPerVrf"); value.Exists() {
+ data.AffinityPerVrfs = make([]SystemBasicAffinityPerVrfs, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemBasicAffinityPerVrfs{}
+ item.AffinityGroupNumber = types.Int64Null()
+ item.AffinityGroupNumberVariable = types.StringNull()
+ if t := v.Get("affinityGroupNumber.optionType"); t.Exists() {
+ va := v.Get("affinityGroupNumber.value")
+ if t.String() == "variable" {
+ item.AffinityGroupNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AffinityGroupNumber = types.Int64Value(va.Int())
+ }
+ }
+ item.VrfRange = types.StringNull()
+ item.VrfRangeVariable = types.StringNull()
+ if t := v.Get("vrfRange.optionType"); t.Exists() {
+ va := v.Get("vrfRange.value")
+ if t.String() == "variable" {
+ item.VrfRangeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.VrfRange = types.StringValue(va.String())
+ }
+ }
+ data.AffinityPerVrfs = append(data.AffinityPerVrfs, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemBasic) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Timezone = types.StringNull()
+ data.TimezoneVariable = types.StringNull()
+ if t := res.Get(path + "clock.timezone.optionType"); t.Exists() {
+ va := res.Get(path + "clock.timezone.value")
+ if t.String() == "variable" {
+ data.TimezoneVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Timezone = types.StringValue(va.String())
+ }
+ }
+ data.ConfigDescription = types.StringNull()
+ data.ConfigDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.ConfigDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ConfigDescription = types.StringValue(va.String())
+ }
+ }
+ data.Location = types.StringNull()
+ data.LocationVariable = types.StringNull()
+ if t := res.Get(path + "location.optionType"); t.Exists() {
+ va := res.Get(path + "location.value")
+ if t.String() == "variable" {
+ data.LocationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Location = types.StringValue(va.String())
+ }
+ }
+ data.GpsLongitude = types.Float64Null()
+ data.GpsLongitudeVariable = types.StringNull()
+ if t := res.Get(path + "gpsLocation.longitude.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.longitude.value")
+ if t.String() == "variable" {
+ data.GpsLongitudeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsLongitude = types.Float64Value(va.Float())
+ }
+ }
+ data.GpsLatitude = types.Float64Null()
+ data.GpsLatitudeVariable = types.StringNull()
+ if t := res.Get(path + "gpsLocation.latitude.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.latitude.value")
+ if t.String() == "variable" {
+ data.GpsLatitudeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsLatitude = types.Float64Value(va.Float())
+ }
+ }
+ data.GpsGeoFencingEnable = types.BoolNull()
+
+ if t := res.Get(path + "gpsLocation.geoFencing.enable.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.geoFencing.enable.value")
+ if t.String() == "global" {
+ data.GpsGeoFencingEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.GpsGeoFencingRange = types.Int64Null()
+ data.GpsGeoFencingRangeVariable = types.StringNull()
+ if t := res.Get(path + "gpsLocation.geoFencing.range.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.geoFencing.range.value")
+ if t.String() == "variable" {
+ data.GpsGeoFencingRangeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsGeoFencingRange = types.Int64Value(va.Int())
+ }
+ }
+ data.GpsSmsEnable = types.BoolNull()
+
+ if t := res.Get(path + "gpsLocation.geoFencing.sms.enable.optionType"); t.Exists() {
+ va := res.Get(path + "gpsLocation.geoFencing.sms.enable.value")
+ if t.String() == "global" {
+ data.GpsSmsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.GpsSmsMobileNumbers {
+ keys := [...]string{"number"}
+ keyValues := [...]string{data.GpsSmsMobileNumbers[i].Number.ValueString()}
+ keyValuesVariables := [...]string{data.GpsSmsMobileNumbers[i].NumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "gpsLocation.geoFencing.sms.mobileNumber").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.GpsSmsMobileNumbers[i].Number = types.StringNull()
+ data.GpsSmsMobileNumbers[i].NumberVariable = types.StringNull()
+ if t := r.Get("number.optionType"); t.Exists() {
+ va := r.Get("number.value")
+ if t.String() == "variable" {
+ data.GpsSmsMobileNumbers[i].NumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsSmsMobileNumbers[i].Number = types.StringValue(va.String())
+ }
+ }
+ }
+ data.DeviceGroups = types.SetNull(types.StringType)
+ data.DeviceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "deviceGroups.optionType"); t.Exists() {
+ va := res.Get(path + "deviceGroups.value")
+ if t.String() == "variable" {
+ data.DeviceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DeviceGroups = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.ControllerGroups = types.SetNull(types.Int64Type)
+ data.ControllerGroupsVariable = types.StringNull()
+ if t := res.Get(path + "controllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "controllerGroupList.value")
+ if t.String() == "variable" {
+ data.ControllerGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ControllerGroups = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.OverlayId = types.Int64Null()
+ data.OverlayIdVariable = types.StringNull()
+ if t := res.Get(path + "overlayId.optionType"); t.Exists() {
+ va := res.Get(path + "overlayId.value")
+ if t.String() == "variable" {
+ data.OverlayIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OverlayId = types.Int64Value(va.Int())
+ }
+ }
+ data.PortOffset = types.Int64Null()
+ data.PortOffsetVariable = types.StringNull()
+ if t := res.Get(path + "portOffset.optionType"); t.Exists() {
+ va := res.Get(path + "portOffset.value")
+ if t.String() == "variable" {
+ data.PortOffsetVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PortOffset = types.Int64Value(va.Int())
+ }
+ }
+ data.PortHopping = types.BoolNull()
+ data.PortHoppingVariable = types.StringNull()
+ if t := res.Get(path + "portHop.optionType"); t.Exists() {
+ va := res.Get(path + "portHop.value")
+ if t.String() == "variable" {
+ data.PortHoppingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PortHopping = types.BoolValue(va.Bool())
+ }
+ }
+ data.ControlSessionPps = types.Int64Null()
+ data.ControlSessionPpsVariable = types.StringNull()
+ if t := res.Get(path + "controlSessionPps.optionType"); t.Exists() {
+ va := res.Get(path + "controlSessionPps.value")
+ if t.String() == "variable" {
+ data.ControlSessionPpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ControlSessionPps = types.Int64Value(va.Int())
+ }
+ }
+ data.TrackTransport = types.BoolNull()
+ data.TrackTransportVariable = types.StringNull()
+ if t := res.Get(path + "trackTransport.optionType"); t.Exists() {
+ va := res.Get(path + "trackTransport.value")
+ if t.String() == "variable" {
+ data.TrackTransportVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackTransport = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrackInterfaceTag = types.Int64Null()
+ data.TrackInterfaceTagVariable = types.StringNull()
+ if t := res.Get(path + "trackInterfaceTag.optionType"); t.Exists() {
+ va := res.Get(path + "trackInterfaceTag.value")
+ if t.String() == "variable" {
+ data.TrackInterfaceTagVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackInterfaceTag = types.Int64Value(va.Int())
+ }
+ }
+ data.ConsoleBaudRate = types.StringNull()
+ data.ConsoleBaudRateVariable = types.StringNull()
+ if t := res.Get(path + "consoleBaudRate.optionType"); t.Exists() {
+ va := res.Get(path + "consoleBaudRate.value")
+ if t.String() == "variable" {
+ data.ConsoleBaudRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ConsoleBaudRate = types.StringValue(va.String())
+ }
+ }
+ data.MaxOmpSessions = types.Int64Null()
+ data.MaxOmpSessionsVariable = types.StringNull()
+ if t := res.Get(path + "maxOmpSessions.optionType"); t.Exists() {
+ va := res.Get(path + "maxOmpSessions.value")
+ if t.String() == "variable" {
+ data.MaxOmpSessionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MaxOmpSessions = types.Int64Value(va.Int())
+ }
+ }
+ data.MultiTenant = types.BoolNull()
+ data.MultiTenantVariable = types.StringNull()
+ if t := res.Get(path + "multiTenant.optionType"); t.Exists() {
+ va := res.Get(path + "multiTenant.value")
+ if t.String() == "variable" {
+ data.MultiTenantVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MultiTenant = types.BoolValue(va.Bool())
+ }
+ }
+ data.TrackDefaultGateway = types.BoolNull()
+ data.TrackDefaultGatewayVariable = types.StringNull()
+ if t := res.Get(path + "trackDefaultGateway.optionType"); t.Exists() {
+ va := res.Get(path + "trackDefaultGateway.value")
+ if t.String() == "variable" {
+ data.TrackDefaultGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackDefaultGateway = types.BoolValue(va.Bool())
+ }
+ }
+ data.AdminTechOnFailure = types.BoolNull()
+ data.AdminTechOnFailureVariable = types.StringNull()
+ if t := res.Get(path + "adminTechOnFailure.optionType"); t.Exists() {
+ va := res.Get(path + "adminTechOnFailure.value")
+ if t.String() == "variable" {
+ data.AdminTechOnFailureVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AdminTechOnFailure = types.BoolValue(va.Bool())
+ }
+ }
+ data.IdleTimeout = types.Int64Null()
+ data.IdleTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "idleTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "idleTimeout.value")
+ if t.String() == "variable" {
+ data.IdleTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IdleTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.OnDemandEnable = types.BoolNull()
+ data.OnDemandEnableVariable = types.StringNull()
+ if t := res.Get(path + "onDemand.onDemandEnable.optionType"); t.Exists() {
+ va := res.Get(path + "onDemand.onDemandEnable.value")
+ if t.String() == "variable" {
+ data.OnDemandEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OnDemandEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.OnDemandIdleTimeout = types.Int64Null()
+ data.OnDemandIdleTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "onDemand.onDemandIdleTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "onDemand.onDemandIdleTimeout.value")
+ if t.String() == "variable" {
+ data.OnDemandIdleTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.OnDemandIdleTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.TransportGateway = types.BoolNull()
+ data.TransportGatewayVariable = types.StringNull()
+ if t := res.Get(path + "transportGateway.optionType"); t.Exists() {
+ va := res.Get(path + "transportGateway.value")
+ if t.String() == "variable" {
+ data.TransportGatewayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TransportGateway = types.BoolValue(va.Bool())
+ }
+ }
+ data.EnhancedAppAwareRouting = types.StringNull()
+ data.EnhancedAppAwareRoutingVariable = types.StringNull()
+ if t := res.Get(path + "epfr.optionType"); t.Exists() {
+ va := res.Get(path + "epfr.value")
+ if t.String() == "variable" {
+ data.EnhancedAppAwareRoutingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EnhancedAppAwareRouting = types.StringValue(va.String())
+ }
+ }
+ data.SiteTypes = types.SetNull(types.StringType)
+ data.SiteTypesVariable = types.StringNull()
+ if t := res.Get(path + "siteType.optionType"); t.Exists() {
+ va := res.Get(path + "siteType.value")
+ if t.String() == "variable" {
+ data.SiteTypesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SiteTypes = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.AffinityGroupNumber = types.Int64Null()
+ data.AffinityGroupNumberVariable = types.StringNull()
+ if t := res.Get(path + "affinityGroupNumber.optionType"); t.Exists() {
+ va := res.Get(path + "affinityGroupNumber.value")
+ if t.String() == "variable" {
+ data.AffinityGroupNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityGroupNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.AffinityGroupPreferences = types.SetNull(types.Int64Type)
+ data.AffinityGroupPreferencesVariable = types.StringNull()
+ if t := res.Get(path + "affinityGroupPreference.optionType"); t.Exists() {
+ va := res.Get(path + "affinityGroupPreference.value")
+ if t.String() == "variable" {
+ data.AffinityGroupPreferencesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityGroupPreferences = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.AffinityPreferenceAuto = types.BoolNull()
+ data.AffinityPreferenceAutoVariable = types.StringNull()
+ if t := res.Get(path + "affinityPreferenceAuto.optionType"); t.Exists() {
+ va := res.Get(path + "affinityPreferenceAuto.value")
+ if t.String() == "variable" {
+ data.AffinityPreferenceAutoVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityPreferenceAuto = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.AffinityPerVrfs {
+ keys := [...]string{"affinityGroupNumber"}
+ keyValues := [...]string{strconv.FormatInt(data.AffinityPerVrfs[i].AffinityGroupNumber.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.AffinityPerVrfs[i].AffinityGroupNumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "affinityPerVrf").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AffinityPerVrfs[i].AffinityGroupNumber = types.Int64Null()
+ data.AffinityPerVrfs[i].AffinityGroupNumberVariable = types.StringNull()
+ if t := r.Get("affinityGroupNumber.optionType"); t.Exists() {
+ va := r.Get("affinityGroupNumber.value")
+ if t.String() == "variable" {
+ data.AffinityPerVrfs[i].AffinityGroupNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityPerVrfs[i].AffinityGroupNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.AffinityPerVrfs[i].VrfRange = types.StringNull()
+ data.AffinityPerVrfs[i].VrfRangeVariable = types.StringNull()
+ if t := r.Get("vrfRange.optionType"); t.Exists() {
+ va := r.Get("vrfRange.value")
+ if t.String() == "variable" {
+ data.AffinityPerVrfs[i].VrfRangeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AffinityPerVrfs[i].VrfRange = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemBasic) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.Timezone.IsNull() {
+ return false
+ }
+ if !data.TimezoneVariable.IsNull() {
+ return false
+ }
+ if !data.ConfigDescription.IsNull() {
+ return false
+ }
+ if !data.ConfigDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Location.IsNull() {
+ return false
+ }
+ if !data.LocationVariable.IsNull() {
+ return false
+ }
+ if !data.GpsLongitude.IsNull() {
+ return false
+ }
+ if !data.GpsLongitudeVariable.IsNull() {
+ return false
+ }
+ if !data.GpsLatitude.IsNull() {
+ return false
+ }
+ if !data.GpsLatitudeVariable.IsNull() {
+ return false
+ }
+ if !data.GpsGeoFencingEnable.IsNull() {
+ return false
+ }
+ if !data.GpsGeoFencingRange.IsNull() {
+ return false
+ }
+ if !data.GpsGeoFencingRangeVariable.IsNull() {
+ return false
+ }
+ if !data.GpsSmsEnable.IsNull() {
+ return false
+ }
+ if len(data.GpsSmsMobileNumbers) > 0 {
+ return false
+ }
+ if !data.DeviceGroups.IsNull() {
+ return false
+ }
+ if !data.DeviceGroupsVariable.IsNull() {
+ return false
+ }
+ if !data.ControllerGroups.IsNull() {
+ return false
+ }
+ if !data.ControllerGroupsVariable.IsNull() {
+ return false
+ }
+ if !data.OverlayId.IsNull() {
+ return false
+ }
+ if !data.OverlayIdVariable.IsNull() {
+ return false
+ }
+ if !data.PortOffset.IsNull() {
+ return false
+ }
+ if !data.PortOffsetVariable.IsNull() {
+ return false
+ }
+ if !data.PortHopping.IsNull() {
+ return false
+ }
+ if !data.PortHoppingVariable.IsNull() {
+ return false
+ }
+ if !data.ControlSessionPps.IsNull() {
+ return false
+ }
+ if !data.ControlSessionPpsVariable.IsNull() {
+ return false
+ }
+ if !data.TrackTransport.IsNull() {
+ return false
+ }
+ if !data.TrackTransportVariable.IsNull() {
+ return false
+ }
+ if !data.TrackInterfaceTag.IsNull() {
+ return false
+ }
+ if !data.TrackInterfaceTagVariable.IsNull() {
+ return false
+ }
+ if !data.ConsoleBaudRate.IsNull() {
+ return false
+ }
+ if !data.ConsoleBaudRateVariable.IsNull() {
+ return false
+ }
+ if !data.MaxOmpSessions.IsNull() {
+ return false
+ }
+ if !data.MaxOmpSessionsVariable.IsNull() {
+ return false
+ }
+ if !data.MultiTenant.IsNull() {
+ return false
+ }
+ if !data.MultiTenantVariable.IsNull() {
+ return false
+ }
+ if !data.TrackDefaultGateway.IsNull() {
+ return false
+ }
+ if !data.TrackDefaultGatewayVariable.IsNull() {
+ return false
+ }
+ if !data.AdminTechOnFailure.IsNull() {
+ return false
+ }
+ if !data.AdminTechOnFailureVariable.IsNull() {
+ return false
+ }
+ if !data.IdleTimeout.IsNull() {
+ return false
+ }
+ if !data.IdleTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.OnDemandEnable.IsNull() {
+ return false
+ }
+ if !data.OnDemandEnableVariable.IsNull() {
+ return false
+ }
+ if !data.OnDemandIdleTimeout.IsNull() {
+ return false
+ }
+ if !data.OnDemandIdleTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.TransportGateway.IsNull() {
+ return false
+ }
+ if !data.TransportGatewayVariable.IsNull() {
+ return false
+ }
+ if !data.EnhancedAppAwareRouting.IsNull() {
+ return false
+ }
+ if !data.EnhancedAppAwareRoutingVariable.IsNull() {
+ return false
+ }
+ if !data.SiteTypes.IsNull() {
+ return false
+ }
+ if !data.SiteTypesVariable.IsNull() {
+ return false
+ }
+ if !data.AffinityGroupNumber.IsNull() {
+ return false
+ }
+ if !data.AffinityGroupNumberVariable.IsNull() {
+ return false
+ }
+ if !data.AffinityGroupPreferences.IsNull() {
+ return false
+ }
+ if !data.AffinityGroupPreferencesVariable.IsNull() {
+ return false
+ }
+ if !data.AffinityPreferenceAuto.IsNull() {
+ return false
+ }
+ if !data.AffinityPreferenceAutoVariable.IsNull() {
+ return false
+ }
+ if len(data.AffinityPerVrfs) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_basic_profile_parcel.go b/internal/provider/model_sdwan_system_basic_profile_parcel.go
deleted file mode 100644
index c4110fdce..000000000
--- a/internal/provider/model_sdwan_system_basic_profile_parcel.go
+++ /dev/null
@@ -1,1645 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemBasic 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"`
- Timezone types.String `tfsdk:"timezone"`
- TimezoneVariable types.String `tfsdk:"timezone_variable"`
- ConfigDescription types.String `tfsdk:"config_description"`
- ConfigDescriptionVariable types.String `tfsdk:"config_description_variable"`
- Location types.String `tfsdk:"location"`
- LocationVariable types.String `tfsdk:"location_variable"`
- GpsLongitude types.Float64 `tfsdk:"gps_longitude"`
- GpsLongitudeVariable types.String `tfsdk:"gps_longitude_variable"`
- GpsLatitude types.Float64 `tfsdk:"gps_latitude"`
- GpsLatitudeVariable types.String `tfsdk:"gps_latitude_variable"`
- GpsGeoFencingEnable types.Bool `tfsdk:"gps_geo_fencing_enable"`
- GpsGeoFencingRange types.Int64 `tfsdk:"gps_geo_fencing_range"`
- GpsGeoFencingRangeVariable types.String `tfsdk:"gps_geo_fencing_range_variable"`
- GpsSmsEnable types.Bool `tfsdk:"gps_sms_enable"`
- GpsSmsMobileNumbers []SystemBasicGpsSmsMobileNumbers `tfsdk:"gps_sms_mobile_numbers"`
- DeviceGroups types.Set `tfsdk:"device_groups"`
- DeviceGroupsVariable types.String `tfsdk:"device_groups_variable"`
- ControllerGroups types.Set `tfsdk:"controller_groups"`
- ControllerGroupsVariable types.String `tfsdk:"controller_groups_variable"`
- OverlayId types.Int64 `tfsdk:"overlay_id"`
- OverlayIdVariable types.String `tfsdk:"overlay_id_variable"`
- PortOffset types.Int64 `tfsdk:"port_offset"`
- PortOffsetVariable types.String `tfsdk:"port_offset_variable"`
- PortHopping types.Bool `tfsdk:"port_hopping"`
- PortHoppingVariable types.String `tfsdk:"port_hopping_variable"`
- ControlSessionPps types.Int64 `tfsdk:"control_session_pps"`
- ControlSessionPpsVariable types.String `tfsdk:"control_session_pps_variable"`
- TrackTransport types.Bool `tfsdk:"track_transport"`
- TrackTransportVariable types.String `tfsdk:"track_transport_variable"`
- TrackInterfaceTag types.Int64 `tfsdk:"track_interface_tag"`
- TrackInterfaceTagVariable types.String `tfsdk:"track_interface_tag_variable"`
- ConsoleBaudRate types.String `tfsdk:"console_baud_rate"`
- ConsoleBaudRateVariable types.String `tfsdk:"console_baud_rate_variable"`
- MaxOmpSessions types.Int64 `tfsdk:"max_omp_sessions"`
- MaxOmpSessionsVariable types.String `tfsdk:"max_omp_sessions_variable"`
- MultiTenant types.Bool `tfsdk:"multi_tenant"`
- MultiTenantVariable types.String `tfsdk:"multi_tenant_variable"`
- TrackDefaultGateway types.Bool `tfsdk:"track_default_gateway"`
- TrackDefaultGatewayVariable types.String `tfsdk:"track_default_gateway_variable"`
- AdminTechOnFailure types.Bool `tfsdk:"admin_tech_on_failure"`
- AdminTechOnFailureVariable types.String `tfsdk:"admin_tech_on_failure_variable"`
- IdleTimeout types.Int64 `tfsdk:"idle_timeout"`
- IdleTimeoutVariable types.String `tfsdk:"idle_timeout_variable"`
- OnDemandEnable types.Bool `tfsdk:"on_demand_enable"`
- OnDemandEnableVariable types.String `tfsdk:"on_demand_enable_variable"`
- OnDemandIdleTimeout types.Int64 `tfsdk:"on_demand_idle_timeout"`
- OnDemandIdleTimeoutVariable types.String `tfsdk:"on_demand_idle_timeout_variable"`
- TransportGateway types.Bool `tfsdk:"transport_gateway"`
- TransportGatewayVariable types.String `tfsdk:"transport_gateway_variable"`
- EnhancedAppAwareRouting types.String `tfsdk:"enhanced_app_aware_routing"`
- EnhancedAppAwareRoutingVariable types.String `tfsdk:"enhanced_app_aware_routing_variable"`
- SiteTypes types.Set `tfsdk:"site_types"`
- SiteTypesVariable types.String `tfsdk:"site_types_variable"`
- AffinityGroupNumber types.Int64 `tfsdk:"affinity_group_number"`
- AffinityGroupNumberVariable types.String `tfsdk:"affinity_group_number_variable"`
- AffinityGroupPreferences types.Set `tfsdk:"affinity_group_preferences"`
- AffinityGroupPreferencesVariable types.String `tfsdk:"affinity_group_preferences_variable"`
- AffinityPreferenceAuto types.Bool `tfsdk:"affinity_preference_auto"`
- AffinityPreferenceAutoVariable types.String `tfsdk:"affinity_preference_auto_variable"`
- AffinityPerVrfs []SystemBasicAffinityPerVrfs `tfsdk:"affinity_per_vrfs"`
-}
-
-type SystemBasicGpsSmsMobileNumbers struct {
- Number types.String `tfsdk:"number"`
- NumberVariable types.String `tfsdk:"number_variable"`
-}
-
-type SystemBasicAffinityPerVrfs struct {
- AffinityGroupNumber types.Int64 `tfsdk:"affinity_group_number"`
- AffinityGroupNumberVariable types.String `tfsdk:"affinity_group_number_variable"`
- VrfRange types.String `tfsdk:"vrf_range"`
- VrfRangeVariable types.String `tfsdk:"vrf_range_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemBasic) getModel() string {
- return "system_basic"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemBasic) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/basic", 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 SystemBasic) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.TimezoneVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clock.timezone.optionType", "variable")
- body, _ = sjson.Set(body, path+"clock.timezone.value", data.TimezoneVariable.ValueString())
- }
- } else if data.Timezone.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clock.timezone.optionType", "default")
- body, _ = sjson.Set(body, path+"clock.timezone.value", "UTC")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"clock.timezone.optionType", "global")
- body, _ = sjson.Set(body, path+"clock.timezone.value", data.Timezone.ValueString())
- }
- }
-
- if !data.ConfigDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.ConfigDescriptionVariable.ValueString())
- }
- } else if data.ConfigDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.ConfigDescription.ValueString())
- }
- }
-
- if !data.LocationVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"location.optionType", "variable")
- body, _ = sjson.Set(body, path+"location.value", data.LocationVariable.ValueString())
- }
- } else if data.Location.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"location.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"location.optionType", "global")
- body, _ = sjson.Set(body, path+"location.value", data.Location.ValueString())
- }
- }
-
- if !data.GpsLongitudeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "variable")
- body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitudeVariable.ValueString())
- }
- } else if data.GpsLongitude.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "global")
- body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitude.ValueFloat64())
- }
- }
-
- if !data.GpsLatitudeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "variable")
- body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitudeVariable.ValueString())
- }
- } else if data.GpsLatitude.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "global")
- body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitude.ValueFloat64())
- }
- }
- if data.GpsGeoFencingEnable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "default")
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "global")
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", data.GpsGeoFencingEnable.ValueBool())
- }
- }
-
- if !data.GpsGeoFencingRangeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "variable")
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRangeVariable.ValueString())
- }
- } else if data.GpsGeoFencingRange.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "default")
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", 100)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "global")
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRange.ValueInt64())
- }
- }
- if data.GpsSmsEnable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "default")
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "global")
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", data.GpsSmsEnable.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.mobileNumber", []interface{}{})
- for _, item := range data.GpsSmsMobileNumbers {
- itemBody := ""
-
- if !item.NumberVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "number.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "number.value", item.NumberVariable.ValueString())
- }
- } else if !item.Number.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "number.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "number.value", item.Number.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"gpsLocation.geoFencing.sms.mobileNumber.-1", itemBody)
- }
- }
-
- if !data.DeviceGroupsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"deviceGroups.optionType", "variable")
- body, _ = sjson.Set(body, path+"deviceGroups.value", data.DeviceGroupsVariable.ValueString())
- }
- } else if data.DeviceGroups.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"deviceGroups.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"deviceGroups.optionType", "global")
- var values []string
- data.DeviceGroups.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"deviceGroups.value", values)
- }
- }
-
- if !data.ControllerGroupsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "variable")
- body, _ = sjson.Set(body, path+"controllerGroupList.value", data.ControllerGroupsVariable.ValueString())
- }
- } else if data.ControllerGroups.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "global")
- var values []int64
- data.ControllerGroups.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"controllerGroupList.value", values)
- }
- }
-
- if !data.OverlayIdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"overlayId.optionType", "variable")
- body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayIdVariable.ValueString())
- }
- } else if data.OverlayId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"overlayId.optionType", "default")
- body, _ = sjson.Set(body, path+"overlayId.value", 1)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"overlayId.optionType", "global")
- body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayId.ValueInt64())
- }
- }
-
- if !data.PortOffsetVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"portOffset.optionType", "variable")
- body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffsetVariable.ValueString())
- }
- } else if data.PortOffset.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"portOffset.optionType", "default")
- body, _ = sjson.Set(body, path+"portOffset.value", 0)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"portOffset.optionType", "global")
- body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffset.ValueInt64())
- }
- }
-
- if !data.PortHoppingVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"portHop.optionType", "variable")
- body, _ = sjson.Set(body, path+"portHop.value", data.PortHoppingVariable.ValueString())
- }
- } else if data.PortHopping.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"portHop.optionType", "default")
- body, _ = sjson.Set(body, path+"portHop.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"portHop.optionType", "global")
- body, _ = sjson.Set(body, path+"portHop.value", data.PortHopping.ValueBool())
- }
- }
-
- if !data.ControlSessionPpsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "variable")
- body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPpsVariable.ValueString())
- }
- } else if data.ControlSessionPps.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "default")
- body, _ = sjson.Set(body, path+"controlSessionPps.value", 300)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "global")
- body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPps.ValueInt64())
- }
- }
-
- if !data.TrackTransportVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trackTransport.optionType", "variable")
- body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransportVariable.ValueString())
- }
- } else if data.TrackTransport.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trackTransport.optionType", "default")
- body, _ = sjson.Set(body, path+"trackTransport.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trackTransport.optionType", "global")
- body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransport.ValueBool())
- }
- }
-
- if !data.TrackInterfaceTagVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "variable")
- body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTagVariable.ValueString())
- }
- } else if data.TrackInterfaceTag.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "global")
- body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTag.ValueInt64())
- }
- }
-
- if !data.ConsoleBaudRateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "variable")
- body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRateVariable.ValueString())
- }
- } else if data.ConsoleBaudRate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "default")
- body, _ = sjson.Set(body, path+"consoleBaudRate.value", "9600")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "global")
- body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRate.ValueString())
- }
- }
-
- if !data.MaxOmpSessionsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "variable")
- body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessionsVariable.ValueString())
- }
- } else if data.MaxOmpSessions.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "global")
- body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessions.ValueInt64())
- }
- }
-
- if !data.MultiTenantVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"multiTenant.optionType", "variable")
- body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenantVariable.ValueString())
- }
- } else if data.MultiTenant.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"multiTenant.optionType", "default")
- body, _ = sjson.Set(body, path+"multiTenant.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"multiTenant.optionType", "global")
- body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenant.ValueBool())
- }
- }
-
- if !data.TrackDefaultGatewayVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "variable")
- body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGatewayVariable.ValueString())
- }
- } else if data.TrackDefaultGateway.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "default")
- body, _ = sjson.Set(body, path+"trackDefaultGateway.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "global")
- body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGateway.ValueBool())
- }
- }
-
- if !data.AdminTechOnFailureVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "variable")
- body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailureVariable.ValueString())
- }
- } else if data.AdminTechOnFailure.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "default")
- body, _ = sjson.Set(body, path+"adminTechOnFailure.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "global")
- body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailure.ValueBool())
- }
- }
-
- if !data.IdleTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"idleTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeoutVariable.ValueString())
- }
- } else if data.IdleTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"idleTimeout.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"idleTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeout.ValueInt64())
- }
- }
-
- if !data.OnDemandEnableVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "variable")
- body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnableVariable.ValueString())
- }
- } else if data.OnDemandEnable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "default")
- body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "global")
- body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnable.ValueBool())
- }
- }
-
- if !data.OnDemandIdleTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeoutVariable.ValueString())
- }
- } else if data.OnDemandIdleTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", 10)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeout.ValueInt64())
- }
- }
-
- if !data.TransportGatewayVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"transportGateway.optionType", "variable")
- body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGatewayVariable.ValueString())
- }
- } else if data.TransportGateway.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"transportGateway.optionType", "default")
- body, _ = sjson.Set(body, path+"transportGateway.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"transportGateway.optionType", "global")
- body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueBool())
- }
- }
-
- if !data.EnhancedAppAwareRoutingVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"epfr.optionType", "variable")
- body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRoutingVariable.ValueString())
- }
- } else if data.EnhancedAppAwareRouting.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"epfr.optionType", "default")
- body, _ = sjson.Set(body, path+"epfr.value", "disabled")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"epfr.optionType", "global")
- body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRouting.ValueString())
- }
- }
-
- if !data.SiteTypesVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"siteType.optionType", "variable")
- body, _ = sjson.Set(body, path+"siteType.value", data.SiteTypesVariable.ValueString())
- }
- } else if data.SiteTypes.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"siteType.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"siteType.optionType", "global")
- var values []string
- data.SiteTypes.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"siteType.value", values)
- }
- }
-
- if !data.AffinityGroupNumberVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "variable")
- body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumberVariable.ValueString())
- }
- } else if data.AffinityGroupNumber.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "global")
- body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumber.ValueInt64())
- }
- }
-
- if !data.AffinityGroupPreferencesVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "variable")
- body, _ = sjson.Set(body, path+"affinityGroupPreference.value", data.AffinityGroupPreferencesVariable.ValueString())
- }
- } else if data.AffinityGroupPreferences.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "global")
- var values []int64
- data.AffinityGroupPreferences.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"affinityGroupPreference.value", values)
- }
- }
-
- if !data.AffinityPreferenceAutoVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "variable")
- body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAutoVariable.ValueString())
- }
- } else if data.AffinityPreferenceAuto.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "default")
- body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "global")
- body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAuto.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"affinityPerVrf", []interface{}{})
- for _, item := range data.AffinityPerVrfs {
- itemBody := ""
-
- if !item.AffinityGroupNumberVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumberVariable.ValueString())
- }
- } else if item.AffinityGroupNumber.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumber.ValueInt64())
- }
- }
-
- if !item.VrfRangeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRangeVariable.ValueString())
- }
- } else if item.VrfRange.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRange.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"affinityPerVrf.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemBasic) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Timezone = types.StringNull()
- data.TimezoneVariable = types.StringNull()
- if t := res.Get(path + "clock.timezone.optionType"); t.Exists() {
- va := res.Get(path + "clock.timezone.value")
- if t.String() == "variable" {
- data.TimezoneVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Timezone = types.StringValue(va.String())
- }
- }
- data.ConfigDescription = types.StringNull()
- data.ConfigDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.ConfigDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ConfigDescription = types.StringValue(va.String())
- }
- }
- data.Location = types.StringNull()
- data.LocationVariable = types.StringNull()
- if t := res.Get(path + "location.optionType"); t.Exists() {
- va := res.Get(path + "location.value")
- if t.String() == "variable" {
- data.LocationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Location = types.StringValue(va.String())
- }
- }
- data.GpsLongitude = types.Float64Null()
- data.GpsLongitudeVariable = types.StringNull()
- if t := res.Get(path + "gpsLocation.longitude.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.longitude.value")
- if t.String() == "variable" {
- data.GpsLongitudeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GpsLongitude = types.Float64Value(va.Float())
- }
- }
- data.GpsLatitude = types.Float64Null()
- data.GpsLatitudeVariable = types.StringNull()
- if t := res.Get(path + "gpsLocation.latitude.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.latitude.value")
- if t.String() == "variable" {
- data.GpsLatitudeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GpsLatitude = types.Float64Value(va.Float())
- }
- }
- data.GpsGeoFencingEnable = types.BoolNull()
-
- if t := res.Get(path + "gpsLocation.geoFencing.enable.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.geoFencing.enable.value")
- if t.String() == "global" {
- data.GpsGeoFencingEnable = types.BoolValue(va.Bool())
- }
- }
- data.GpsGeoFencingRange = types.Int64Null()
- data.GpsGeoFencingRangeVariable = types.StringNull()
- if t := res.Get(path + "gpsLocation.geoFencing.range.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.geoFencing.range.value")
- if t.String() == "variable" {
- data.GpsGeoFencingRangeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GpsGeoFencingRange = types.Int64Value(va.Int())
- }
- }
- data.GpsSmsEnable = types.BoolNull()
-
- if t := res.Get(path + "gpsLocation.geoFencing.sms.enable.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.geoFencing.sms.enable.value")
- if t.String() == "global" {
- data.GpsSmsEnable = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "gpsLocation.geoFencing.sms.mobileNumber"); value.Exists() {
- data.GpsSmsMobileNumbers = make([]SystemBasicGpsSmsMobileNumbers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemBasicGpsSmsMobileNumbers{}
- item.Number = types.StringNull()
- item.NumberVariable = types.StringNull()
- if t := v.Get("number.optionType"); t.Exists() {
- va := v.Get("number.value")
- if t.String() == "variable" {
- item.NumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Number = types.StringValue(va.String())
- }
- }
- data.GpsSmsMobileNumbers = append(data.GpsSmsMobileNumbers, item)
- return true
- })
- }
- data.DeviceGroups = types.SetNull(types.StringType)
- data.DeviceGroupsVariable = types.StringNull()
- if t := res.Get(path + "deviceGroups.optionType"); t.Exists() {
- va := res.Get(path + "deviceGroups.value")
- if t.String() == "variable" {
- data.DeviceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DeviceGroups = helpers.GetStringSet(va.Array())
- }
- }
- data.ControllerGroups = types.SetNull(types.Int64Type)
- data.ControllerGroupsVariable = types.StringNull()
- if t := res.Get(path + "controllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "controllerGroupList.value")
- if t.String() == "variable" {
- data.ControllerGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ControllerGroups = helpers.GetInt64Set(va.Array())
- }
- }
- data.OverlayId = types.Int64Null()
- data.OverlayIdVariable = types.StringNull()
- if t := res.Get(path + "overlayId.optionType"); t.Exists() {
- va := res.Get(path + "overlayId.value")
- if t.String() == "variable" {
- data.OverlayIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OverlayId = types.Int64Value(va.Int())
- }
- }
- data.PortOffset = types.Int64Null()
- data.PortOffsetVariable = types.StringNull()
- if t := res.Get(path + "portOffset.optionType"); t.Exists() {
- va := res.Get(path + "portOffset.value")
- if t.String() == "variable" {
- data.PortOffsetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PortOffset = types.Int64Value(va.Int())
- }
- }
- data.PortHopping = types.BoolNull()
- data.PortHoppingVariable = types.StringNull()
- if t := res.Get(path + "portHop.optionType"); t.Exists() {
- va := res.Get(path + "portHop.value")
- if t.String() == "variable" {
- data.PortHoppingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PortHopping = types.BoolValue(va.Bool())
- }
- }
- data.ControlSessionPps = types.Int64Null()
- data.ControlSessionPpsVariable = types.StringNull()
- if t := res.Get(path + "controlSessionPps.optionType"); t.Exists() {
- va := res.Get(path + "controlSessionPps.value")
- if t.String() == "variable" {
- data.ControlSessionPpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ControlSessionPps = types.Int64Value(va.Int())
- }
- }
- data.TrackTransport = types.BoolNull()
- data.TrackTransportVariable = types.StringNull()
- if t := res.Get(path + "trackTransport.optionType"); t.Exists() {
- va := res.Get(path + "trackTransport.value")
- if t.String() == "variable" {
- data.TrackTransportVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackTransport = types.BoolValue(va.Bool())
- }
- }
- data.TrackInterfaceTag = types.Int64Null()
- data.TrackInterfaceTagVariable = types.StringNull()
- if t := res.Get(path + "trackInterfaceTag.optionType"); t.Exists() {
- va := res.Get(path + "trackInterfaceTag.value")
- if t.String() == "variable" {
- data.TrackInterfaceTagVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackInterfaceTag = types.Int64Value(va.Int())
- }
- }
- data.ConsoleBaudRate = types.StringNull()
- data.ConsoleBaudRateVariable = types.StringNull()
- if t := res.Get(path + "consoleBaudRate.optionType"); t.Exists() {
- va := res.Get(path + "consoleBaudRate.value")
- if t.String() == "variable" {
- data.ConsoleBaudRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ConsoleBaudRate = types.StringValue(va.String())
- }
- }
- data.MaxOmpSessions = types.Int64Null()
- data.MaxOmpSessionsVariable = types.StringNull()
- if t := res.Get(path + "maxOmpSessions.optionType"); t.Exists() {
- va := res.Get(path + "maxOmpSessions.value")
- if t.String() == "variable" {
- data.MaxOmpSessionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MaxOmpSessions = types.Int64Value(va.Int())
- }
- }
- data.MultiTenant = types.BoolNull()
- data.MultiTenantVariable = types.StringNull()
- if t := res.Get(path + "multiTenant.optionType"); t.Exists() {
- va := res.Get(path + "multiTenant.value")
- if t.String() == "variable" {
- data.MultiTenantVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MultiTenant = types.BoolValue(va.Bool())
- }
- }
- data.TrackDefaultGateway = types.BoolNull()
- data.TrackDefaultGatewayVariable = types.StringNull()
- if t := res.Get(path + "trackDefaultGateway.optionType"); t.Exists() {
- va := res.Get(path + "trackDefaultGateway.value")
- if t.String() == "variable" {
- data.TrackDefaultGatewayVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackDefaultGateway = types.BoolValue(va.Bool())
- }
- }
- data.AdminTechOnFailure = types.BoolNull()
- data.AdminTechOnFailureVariable = types.StringNull()
- if t := res.Get(path + "adminTechOnFailure.optionType"); t.Exists() {
- va := res.Get(path + "adminTechOnFailure.value")
- if t.String() == "variable" {
- data.AdminTechOnFailureVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdminTechOnFailure = types.BoolValue(va.Bool())
- }
- }
- data.IdleTimeout = types.Int64Null()
- data.IdleTimeoutVariable = types.StringNull()
- if t := res.Get(path + "idleTimeout.optionType"); t.Exists() {
- va := res.Get(path + "idleTimeout.value")
- if t.String() == "variable" {
- data.IdleTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IdleTimeout = types.Int64Value(va.Int())
- }
- }
- data.OnDemandEnable = types.BoolNull()
- data.OnDemandEnableVariable = types.StringNull()
- if t := res.Get(path + "onDemand.onDemandEnable.optionType"); t.Exists() {
- va := res.Get(path + "onDemand.onDemandEnable.value")
- if t.String() == "variable" {
- data.OnDemandEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OnDemandEnable = types.BoolValue(va.Bool())
- }
- }
- data.OnDemandIdleTimeout = types.Int64Null()
- data.OnDemandIdleTimeoutVariable = types.StringNull()
- if t := res.Get(path + "onDemand.onDemandIdleTimeout.optionType"); t.Exists() {
- va := res.Get(path + "onDemand.onDemandIdleTimeout.value")
- if t.String() == "variable" {
- data.OnDemandIdleTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OnDemandIdleTimeout = types.Int64Value(va.Int())
- }
- }
- data.TransportGateway = types.BoolNull()
- data.TransportGatewayVariable = types.StringNull()
- if t := res.Get(path + "transportGateway.optionType"); t.Exists() {
- va := res.Get(path + "transportGateway.value")
- if t.String() == "variable" {
- data.TransportGatewayVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TransportGateway = types.BoolValue(va.Bool())
- }
- }
- data.EnhancedAppAwareRouting = types.StringNull()
- data.EnhancedAppAwareRoutingVariable = types.StringNull()
- if t := res.Get(path + "epfr.optionType"); t.Exists() {
- va := res.Get(path + "epfr.value")
- if t.String() == "variable" {
- data.EnhancedAppAwareRoutingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.EnhancedAppAwareRouting = types.StringValue(va.String())
- }
- }
- data.SiteTypes = types.SetNull(types.StringType)
- data.SiteTypesVariable = types.StringNull()
- if t := res.Get(path + "siteType.optionType"); t.Exists() {
- va := res.Get(path + "siteType.value")
- if t.String() == "variable" {
- data.SiteTypesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SiteTypes = helpers.GetStringSet(va.Array())
- }
- }
- data.AffinityGroupNumber = types.Int64Null()
- data.AffinityGroupNumberVariable = types.StringNull()
- if t := res.Get(path + "affinityGroupNumber.optionType"); t.Exists() {
- va := res.Get(path + "affinityGroupNumber.value")
- if t.String() == "variable" {
- data.AffinityGroupNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityGroupNumber = types.Int64Value(va.Int())
- }
- }
- data.AffinityGroupPreferences = types.SetNull(types.Int64Type)
- data.AffinityGroupPreferencesVariable = types.StringNull()
- if t := res.Get(path + "affinityGroupPreference.optionType"); t.Exists() {
- va := res.Get(path + "affinityGroupPreference.value")
- if t.String() == "variable" {
- data.AffinityGroupPreferencesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityGroupPreferences = helpers.GetInt64Set(va.Array())
- }
- }
- data.AffinityPreferenceAuto = types.BoolNull()
- data.AffinityPreferenceAutoVariable = types.StringNull()
- if t := res.Get(path + "affinityPreferenceAuto.optionType"); t.Exists() {
- va := res.Get(path + "affinityPreferenceAuto.value")
- if t.String() == "variable" {
- data.AffinityPreferenceAutoVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityPreferenceAuto = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "affinityPerVrf"); value.Exists() {
- data.AffinityPerVrfs = make([]SystemBasicAffinityPerVrfs, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemBasicAffinityPerVrfs{}
- item.AffinityGroupNumber = types.Int64Null()
- item.AffinityGroupNumberVariable = types.StringNull()
- if t := v.Get("affinityGroupNumber.optionType"); t.Exists() {
- va := v.Get("affinityGroupNumber.value")
- if t.String() == "variable" {
- item.AffinityGroupNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AffinityGroupNumber = types.Int64Value(va.Int())
- }
- }
- item.VrfRange = types.StringNull()
- item.VrfRangeVariable = types.StringNull()
- if t := v.Get("vrfRange.optionType"); t.Exists() {
- va := v.Get("vrfRange.value")
- if t.String() == "variable" {
- item.VrfRangeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.VrfRange = types.StringValue(va.String())
- }
- }
- data.AffinityPerVrfs = append(data.AffinityPerVrfs, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemBasic) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Timezone = types.StringNull()
- data.TimezoneVariable = types.StringNull()
- if t := res.Get(path + "clock.timezone.optionType"); t.Exists() {
- va := res.Get(path + "clock.timezone.value")
- if t.String() == "variable" {
- data.TimezoneVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Timezone = types.StringValue(va.String())
- }
- }
- data.ConfigDescription = types.StringNull()
- data.ConfigDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.ConfigDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ConfigDescription = types.StringValue(va.String())
- }
- }
- data.Location = types.StringNull()
- data.LocationVariable = types.StringNull()
- if t := res.Get(path + "location.optionType"); t.Exists() {
- va := res.Get(path + "location.value")
- if t.String() == "variable" {
- data.LocationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Location = types.StringValue(va.String())
- }
- }
- data.GpsLongitude = types.Float64Null()
- data.GpsLongitudeVariable = types.StringNull()
- if t := res.Get(path + "gpsLocation.longitude.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.longitude.value")
- if t.String() == "variable" {
- data.GpsLongitudeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GpsLongitude = types.Float64Value(va.Float())
- }
- }
- data.GpsLatitude = types.Float64Null()
- data.GpsLatitudeVariable = types.StringNull()
- if t := res.Get(path + "gpsLocation.latitude.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.latitude.value")
- if t.String() == "variable" {
- data.GpsLatitudeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GpsLatitude = types.Float64Value(va.Float())
- }
- }
- data.GpsGeoFencingEnable = types.BoolNull()
-
- if t := res.Get(path + "gpsLocation.geoFencing.enable.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.geoFencing.enable.value")
- if t.String() == "global" {
- data.GpsGeoFencingEnable = types.BoolValue(va.Bool())
- }
- }
- data.GpsGeoFencingRange = types.Int64Null()
- data.GpsGeoFencingRangeVariable = types.StringNull()
- if t := res.Get(path + "gpsLocation.geoFencing.range.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.geoFencing.range.value")
- if t.String() == "variable" {
- data.GpsGeoFencingRangeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GpsGeoFencingRange = types.Int64Value(va.Int())
- }
- }
- data.GpsSmsEnable = types.BoolNull()
-
- if t := res.Get(path + "gpsLocation.geoFencing.sms.enable.optionType"); t.Exists() {
- va := res.Get(path + "gpsLocation.geoFencing.sms.enable.value")
- if t.String() == "global" {
- data.GpsSmsEnable = types.BoolValue(va.Bool())
- }
- }
- for i := range data.GpsSmsMobileNumbers {
- keys := [...]string{"number"}
- keyValues := [...]string{data.GpsSmsMobileNumbers[i].Number.ValueString()}
- keyValuesVariables := [...]string{data.GpsSmsMobileNumbers[i].NumberVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "gpsLocation.geoFencing.sms.mobileNumber").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.GpsSmsMobileNumbers[i].Number = types.StringNull()
- data.GpsSmsMobileNumbers[i].NumberVariable = types.StringNull()
- if t := r.Get("number.optionType"); t.Exists() {
- va := r.Get("number.value")
- if t.String() == "variable" {
- data.GpsSmsMobileNumbers[i].NumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GpsSmsMobileNumbers[i].Number = types.StringValue(va.String())
- }
- }
- }
- data.DeviceGroups = types.SetNull(types.StringType)
- data.DeviceGroupsVariable = types.StringNull()
- if t := res.Get(path + "deviceGroups.optionType"); t.Exists() {
- va := res.Get(path + "deviceGroups.value")
- if t.String() == "variable" {
- data.DeviceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DeviceGroups = helpers.GetStringSet(va.Array())
- }
- }
- data.ControllerGroups = types.SetNull(types.Int64Type)
- data.ControllerGroupsVariable = types.StringNull()
- if t := res.Get(path + "controllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "controllerGroupList.value")
- if t.String() == "variable" {
- data.ControllerGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ControllerGroups = helpers.GetInt64Set(va.Array())
- }
- }
- data.OverlayId = types.Int64Null()
- data.OverlayIdVariable = types.StringNull()
- if t := res.Get(path + "overlayId.optionType"); t.Exists() {
- va := res.Get(path + "overlayId.value")
- if t.String() == "variable" {
- data.OverlayIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OverlayId = types.Int64Value(va.Int())
- }
- }
- data.PortOffset = types.Int64Null()
- data.PortOffsetVariable = types.StringNull()
- if t := res.Get(path + "portOffset.optionType"); t.Exists() {
- va := res.Get(path + "portOffset.value")
- if t.String() == "variable" {
- data.PortOffsetVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PortOffset = types.Int64Value(va.Int())
- }
- }
- data.PortHopping = types.BoolNull()
- data.PortHoppingVariable = types.StringNull()
- if t := res.Get(path + "portHop.optionType"); t.Exists() {
- va := res.Get(path + "portHop.value")
- if t.String() == "variable" {
- data.PortHoppingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PortHopping = types.BoolValue(va.Bool())
- }
- }
- data.ControlSessionPps = types.Int64Null()
- data.ControlSessionPpsVariable = types.StringNull()
- if t := res.Get(path + "controlSessionPps.optionType"); t.Exists() {
- va := res.Get(path + "controlSessionPps.value")
- if t.String() == "variable" {
- data.ControlSessionPpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ControlSessionPps = types.Int64Value(va.Int())
- }
- }
- data.TrackTransport = types.BoolNull()
- data.TrackTransportVariable = types.StringNull()
- if t := res.Get(path + "trackTransport.optionType"); t.Exists() {
- va := res.Get(path + "trackTransport.value")
- if t.String() == "variable" {
- data.TrackTransportVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackTransport = types.BoolValue(va.Bool())
- }
- }
- data.TrackInterfaceTag = types.Int64Null()
- data.TrackInterfaceTagVariable = types.StringNull()
- if t := res.Get(path + "trackInterfaceTag.optionType"); t.Exists() {
- va := res.Get(path + "trackInterfaceTag.value")
- if t.String() == "variable" {
- data.TrackInterfaceTagVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackInterfaceTag = types.Int64Value(va.Int())
- }
- }
- data.ConsoleBaudRate = types.StringNull()
- data.ConsoleBaudRateVariable = types.StringNull()
- if t := res.Get(path + "consoleBaudRate.optionType"); t.Exists() {
- va := res.Get(path + "consoleBaudRate.value")
- if t.String() == "variable" {
- data.ConsoleBaudRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ConsoleBaudRate = types.StringValue(va.String())
- }
- }
- data.MaxOmpSessions = types.Int64Null()
- data.MaxOmpSessionsVariable = types.StringNull()
- if t := res.Get(path + "maxOmpSessions.optionType"); t.Exists() {
- va := res.Get(path + "maxOmpSessions.value")
- if t.String() == "variable" {
- data.MaxOmpSessionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MaxOmpSessions = types.Int64Value(va.Int())
- }
- }
- data.MultiTenant = types.BoolNull()
- data.MultiTenantVariable = types.StringNull()
- if t := res.Get(path + "multiTenant.optionType"); t.Exists() {
- va := res.Get(path + "multiTenant.value")
- if t.String() == "variable" {
- data.MultiTenantVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MultiTenant = types.BoolValue(va.Bool())
- }
- }
- data.TrackDefaultGateway = types.BoolNull()
- data.TrackDefaultGatewayVariable = types.StringNull()
- if t := res.Get(path + "trackDefaultGateway.optionType"); t.Exists() {
- va := res.Get(path + "trackDefaultGateway.value")
- if t.String() == "variable" {
- data.TrackDefaultGatewayVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackDefaultGateway = types.BoolValue(va.Bool())
- }
- }
- data.AdminTechOnFailure = types.BoolNull()
- data.AdminTechOnFailureVariable = types.StringNull()
- if t := res.Get(path + "adminTechOnFailure.optionType"); t.Exists() {
- va := res.Get(path + "adminTechOnFailure.value")
- if t.String() == "variable" {
- data.AdminTechOnFailureVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AdminTechOnFailure = types.BoolValue(va.Bool())
- }
- }
- data.IdleTimeout = types.Int64Null()
- data.IdleTimeoutVariable = types.StringNull()
- if t := res.Get(path + "idleTimeout.optionType"); t.Exists() {
- va := res.Get(path + "idleTimeout.value")
- if t.String() == "variable" {
- data.IdleTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IdleTimeout = types.Int64Value(va.Int())
- }
- }
- data.OnDemandEnable = types.BoolNull()
- data.OnDemandEnableVariable = types.StringNull()
- if t := res.Get(path + "onDemand.onDemandEnable.optionType"); t.Exists() {
- va := res.Get(path + "onDemand.onDemandEnable.value")
- if t.String() == "variable" {
- data.OnDemandEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OnDemandEnable = types.BoolValue(va.Bool())
- }
- }
- data.OnDemandIdleTimeout = types.Int64Null()
- data.OnDemandIdleTimeoutVariable = types.StringNull()
- if t := res.Get(path + "onDemand.onDemandIdleTimeout.optionType"); t.Exists() {
- va := res.Get(path + "onDemand.onDemandIdleTimeout.value")
- if t.String() == "variable" {
- data.OnDemandIdleTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.OnDemandIdleTimeout = types.Int64Value(va.Int())
- }
- }
- data.TransportGateway = types.BoolNull()
- data.TransportGatewayVariable = types.StringNull()
- if t := res.Get(path + "transportGateway.optionType"); t.Exists() {
- va := res.Get(path + "transportGateway.value")
- if t.String() == "variable" {
- data.TransportGatewayVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TransportGateway = types.BoolValue(va.Bool())
- }
- }
- data.EnhancedAppAwareRouting = types.StringNull()
- data.EnhancedAppAwareRoutingVariable = types.StringNull()
- if t := res.Get(path + "epfr.optionType"); t.Exists() {
- va := res.Get(path + "epfr.value")
- if t.String() == "variable" {
- data.EnhancedAppAwareRoutingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.EnhancedAppAwareRouting = types.StringValue(va.String())
- }
- }
- data.SiteTypes = types.SetNull(types.StringType)
- data.SiteTypesVariable = types.StringNull()
- if t := res.Get(path + "siteType.optionType"); t.Exists() {
- va := res.Get(path + "siteType.value")
- if t.String() == "variable" {
- data.SiteTypesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SiteTypes = helpers.GetStringSet(va.Array())
- }
- }
- data.AffinityGroupNumber = types.Int64Null()
- data.AffinityGroupNumberVariable = types.StringNull()
- if t := res.Get(path + "affinityGroupNumber.optionType"); t.Exists() {
- va := res.Get(path + "affinityGroupNumber.value")
- if t.String() == "variable" {
- data.AffinityGroupNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityGroupNumber = types.Int64Value(va.Int())
- }
- }
- data.AffinityGroupPreferences = types.SetNull(types.Int64Type)
- data.AffinityGroupPreferencesVariable = types.StringNull()
- if t := res.Get(path + "affinityGroupPreference.optionType"); t.Exists() {
- va := res.Get(path + "affinityGroupPreference.value")
- if t.String() == "variable" {
- data.AffinityGroupPreferencesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityGroupPreferences = helpers.GetInt64Set(va.Array())
- }
- }
- data.AffinityPreferenceAuto = types.BoolNull()
- data.AffinityPreferenceAutoVariable = types.StringNull()
- if t := res.Get(path + "affinityPreferenceAuto.optionType"); t.Exists() {
- va := res.Get(path + "affinityPreferenceAuto.value")
- if t.String() == "variable" {
- data.AffinityPreferenceAutoVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityPreferenceAuto = types.BoolValue(va.Bool())
- }
- }
- for i := range data.AffinityPerVrfs {
- keys := [...]string{"affinityGroupNumber"}
- keyValues := [...]string{strconv.FormatInt(data.AffinityPerVrfs[i].AffinityGroupNumber.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.AffinityPerVrfs[i].AffinityGroupNumberVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "affinityPerVrf").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.AffinityPerVrfs[i].AffinityGroupNumber = types.Int64Null()
- data.AffinityPerVrfs[i].AffinityGroupNumberVariable = types.StringNull()
- if t := r.Get("affinityGroupNumber.optionType"); t.Exists() {
- va := r.Get("affinityGroupNumber.value")
- if t.String() == "variable" {
- data.AffinityPerVrfs[i].AffinityGroupNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityPerVrfs[i].AffinityGroupNumber = types.Int64Value(va.Int())
- }
- }
- data.AffinityPerVrfs[i].VrfRange = types.StringNull()
- data.AffinityPerVrfs[i].VrfRangeVariable = types.StringNull()
- if t := r.Get("vrfRange.optionType"); t.Exists() {
- va := r.Get("vrfRange.value")
- if t.String() == "variable" {
- data.AffinityPerVrfs[i].VrfRangeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AffinityPerVrfs[i].VrfRange = types.StringValue(va.String())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemBasic) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.Timezone.IsNull() {
- return false
- }
- if !data.TimezoneVariable.IsNull() {
- return false
- }
- if !data.ConfigDescription.IsNull() {
- return false
- }
- if !data.ConfigDescriptionVariable.IsNull() {
- return false
- }
- if !data.Location.IsNull() {
- return false
- }
- if !data.LocationVariable.IsNull() {
- return false
- }
- if !data.GpsLongitude.IsNull() {
- return false
- }
- if !data.GpsLongitudeVariable.IsNull() {
- return false
- }
- if !data.GpsLatitude.IsNull() {
- return false
- }
- if !data.GpsLatitudeVariable.IsNull() {
- return false
- }
- if !data.GpsGeoFencingEnable.IsNull() {
- return false
- }
- if !data.GpsGeoFencingRange.IsNull() {
- return false
- }
- if !data.GpsGeoFencingRangeVariable.IsNull() {
- return false
- }
- if !data.GpsSmsEnable.IsNull() {
- return false
- }
- if len(data.GpsSmsMobileNumbers) > 0 {
- return false
- }
- if !data.DeviceGroups.IsNull() {
- return false
- }
- if !data.DeviceGroupsVariable.IsNull() {
- return false
- }
- if !data.ControllerGroups.IsNull() {
- return false
- }
- if !data.ControllerGroupsVariable.IsNull() {
- return false
- }
- if !data.OverlayId.IsNull() {
- return false
- }
- if !data.OverlayIdVariable.IsNull() {
- return false
- }
- if !data.PortOffset.IsNull() {
- return false
- }
- if !data.PortOffsetVariable.IsNull() {
- return false
- }
- if !data.PortHopping.IsNull() {
- return false
- }
- if !data.PortHoppingVariable.IsNull() {
- return false
- }
- if !data.ControlSessionPps.IsNull() {
- return false
- }
- if !data.ControlSessionPpsVariable.IsNull() {
- return false
- }
- if !data.TrackTransport.IsNull() {
- return false
- }
- if !data.TrackTransportVariable.IsNull() {
- return false
- }
- if !data.TrackInterfaceTag.IsNull() {
- return false
- }
- if !data.TrackInterfaceTagVariable.IsNull() {
- return false
- }
- if !data.ConsoleBaudRate.IsNull() {
- return false
- }
- if !data.ConsoleBaudRateVariable.IsNull() {
- return false
- }
- if !data.MaxOmpSessions.IsNull() {
- return false
- }
- if !data.MaxOmpSessionsVariable.IsNull() {
- return false
- }
- if !data.MultiTenant.IsNull() {
- return false
- }
- if !data.MultiTenantVariable.IsNull() {
- return false
- }
- if !data.TrackDefaultGateway.IsNull() {
- return false
- }
- if !data.TrackDefaultGatewayVariable.IsNull() {
- return false
- }
- if !data.AdminTechOnFailure.IsNull() {
- return false
- }
- if !data.AdminTechOnFailureVariable.IsNull() {
- return false
- }
- if !data.IdleTimeout.IsNull() {
- return false
- }
- if !data.IdleTimeoutVariable.IsNull() {
- return false
- }
- if !data.OnDemandEnable.IsNull() {
- return false
- }
- if !data.OnDemandEnableVariable.IsNull() {
- return false
- }
- if !data.OnDemandIdleTimeout.IsNull() {
- return false
- }
- if !data.OnDemandIdleTimeoutVariable.IsNull() {
- return false
- }
- if !data.TransportGateway.IsNull() {
- return false
- }
- if !data.TransportGatewayVariable.IsNull() {
- return false
- }
- if !data.EnhancedAppAwareRouting.IsNull() {
- return false
- }
- if !data.EnhancedAppAwareRoutingVariable.IsNull() {
- return false
- }
- if !data.SiteTypes.IsNull() {
- return false
- }
- if !data.SiteTypesVariable.IsNull() {
- return false
- }
- if !data.AffinityGroupNumber.IsNull() {
- return false
- }
- if !data.AffinityGroupNumberVariable.IsNull() {
- return false
- }
- if !data.AffinityGroupPreferences.IsNull() {
- return false
- }
- if !data.AffinityGroupPreferencesVariable.IsNull() {
- return false
- }
- if !data.AffinityPreferenceAuto.IsNull() {
- return false
- }
- if !data.AffinityPreferenceAutoVariable.IsNull() {
- return false
- }
- if len(data.AffinityPerVrfs) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_bfd_feature.go b/internal/provider/model_sdwan_system_bfd_feature.go
new file mode 100644
index 000000000..7bcb17d3c
--- /dev/null
+++ b/internal/provider/model_sdwan_system_bfd_feature.go
@@ -0,0 +1,480 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemBFD 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"`
+ Multiplier types.Int64 `tfsdk:"multiplier"`
+ MultiplierVariable types.String `tfsdk:"multiplier_variable"`
+ PollInterval types.Int64 `tfsdk:"poll_interval"`
+ PollIntervalVariable types.String `tfsdk:"poll_interval_variable"`
+ DefaultDscp types.Int64 `tfsdk:"default_dscp"`
+ DefaultDscpVariable types.String `tfsdk:"default_dscp_variable"`
+ Colors []SystemBFDColors `tfsdk:"colors"`
+}
+
+type SystemBFDColors struct {
+ Color types.String `tfsdk:"color"`
+ ColorVariable types.String `tfsdk:"color_variable"`
+ HelloInterval types.Int64 `tfsdk:"hello_interval"`
+ HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
+ Multiplier types.Int64 `tfsdk:"multiplier"`
+ MultiplierVariable types.String `tfsdk:"multiplier_variable"`
+ PmtuDiscovery types.Bool `tfsdk:"pmtu_discovery"`
+ PmtuDiscoveryVariable types.String `tfsdk:"pmtu_discovery_variable"`
+ Dscp types.Int64 `tfsdk:"dscp"`
+ DscpVariable types.String `tfsdk:"dscp_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemBFD) getModel() string {
+ return "system_bfd"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemBFD) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/bfd", 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 SystemBFD) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.MultiplierVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multiplier.optionType", "variable")
+ body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString())
+ }
+ } else if data.Multiplier.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multiplier.optionType", "default")
+ body, _ = sjson.Set(body, path+"multiplier.value", 6)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"multiplier.optionType", "global")
+ body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64())
+ }
+ }
+
+ if !data.PollIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"pollInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"pollInterval.value", data.PollIntervalVariable.ValueString())
+ }
+ } else if data.PollInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"pollInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"pollInterval.value", 600000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"pollInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"pollInterval.value", data.PollInterval.ValueInt64())
+ }
+ }
+
+ if !data.DefaultDscpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultDscp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscpVariable.ValueString())
+ }
+ } else if data.DefaultDscp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultDscp.optionType", "default")
+ body, _ = sjson.Set(body, path+"defaultDscp.value", 48)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultDscp.optionType", "global")
+ body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscp.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"colors", []interface{}{})
+ for _, item := range data.Colors {
+ itemBody := ""
+
+ if !item.ColorVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "color.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "color.value", item.ColorVariable.ValueString())
+ }
+ } else if !item.Color.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "color.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString())
+ }
+ }
+
+ if !item.HelloIntervalVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloIntervalVariable.ValueString())
+ }
+ } else if item.HelloInterval.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "helloInterval.value", 1000)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloInterval.ValueInt64())
+ }
+ }
+
+ if !item.MultiplierVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.MultiplierVariable.ValueString())
+ }
+ } else if item.Multiplier.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "multiplier.value", 7)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.Multiplier.ValueInt64())
+ }
+ }
+
+ if !item.PmtuDiscoveryVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscoveryVariable.ValueString())
+ }
+ } else if item.PmtuDiscovery.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscovery.ValueBool())
+ }
+ }
+
+ if !item.DscpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "dscp.value", item.DscpVariable.ValueString())
+ }
+ } else if item.Dscp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "dscp.value", 48)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "dscp.value", item.Dscp.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"colors.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemBFD) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Multiplier = types.Int64Null()
+ data.MultiplierVariable = types.StringNull()
+ if t := res.Get(path + "multiplier.optionType"); t.Exists() {
+ va := res.Get(path + "multiplier.value")
+ if t.String() == "variable" {
+ data.MultiplierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Multiplier = types.Int64Value(va.Int())
+ }
+ }
+ data.PollInterval = types.Int64Null()
+ data.PollIntervalVariable = types.StringNull()
+ if t := res.Get(path + "pollInterval.optionType"); t.Exists() {
+ va := res.Get(path + "pollInterval.value")
+ if t.String() == "variable" {
+ data.PollIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PollInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultDscp = types.Int64Null()
+ data.DefaultDscpVariable = types.StringNull()
+ if t := res.Get(path + "defaultDscp.optionType"); t.Exists() {
+ va := res.Get(path + "defaultDscp.value")
+ if t.String() == "variable" {
+ data.DefaultDscpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultDscp = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "colors"); value.Exists() {
+ data.Colors = make([]SystemBFDColors, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemBFDColors{}
+ item.Color = types.StringNull()
+ item.ColorVariable = types.StringNull()
+ if t := v.Get("color.optionType"); t.Exists() {
+ va := v.Get("color.value")
+ if t.String() == "variable" {
+ item.ColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Color = types.StringValue(va.String())
+ }
+ }
+ item.HelloInterval = types.Int64Null()
+ item.HelloIntervalVariable = types.StringNull()
+ if t := v.Get("helloInterval.optionType"); t.Exists() {
+ va := v.Get("helloInterval.value")
+ if t.String() == "variable" {
+ item.HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ item.Multiplier = types.Int64Null()
+ item.MultiplierVariable = types.StringNull()
+ if t := v.Get("multiplier.optionType"); t.Exists() {
+ va := v.Get("multiplier.value")
+ if t.String() == "variable" {
+ item.MultiplierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Multiplier = types.Int64Value(va.Int())
+ }
+ }
+ item.PmtuDiscovery = types.BoolNull()
+ item.PmtuDiscoveryVariable = types.StringNull()
+ if t := v.Get("pmtuDiscovery.optionType"); t.Exists() {
+ va := v.Get("pmtuDiscovery.value")
+ if t.String() == "variable" {
+ item.PmtuDiscoveryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PmtuDiscovery = types.BoolValue(va.Bool())
+ }
+ }
+ item.Dscp = types.Int64Null()
+ item.DscpVariable = types.StringNull()
+ if t := v.Get("dscp.optionType"); t.Exists() {
+ va := v.Get("dscp.value")
+ if t.String() == "variable" {
+ item.DscpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Dscp = types.Int64Value(va.Int())
+ }
+ }
+ data.Colors = append(data.Colors, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemBFD) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Multiplier = types.Int64Null()
+ data.MultiplierVariable = types.StringNull()
+ if t := res.Get(path + "multiplier.optionType"); t.Exists() {
+ va := res.Get(path + "multiplier.value")
+ if t.String() == "variable" {
+ data.MultiplierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Multiplier = types.Int64Value(va.Int())
+ }
+ }
+ data.PollInterval = types.Int64Null()
+ data.PollIntervalVariable = types.StringNull()
+ if t := res.Get(path + "pollInterval.optionType"); t.Exists() {
+ va := res.Get(path + "pollInterval.value")
+ if t.String() == "variable" {
+ data.PollIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PollInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultDscp = types.Int64Null()
+ data.DefaultDscpVariable = types.StringNull()
+ if t := res.Get(path + "defaultDscp.optionType"); t.Exists() {
+ va := res.Get(path + "defaultDscp.value")
+ if t.String() == "variable" {
+ data.DefaultDscpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultDscp = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Colors {
+ keys := [...]string{"color"}
+ keyValues := [...]string{data.Colors[i].Color.ValueString()}
+ keyValuesVariables := [...]string{data.Colors[i].ColorVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "colors").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Colors[i].Color = types.StringNull()
+ data.Colors[i].ColorVariable = types.StringNull()
+ if t := r.Get("color.optionType"); t.Exists() {
+ va := r.Get("color.value")
+ if t.String() == "variable" {
+ data.Colors[i].ColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Colors[i].Color = types.StringValue(va.String())
+ }
+ }
+ data.Colors[i].HelloInterval = types.Int64Null()
+ data.Colors[i].HelloIntervalVariable = types.StringNull()
+ if t := r.Get("helloInterval.optionType"); t.Exists() {
+ va := r.Get("helloInterval.value")
+ if t.String() == "variable" {
+ data.Colors[i].HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Colors[i].HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Colors[i].Multiplier = types.Int64Null()
+ data.Colors[i].MultiplierVariable = types.StringNull()
+ if t := r.Get("multiplier.optionType"); t.Exists() {
+ va := r.Get("multiplier.value")
+ if t.String() == "variable" {
+ data.Colors[i].MultiplierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Colors[i].Multiplier = types.Int64Value(va.Int())
+ }
+ }
+ data.Colors[i].PmtuDiscovery = types.BoolNull()
+ data.Colors[i].PmtuDiscoveryVariable = types.StringNull()
+ if t := r.Get("pmtuDiscovery.optionType"); t.Exists() {
+ va := r.Get("pmtuDiscovery.value")
+ if t.String() == "variable" {
+ data.Colors[i].PmtuDiscoveryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Colors[i].PmtuDiscovery = types.BoolValue(va.Bool())
+ }
+ }
+ data.Colors[i].Dscp = types.Int64Null()
+ data.Colors[i].DscpVariable = types.StringNull()
+ if t := r.Get("dscp.optionType"); t.Exists() {
+ va := r.Get("dscp.value")
+ if t.String() == "variable" {
+ data.Colors[i].DscpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Colors[i].Dscp = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemBFD) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.Multiplier.IsNull() {
+ return false
+ }
+ if !data.MultiplierVariable.IsNull() {
+ return false
+ }
+ if !data.PollInterval.IsNull() {
+ return false
+ }
+ if !data.PollIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultDscp.IsNull() {
+ return false
+ }
+ if !data.DefaultDscpVariable.IsNull() {
+ return false
+ }
+ if len(data.Colors) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_bfd_profile_parcel.go b/internal/provider/model_sdwan_system_bfd_profile_parcel.go
deleted file mode 100644
index d00188549..000000000
--- a/internal/provider/model_sdwan_system_bfd_profile_parcel.go
+++ /dev/null
@@ -1,477 +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/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemBFD 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"`
- Multiplier types.Int64 `tfsdk:"multiplier"`
- MultiplierVariable types.String `tfsdk:"multiplier_variable"`
- PollInterval types.Int64 `tfsdk:"poll_interval"`
- PollIntervalVariable types.String `tfsdk:"poll_interval_variable"`
- DefaultDscp types.Int64 `tfsdk:"default_dscp"`
- DefaultDscpVariable types.String `tfsdk:"default_dscp_variable"`
- Colors []SystemBFDColors `tfsdk:"colors"`
-}
-
-type SystemBFDColors struct {
- Color types.String `tfsdk:"color"`
- ColorVariable types.String `tfsdk:"color_variable"`
- HelloInterval types.Int64 `tfsdk:"hello_interval"`
- HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
- Multiplier types.Int64 `tfsdk:"multiplier"`
- MultiplierVariable types.String `tfsdk:"multiplier_variable"`
- PmtuDiscovery types.Bool `tfsdk:"pmtu_discovery"`
- PmtuDiscoveryVariable types.String `tfsdk:"pmtu_discovery_variable"`
- Dscp types.Int64 `tfsdk:"dscp"`
- DscpVariable types.String `tfsdk:"dscp_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemBFD) getModel() string {
- return "system_bfd"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemBFD) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/bfd", 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 SystemBFD) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.MultiplierVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"multiplier.optionType", "variable")
- body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString())
- }
- } else if data.Multiplier.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"multiplier.optionType", "default")
- body, _ = sjson.Set(body, path+"multiplier.value", 6)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"multiplier.optionType", "global")
- body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64())
- }
- }
-
- if !data.PollIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"pollInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"pollInterval.value", data.PollIntervalVariable.ValueString())
- }
- } else if data.PollInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"pollInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"pollInterval.value", 600000)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"pollInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"pollInterval.value", data.PollInterval.ValueInt64())
- }
- }
-
- if !data.DefaultDscpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"defaultDscp.optionType", "variable")
- body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscpVariable.ValueString())
- }
- } else if data.DefaultDscp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"defaultDscp.optionType", "default")
- body, _ = sjson.Set(body, path+"defaultDscp.value", 48)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"defaultDscp.optionType", "global")
- body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscp.ValueInt64())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"colors", []interface{}{})
- for _, item := range data.Colors {
- itemBody := ""
-
- if !item.ColorVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "color.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "color.value", item.ColorVariable.ValueString())
- }
- } else if !item.Color.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "color.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString())
- }
- }
-
- if !item.HelloIntervalVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloIntervalVariable.ValueString())
- }
- } else if item.HelloInterval.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "helloInterval.value", 1000)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloInterval.ValueInt64())
- }
- }
-
- if !item.MultiplierVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.MultiplierVariable.ValueString())
- }
- } else if item.Multiplier.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "multiplier.value", 7)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.Multiplier.ValueInt64())
- }
- }
-
- if !item.PmtuDiscoveryVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscoveryVariable.ValueString())
- }
- } else if item.PmtuDiscovery.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscovery.ValueBool())
- }
- }
-
- if !item.DscpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "dscp.value", item.DscpVariable.ValueString())
- }
- } else if item.Dscp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "dscp.value", 48)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "dscp.value", item.Dscp.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"colors.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemBFD) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Multiplier = types.Int64Null()
- data.MultiplierVariable = types.StringNull()
- if t := res.Get(path + "multiplier.optionType"); t.Exists() {
- va := res.Get(path + "multiplier.value")
- if t.String() == "variable" {
- data.MultiplierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Multiplier = types.Int64Value(va.Int())
- }
- }
- data.PollInterval = types.Int64Null()
- data.PollIntervalVariable = types.StringNull()
- if t := res.Get(path + "pollInterval.optionType"); t.Exists() {
- va := res.Get(path + "pollInterval.value")
- if t.String() == "variable" {
- data.PollIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PollInterval = types.Int64Value(va.Int())
- }
- }
- data.DefaultDscp = types.Int64Null()
- data.DefaultDscpVariable = types.StringNull()
- if t := res.Get(path + "defaultDscp.optionType"); t.Exists() {
- va := res.Get(path + "defaultDscp.value")
- if t.String() == "variable" {
- data.DefaultDscpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DefaultDscp = types.Int64Value(va.Int())
- }
- }
- if value := res.Get(path + "colors"); value.Exists() {
- data.Colors = make([]SystemBFDColors, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemBFDColors{}
- item.Color = types.StringNull()
- item.ColorVariable = types.StringNull()
- if t := v.Get("color.optionType"); t.Exists() {
- va := v.Get("color.value")
- if t.String() == "variable" {
- item.ColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Color = types.StringValue(va.String())
- }
- }
- item.HelloInterval = types.Int64Null()
- item.HelloIntervalVariable = types.StringNull()
- if t := v.Get("helloInterval.optionType"); t.Exists() {
- va := v.Get("helloInterval.value")
- if t.String() == "variable" {
- item.HelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HelloInterval = types.Int64Value(va.Int())
- }
- }
- item.Multiplier = types.Int64Null()
- item.MultiplierVariable = types.StringNull()
- if t := v.Get("multiplier.optionType"); t.Exists() {
- va := v.Get("multiplier.value")
- if t.String() == "variable" {
- item.MultiplierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Multiplier = types.Int64Value(va.Int())
- }
- }
- item.PmtuDiscovery = types.BoolNull()
- item.PmtuDiscoveryVariable = types.StringNull()
- if t := v.Get("pmtuDiscovery.optionType"); t.Exists() {
- va := v.Get("pmtuDiscovery.value")
- if t.String() == "variable" {
- item.PmtuDiscoveryVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.PmtuDiscovery = types.BoolValue(va.Bool())
- }
- }
- item.Dscp = types.Int64Null()
- item.DscpVariable = types.StringNull()
- if t := v.Get("dscp.optionType"); t.Exists() {
- va := v.Get("dscp.value")
- if t.String() == "variable" {
- item.DscpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Dscp = types.Int64Value(va.Int())
- }
- }
- data.Colors = append(data.Colors, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemBFD) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Multiplier = types.Int64Null()
- data.MultiplierVariable = types.StringNull()
- if t := res.Get(path + "multiplier.optionType"); t.Exists() {
- va := res.Get(path + "multiplier.value")
- if t.String() == "variable" {
- data.MultiplierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Multiplier = types.Int64Value(va.Int())
- }
- }
- data.PollInterval = types.Int64Null()
- data.PollIntervalVariable = types.StringNull()
- if t := res.Get(path + "pollInterval.optionType"); t.Exists() {
- va := res.Get(path + "pollInterval.value")
- if t.String() == "variable" {
- data.PollIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PollInterval = types.Int64Value(va.Int())
- }
- }
- data.DefaultDscp = types.Int64Null()
- data.DefaultDscpVariable = types.StringNull()
- if t := res.Get(path + "defaultDscp.optionType"); t.Exists() {
- va := res.Get(path + "defaultDscp.value")
- if t.String() == "variable" {
- data.DefaultDscpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DefaultDscp = types.Int64Value(va.Int())
- }
- }
- for i := range data.Colors {
- keys := [...]string{"color"}
- keyValues := [...]string{data.Colors[i].Color.ValueString()}
- keyValuesVariables := [...]string{data.Colors[i].ColorVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "colors").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Colors[i].Color = types.StringNull()
- data.Colors[i].ColorVariable = types.StringNull()
- if t := r.Get("color.optionType"); t.Exists() {
- va := r.Get("color.value")
- if t.String() == "variable" {
- data.Colors[i].ColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Colors[i].Color = types.StringValue(va.String())
- }
- }
- data.Colors[i].HelloInterval = types.Int64Null()
- data.Colors[i].HelloIntervalVariable = types.StringNull()
- if t := r.Get("helloInterval.optionType"); t.Exists() {
- va := r.Get("helloInterval.value")
- if t.String() == "variable" {
- data.Colors[i].HelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Colors[i].HelloInterval = types.Int64Value(va.Int())
- }
- }
- data.Colors[i].Multiplier = types.Int64Null()
- data.Colors[i].MultiplierVariable = types.StringNull()
- if t := r.Get("multiplier.optionType"); t.Exists() {
- va := r.Get("multiplier.value")
- if t.String() == "variable" {
- data.Colors[i].MultiplierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Colors[i].Multiplier = types.Int64Value(va.Int())
- }
- }
- data.Colors[i].PmtuDiscovery = types.BoolNull()
- data.Colors[i].PmtuDiscoveryVariable = types.StringNull()
- if t := r.Get("pmtuDiscovery.optionType"); t.Exists() {
- va := r.Get("pmtuDiscovery.value")
- if t.String() == "variable" {
- data.Colors[i].PmtuDiscoveryVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Colors[i].PmtuDiscovery = types.BoolValue(va.Bool())
- }
- }
- data.Colors[i].Dscp = types.Int64Null()
- data.Colors[i].DscpVariable = types.StringNull()
- if t := r.Get("dscp.optionType"); t.Exists() {
- va := r.Get("dscp.value")
- if t.String() == "variable" {
- data.Colors[i].DscpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Colors[i].Dscp = types.Int64Value(va.Int())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemBFD) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.Multiplier.IsNull() {
- return false
- }
- if !data.MultiplierVariable.IsNull() {
- return false
- }
- if !data.PollInterval.IsNull() {
- return false
- }
- if !data.PollIntervalVariable.IsNull() {
- return false
- }
- if !data.DefaultDscp.IsNull() {
- return false
- }
- if !data.DefaultDscpVariable.IsNull() {
- return false
- }
- if len(data.Colors) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go b/internal/provider/model_sdwan_system_flexible_port_speed_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go
rename to internal/provider/model_sdwan_system_flexible_port_speed_feature.go
diff --git a/internal/provider/model_sdwan_system_global_profile_parcel.go b/internal/provider/model_sdwan_system_global_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_system_global_profile_parcel.go
rename to internal/provider/model_sdwan_system_global_feature.go
diff --git a/internal/provider/model_sdwan_system_ipv4_device_access_feature.go b/internal/provider/model_sdwan_system_ipv4_device_access_feature.go
new file mode 100644
index 000000000..4a50405fd
--- /dev/null
+++ b/internal/provider/model_sdwan_system_ipv4_device_access_feature.go
@@ -0,0 +1,423 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemIPv4DeviceAccess 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"`
+ DefaultAction types.String `tfsdk:"default_action"`
+ Sequences []SystemIPv4DeviceAccessSequences `tfsdk:"sequences"`
+}
+
+type SystemIPv4DeviceAccessSequences struct {
+ Id types.Int64 `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ BaseAction types.String `tfsdk:"base_action"`
+ DeviceAccessPort types.Int64 `tfsdk:"device_access_port"`
+ DestinationDataPrefixListId types.String `tfsdk:"destination_data_prefix_list_id"`
+ DestinationIpPrefixList types.Set `tfsdk:"destination_ip_prefix_list"`
+ DestinationIpPrefixListVariable types.String `tfsdk:"destination_ip_prefix_list_variable"`
+ SourcePorts types.Set `tfsdk:"source_ports"`
+ SourceDataPrefixListId types.String `tfsdk:"source_data_prefix_list_id"`
+ SourceIpPrefixList types.Set `tfsdk:"source_ip_prefix_list"`
+ SourceIpPrefixListVariable types.String `tfsdk:"source_ip_prefix_list_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemIPv4DeviceAccess) getModel() string {
+ return "system_ipv4_device_access"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemIPv4DeviceAccess) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/ipv4-device-access-policy", 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 SystemIPv4DeviceAccess) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if data.DefaultAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "default")
+ body, _ = sjson.Set(body, path+"defaultAction.value", "drop")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "global")
+ body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"sequences", []interface{}{})
+ for _, item := range data.Sequences {
+ itemBody := ""
+ if !item.Id.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64())
+ }
+ }
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString())
+ }
+ }
+ if !item.BaseAction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString())
+ }
+ }
+ if !item.DeviceAccessPort.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64())
+ }
+ }
+ if !item.DestinationDataPrefixListId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString())
+ }
+ }
+
+ if !item.DestinationIpPrefixListVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString())
+ }
+ } else if !item.DestinationIpPrefixList.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global")
+ var values []string
+ item.DestinationIpPrefixList.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values)
+ }
+ }
+ if !item.SourcePorts.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global")
+ var values []int64
+ item.SourcePorts.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values)
+ }
+ }
+ if !item.SourceDataPrefixListId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString())
+ }
+ }
+
+ if !item.SourceIpPrefixListVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString())
+ }
+ } else if !item.SourceIpPrefixList.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global")
+ var values []string
+ item.SourceIpPrefixList.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemIPv4DeviceAccess) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "sequences"); value.Exists() {
+ data.Sequences = make([]SystemIPv4DeviceAccessSequences, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemIPv4DeviceAccessSequences{}
+ item.Id = types.Int64Null()
+
+ if t := v.Get("sequenceId.optionType"); t.Exists() {
+ va := v.Get("sequenceId.value")
+ if t.String() == "global" {
+ item.Id = types.Int64Value(va.Int())
+ }
+ }
+ item.Name = types.StringNull()
+
+ if t := v.Get("sequenceName.optionType"); t.Exists() {
+ va := v.Get("sequenceName.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.BaseAction = types.StringNull()
+
+ if t := v.Get("baseAction.optionType"); t.Exists() {
+ va := v.Get("baseAction.value")
+ if t.String() == "global" {
+ item.BaseAction = types.StringValue(va.String())
+ }
+ }
+ item.DeviceAccessPort = types.Int64Null()
+
+ if t := v.Get("matchEntries.destinationPort.optionType"); t.Exists() {
+ va := v.Get("matchEntries.destinationPort.value")
+ if t.String() == "global" {
+ item.DeviceAccessPort = types.Int64Value(va.Int())
+ }
+ }
+ item.DestinationDataPrefixListId = types.StringNull()
+
+ if t := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
+ va := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
+ if t.String() == "global" {
+ item.DestinationDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ item.DestinationIpPrefixList = types.SetNull(types.StringType)
+ item.DestinationIpPrefixListVariable = types.StringNull()
+ if t := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
+ va := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
+ if t.String() == "variable" {
+ item.DestinationIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.DestinationIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.SourcePorts = types.SetNull(types.Int64Type)
+
+ if t := v.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
+ va := v.Get("matchEntries.sourcePorts.value")
+ if t.String() == "global" {
+ item.SourcePorts = helpers.GetInt64Set(va.Array())
+ }
+ }
+ item.SourceDataPrefixListId = types.StringNull()
+
+ if t := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
+ va := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
+ if t.String() == "global" {
+ item.SourceDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ item.SourceIpPrefixList = types.SetNull(types.StringType)
+ item.SourceIpPrefixListVariable = types.StringNull()
+ if t := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
+ va := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
+ if t.String() == "variable" {
+ item.SourceIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Sequences = append(data.Sequences, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemIPv4DeviceAccess) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Sequences {
+ keys := [...]string{"sequenceId"}
+ keyValues := [...]string{strconv.FormatInt(data.Sequences[i].Id.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "sequences").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].Id = types.Int64Null()
+
+ if t := r.Get("sequenceId.optionType"); t.Exists() {
+ va := r.Get("sequenceId.value")
+ if t.String() == "global" {
+ data.Sequences[i].Id = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Name = types.StringNull()
+
+ if t := r.Get("sequenceName.optionType"); t.Exists() {
+ va := r.Get("sequenceName.value")
+ if t.String() == "global" {
+ data.Sequences[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].BaseAction = types.StringNull()
+
+ if t := r.Get("baseAction.optionType"); t.Exists() {
+ va := r.Get("baseAction.value")
+ if t.String() == "global" {
+ data.Sequences[i].BaseAction = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].DeviceAccessPort = types.Int64Null()
+
+ if t := r.Get("matchEntries.destinationPort.optionType"); t.Exists() {
+ va := r.Get("matchEntries.destinationPort.value")
+ if t.String() == "global" {
+ data.Sequences[i].DeviceAccessPort = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].DestinationDataPrefixListId = types.StringNull()
+
+ if t := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
+ va := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].DestinationDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].DestinationIpPrefixList = types.SetNull(types.StringType)
+ data.Sequences[i].DestinationIpPrefixListVariable = types.StringNull()
+ if t := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
+ va := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
+ if t.String() == "variable" {
+ data.Sequences[i].DestinationIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Sequences[i].DestinationIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Sequences[i].SourcePorts = types.SetNull(types.Int64Type)
+
+ if t := r.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
+ va := r.Get("matchEntries.sourcePorts.value")
+ if t.String() == "global" {
+ data.Sequences[i].SourcePorts = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.Sequences[i].SourceDataPrefixListId = types.StringNull()
+
+ if t := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
+ va := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].SourceDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].SourceIpPrefixList = types.SetNull(types.StringType)
+ data.Sequences[i].SourceIpPrefixListVariable = types.StringNull()
+ if t := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
+ va := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
+ if t.String() == "variable" {
+ data.Sequences[i].SourceIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Sequences[i].SourceIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemIPv4DeviceAccess) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.DefaultAction.IsNull() {
+ return false
+ }
+ if len(data.Sequences) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go b/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go
deleted file mode 100644
index cf42210a0..000000000
--- a/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go
+++ /dev/null
@@ -1,420 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemIPv4DeviceAccess 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"`
- DefaultAction types.String `tfsdk:"default_action"`
- Sequences []SystemIPv4DeviceAccessSequences `tfsdk:"sequences"`
-}
-
-type SystemIPv4DeviceAccessSequences struct {
- Id types.Int64 `tfsdk:"id"`
- Name types.String `tfsdk:"name"`
- BaseAction types.String `tfsdk:"base_action"`
- DeviceAccessPort types.Int64 `tfsdk:"device_access_port"`
- DestinationDataPrefixListId types.String `tfsdk:"destination_data_prefix_list_id"`
- DestinationIpPrefixList types.Set `tfsdk:"destination_ip_prefix_list"`
- DestinationIpPrefixListVariable types.String `tfsdk:"destination_ip_prefix_list_variable"`
- SourcePorts types.Set `tfsdk:"source_ports"`
- SourceDataPrefixListId types.String `tfsdk:"source_data_prefix_list_id"`
- SourceIpPrefixList types.Set `tfsdk:"source_ip_prefix_list"`
- SourceIpPrefixListVariable types.String `tfsdk:"source_ip_prefix_list_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemIPv4DeviceAccess) getModel() string {
- return "system_ipv4_device_access"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemIPv4DeviceAccess) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/ipv4-device-access-policy", 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 SystemIPv4DeviceAccess) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
- if data.DefaultAction.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"defaultAction.optionType", "default")
- body, _ = sjson.Set(body, path+"defaultAction.value", "drop")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"defaultAction.optionType", "global")
- body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"sequences", []interface{}{})
- for _, item := range data.Sequences {
- itemBody := ""
- if !item.Id.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64())
- }
- }
- if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString())
- }
- }
- if !item.BaseAction.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString())
- }
- }
- if !item.DeviceAccessPort.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64())
- }
- }
- if !item.DestinationDataPrefixListId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString())
- }
- }
-
- if !item.DestinationIpPrefixListVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString())
- }
- } else if !item.DestinationIpPrefixList.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global")
- var values []string
- item.DestinationIpPrefixList.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values)
- }
- }
- if !item.SourcePorts.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global")
- var values []int64
- item.SourcePorts.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values)
- }
- }
- if !item.SourceDataPrefixListId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString())
- }
- }
-
- if !item.SourceIpPrefixListVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString())
- }
- } else if !item.SourceIpPrefixList.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global")
- var values []string
- item.SourceIpPrefixList.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemIPv4DeviceAccess) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.DefaultAction = types.StringNull()
-
- if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
- va := res.Get(path + "defaultAction.value")
- if t.String() == "global" {
- data.DefaultAction = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "sequences"); value.Exists() {
- data.Sequences = make([]SystemIPv4DeviceAccessSequences, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemIPv4DeviceAccessSequences{}
- item.Id = types.Int64Null()
-
- if t := v.Get("sequenceId.optionType"); t.Exists() {
- va := v.Get("sequenceId.value")
- if t.String() == "global" {
- item.Id = types.Int64Value(va.Int())
- }
- }
- item.Name = types.StringNull()
-
- if t := v.Get("sequenceName.optionType"); t.Exists() {
- va := v.Get("sequenceName.value")
- if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- item.BaseAction = types.StringNull()
-
- if t := v.Get("baseAction.optionType"); t.Exists() {
- va := v.Get("baseAction.value")
- if t.String() == "global" {
- item.BaseAction = types.StringValue(va.String())
- }
- }
- item.DeviceAccessPort = types.Int64Null()
-
- if t := v.Get("matchEntries.destinationPort.optionType"); t.Exists() {
- va := v.Get("matchEntries.destinationPort.value")
- if t.String() == "global" {
- item.DeviceAccessPort = types.Int64Value(va.Int())
- }
- }
- item.DestinationDataPrefixListId = types.StringNull()
-
- if t := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
- va := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
- if t.String() == "global" {
- item.DestinationDataPrefixListId = types.StringValue(va.String())
- }
- }
- item.DestinationIpPrefixList = types.SetNull(types.StringType)
- item.DestinationIpPrefixListVariable = types.StringNull()
- if t := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
- va := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
- if t.String() == "variable" {
- item.DestinationIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.DestinationIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- item.SourcePorts = types.SetNull(types.Int64Type)
-
- if t := v.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
- va := v.Get("matchEntries.sourcePorts.value")
- if t.String() == "global" {
- item.SourcePorts = helpers.GetInt64Set(va.Array())
- }
- }
- item.SourceDataPrefixListId = types.StringNull()
-
- if t := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
- va := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
- if t.String() == "global" {
- item.SourceDataPrefixListId = types.StringValue(va.String())
- }
- }
- item.SourceIpPrefixList = types.SetNull(types.StringType)
- item.SourceIpPrefixListVariable = types.StringNull()
- if t := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
- va := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
- if t.String() == "variable" {
- item.SourceIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- data.Sequences = append(data.Sequences, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemIPv4DeviceAccess) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.DefaultAction = types.StringNull()
-
- if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
- va := res.Get(path + "defaultAction.value")
- if t.String() == "global" {
- data.DefaultAction = types.StringValue(va.String())
- }
- }
- for i := range data.Sequences {
- keys := [...]string{"sequenceId"}
- keyValues := [...]string{strconv.FormatInt(data.Sequences[i].Id.ValueInt64(), 10)}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "sequences").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Sequences[i].Id = types.Int64Null()
-
- if t := r.Get("sequenceId.optionType"); t.Exists() {
- va := r.Get("sequenceId.value")
- if t.String() == "global" {
- data.Sequences[i].Id = types.Int64Value(va.Int())
- }
- }
- data.Sequences[i].Name = types.StringNull()
-
- if t := r.Get("sequenceName.optionType"); t.Exists() {
- va := r.Get("sequenceName.value")
- if t.String() == "global" {
- data.Sequences[i].Name = types.StringValue(va.String())
- }
- }
- data.Sequences[i].BaseAction = types.StringNull()
-
- if t := r.Get("baseAction.optionType"); t.Exists() {
- va := r.Get("baseAction.value")
- if t.String() == "global" {
- data.Sequences[i].BaseAction = types.StringValue(va.String())
- }
- }
- data.Sequences[i].DeviceAccessPort = types.Int64Null()
-
- if t := r.Get("matchEntries.destinationPort.optionType"); t.Exists() {
- va := r.Get("matchEntries.destinationPort.value")
- if t.String() == "global" {
- data.Sequences[i].DeviceAccessPort = types.Int64Value(va.Int())
- }
- }
- data.Sequences[i].DestinationDataPrefixListId = types.StringNull()
-
- if t := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
- va := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
- if t.String() == "global" {
- data.Sequences[i].DestinationDataPrefixListId = types.StringValue(va.String())
- }
- }
- data.Sequences[i].DestinationIpPrefixList = types.SetNull(types.StringType)
- data.Sequences[i].DestinationIpPrefixListVariable = types.StringNull()
- if t := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
- va := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
- if t.String() == "variable" {
- data.Sequences[i].DestinationIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Sequences[i].DestinationIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- data.Sequences[i].SourcePorts = types.SetNull(types.Int64Type)
-
- if t := r.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
- va := r.Get("matchEntries.sourcePorts.value")
- if t.String() == "global" {
- data.Sequences[i].SourcePorts = helpers.GetInt64Set(va.Array())
- }
- }
- data.Sequences[i].SourceDataPrefixListId = types.StringNull()
-
- if t := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
- va := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
- if t.String() == "global" {
- data.Sequences[i].SourceDataPrefixListId = types.StringValue(va.String())
- }
- }
- data.Sequences[i].SourceIpPrefixList = types.SetNull(types.StringType)
- data.Sequences[i].SourceIpPrefixListVariable = types.StringNull()
- if t := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
- va := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
- if t.String() == "variable" {
- data.Sequences[i].SourceIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Sequences[i].SourceIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemIPv4DeviceAccess) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.DefaultAction.IsNull() {
- return false
- }
- if len(data.Sequences) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_ipv6_device_access_feature.go b/internal/provider/model_sdwan_system_ipv6_device_access_feature.go
new file mode 100644
index 000000000..208878a76
--- /dev/null
+++ b/internal/provider/model_sdwan_system_ipv6_device_access_feature.go
@@ -0,0 +1,428 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemIPv6DeviceAccess 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"`
+ DefaultAction types.String `tfsdk:"default_action"`
+ Sequences []SystemIPv6DeviceAccessSequences `tfsdk:"sequences"`
+}
+
+type SystemIPv6DeviceAccessSequences struct {
+ Id types.Int64 `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ BaseAction types.String `tfsdk:"base_action"`
+ DeviceAccessPort types.Int64 `tfsdk:"device_access_port"`
+ DestinationDataPrefixListId types.String `tfsdk:"destination_data_prefix_list_id"`
+ DestinationIpPrefixList types.Set `tfsdk:"destination_ip_prefix_list"`
+ DestinationIpPrefixListVariable types.String `tfsdk:"destination_ip_prefix_list_variable"`
+ SourcePorts types.Set `tfsdk:"source_ports"`
+ SourceDataPrefixListId types.String `tfsdk:"source_data_prefix_list_id"`
+ SourceIpPrefixList types.Set `tfsdk:"source_ip_prefix_list"`
+ SourceIpPrefixListVariable types.String `tfsdk:"source_ip_prefix_list_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemIPv6DeviceAccess) getModel() string {
+ return "system_ipv6_device_access"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemIPv6DeviceAccess) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/ipv6-device-access-policy", 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 SystemIPv6DeviceAccess) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if data.DefaultAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "default")
+ body, _ = sjson.Set(body, path+"defaultAction.value", "drop")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "global")
+ body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"sequences", []interface{}{})
+ for _, item := range data.Sequences {
+ itemBody := ""
+ if !item.Id.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64())
+ }
+ }
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString())
+ }
+ }
+ if item.BaseAction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "baseAction.value", "accept")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString())
+ }
+ }
+ if !item.DeviceAccessPort.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64())
+ }
+ }
+ if !item.DestinationDataPrefixListId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString())
+ }
+ }
+
+ if !item.DestinationIpPrefixListVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString())
+ }
+ } else if !item.DestinationIpPrefixList.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global")
+ var values []string
+ item.DestinationIpPrefixList.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values)
+ }
+ }
+ if !item.SourcePorts.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global")
+ var values []int64
+ item.SourcePorts.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values)
+ }
+ }
+ if !item.SourceDataPrefixListId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString())
+ }
+ }
+
+ if !item.SourceIpPrefixListVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString())
+ }
+ } else if !item.SourceIpPrefixList.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global")
+ var values []string
+ item.SourceIpPrefixList.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemIPv6DeviceAccess) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "sequences"); value.Exists() {
+ data.Sequences = make([]SystemIPv6DeviceAccessSequences, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemIPv6DeviceAccessSequences{}
+ item.Id = types.Int64Null()
+
+ if t := v.Get("sequenceId.optionType"); t.Exists() {
+ va := v.Get("sequenceId.value")
+ if t.String() == "global" {
+ item.Id = types.Int64Value(va.Int())
+ }
+ }
+ item.Name = types.StringNull()
+
+ if t := v.Get("sequenceName.optionType"); t.Exists() {
+ va := v.Get("sequenceName.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.BaseAction = types.StringNull()
+
+ if t := v.Get("baseAction.optionType"); t.Exists() {
+ va := v.Get("baseAction.value")
+ if t.String() == "global" {
+ item.BaseAction = types.StringValue(va.String())
+ }
+ }
+ item.DeviceAccessPort = types.Int64Null()
+
+ if t := v.Get("matchEntries.destinationPort.optionType"); t.Exists() {
+ va := v.Get("matchEntries.destinationPort.value")
+ if t.String() == "global" {
+ item.DeviceAccessPort = types.Int64Value(va.Int())
+ }
+ }
+ item.DestinationDataPrefixListId = types.StringNull()
+
+ if t := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
+ va := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
+ if t.String() == "global" {
+ item.DestinationDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ item.DestinationIpPrefixList = types.SetNull(types.StringType)
+ item.DestinationIpPrefixListVariable = types.StringNull()
+ if t := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
+ va := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
+ if t.String() == "variable" {
+ item.DestinationIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.DestinationIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ item.SourcePorts = types.SetNull(types.Int64Type)
+
+ if t := v.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
+ va := v.Get("matchEntries.sourcePorts.value")
+ if t.String() == "global" {
+ item.SourcePorts = helpers.GetInt64Set(va.Array())
+ }
+ }
+ item.SourceDataPrefixListId = types.StringNull()
+
+ if t := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
+ va := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
+ if t.String() == "global" {
+ item.SourceDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ item.SourceIpPrefixList = types.SetNull(types.StringType)
+ item.SourceIpPrefixListVariable = types.StringNull()
+ if t := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
+ va := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
+ if t.String() == "variable" {
+ item.SourceIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Sequences = append(data.Sequences, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemIPv6DeviceAccess) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Sequences {
+ keys := [...]string{"sequenceId"}
+ keyValues := [...]string{strconv.FormatInt(data.Sequences[i].Id.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "sequences").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].Id = types.Int64Null()
+
+ if t := r.Get("sequenceId.optionType"); t.Exists() {
+ va := r.Get("sequenceId.value")
+ if t.String() == "global" {
+ data.Sequences[i].Id = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Name = types.StringNull()
+
+ if t := r.Get("sequenceName.optionType"); t.Exists() {
+ va := r.Get("sequenceName.value")
+ if t.String() == "global" {
+ data.Sequences[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].BaseAction = types.StringNull()
+
+ if t := r.Get("baseAction.optionType"); t.Exists() {
+ va := r.Get("baseAction.value")
+ if t.String() == "global" {
+ data.Sequences[i].BaseAction = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].DeviceAccessPort = types.Int64Null()
+
+ if t := r.Get("matchEntries.destinationPort.optionType"); t.Exists() {
+ va := r.Get("matchEntries.destinationPort.value")
+ if t.String() == "global" {
+ data.Sequences[i].DeviceAccessPort = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].DestinationDataPrefixListId = types.StringNull()
+
+ if t := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
+ va := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].DestinationDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].DestinationIpPrefixList = types.SetNull(types.StringType)
+ data.Sequences[i].DestinationIpPrefixListVariable = types.StringNull()
+ if t := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
+ va := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
+ if t.String() == "variable" {
+ data.Sequences[i].DestinationIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Sequences[i].DestinationIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Sequences[i].SourcePorts = types.SetNull(types.Int64Type)
+
+ if t := r.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
+ va := r.Get("matchEntries.sourcePorts.value")
+ if t.String() == "global" {
+ data.Sequences[i].SourcePorts = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.Sequences[i].SourceDataPrefixListId = types.StringNull()
+
+ if t := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
+ va := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].SourceDataPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].SourceIpPrefixList = types.SetNull(types.StringType)
+ data.Sequences[i].SourceIpPrefixListVariable = types.StringNull()
+ if t := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
+ va := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
+ if t.String() == "variable" {
+ data.Sequences[i].SourceIpPrefixListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Sequences[i].SourceIpPrefixList = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemIPv6DeviceAccess) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.DefaultAction.IsNull() {
+ return false
+ }
+ if len(data.Sequences) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go b/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go
deleted file mode 100644
index c85983819..000000000
--- a/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go
+++ /dev/null
@@ -1,425 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemIPv6DeviceAccess 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"`
- DefaultAction types.String `tfsdk:"default_action"`
- Sequences []SystemIPv6DeviceAccessSequences `tfsdk:"sequences"`
-}
-
-type SystemIPv6DeviceAccessSequences struct {
- Id types.Int64 `tfsdk:"id"`
- Name types.String `tfsdk:"name"`
- BaseAction types.String `tfsdk:"base_action"`
- DeviceAccessPort types.Int64 `tfsdk:"device_access_port"`
- DestinationDataPrefixListId types.String `tfsdk:"destination_data_prefix_list_id"`
- DestinationIpPrefixList types.Set `tfsdk:"destination_ip_prefix_list"`
- DestinationIpPrefixListVariable types.String `tfsdk:"destination_ip_prefix_list_variable"`
- SourcePorts types.Set `tfsdk:"source_ports"`
- SourceDataPrefixListId types.String `tfsdk:"source_data_prefix_list_id"`
- SourceIpPrefixList types.Set `tfsdk:"source_ip_prefix_list"`
- SourceIpPrefixListVariable types.String `tfsdk:"source_ip_prefix_list_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemIPv6DeviceAccess) getModel() string {
- return "system_ipv6_device_access"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemIPv6DeviceAccess) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/ipv6-device-access-policy", 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 SystemIPv6DeviceAccess) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
- if data.DefaultAction.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"defaultAction.optionType", "default")
- body, _ = sjson.Set(body, path+"defaultAction.value", "drop")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"defaultAction.optionType", "global")
- body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"sequences", []interface{}{})
- for _, item := range data.Sequences {
- itemBody := ""
- if !item.Id.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64())
- }
- }
- if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString())
- }
- }
- if item.BaseAction.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "baseAction.value", "accept")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString())
- }
- }
- if !item.DeviceAccessPort.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64())
- }
- }
- if !item.DestinationDataPrefixListId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString())
- }
- }
-
- if !item.DestinationIpPrefixListVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString())
- }
- } else if !item.DestinationIpPrefixList.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global")
- var values []string
- item.DestinationIpPrefixList.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values)
- }
- }
- if !item.SourcePorts.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global")
- var values []int64
- item.SourcePorts.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values)
- }
- }
- if !item.SourceDataPrefixListId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString())
- }
- }
-
- if !item.SourceIpPrefixListVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString())
- }
- } else if !item.SourceIpPrefixList.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global")
- var values []string
- item.SourceIpPrefixList.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemIPv6DeviceAccess) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.DefaultAction = types.StringNull()
-
- if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
- va := res.Get(path + "defaultAction.value")
- if t.String() == "global" {
- data.DefaultAction = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "sequences"); value.Exists() {
- data.Sequences = make([]SystemIPv6DeviceAccessSequences, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemIPv6DeviceAccessSequences{}
- item.Id = types.Int64Null()
-
- if t := v.Get("sequenceId.optionType"); t.Exists() {
- va := v.Get("sequenceId.value")
- if t.String() == "global" {
- item.Id = types.Int64Value(va.Int())
- }
- }
- item.Name = types.StringNull()
-
- if t := v.Get("sequenceName.optionType"); t.Exists() {
- va := v.Get("sequenceName.value")
- if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- item.BaseAction = types.StringNull()
-
- if t := v.Get("baseAction.optionType"); t.Exists() {
- va := v.Get("baseAction.value")
- if t.String() == "global" {
- item.BaseAction = types.StringValue(va.String())
- }
- }
- item.DeviceAccessPort = types.Int64Null()
-
- if t := v.Get("matchEntries.destinationPort.optionType"); t.Exists() {
- va := v.Get("matchEntries.destinationPort.value")
- if t.String() == "global" {
- item.DeviceAccessPort = types.Int64Value(va.Int())
- }
- }
- item.DestinationDataPrefixListId = types.StringNull()
-
- if t := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
- va := v.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
- if t.String() == "global" {
- item.DestinationDataPrefixListId = types.StringValue(va.String())
- }
- }
- item.DestinationIpPrefixList = types.SetNull(types.StringType)
- item.DestinationIpPrefixListVariable = types.StringNull()
- if t := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
- va := v.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
- if t.String() == "variable" {
- item.DestinationIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.DestinationIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- item.SourcePorts = types.SetNull(types.Int64Type)
-
- if t := v.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
- va := v.Get("matchEntries.sourcePorts.value")
- if t.String() == "global" {
- item.SourcePorts = helpers.GetInt64Set(va.Array())
- }
- }
- item.SourceDataPrefixListId = types.StringNull()
-
- if t := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
- va := v.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
- if t.String() == "global" {
- item.SourceDataPrefixListId = types.StringValue(va.String())
- }
- }
- item.SourceIpPrefixList = types.SetNull(types.StringType)
- item.SourceIpPrefixListVariable = types.StringNull()
- if t := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
- va := v.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
- if t.String() == "variable" {
- item.SourceIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- data.Sequences = append(data.Sequences, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemIPv6DeviceAccess) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.DefaultAction = types.StringNull()
-
- if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
- va := res.Get(path + "defaultAction.value")
- if t.String() == "global" {
- data.DefaultAction = types.StringValue(va.String())
- }
- }
- for i := range data.Sequences {
- keys := [...]string{"sequenceId"}
- keyValues := [...]string{strconv.FormatInt(data.Sequences[i].Id.ValueInt64(), 10)}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "sequences").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Sequences[i].Id = types.Int64Null()
-
- if t := r.Get("sequenceId.optionType"); t.Exists() {
- va := r.Get("sequenceId.value")
- if t.String() == "global" {
- data.Sequences[i].Id = types.Int64Value(va.Int())
- }
- }
- data.Sequences[i].Name = types.StringNull()
-
- if t := r.Get("sequenceName.optionType"); t.Exists() {
- va := r.Get("sequenceName.value")
- if t.String() == "global" {
- data.Sequences[i].Name = types.StringValue(va.String())
- }
- }
- data.Sequences[i].BaseAction = types.StringNull()
-
- if t := r.Get("baseAction.optionType"); t.Exists() {
- va := r.Get("baseAction.value")
- if t.String() == "global" {
- data.Sequences[i].BaseAction = types.StringValue(va.String())
- }
- }
- data.Sequences[i].DeviceAccessPort = types.Int64Null()
-
- if t := r.Get("matchEntries.destinationPort.optionType"); t.Exists() {
- va := r.Get("matchEntries.destinationPort.value")
- if t.String() == "global" {
- data.Sequences[i].DeviceAccessPort = types.Int64Value(va.Int())
- }
- }
- data.Sequences[i].DestinationDataPrefixListId = types.StringNull()
-
- if t := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType"); t.Exists() {
- va := r.Get("matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value")
- if t.String() == "global" {
- data.Sequences[i].DestinationDataPrefixListId = types.StringValue(va.String())
- }
- }
- data.Sequences[i].DestinationIpPrefixList = types.SetNull(types.StringType)
- data.Sequences[i].DestinationIpPrefixListVariable = types.StringNull()
- if t := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType"); t.Exists() {
- va := r.Get("matchEntries.destinationDataPrefix.destinationIpPrefixList.value")
- if t.String() == "variable" {
- data.Sequences[i].DestinationIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Sequences[i].DestinationIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- data.Sequences[i].SourcePorts = types.SetNull(types.Int64Type)
-
- if t := r.Get("matchEntries.sourcePorts.optionType"); t.Exists() {
- va := r.Get("matchEntries.sourcePorts.value")
- if t.String() == "global" {
- data.Sequences[i].SourcePorts = helpers.GetInt64Set(va.Array())
- }
- }
- data.Sequences[i].SourceDataPrefixListId = types.StringNull()
-
- if t := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType"); t.Exists() {
- va := r.Get("matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value")
- if t.String() == "global" {
- data.Sequences[i].SourceDataPrefixListId = types.StringValue(va.String())
- }
- }
- data.Sequences[i].SourceIpPrefixList = types.SetNull(types.StringType)
- data.Sequences[i].SourceIpPrefixListVariable = types.StringNull()
- if t := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType"); t.Exists() {
- va := r.Get("matchEntries.sourceDataPrefix.sourceIpPrefixList.value")
- if t.String() == "variable" {
- data.Sequences[i].SourceIpPrefixListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Sequences[i].SourceIpPrefixList = helpers.GetStringSet(va.Array())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemIPv6DeviceAccess) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.DefaultAction.IsNull() {
- return false
- }
- if len(data.Sequences) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_logging_feature.go b/internal/provider/model_sdwan_system_logging_feature.go
new file mode 100644
index 000000000..3e4537660
--- /dev/null
+++ b/internal/provider/model_sdwan_system_logging_feature.go
@@ -0,0 +1,1049 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemLogging 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"`
+ DiskEnable types.Bool `tfsdk:"disk_enable"`
+ DiskEnableVariable types.String `tfsdk:"disk_enable_variable"`
+ DiskFileSize types.Int64 `tfsdk:"disk_file_size"`
+ DiskFileSizeVariable types.String `tfsdk:"disk_file_size_variable"`
+ DiskFileRotate types.Int64 `tfsdk:"disk_file_rotate"`
+ DiskFileRotateVariable types.String `tfsdk:"disk_file_rotate_variable"`
+ TlsProfiles []SystemLoggingTlsProfiles `tfsdk:"tls_profiles"`
+ Ipv4Servers []SystemLoggingIpv4Servers `tfsdk:"ipv4_servers"`
+ Ipv6Servers []SystemLoggingIpv6Servers `tfsdk:"ipv6_servers"`
+}
+
+type SystemLoggingTlsProfiles struct {
+ Profile types.String `tfsdk:"profile"`
+ ProfileVariable types.String `tfsdk:"profile_variable"`
+ TlsVersion types.String `tfsdk:"tls_version"`
+ TlsVersionVariable types.String `tfsdk:"tls_version_variable"`
+ CipherSuites types.Set `tfsdk:"cipher_suites"`
+ CipherSuitesVariable types.String `tfsdk:"cipher_suites_variable"`
+}
+
+type SystemLoggingIpv4Servers struct {
+ HostnameIp types.String `tfsdk:"hostname_ip"`
+ HostnameIpVariable types.String `tfsdk:"hostname_ip_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ VpnVariable types.String `tfsdk:"vpn_variable"`
+ SourceInterface types.String `tfsdk:"source_interface"`
+ SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
+ Priority types.String `tfsdk:"priority"`
+ PriorityVariable types.String `tfsdk:"priority_variable"`
+ TlsEnable types.Bool `tfsdk:"tls_enable"`
+ TlsEnableVariable types.String `tfsdk:"tls_enable_variable"`
+ TlsPropertiesCustomProfile types.Bool `tfsdk:"tls_properties_custom_profile"`
+ TlsPropertiesCustomProfileVariable types.String `tfsdk:"tls_properties_custom_profile_variable"`
+ TlsPropertiesProfile types.String `tfsdk:"tls_properties_profile"`
+ TlsPropertiesProfileVariable types.String `tfsdk:"tls_properties_profile_variable"`
+}
+
+type SystemLoggingIpv6Servers struct {
+ HostnameIp types.String `tfsdk:"hostname_ip"`
+ HostnameIpVariable types.String `tfsdk:"hostname_ip_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ VpnVariable types.String `tfsdk:"vpn_variable"`
+ SourceInterface types.String `tfsdk:"source_interface"`
+ SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
+ Priority types.String `tfsdk:"priority"`
+ PriorityVariable types.String `tfsdk:"priority_variable"`
+ TlsEnable types.Bool `tfsdk:"tls_enable"`
+ TlsEnableVariable types.String `tfsdk:"tls_enable_variable"`
+ TlsPropertiesCustomProfile types.Bool `tfsdk:"tls_properties_custom_profile"`
+ TlsPropertiesCustomProfileVariable types.String `tfsdk:"tls_properties_custom_profile_variable"`
+ TlsPropertiesProfile types.String `tfsdk:"tls_properties_profile"`
+ TlsPropertiesProfileVariable types.String `tfsdk:"tls_properties_profile_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemLogging) getModel() string {
+ return "system_logging"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemLogging) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/logging", 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 SystemLogging) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.DiskEnableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnableVariable.ValueString())
+ }
+ } else if data.DiskEnable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "default")
+ body, _ = sjson.Set(body, path+"disk.diskEnable.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "global")
+ body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnable.ValueBool())
+ }
+ }
+
+ if !data.DiskFileSizeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "variable")
+ body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSizeVariable.ValueString())
+ }
+ } else if data.DiskFileSize.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "default")
+ body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", 10)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "global")
+ body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSize.ValueInt64())
+ }
+ }
+
+ if !data.DiskFileRotateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotateVariable.ValueString())
+ }
+ } else if data.DiskFileRotate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "default")
+ body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", 10)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "global")
+ body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotate.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"tlsProfile", []interface{}{})
+ for _, item := range data.TlsProfiles {
+ itemBody := ""
+
+ if !item.ProfileVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "profile.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "profile.value", item.ProfileVariable.ValueString())
+ }
+ } else if !item.Profile.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "profile.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "profile.value", item.Profile.ValueString())
+ }
+ }
+
+ if !item.TlsVersionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersionVariable.ValueString())
+ }
+ } else if item.TlsVersion.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", "TLSv1.1")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersion.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "authType.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "authType.value", "Server")
+ }
+
+ if !item.CipherSuitesVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", item.CipherSuitesVariable.ValueString())
+ }
+ } else if item.CipherSuites.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "global")
+ var values []string
+ item.CipherSuites.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"tlsProfile.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"server", []interface{}{})
+ for _, item := range data.Ipv4Servers {
+ itemBody := ""
+
+ if !item.HostnameIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString())
+ }
+ } else if !item.HostnameIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString())
+ }
+ }
+
+ if !item.VpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
+ }
+ } else if item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+
+ if !item.SourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
+ }
+ } else if item.SourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
+ }
+ }
+
+ if !item.PriorityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
+ }
+ } else if item.Priority.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", "informational")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString())
+ }
+ }
+
+ if !item.TlsEnableVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString())
+ }
+ } else if item.TlsEnable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool())
+ }
+ }
+
+ if !item.TlsPropertiesCustomProfileVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString())
+ }
+ } else if item.TlsPropertiesCustomProfile.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool())
+ }
+ }
+
+ if !item.TlsPropertiesProfileVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString())
+ }
+ } else if item.TlsPropertiesProfile.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"server.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6Server", []interface{}{})
+ for _, item := range data.Ipv6Servers {
+ itemBody := ""
+
+ if !item.HostnameIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString())
+ }
+ } else if !item.HostnameIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString())
+ }
+ }
+
+ if !item.VpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
+ }
+ } else if item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+
+ if !item.SourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
+ }
+ } else if item.SourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
+ }
+ }
+
+ if !item.PriorityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
+ }
+ } else if item.Priority.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", "informational")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString())
+ }
+ }
+
+ if !item.TlsEnableVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString())
+ }
+ } else if item.TlsEnable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool())
+ }
+ }
+
+ if !item.TlsPropertiesCustomProfileVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString())
+ }
+ } else if item.TlsPropertiesCustomProfile.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool())
+ }
+ }
+
+ if !item.TlsPropertiesProfileVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString())
+ }
+ } else if item.TlsPropertiesProfile.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6Server.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemLogging) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DiskEnable = types.BoolNull()
+ data.DiskEnableVariable = types.StringNull()
+ if t := res.Get(path + "disk.diskEnable.optionType"); t.Exists() {
+ va := res.Get(path + "disk.diskEnable.value")
+ if t.String() == "variable" {
+ data.DiskEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DiskEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.DiskFileSize = types.Int64Null()
+ data.DiskFileSizeVariable = types.StringNull()
+ if t := res.Get(path + "disk.file.diskFileSize.optionType"); t.Exists() {
+ va := res.Get(path + "disk.file.diskFileSize.value")
+ if t.String() == "variable" {
+ data.DiskFileSizeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DiskFileSize = types.Int64Value(va.Int())
+ }
+ }
+ data.DiskFileRotate = types.Int64Null()
+ data.DiskFileRotateVariable = types.StringNull()
+ if t := res.Get(path + "disk.file.diskFileRotate.optionType"); t.Exists() {
+ va := res.Get(path + "disk.file.diskFileRotate.value")
+ if t.String() == "variable" {
+ data.DiskFileRotateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DiskFileRotate = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "tlsProfile"); value.Exists() {
+ data.TlsProfiles = make([]SystemLoggingTlsProfiles, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemLoggingTlsProfiles{}
+ item.Profile = types.StringNull()
+ item.ProfileVariable = types.StringNull()
+ if t := v.Get("profile.optionType"); t.Exists() {
+ va := v.Get("profile.value")
+ if t.String() == "variable" {
+ item.ProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Profile = types.StringValue(va.String())
+ }
+ }
+ item.TlsVersion = types.StringNull()
+ item.TlsVersionVariable = types.StringNull()
+ if t := v.Get("tlsVersion.optionType"); t.Exists() {
+ va := v.Get("tlsVersion.value")
+ if t.String() == "variable" {
+ item.TlsVersionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlsVersion = types.StringValue(va.String())
+ }
+ }
+ item.CipherSuites = types.SetNull(types.StringType)
+ item.CipherSuitesVariable = types.StringNull()
+ if t := v.Get("cipherSuiteList.optionType"); t.Exists() {
+ va := v.Get("cipherSuiteList.value")
+ if t.String() == "variable" {
+ item.CipherSuitesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.CipherSuites = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.TlsProfiles = append(data.TlsProfiles, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "server"); value.Exists() {
+ data.Ipv4Servers = make([]SystemLoggingIpv4Servers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemLoggingIpv4Servers{}
+ item.HostnameIp = types.StringNull()
+ item.HostnameIpVariable = types.StringNull()
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "variable" {
+ item.HostnameIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HostnameIp = types.StringValue(va.String())
+ }
+ }
+ item.Vpn = types.Int64Null()
+ item.VpnVariable = types.StringNull()
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "variable" {
+ item.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ item.SourceInterface = types.StringNull()
+ item.SourceInterfaceVariable = types.StringNull()
+ if t := v.Get("sourceInterface.optionType"); t.Exists() {
+ va := v.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ item.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceInterface = types.StringValue(va.String())
+ }
+ }
+ item.Priority = types.StringNull()
+ item.PriorityVariable = types.StringNull()
+ if t := v.Get("priority.optionType"); t.Exists() {
+ va := v.Get("priority.value")
+ if t.String() == "variable" {
+ item.PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Priority = types.StringValue(va.String())
+ }
+ }
+ item.TlsEnable = types.BoolNull()
+ item.TlsEnableVariable = types.StringNull()
+ if t := v.Get("tlsEnable.optionType"); t.Exists() {
+ va := v.Get("tlsEnable.value")
+ if t.String() == "variable" {
+ item.TlsEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ item.TlsPropertiesCustomProfile = types.BoolNull()
+ item.TlsPropertiesCustomProfileVariable = types.StringNull()
+ if t := v.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
+ va := v.Get("tlsPropertiesCustomProfile.value")
+ if t.String() == "variable" {
+ item.TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
+ }
+ }
+ item.TlsPropertiesProfile = types.StringNull()
+ item.TlsPropertiesProfileVariable = types.StringNull()
+ if t := v.Get("tlsPropertiesProfile.optionType"); t.Exists() {
+ va := v.Get("tlsPropertiesProfile.value")
+ if t.String() == "variable" {
+ item.TlsPropertiesProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlsPropertiesProfile = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Servers = append(data.Ipv4Servers, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6Server"); value.Exists() {
+ data.Ipv6Servers = make([]SystemLoggingIpv6Servers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemLoggingIpv6Servers{}
+ item.HostnameIp = types.StringNull()
+ item.HostnameIpVariable = types.StringNull()
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "variable" {
+ item.HostnameIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HostnameIp = types.StringValue(va.String())
+ }
+ }
+ item.Vpn = types.Int64Null()
+ item.VpnVariable = types.StringNull()
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "variable" {
+ item.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ item.SourceInterface = types.StringNull()
+ item.SourceInterfaceVariable = types.StringNull()
+ if t := v.Get("sourceInterface.optionType"); t.Exists() {
+ va := v.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ item.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceInterface = types.StringValue(va.String())
+ }
+ }
+ item.Priority = types.StringNull()
+ item.PriorityVariable = types.StringNull()
+ if t := v.Get("priority.optionType"); t.Exists() {
+ va := v.Get("priority.value")
+ if t.String() == "variable" {
+ item.PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Priority = types.StringValue(va.String())
+ }
+ }
+ item.TlsEnable = types.BoolNull()
+ item.TlsEnableVariable = types.StringNull()
+ if t := v.Get("tlsEnable.optionType"); t.Exists() {
+ va := v.Get("tlsEnable.value")
+ if t.String() == "variable" {
+ item.TlsEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ item.TlsPropertiesCustomProfile = types.BoolNull()
+ item.TlsPropertiesCustomProfileVariable = types.StringNull()
+ if t := v.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
+ va := v.Get("tlsPropertiesCustomProfile.value")
+ if t.String() == "variable" {
+ item.TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
+ }
+ }
+ item.TlsPropertiesProfile = types.StringNull()
+ item.TlsPropertiesProfileVariable = types.StringNull()
+ if t := v.Get("tlsPropertiesProfile.optionType"); t.Exists() {
+ va := v.Get("tlsPropertiesProfile.value")
+ if t.String() == "variable" {
+ item.TlsPropertiesProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TlsPropertiesProfile = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Servers = append(data.Ipv6Servers, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemLogging) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DiskEnable = types.BoolNull()
+ data.DiskEnableVariable = types.StringNull()
+ if t := res.Get(path + "disk.diskEnable.optionType"); t.Exists() {
+ va := res.Get(path + "disk.diskEnable.value")
+ if t.String() == "variable" {
+ data.DiskEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DiskEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.DiskFileSize = types.Int64Null()
+ data.DiskFileSizeVariable = types.StringNull()
+ if t := res.Get(path + "disk.file.diskFileSize.optionType"); t.Exists() {
+ va := res.Get(path + "disk.file.diskFileSize.value")
+ if t.String() == "variable" {
+ data.DiskFileSizeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DiskFileSize = types.Int64Value(va.Int())
+ }
+ }
+ data.DiskFileRotate = types.Int64Null()
+ data.DiskFileRotateVariable = types.StringNull()
+ if t := res.Get(path + "disk.file.diskFileRotate.optionType"); t.Exists() {
+ va := res.Get(path + "disk.file.diskFileRotate.value")
+ if t.String() == "variable" {
+ data.DiskFileRotateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DiskFileRotate = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.TlsProfiles {
+ keys := [...]string{"profile"}
+ keyValues := [...]string{data.TlsProfiles[i].Profile.ValueString()}
+ keyValuesVariables := [...]string{data.TlsProfiles[i].ProfileVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "tlsProfile").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TlsProfiles[i].Profile = types.StringNull()
+ data.TlsProfiles[i].ProfileVariable = types.StringNull()
+ if t := r.Get("profile.optionType"); t.Exists() {
+ va := r.Get("profile.value")
+ if t.String() == "variable" {
+ data.TlsProfiles[i].ProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlsProfiles[i].Profile = types.StringValue(va.String())
+ }
+ }
+ data.TlsProfiles[i].TlsVersion = types.StringNull()
+ data.TlsProfiles[i].TlsVersionVariable = types.StringNull()
+ if t := r.Get("tlsVersion.optionType"); t.Exists() {
+ va := r.Get("tlsVersion.value")
+ if t.String() == "variable" {
+ data.TlsProfiles[i].TlsVersionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlsProfiles[i].TlsVersion = types.StringValue(va.String())
+ }
+ }
+ data.TlsProfiles[i].CipherSuites = types.SetNull(types.StringType)
+ data.TlsProfiles[i].CipherSuitesVariable = types.StringNull()
+ if t := r.Get("cipherSuiteList.optionType"); t.Exists() {
+ va := r.Get("cipherSuiteList.value")
+ if t.String() == "variable" {
+ data.TlsProfiles[i].CipherSuitesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlsProfiles[i].CipherSuites = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+ for i := range data.Ipv4Servers {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Ipv4Servers[i].HostnameIp.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Servers[i].HostnameIpVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "server").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Servers[i].HostnameIp = types.StringNull()
+ data.Ipv4Servers[i].HostnameIpVariable = types.StringNull()
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "variable" {
+ data.Ipv4Servers[i].HostnameIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Servers[i].HostnameIp = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Servers[i].Vpn = types.Int64Null()
+ data.Ipv4Servers[i].VpnVariable = types.StringNull()
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "variable" {
+ data.Ipv4Servers[i].VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Servers[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Servers[i].SourceInterface = types.StringNull()
+ data.Ipv4Servers[i].SourceInterfaceVariable = types.StringNull()
+ if t := r.Get("sourceInterface.optionType"); t.Exists() {
+ va := r.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ data.Ipv4Servers[i].SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Servers[i].SourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Servers[i].Priority = types.StringNull()
+ data.Ipv4Servers[i].PriorityVariable = types.StringNull()
+ if t := r.Get("priority.optionType"); t.Exists() {
+ va := r.Get("priority.value")
+ if t.String() == "variable" {
+ data.Ipv4Servers[i].PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Servers[i].Priority = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Servers[i].TlsEnable = types.BoolNull()
+ data.Ipv4Servers[i].TlsEnableVariable = types.StringNull()
+ if t := r.Get("tlsEnable.optionType"); t.Exists() {
+ va := r.Get("tlsEnable.value")
+ if t.String() == "variable" {
+ data.Ipv4Servers[i].TlsEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Servers[i].TlsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Servers[i].TlsPropertiesCustomProfile = types.BoolNull()
+ data.Ipv4Servers[i].TlsPropertiesCustomProfileVariable = types.StringNull()
+ if t := r.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
+ va := r.Get("tlsPropertiesCustomProfile.value")
+ if t.String() == "variable" {
+ data.Ipv4Servers[i].TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Servers[i].TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Servers[i].TlsPropertiesProfile = types.StringNull()
+ data.Ipv4Servers[i].TlsPropertiesProfileVariable = types.StringNull()
+ if t := r.Get("tlsPropertiesProfile.optionType"); t.Exists() {
+ va := r.Get("tlsPropertiesProfile.value")
+ if t.String() == "variable" {
+ data.Ipv4Servers[i].TlsPropertiesProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Servers[i].TlsPropertiesProfile = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv6Servers {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Ipv6Servers[i].HostnameIp.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Servers[i].HostnameIpVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6Server").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Servers[i].HostnameIp = types.StringNull()
+ data.Ipv6Servers[i].HostnameIpVariable = types.StringNull()
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "variable" {
+ data.Ipv6Servers[i].HostnameIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Servers[i].HostnameIp = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Servers[i].Vpn = types.Int64Null()
+ data.Ipv6Servers[i].VpnVariable = types.StringNull()
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "variable" {
+ data.Ipv6Servers[i].VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Servers[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Servers[i].SourceInterface = types.StringNull()
+ data.Ipv6Servers[i].SourceInterfaceVariable = types.StringNull()
+ if t := r.Get("sourceInterface.optionType"); t.Exists() {
+ va := r.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ data.Ipv6Servers[i].SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Servers[i].SourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Servers[i].Priority = types.StringNull()
+ data.Ipv6Servers[i].PriorityVariable = types.StringNull()
+ if t := r.Get("priority.optionType"); t.Exists() {
+ va := r.Get("priority.value")
+ if t.String() == "variable" {
+ data.Ipv6Servers[i].PriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Servers[i].Priority = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Servers[i].TlsEnable = types.BoolNull()
+ data.Ipv6Servers[i].TlsEnableVariable = types.StringNull()
+ if t := r.Get("tlsEnable.optionType"); t.Exists() {
+ va := r.Get("tlsEnable.value")
+ if t.String() == "variable" {
+ data.Ipv6Servers[i].TlsEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Servers[i].TlsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Servers[i].TlsPropertiesCustomProfile = types.BoolNull()
+ data.Ipv6Servers[i].TlsPropertiesCustomProfileVariable = types.StringNull()
+ if t := r.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
+ va := r.Get("tlsPropertiesCustomProfile.value")
+ if t.String() == "variable" {
+ data.Ipv6Servers[i].TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Servers[i].TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Servers[i].TlsPropertiesProfile = types.StringNull()
+ data.Ipv6Servers[i].TlsPropertiesProfileVariable = types.StringNull()
+ if t := r.Get("tlsPropertiesProfile.optionType"); t.Exists() {
+ va := r.Get("tlsPropertiesProfile.value")
+ if t.String() == "variable" {
+ data.Ipv6Servers[i].TlsPropertiesProfileVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Servers[i].TlsPropertiesProfile = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemLogging) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.DiskEnable.IsNull() {
+ return false
+ }
+ if !data.DiskEnableVariable.IsNull() {
+ return false
+ }
+ if !data.DiskFileSize.IsNull() {
+ return false
+ }
+ if !data.DiskFileSizeVariable.IsNull() {
+ return false
+ }
+ if !data.DiskFileRotate.IsNull() {
+ return false
+ }
+ if !data.DiskFileRotateVariable.IsNull() {
+ return false
+ }
+ if len(data.TlsProfiles) > 0 {
+ return false
+ }
+ if len(data.Ipv4Servers) > 0 {
+ return false
+ }
+ if len(data.Ipv6Servers) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_logging_profile_parcel.go b/internal/provider/model_sdwan_system_logging_profile_parcel.go
deleted file mode 100644
index 225c3617b..000000000
--- a/internal/provider/model_sdwan_system_logging_profile_parcel.go
+++ /dev/null
@@ -1,1040 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemLogging 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"`
- DiskEnable types.Bool `tfsdk:"disk_enable"`
- DiskEnableVariable types.String `tfsdk:"disk_enable_variable"`
- DiskFileSize types.Int64 `tfsdk:"disk_file_size"`
- DiskFileSizeVariable types.String `tfsdk:"disk_file_size_variable"`
- DiskFileRotate types.Int64 `tfsdk:"disk_file_rotate"`
- DiskFileRotateVariable types.String `tfsdk:"disk_file_rotate_variable"`
- TlsProfiles []SystemLoggingTlsProfiles `tfsdk:"tls_profiles"`
- Ipv4Servers []SystemLoggingIpv4Servers `tfsdk:"ipv4_servers"`
- Ipv6Servers []SystemLoggingIpv6Servers `tfsdk:"ipv6_servers"`
-}
-
-type SystemLoggingTlsProfiles struct {
- Profile types.String `tfsdk:"profile"`
- ProfileVariable types.String `tfsdk:"profile_variable"`
- TlsVersion types.String `tfsdk:"tls_version"`
- TlsVersionVariable types.String `tfsdk:"tls_version_variable"`
- CipherSuites types.Set `tfsdk:"cipher_suites"`
- CipherSuitesVariable types.String `tfsdk:"cipher_suites_variable"`
-}
-
-type SystemLoggingIpv4Servers struct {
- HostnameIp types.String `tfsdk:"hostname_ip"`
- HostnameIpVariable types.String `tfsdk:"hostname_ip_variable"`
- Vpn types.Int64 `tfsdk:"vpn"`
- VpnVariable types.String `tfsdk:"vpn_variable"`
- SourceInterface types.String `tfsdk:"source_interface"`
- SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
- Priority types.String `tfsdk:"priority"`
- PriorityVariable types.String `tfsdk:"priority_variable"`
- TlsEnable types.Bool `tfsdk:"tls_enable"`
- TlsEnableVariable types.String `tfsdk:"tls_enable_variable"`
- TlsPropertiesCustomProfile types.Bool `tfsdk:"tls_properties_custom_profile"`
- TlsPropertiesCustomProfileVariable types.String `tfsdk:"tls_properties_custom_profile_variable"`
- TlsPropertiesProfile types.String `tfsdk:"tls_properties_profile"`
- TlsPropertiesProfileVariable types.String `tfsdk:"tls_properties_profile_variable"`
-}
-
-type SystemLoggingIpv6Servers struct {
- HostnameIp types.String `tfsdk:"hostname_ip"`
- HostnameIpVariable types.String `tfsdk:"hostname_ip_variable"`
- Vpn types.Int64 `tfsdk:"vpn"`
- VpnVariable types.String `tfsdk:"vpn_variable"`
- SourceInterface types.String `tfsdk:"source_interface"`
- SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
- Priority types.String `tfsdk:"priority"`
- PriorityVariable types.String `tfsdk:"priority_variable"`
- TlsEnable types.Bool `tfsdk:"tls_enable"`
- TlsEnableVariable types.String `tfsdk:"tls_enable_variable"`
- TlsPropertiesCustomProfile types.Bool `tfsdk:"tls_properties_custom_profile"`
- TlsPropertiesCustomProfileVariable types.String `tfsdk:"tls_properties_custom_profile_variable"`
- TlsPropertiesProfile types.String `tfsdk:"tls_properties_profile"`
- TlsPropertiesProfileVariable types.String `tfsdk:"tls_properties_profile_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemLogging) getModel() string {
- return "system_logging"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemLogging) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/logging", 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 SystemLogging) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.DiskEnableVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "variable")
- body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnableVariable.ValueString())
- }
- } else if data.DiskEnable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "default")
- body, _ = sjson.Set(body, path+"disk.diskEnable.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "global")
- body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnable.ValueBool())
- }
- }
-
- if !data.DiskFileSizeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "variable")
- body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSizeVariable.ValueString())
- }
- } else if data.DiskFileSize.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "default")
- body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", 10)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "global")
- body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSize.ValueInt64())
- }
- }
-
- if !data.DiskFileRotateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "variable")
- body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotateVariable.ValueString())
- }
- } else if data.DiskFileRotate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "default")
- body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", 10)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "global")
- body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotate.ValueInt64())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"tlsProfile", []interface{}{})
- for _, item := range data.TlsProfiles {
- itemBody := ""
-
- if !item.ProfileVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "profile.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "profile.value", item.ProfileVariable.ValueString())
- }
- } else if !item.Profile.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "profile.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "profile.value", item.Profile.ValueString())
- }
- }
-
- if !item.TlsVersionVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersionVariable.ValueString())
- }
- } else if item.TlsVersion.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", "TLSv1.1")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersion.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "authType.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "authType.value", "Server")
- }
-
- if !item.CipherSuitesVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", item.CipherSuitesVariable.ValueString())
- }
- } else if item.CipherSuites.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "global")
- var values []string
- item.CipherSuites.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"tlsProfile.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"server", []interface{}{})
- for _, item := range data.Ipv4Servers {
- itemBody := ""
-
- if !item.HostnameIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString())
- }
- } else if !item.HostnameIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString())
- }
- }
-
- if !item.VpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
- }
- } else if item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
-
- if !item.SourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
- }
- } else if item.SourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
- }
- }
-
- if !item.PriorityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
- }
- } else if item.Priority.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "priority.value", "informational")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString())
- }
- }
-
- if !item.TlsEnableVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString())
- }
- } else if item.TlsEnable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool())
- }
- }
-
- if !item.TlsPropertiesCustomProfileVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString())
- }
- } else if item.TlsPropertiesCustomProfile.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool())
- }
- }
-
- if !item.TlsPropertiesProfileVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString())
- }
- } else if item.TlsPropertiesProfile.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"server.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6Server", []interface{}{})
- for _, item := range data.Ipv6Servers {
- itemBody := ""
-
- if !item.HostnameIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString())
- }
- } else if !item.HostnameIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString())
- }
- }
-
- if !item.VpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
- }
- } else if item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
-
- if !item.SourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
- }
- } else if item.SourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
- }
- }
-
- if !item.PriorityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString())
- }
- } else if item.Priority.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "priority.value", "informational")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString())
- }
- }
-
- if !item.TlsEnableVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString())
- }
- } else if item.TlsEnable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool())
- }
- }
-
- if !item.TlsPropertiesCustomProfileVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString())
- }
- } else if item.TlsPropertiesCustomProfile.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool())
- }
- }
-
- if !item.TlsPropertiesProfileVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString())
- }
- } else if item.TlsPropertiesProfile.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6Server.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemLogging) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.DiskEnable = types.BoolNull()
- data.DiskEnableVariable = types.StringNull()
- if t := res.Get(path + "disk.diskEnable.optionType"); t.Exists() {
- va := res.Get(path + "disk.diskEnable.value")
- if t.String() == "variable" {
- data.DiskEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DiskEnable = types.BoolValue(va.Bool())
- }
- }
- data.DiskFileSize = types.Int64Null()
- data.DiskFileSizeVariable = types.StringNull()
- if t := res.Get(path + "disk.file.diskFileSize.optionType"); t.Exists() {
- va := res.Get(path + "disk.file.diskFileSize.value")
- if t.String() == "variable" {
- data.DiskFileSizeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DiskFileSize = types.Int64Value(va.Int())
- }
- }
- data.DiskFileRotate = types.Int64Null()
- data.DiskFileRotateVariable = types.StringNull()
- if t := res.Get(path + "disk.file.diskFileRotate.optionType"); t.Exists() {
- va := res.Get(path + "disk.file.diskFileRotate.value")
- if t.String() == "variable" {
- data.DiskFileRotateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DiskFileRotate = types.Int64Value(va.Int())
- }
- }
- if value := res.Get(path + "tlsProfile"); value.Exists() {
- data.TlsProfiles = make([]SystemLoggingTlsProfiles, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemLoggingTlsProfiles{}
- item.Profile = types.StringNull()
- item.ProfileVariable = types.StringNull()
- if t := v.Get("profile.optionType"); t.Exists() {
- va := v.Get("profile.value")
- if t.String() == "variable" {
- item.ProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Profile = types.StringValue(va.String())
- }
- }
- item.TlsVersion = types.StringNull()
- item.TlsVersionVariable = types.StringNull()
- if t := v.Get("tlsVersion.optionType"); t.Exists() {
- va := v.Get("tlsVersion.value")
- if t.String() == "variable" {
- item.TlsVersionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlsVersion = types.StringValue(va.String())
- }
- }
- item.CipherSuites = types.SetNull(types.StringType)
- item.CipherSuitesVariable = types.StringNull()
- if t := v.Get("cipherSuiteList.optionType"); t.Exists() {
- va := v.Get("cipherSuiteList.value")
- if t.String() == "variable" {
- item.CipherSuitesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.CipherSuites = helpers.GetStringSet(va.Array())
- }
- }
- data.TlsProfiles = append(data.TlsProfiles, item)
- return true
- })
- }
- if value := res.Get(path + "server"); value.Exists() {
- data.Ipv4Servers = make([]SystemLoggingIpv4Servers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemLoggingIpv4Servers{}
- item.HostnameIp = types.StringNull()
- item.HostnameIpVariable = types.StringNull()
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "variable" {
- item.HostnameIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HostnameIp = types.StringValue(va.String())
- }
- }
- item.Vpn = types.Int64Null()
- item.VpnVariable = types.StringNull()
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "variable" {
- item.VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- item.SourceInterface = types.StringNull()
- item.SourceInterfaceVariable = types.StringNull()
- if t := v.Get("sourceInterface.optionType"); t.Exists() {
- va := v.Get("sourceInterface.value")
- if t.String() == "variable" {
- item.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceInterface = types.StringValue(va.String())
- }
- }
- item.Priority = types.StringNull()
- item.PriorityVariable = types.StringNull()
- if t := v.Get("priority.optionType"); t.Exists() {
- va := v.Get("priority.value")
- if t.String() == "variable" {
- item.PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Priority = types.StringValue(va.String())
- }
- }
- item.TlsEnable = types.BoolNull()
- item.TlsEnableVariable = types.StringNull()
- if t := v.Get("tlsEnable.optionType"); t.Exists() {
- va := v.Get("tlsEnable.value")
- if t.String() == "variable" {
- item.TlsEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlsEnable = types.BoolValue(va.Bool())
- }
- }
- item.TlsPropertiesCustomProfile = types.BoolNull()
- item.TlsPropertiesCustomProfileVariable = types.StringNull()
- if t := v.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
- va := v.Get("tlsPropertiesCustomProfile.value")
- if t.String() == "variable" {
- item.TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
- }
- }
- item.TlsPropertiesProfile = types.StringNull()
- item.TlsPropertiesProfileVariable = types.StringNull()
- if t := v.Get("tlsPropertiesProfile.optionType"); t.Exists() {
- va := v.Get("tlsPropertiesProfile.value")
- if t.String() == "variable" {
- item.TlsPropertiesProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlsPropertiesProfile = types.StringValue(va.String())
- }
- }
- data.Ipv4Servers = append(data.Ipv4Servers, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6Server"); value.Exists() {
- data.Ipv6Servers = make([]SystemLoggingIpv6Servers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemLoggingIpv6Servers{}
- item.HostnameIp = types.StringNull()
- item.HostnameIpVariable = types.StringNull()
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "variable" {
- item.HostnameIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HostnameIp = types.StringValue(va.String())
- }
- }
- item.Vpn = types.Int64Null()
- item.VpnVariable = types.StringNull()
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "variable" {
- item.VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- item.SourceInterface = types.StringNull()
- item.SourceInterfaceVariable = types.StringNull()
- if t := v.Get("sourceInterface.optionType"); t.Exists() {
- va := v.Get("sourceInterface.value")
- if t.String() == "variable" {
- item.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceInterface = types.StringValue(va.String())
- }
- }
- item.Priority = types.StringNull()
- item.PriorityVariable = types.StringNull()
- if t := v.Get("priority.optionType"); t.Exists() {
- va := v.Get("priority.value")
- if t.String() == "variable" {
- item.PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Priority = types.StringValue(va.String())
- }
- }
- item.TlsEnable = types.BoolNull()
- item.TlsEnableVariable = types.StringNull()
- if t := v.Get("tlsEnable.optionType"); t.Exists() {
- va := v.Get("tlsEnable.value")
- if t.String() == "variable" {
- item.TlsEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlsEnable = types.BoolValue(va.Bool())
- }
- }
- item.TlsPropertiesCustomProfile = types.BoolNull()
- item.TlsPropertiesCustomProfileVariable = types.StringNull()
- if t := v.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
- va := v.Get("tlsPropertiesCustomProfile.value")
- if t.String() == "variable" {
- item.TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
- }
- }
- item.TlsPropertiesProfile = types.StringNull()
- item.TlsPropertiesProfileVariable = types.StringNull()
- if t := v.Get("tlsPropertiesProfile.optionType"); t.Exists() {
- va := v.Get("tlsPropertiesProfile.value")
- if t.String() == "variable" {
- item.TlsPropertiesProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TlsPropertiesProfile = types.StringValue(va.String())
- }
- }
- data.Ipv6Servers = append(data.Ipv6Servers, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemLogging) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.DiskEnable = types.BoolNull()
- data.DiskEnableVariable = types.StringNull()
- if t := res.Get(path + "disk.diskEnable.optionType"); t.Exists() {
- va := res.Get(path + "disk.diskEnable.value")
- if t.String() == "variable" {
- data.DiskEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DiskEnable = types.BoolValue(va.Bool())
- }
- }
- data.DiskFileSize = types.Int64Null()
- data.DiskFileSizeVariable = types.StringNull()
- if t := res.Get(path + "disk.file.diskFileSize.optionType"); t.Exists() {
- va := res.Get(path + "disk.file.diskFileSize.value")
- if t.String() == "variable" {
- data.DiskFileSizeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DiskFileSize = types.Int64Value(va.Int())
- }
- }
- data.DiskFileRotate = types.Int64Null()
- data.DiskFileRotateVariable = types.StringNull()
- if t := res.Get(path + "disk.file.diskFileRotate.optionType"); t.Exists() {
- va := res.Get(path + "disk.file.diskFileRotate.value")
- if t.String() == "variable" {
- data.DiskFileRotateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DiskFileRotate = types.Int64Value(va.Int())
- }
- }
- for i := range data.TlsProfiles {
- keys := [...]string{"profile"}
- keyValues := [...]string{data.TlsProfiles[i].Profile.ValueString()}
- keyValuesVariables := [...]string{data.TlsProfiles[i].ProfileVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "tlsProfile").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.TlsProfiles[i].Profile = types.StringNull()
- data.TlsProfiles[i].ProfileVariable = types.StringNull()
- if t := r.Get("profile.optionType"); t.Exists() {
- va := r.Get("profile.value")
- if t.String() == "variable" {
- data.TlsProfiles[i].ProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlsProfiles[i].Profile = types.StringValue(va.String())
- }
- }
- data.TlsProfiles[i].TlsVersion = types.StringNull()
- data.TlsProfiles[i].TlsVersionVariable = types.StringNull()
- if t := r.Get("tlsVersion.optionType"); t.Exists() {
- va := r.Get("tlsVersion.value")
- if t.String() == "variable" {
- data.TlsProfiles[i].TlsVersionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlsProfiles[i].TlsVersion = types.StringValue(va.String())
- }
- }
- data.TlsProfiles[i].CipherSuites = types.SetNull(types.StringType)
- data.TlsProfiles[i].CipherSuitesVariable = types.StringNull()
- if t := r.Get("cipherSuiteList.optionType"); t.Exists() {
- va := r.Get("cipherSuiteList.value")
- if t.String() == "variable" {
- data.TlsProfiles[i].CipherSuitesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlsProfiles[i].CipherSuites = helpers.GetStringSet(va.Array())
- }
- }
- }
- for i := range data.Ipv4Servers {
- keys := [...]string{"name"}
- keyValues := [...]string{data.Ipv4Servers[i].HostnameIp.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4Servers[i].HostnameIpVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "server").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4Servers[i].HostnameIp = types.StringNull()
- data.Ipv4Servers[i].HostnameIpVariable = types.StringNull()
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "variable" {
- data.Ipv4Servers[i].HostnameIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Servers[i].HostnameIp = types.StringValue(va.String())
- }
- }
- data.Ipv4Servers[i].Vpn = types.Int64Null()
- data.Ipv4Servers[i].VpnVariable = types.StringNull()
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "variable" {
- data.Ipv4Servers[i].VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Servers[i].Vpn = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Servers[i].SourceInterface = types.StringNull()
- data.Ipv4Servers[i].SourceInterfaceVariable = types.StringNull()
- if t := r.Get("sourceInterface.optionType"); t.Exists() {
- va := r.Get("sourceInterface.value")
- if t.String() == "variable" {
- data.Ipv4Servers[i].SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Servers[i].SourceInterface = types.StringValue(va.String())
- }
- }
- data.Ipv4Servers[i].Priority = types.StringNull()
- data.Ipv4Servers[i].PriorityVariable = types.StringNull()
- if t := r.Get("priority.optionType"); t.Exists() {
- va := r.Get("priority.value")
- if t.String() == "variable" {
- data.Ipv4Servers[i].PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Servers[i].Priority = types.StringValue(va.String())
- }
- }
- data.Ipv4Servers[i].TlsEnable = types.BoolNull()
- data.Ipv4Servers[i].TlsEnableVariable = types.StringNull()
- if t := r.Get("tlsEnable.optionType"); t.Exists() {
- va := r.Get("tlsEnable.value")
- if t.String() == "variable" {
- data.Ipv4Servers[i].TlsEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Servers[i].TlsEnable = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Servers[i].TlsPropertiesCustomProfile = types.BoolNull()
- data.Ipv4Servers[i].TlsPropertiesCustomProfileVariable = types.StringNull()
- if t := r.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
- va := r.Get("tlsPropertiesCustomProfile.value")
- if t.String() == "variable" {
- data.Ipv4Servers[i].TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Servers[i].TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Servers[i].TlsPropertiesProfile = types.StringNull()
- data.Ipv4Servers[i].TlsPropertiesProfileVariable = types.StringNull()
- if t := r.Get("tlsPropertiesProfile.optionType"); t.Exists() {
- va := r.Get("tlsPropertiesProfile.value")
- if t.String() == "variable" {
- data.Ipv4Servers[i].TlsPropertiesProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Servers[i].TlsPropertiesProfile = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv6Servers {
- keys := [...]string{"name"}
- keyValues := [...]string{data.Ipv6Servers[i].HostnameIp.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6Servers[i].HostnameIpVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6Server").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6Servers[i].HostnameIp = types.StringNull()
- data.Ipv6Servers[i].HostnameIpVariable = types.StringNull()
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "variable" {
- data.Ipv6Servers[i].HostnameIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Servers[i].HostnameIp = types.StringValue(va.String())
- }
- }
- data.Ipv6Servers[i].Vpn = types.Int64Null()
- data.Ipv6Servers[i].VpnVariable = types.StringNull()
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "variable" {
- data.Ipv6Servers[i].VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Servers[i].Vpn = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Servers[i].SourceInterface = types.StringNull()
- data.Ipv6Servers[i].SourceInterfaceVariable = types.StringNull()
- if t := r.Get("sourceInterface.optionType"); t.Exists() {
- va := r.Get("sourceInterface.value")
- if t.String() == "variable" {
- data.Ipv6Servers[i].SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Servers[i].SourceInterface = types.StringValue(va.String())
- }
- }
- data.Ipv6Servers[i].Priority = types.StringNull()
- data.Ipv6Servers[i].PriorityVariable = types.StringNull()
- if t := r.Get("priority.optionType"); t.Exists() {
- va := r.Get("priority.value")
- if t.String() == "variable" {
- data.Ipv6Servers[i].PriorityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Servers[i].Priority = types.StringValue(va.String())
- }
- }
- data.Ipv6Servers[i].TlsEnable = types.BoolNull()
- data.Ipv6Servers[i].TlsEnableVariable = types.StringNull()
- if t := r.Get("tlsEnable.optionType"); t.Exists() {
- va := r.Get("tlsEnable.value")
- if t.String() == "variable" {
- data.Ipv6Servers[i].TlsEnableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Servers[i].TlsEnable = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Servers[i].TlsPropertiesCustomProfile = types.BoolNull()
- data.Ipv6Servers[i].TlsPropertiesCustomProfileVariable = types.StringNull()
- if t := r.Get("tlsPropertiesCustomProfile.optionType"); t.Exists() {
- va := r.Get("tlsPropertiesCustomProfile.value")
- if t.String() == "variable" {
- data.Ipv6Servers[i].TlsPropertiesCustomProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Servers[i].TlsPropertiesCustomProfile = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Servers[i].TlsPropertiesProfile = types.StringNull()
- data.Ipv6Servers[i].TlsPropertiesProfileVariable = types.StringNull()
- if t := r.Get("tlsPropertiesProfile.optionType"); t.Exists() {
- va := r.Get("tlsPropertiesProfile.value")
- if t.String() == "variable" {
- data.Ipv6Servers[i].TlsPropertiesProfileVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Servers[i].TlsPropertiesProfile = types.StringValue(va.String())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemLogging) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.DiskEnable.IsNull() {
- return false
- }
- if !data.DiskEnableVariable.IsNull() {
- return false
- }
- if !data.DiskFileSize.IsNull() {
- return false
- }
- if !data.DiskFileSizeVariable.IsNull() {
- return false
- }
- if !data.DiskFileRotate.IsNull() {
- return false
- }
- if !data.DiskFileRotateVariable.IsNull() {
- return false
- }
- if len(data.TlsProfiles) > 0 {
- return false
- }
- if len(data.Ipv4Servers) > 0 {
- return false
- }
- if len(data.Ipv6Servers) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_mrf_profile_parcel.go b/internal/provider/model_sdwan_system_mrf_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_system_mrf_profile_parcel.go
rename to internal/provider/model_sdwan_system_mrf_feature.go
diff --git a/internal/provider/model_sdwan_system_ntp_feature.go b/internal/provider/model_sdwan_system_ntp_feature.go
new file mode 100644
index 000000000..950558bfc
--- /dev/null
+++ b/internal/provider/model_sdwan_system_ntp_feature.go
@@ -0,0 +1,688 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemNTP 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"`
+ Servers []SystemNTPServers `tfsdk:"servers"`
+ AuthenticationKeys []SystemNTPAuthenticationKeys `tfsdk:"authentication_keys"`
+ TrustedKeys types.Set `tfsdk:"trusted_keys"`
+ TrustedKeysVariable types.String `tfsdk:"trusted_keys_variable"`
+ AuthoritativeNtpServer types.Bool `tfsdk:"authoritative_ntp_server"`
+ AuthoritativeNtpServerVariable types.String `tfsdk:"authoritative_ntp_server_variable"`
+ Stratum types.Int64 `tfsdk:"stratum"`
+ StratumVariable types.String `tfsdk:"stratum_variable"`
+ SourceInterface types.String `tfsdk:"source_interface"`
+ SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
+}
+
+type SystemNTPServers struct {
+ HostnameIpAddress types.String `tfsdk:"hostname_ip_address"`
+ HostnameIpAddressVariable types.String `tfsdk:"hostname_ip_address_variable"`
+ AuthenticationKey types.Int64 `tfsdk:"authentication_key"`
+ AuthenticationKeyVariable types.String `tfsdk:"authentication_key_variable"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ VpnVariable types.String `tfsdk:"vpn_variable"`
+ NtpVersion types.Int64 `tfsdk:"ntp_version"`
+ NtpVersionVariable types.String `tfsdk:"ntp_version_variable"`
+ SourceInterface types.String `tfsdk:"source_interface"`
+ SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
+ PreferThisNtpServer types.Bool `tfsdk:"prefer_this_ntp_server"`
+ PreferThisNtpServerVariable types.String `tfsdk:"prefer_this_ntp_server_variable"`
+}
+
+type SystemNTPAuthenticationKeys struct {
+ KeyId types.Int64 `tfsdk:"key_id"`
+ KeyIdVariable types.String `tfsdk:"key_id_variable"`
+ Md5Value types.String `tfsdk:"md5_value"`
+ Md5ValueVariable types.String `tfsdk:"md5_value_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemNTP) getModel() string {
+ return "system_ntp"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemNTP) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/ntp", 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 SystemNTP) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+ body, _ = sjson.Set(body, path+"server", []interface{}{})
+ for _, item := range data.Servers {
+ itemBody := ""
+
+ if !item.HostnameIpAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddressVariable.ValueString())
+ }
+ } else if !item.HostnameIpAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddress.ValueString())
+ }
+ }
+
+ if !item.AuthenticationKeyVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "key.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKeyVariable.ValueString())
+ }
+ } else if item.AuthenticationKey.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "key.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "key.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKey.ValueInt64())
+ }
+ }
+
+ if !item.VpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
+ }
+ } else if item.Vpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
+ }
+ }
+
+ if !item.NtpVersionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "version.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersionVariable.ValueString())
+ }
+ } else if item.NtpVersion.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "version.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "version.value", 4)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "version.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersion.ValueInt64())
+ }
+ }
+
+ if !item.SourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
+ }
+ } else if item.SourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
+ }
+ }
+
+ if !item.PreferThisNtpServerVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServerVariable.ValueString())
+ }
+ } else if item.PreferThisNtpServer.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "prefer.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServer.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"server.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"authentication.authenticationKeys", []interface{}{})
+ for _, item := range data.AuthenticationKeys {
+ itemBody := ""
+
+ if !item.KeyIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyIdVariable.ValueString())
+ }
+ } else if !item.KeyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyId.ValueInt64())
+ }
+ }
+
+ if !item.Md5ValueVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5ValueVariable.ValueString())
+ }
+ } else if !item.Md5Value.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5Value.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"authentication.authenticationKeys.-1", itemBody)
+ }
+ }
+
+ if !data.TrustedKeysVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "variable")
+ body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", data.TrustedKeysVariable.ValueString())
+ }
+ } else if data.TrustedKeys.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "global")
+ var values []int64
+ data.TrustedKeys.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", values)
+ }
+ }
+
+ if !data.AuthoritativeNtpServerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.enable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServerVariable.ValueString())
+ }
+ } else if data.AuthoritativeNtpServer.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.enable.optionType", "default")
+ body, _ = sjson.Set(body, path+"leader.enable.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.enable.optionType", "global")
+ body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServer.ValueBool())
+ }
+ }
+
+ if !data.StratumVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.stratum.optionType", "variable")
+ body, _ = sjson.Set(body, path+"leader.stratum.value", data.StratumVariable.ValueString())
+ }
+ } else if data.Stratum.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.stratum.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.stratum.optionType", "global")
+ body, _ = sjson.Set(body, path+"leader.stratum.value", data.Stratum.ValueInt64())
+ }
+ }
+
+ if !data.SourceInterfaceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.source.optionType", "variable")
+ body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterfaceVariable.ValueString())
+ }
+ } else if data.SourceInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.source.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"leader.source.optionType", "global")
+ body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterface.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemNTP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "server"); value.Exists() {
+ data.Servers = make([]SystemNTPServers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemNTPServers{}
+ item.HostnameIpAddress = types.StringNull()
+ item.HostnameIpAddressVariable = types.StringNull()
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "variable" {
+ item.HostnameIpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HostnameIpAddress = types.StringValue(va.String())
+ }
+ }
+ item.AuthenticationKey = types.Int64Null()
+ item.AuthenticationKeyVariable = types.StringNull()
+ if t := v.Get("key.optionType"); t.Exists() {
+ va := v.Get("key.value")
+ if t.String() == "variable" {
+ item.AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AuthenticationKey = types.Int64Value(va.Int())
+ }
+ }
+ item.Vpn = types.Int64Null()
+ item.VpnVariable = types.StringNull()
+ if t := v.Get("vpn.optionType"); t.Exists() {
+ va := v.Get("vpn.value")
+ if t.String() == "variable" {
+ item.VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ item.NtpVersion = types.Int64Null()
+ item.NtpVersionVariable = types.StringNull()
+ if t := v.Get("version.optionType"); t.Exists() {
+ va := v.Get("version.value")
+ if t.String() == "variable" {
+ item.NtpVersionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NtpVersion = types.Int64Value(va.Int())
+ }
+ }
+ item.SourceInterface = types.StringNull()
+ item.SourceInterfaceVariable = types.StringNull()
+ if t := v.Get("sourceInterface.optionType"); t.Exists() {
+ va := v.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ item.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceInterface = types.StringValue(va.String())
+ }
+ }
+ item.PreferThisNtpServer = types.BoolNull()
+ item.PreferThisNtpServerVariable = types.StringNull()
+ if t := v.Get("prefer.optionType"); t.Exists() {
+ va := v.Get("prefer.value")
+ if t.String() == "variable" {
+ item.PreferThisNtpServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PreferThisNtpServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.Servers = append(data.Servers, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "authentication.authenticationKeys"); value.Exists() {
+ data.AuthenticationKeys = make([]SystemNTPAuthenticationKeys, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemNTPAuthenticationKeys{}
+ item.KeyId = types.Int64Null()
+ item.KeyIdVariable = types.StringNull()
+ if t := v.Get("keyId.optionType"); t.Exists() {
+ va := v.Get("keyId.value")
+ if t.String() == "variable" {
+ item.KeyIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.KeyId = types.Int64Value(va.Int())
+ }
+ }
+ item.Md5Value = types.StringNull()
+ item.Md5ValueVariable = types.StringNull()
+ if t := v.Get("md5Value.optionType"); t.Exists() {
+ va := v.Get("md5Value.value")
+ if t.String() == "variable" {
+ item.Md5ValueVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Md5Value = types.StringValue(va.String())
+ }
+ }
+ data.AuthenticationKeys = append(data.AuthenticationKeys, item)
+ return true
+ })
+ }
+ data.TrustedKeys = types.SetNull(types.Int64Type)
+ data.TrustedKeysVariable = types.StringNull()
+ if t := res.Get(path + "authentication.trustedKeys.optionType"); t.Exists() {
+ va := res.Get(path + "authentication.trustedKeys.value")
+ if t.String() == "variable" {
+ data.TrustedKeysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrustedKeys = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.AuthoritativeNtpServer = types.BoolNull()
+ data.AuthoritativeNtpServerVariable = types.StringNull()
+ if t := res.Get(path + "leader.enable.optionType"); t.Exists() {
+ va := res.Get(path + "leader.enable.value")
+ if t.String() == "variable" {
+ data.AuthoritativeNtpServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthoritativeNtpServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.Stratum = types.Int64Null()
+ data.StratumVariable = types.StringNull()
+ if t := res.Get(path + "leader.stratum.optionType"); t.Exists() {
+ va := res.Get(path + "leader.stratum.value")
+ if t.String() == "variable" {
+ data.StratumVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Stratum = types.Int64Value(va.Int())
+ }
+ }
+ data.SourceInterface = types.StringNull()
+ data.SourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "leader.source.optionType"); t.Exists() {
+ va := res.Get(path + "leader.source.value")
+ if t.String() == "variable" {
+ data.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SourceInterface = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemNTP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.Servers {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Servers[i].HostnameIpAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Servers[i].HostnameIpAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "server").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Servers[i].HostnameIpAddress = types.StringNull()
+ data.Servers[i].HostnameIpAddressVariable = types.StringNull()
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "variable" {
+ data.Servers[i].HostnameIpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Servers[i].HostnameIpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Servers[i].AuthenticationKey = types.Int64Null()
+ data.Servers[i].AuthenticationKeyVariable = types.StringNull()
+ if t := r.Get("key.optionType"); t.Exists() {
+ va := r.Get("key.value")
+ if t.String() == "variable" {
+ data.Servers[i].AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Servers[i].AuthenticationKey = types.Int64Value(va.Int())
+ }
+ }
+ data.Servers[i].Vpn = types.Int64Null()
+ data.Servers[i].VpnVariable = types.StringNull()
+ if t := r.Get("vpn.optionType"); t.Exists() {
+ va := r.Get("vpn.value")
+ if t.String() == "variable" {
+ data.Servers[i].VpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Servers[i].Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.Servers[i].NtpVersion = types.Int64Null()
+ data.Servers[i].NtpVersionVariable = types.StringNull()
+ if t := r.Get("version.optionType"); t.Exists() {
+ va := r.Get("version.value")
+ if t.String() == "variable" {
+ data.Servers[i].NtpVersionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Servers[i].NtpVersion = types.Int64Value(va.Int())
+ }
+ }
+ data.Servers[i].SourceInterface = types.StringNull()
+ data.Servers[i].SourceInterfaceVariable = types.StringNull()
+ if t := r.Get("sourceInterface.optionType"); t.Exists() {
+ va := r.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ data.Servers[i].SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Servers[i].SourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.Servers[i].PreferThisNtpServer = types.BoolNull()
+ data.Servers[i].PreferThisNtpServerVariable = types.StringNull()
+ if t := r.Get("prefer.optionType"); t.Exists() {
+ va := r.Get("prefer.value")
+ if t.String() == "variable" {
+ data.Servers[i].PreferThisNtpServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Servers[i].PreferThisNtpServer = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.AuthenticationKeys {
+ keys := [...]string{"keyId"}
+ keyValues := [...]string{strconv.FormatInt(data.AuthenticationKeys[i].KeyId.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.AuthenticationKeys[i].KeyIdVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "authentication.authenticationKeys").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.AuthenticationKeys[i].KeyId = types.Int64Null()
+ data.AuthenticationKeys[i].KeyIdVariable = types.StringNull()
+ if t := r.Get("keyId.optionType"); t.Exists() {
+ va := r.Get("keyId.value")
+ if t.String() == "variable" {
+ data.AuthenticationKeys[i].KeyIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthenticationKeys[i].KeyId = types.Int64Value(va.Int())
+ }
+ }
+ data.AuthenticationKeys[i].Md5Value = types.StringNull()
+ data.AuthenticationKeys[i].Md5ValueVariable = types.StringNull()
+ if t := r.Get("md5Value.optionType"); t.Exists() {
+ va := r.Get("md5Value.value")
+ if t.String() == "variable" {
+ data.AuthenticationKeys[i].Md5ValueVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthenticationKeys[i].Md5Value = types.StringValue(va.String())
+ }
+ }
+ }
+ data.TrustedKeys = types.SetNull(types.Int64Type)
+ data.TrustedKeysVariable = types.StringNull()
+ if t := res.Get(path + "authentication.trustedKeys.optionType"); t.Exists() {
+ va := res.Get(path + "authentication.trustedKeys.value")
+ if t.String() == "variable" {
+ data.TrustedKeysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrustedKeys = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.AuthoritativeNtpServer = types.BoolNull()
+ data.AuthoritativeNtpServerVariable = types.StringNull()
+ if t := res.Get(path + "leader.enable.optionType"); t.Exists() {
+ va := res.Get(path + "leader.enable.value")
+ if t.String() == "variable" {
+ data.AuthoritativeNtpServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AuthoritativeNtpServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.Stratum = types.Int64Null()
+ data.StratumVariable = types.StringNull()
+ if t := res.Get(path + "leader.stratum.optionType"); t.Exists() {
+ va := res.Get(path + "leader.stratum.value")
+ if t.String() == "variable" {
+ data.StratumVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Stratum = types.Int64Value(va.Int())
+ }
+ }
+ data.SourceInterface = types.StringNull()
+ data.SourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "leader.source.optionType"); t.Exists() {
+ va := res.Get(path + "leader.source.value")
+ if t.String() == "variable" {
+ data.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SourceInterface = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemNTP) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.Servers) > 0 {
+ return false
+ }
+ if len(data.AuthenticationKeys) > 0 {
+ return false
+ }
+ if !data.TrustedKeys.IsNull() {
+ return false
+ }
+ if !data.TrustedKeysVariable.IsNull() {
+ return false
+ }
+ if !data.AuthoritativeNtpServer.IsNull() {
+ return false
+ }
+ if !data.AuthoritativeNtpServerVariable.IsNull() {
+ return false
+ }
+ if !data.Stratum.IsNull() {
+ return false
+ }
+ if !data.StratumVariable.IsNull() {
+ return false
+ }
+ if !data.SourceInterface.IsNull() {
+ return false
+ }
+ if !data.SourceInterfaceVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_ntp_profile_parcel.go b/internal/provider/model_sdwan_system_ntp_profile_parcel.go
deleted file mode 100644
index e9ef90c78..000000000
--- a/internal/provider/model_sdwan_system_ntp_profile_parcel.go
+++ /dev/null
@@ -1,682 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemNTP 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"`
- Servers []SystemNTPServers `tfsdk:"servers"`
- AuthenticationKeys []SystemNTPAuthenticationKeys `tfsdk:"authentication_keys"`
- TrustedKeys types.Set `tfsdk:"trusted_keys"`
- TrustedKeysVariable types.String `tfsdk:"trusted_keys_variable"`
- AuthoritativeNtpServer types.Bool `tfsdk:"authoritative_ntp_server"`
- AuthoritativeNtpServerVariable types.String `tfsdk:"authoritative_ntp_server_variable"`
- Stratum types.Int64 `tfsdk:"stratum"`
- StratumVariable types.String `tfsdk:"stratum_variable"`
- SourceInterface types.String `tfsdk:"source_interface"`
- SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
-}
-
-type SystemNTPServers struct {
- HostnameIpAddress types.String `tfsdk:"hostname_ip_address"`
- HostnameIpAddressVariable types.String `tfsdk:"hostname_ip_address_variable"`
- AuthenticationKey types.Int64 `tfsdk:"authentication_key"`
- AuthenticationKeyVariable types.String `tfsdk:"authentication_key_variable"`
- Vpn types.Int64 `tfsdk:"vpn"`
- VpnVariable types.String `tfsdk:"vpn_variable"`
- NtpVersion types.Int64 `tfsdk:"ntp_version"`
- NtpVersionVariable types.String `tfsdk:"ntp_version_variable"`
- SourceInterface types.String `tfsdk:"source_interface"`
- SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
- PreferThisNtpServer types.Bool `tfsdk:"prefer_this_ntp_server"`
- PreferThisNtpServerVariable types.String `tfsdk:"prefer_this_ntp_server_variable"`
-}
-
-type SystemNTPAuthenticationKeys struct {
- KeyId types.Int64 `tfsdk:"key_id"`
- KeyIdVariable types.String `tfsdk:"key_id_variable"`
- Md5Value types.String `tfsdk:"md5_value"`
- Md5ValueVariable types.String `tfsdk:"md5_value_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemNTP) getModel() string {
- return "system_ntp"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemNTP) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/ntp", 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 SystemNTP) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
- if true {
- body, _ = sjson.Set(body, path+"server", []interface{}{})
- for _, item := range data.Servers {
- itemBody := ""
-
- if !item.HostnameIpAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddressVariable.ValueString())
- }
- } else if !item.HostnameIpAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddress.ValueString())
- }
- }
-
- if !item.AuthenticationKeyVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "key.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKeyVariable.ValueString())
- }
- } else if item.AuthenticationKey.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "key.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "key.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKey.ValueInt64())
- }
- }
-
- if !item.VpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString())
- }
- } else if item.Vpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", 0)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64())
- }
- }
-
- if !item.NtpVersionVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "version.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersionVariable.ValueString())
- }
- } else if item.NtpVersion.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "version.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "version.value", 4)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "version.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersion.ValueInt64())
- }
- }
-
- if !item.SourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
- }
- } else if item.SourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
- }
- }
-
- if !item.PreferThisNtpServerVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServerVariable.ValueString())
- }
- } else if item.PreferThisNtpServer.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "prefer.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServer.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"server.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"authentication.authenticationKeys", []interface{}{})
- for _, item := range data.AuthenticationKeys {
- itemBody := ""
-
- if !item.KeyIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyIdVariable.ValueString())
- }
- } else if !item.KeyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyId.ValueInt64())
- }
- }
-
- if !item.Md5ValueVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5ValueVariable.ValueString())
- }
- } else if !item.Md5Value.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5Value.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"authentication.authenticationKeys.-1", itemBody)
- }
- }
-
- if !data.TrustedKeysVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "variable")
- body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", data.TrustedKeysVariable.ValueString())
- }
- } else if data.TrustedKeys.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "global")
- var values []int64
- data.TrustedKeys.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", values)
- }
- }
-
- if !data.AuthoritativeNtpServerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"leader.enable.optionType", "variable")
- body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServerVariable.ValueString())
- }
- } else if data.AuthoritativeNtpServer.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"leader.enable.optionType", "default")
- body, _ = sjson.Set(body, path+"leader.enable.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"leader.enable.optionType", "global")
- body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServer.ValueBool())
- }
- }
-
- if !data.StratumVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"leader.stratum.optionType", "variable")
- body, _ = sjson.Set(body, path+"leader.stratum.value", data.StratumVariable.ValueString())
- }
- } else if data.Stratum.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"leader.stratum.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"leader.stratum.optionType", "global")
- body, _ = sjson.Set(body, path+"leader.stratum.value", data.Stratum.ValueInt64())
- }
- }
-
- if !data.SourceInterfaceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"leader.source.optionType", "variable")
- body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterfaceVariable.ValueString())
- }
- } else if data.SourceInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"leader.source.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"leader.source.optionType", "global")
- body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterface.ValueString())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemNTP) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- if value := res.Get(path + "server"); value.Exists() {
- data.Servers = make([]SystemNTPServers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemNTPServers{}
- item.HostnameIpAddress = types.StringNull()
- item.HostnameIpAddressVariable = types.StringNull()
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "variable" {
- item.HostnameIpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HostnameIpAddress = types.StringValue(va.String())
- }
- }
- item.AuthenticationKey = types.Int64Null()
- item.AuthenticationKeyVariable = types.StringNull()
- if t := v.Get("key.optionType"); t.Exists() {
- va := v.Get("key.value")
- if t.String() == "variable" {
- item.AuthenticationKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AuthenticationKey = types.Int64Value(va.Int())
- }
- }
- item.Vpn = types.Int64Null()
- item.VpnVariable = types.StringNull()
- if t := v.Get("vpn.optionType"); t.Exists() {
- va := v.Get("vpn.value")
- if t.String() == "variable" {
- item.VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Vpn = types.Int64Value(va.Int())
- }
- }
- item.NtpVersion = types.Int64Null()
- item.NtpVersionVariable = types.StringNull()
- if t := v.Get("version.optionType"); t.Exists() {
- va := v.Get("version.value")
- if t.String() == "variable" {
- item.NtpVersionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NtpVersion = types.Int64Value(va.Int())
- }
- }
- item.SourceInterface = types.StringNull()
- item.SourceInterfaceVariable = types.StringNull()
- if t := v.Get("sourceInterface.optionType"); t.Exists() {
- va := v.Get("sourceInterface.value")
- if t.String() == "variable" {
- item.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceInterface = types.StringValue(va.String())
- }
- }
- item.PreferThisNtpServer = types.BoolNull()
- item.PreferThisNtpServerVariable = types.StringNull()
- if t := v.Get("prefer.optionType"); t.Exists() {
- va := v.Get("prefer.value")
- if t.String() == "variable" {
- item.PreferThisNtpServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.PreferThisNtpServer = types.BoolValue(va.Bool())
- }
- }
- data.Servers = append(data.Servers, item)
- return true
- })
- }
- if value := res.Get(path + "authentication.authenticationKeys"); value.Exists() {
- data.AuthenticationKeys = make([]SystemNTPAuthenticationKeys, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemNTPAuthenticationKeys{}
- item.KeyId = types.Int64Null()
- item.KeyIdVariable = types.StringNull()
- if t := v.Get("keyId.optionType"); t.Exists() {
- va := v.Get("keyId.value")
- if t.String() == "variable" {
- item.KeyIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.KeyId = types.Int64Value(va.Int())
- }
- }
- item.Md5Value = types.StringNull()
- item.Md5ValueVariable = types.StringNull()
- if t := v.Get("md5Value.optionType"); t.Exists() {
- va := v.Get("md5Value.value")
- if t.String() == "variable" {
- item.Md5ValueVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Md5Value = types.StringValue(va.String())
- }
- }
- data.AuthenticationKeys = append(data.AuthenticationKeys, item)
- return true
- })
- }
- data.TrustedKeys = types.SetNull(types.Int64Type)
- data.TrustedKeysVariable = types.StringNull()
- if t := res.Get(path + "authentication.trustedKeys.optionType"); t.Exists() {
- va := res.Get(path + "authentication.trustedKeys.value")
- if t.String() == "variable" {
- data.TrustedKeysVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrustedKeys = helpers.GetInt64Set(va.Array())
- }
- }
- data.AuthoritativeNtpServer = types.BoolNull()
- data.AuthoritativeNtpServerVariable = types.StringNull()
- if t := res.Get(path + "leader.enable.optionType"); t.Exists() {
- va := res.Get(path + "leader.enable.value")
- if t.String() == "variable" {
- data.AuthoritativeNtpServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthoritativeNtpServer = types.BoolValue(va.Bool())
- }
- }
- data.Stratum = types.Int64Null()
- data.StratumVariable = types.StringNull()
- if t := res.Get(path + "leader.stratum.optionType"); t.Exists() {
- va := res.Get(path + "leader.stratum.value")
- if t.String() == "variable" {
- data.StratumVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Stratum = types.Int64Value(va.Int())
- }
- }
- data.SourceInterface = types.StringNull()
- data.SourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "leader.source.optionType"); t.Exists() {
- va := res.Get(path + "leader.source.value")
- if t.String() == "variable" {
- data.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SourceInterface = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemNTP) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- for i := range data.Servers {
- keys := [...]string{"name"}
- keyValues := [...]string{data.Servers[i].HostnameIpAddress.ValueString()}
- keyValuesVariables := [...]string{data.Servers[i].HostnameIpAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "server").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Servers[i].HostnameIpAddress = types.StringNull()
- data.Servers[i].HostnameIpAddressVariable = types.StringNull()
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "variable" {
- data.Servers[i].HostnameIpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Servers[i].HostnameIpAddress = types.StringValue(va.String())
- }
- }
- data.Servers[i].AuthenticationKey = types.Int64Null()
- data.Servers[i].AuthenticationKeyVariable = types.StringNull()
- if t := r.Get("key.optionType"); t.Exists() {
- va := r.Get("key.value")
- if t.String() == "variable" {
- data.Servers[i].AuthenticationKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Servers[i].AuthenticationKey = types.Int64Value(va.Int())
- }
- }
- data.Servers[i].Vpn = types.Int64Null()
- data.Servers[i].VpnVariable = types.StringNull()
- if t := r.Get("vpn.optionType"); t.Exists() {
- va := r.Get("vpn.value")
- if t.String() == "variable" {
- data.Servers[i].VpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Servers[i].Vpn = types.Int64Value(va.Int())
- }
- }
- data.Servers[i].NtpVersion = types.Int64Null()
- data.Servers[i].NtpVersionVariable = types.StringNull()
- if t := r.Get("version.optionType"); t.Exists() {
- va := r.Get("version.value")
- if t.String() == "variable" {
- data.Servers[i].NtpVersionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Servers[i].NtpVersion = types.Int64Value(va.Int())
- }
- }
- data.Servers[i].SourceInterface = types.StringNull()
- data.Servers[i].SourceInterfaceVariable = types.StringNull()
- if t := r.Get("sourceInterface.optionType"); t.Exists() {
- va := r.Get("sourceInterface.value")
- if t.String() == "variable" {
- data.Servers[i].SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Servers[i].SourceInterface = types.StringValue(va.String())
- }
- }
- data.Servers[i].PreferThisNtpServer = types.BoolNull()
- data.Servers[i].PreferThisNtpServerVariable = types.StringNull()
- if t := r.Get("prefer.optionType"); t.Exists() {
- va := r.Get("prefer.value")
- if t.String() == "variable" {
- data.Servers[i].PreferThisNtpServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Servers[i].PreferThisNtpServer = types.BoolValue(va.Bool())
- }
- }
- }
- for i := range data.AuthenticationKeys {
- keys := [...]string{"keyId"}
- keyValues := [...]string{strconv.FormatInt(data.AuthenticationKeys[i].KeyId.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.AuthenticationKeys[i].KeyIdVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "authentication.authenticationKeys").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.AuthenticationKeys[i].KeyId = types.Int64Null()
- data.AuthenticationKeys[i].KeyIdVariable = types.StringNull()
- if t := r.Get("keyId.optionType"); t.Exists() {
- va := r.Get("keyId.value")
- if t.String() == "variable" {
- data.AuthenticationKeys[i].KeyIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthenticationKeys[i].KeyId = types.Int64Value(va.Int())
- }
- }
- data.AuthenticationKeys[i].Md5Value = types.StringNull()
- data.AuthenticationKeys[i].Md5ValueVariable = types.StringNull()
- if t := r.Get("md5Value.optionType"); t.Exists() {
- va := r.Get("md5Value.value")
- if t.String() == "variable" {
- data.AuthenticationKeys[i].Md5ValueVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthenticationKeys[i].Md5Value = types.StringValue(va.String())
- }
- }
- }
- data.TrustedKeys = types.SetNull(types.Int64Type)
- data.TrustedKeysVariable = types.StringNull()
- if t := res.Get(path + "authentication.trustedKeys.optionType"); t.Exists() {
- va := res.Get(path + "authentication.trustedKeys.value")
- if t.String() == "variable" {
- data.TrustedKeysVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrustedKeys = helpers.GetInt64Set(va.Array())
- }
- }
- data.AuthoritativeNtpServer = types.BoolNull()
- data.AuthoritativeNtpServerVariable = types.StringNull()
- if t := res.Get(path + "leader.enable.optionType"); t.Exists() {
- va := res.Get(path + "leader.enable.value")
- if t.String() == "variable" {
- data.AuthoritativeNtpServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AuthoritativeNtpServer = types.BoolValue(va.Bool())
- }
- }
- data.Stratum = types.Int64Null()
- data.StratumVariable = types.StringNull()
- if t := res.Get(path + "leader.stratum.optionType"); t.Exists() {
- va := res.Get(path + "leader.stratum.value")
- if t.String() == "variable" {
- data.StratumVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Stratum = types.Int64Value(va.Int())
- }
- }
- data.SourceInterface = types.StringNull()
- data.SourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "leader.source.optionType"); t.Exists() {
- va := res.Get(path + "leader.source.value")
- if t.String() == "variable" {
- data.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SourceInterface = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemNTP) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if len(data.Servers) > 0 {
- return false
- }
- if len(data.AuthenticationKeys) > 0 {
- return false
- }
- if !data.TrustedKeys.IsNull() {
- return false
- }
- if !data.TrustedKeysVariable.IsNull() {
- return false
- }
- if !data.AuthoritativeNtpServer.IsNull() {
- return false
- }
- if !data.AuthoritativeNtpServerVariable.IsNull() {
- return false
- }
- if !data.Stratum.IsNull() {
- return false
- }
- if !data.StratumVariable.IsNull() {
- return false
- }
- if !data.SourceInterface.IsNull() {
- return false
- }
- if !data.SourceInterfaceVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_omp_profile_parcel.go b/internal/provider/model_sdwan_system_omp_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_system_omp_profile_parcel.go
rename to internal/provider/model_sdwan_system_omp_feature.go
diff --git a/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go b/internal/provider/model_sdwan_system_performance_monitoring_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go
rename to internal/provider/model_sdwan_system_performance_monitoring_feature.go
diff --git a/internal/provider/model_sdwan_system_remote_access_profile_parcel.go b/internal/provider/model_sdwan_system_remote_access_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_system_remote_access_profile_parcel.go
rename to internal/provider/model_sdwan_system_remote_access_feature.go
diff --git a/internal/provider/model_sdwan_system_security_feature.go b/internal/provider/model_sdwan_system_security_feature.go
new file mode 100644
index 000000000..2bcd56a86
--- /dev/null
+++ b/internal/provider/model_sdwan_system_security_feature.go
@@ -0,0 +1,1012 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemSecurity 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"`
+ Rekey types.Int64 `tfsdk:"rekey"`
+ RekeyVariable types.String `tfsdk:"rekey_variable"`
+ AntiReplayWindow types.String `tfsdk:"anti_replay_window"`
+ AntiReplayWindowVariable types.String `tfsdk:"anti_replay_window_variable"`
+ ExtendedAntiReplayWindow types.Int64 `tfsdk:"extended_anti_replay_window"`
+ ExtendedAntiReplayWindowVariable types.String `tfsdk:"extended_anti_replay_window_variable"`
+ IpsecPairwiseKeying types.Bool `tfsdk:"ipsec_pairwise_keying"`
+ IpsecPairwiseKeyingVariable types.String `tfsdk:"ipsec_pairwise_keying_variable"`
+ IntegrityType types.Set `tfsdk:"integrity_type"`
+ IntegrityTypeVariable types.String `tfsdk:"integrity_type_variable"`
+ Keychains []SystemSecurityKeychains `tfsdk:"keychains"`
+ Keys []SystemSecurityKeys `tfsdk:"keys"`
+}
+
+type SystemSecurityKeychains struct {
+ KeyChainName types.String `tfsdk:"key_chain_name"`
+ KeyId types.Int64 `tfsdk:"key_id"`
+}
+
+type SystemSecurityKeys struct {
+ Id types.Int64 `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ SendId types.Int64 `tfsdk:"send_id"`
+ SendIdVariable types.String `tfsdk:"send_id_variable"`
+ ReceiverId types.Int64 `tfsdk:"receiver_id"`
+ ReceiverIdVariable types.String `tfsdk:"receiver_id_variable"`
+ IncludeTcpOptions types.Bool `tfsdk:"include_tcp_options"`
+ IncludeTcpOptionsVariable types.String `tfsdk:"include_tcp_options_variable"`
+ AcceptAoMismatch types.Bool `tfsdk:"accept_ao_mismatch"`
+ AcceptAoMismatchVariable types.String `tfsdk:"accept_ao_mismatch_variable"`
+ CryptoAlgorithm types.String `tfsdk:"crypto_algorithm"`
+ KeyString types.String `tfsdk:"key_string"`
+ KeyStringVariable types.String `tfsdk:"key_string_variable"`
+ SendLifeTimeLocal types.Bool `tfsdk:"send_life_time_local"`
+ SendLifeTimeLocalVariable types.String `tfsdk:"send_life_time_local_variable"`
+ SendLifeTimeStartEpoch types.Int64 `tfsdk:"send_life_time_start_epoch"`
+ SendLifeTimeInfinite types.Bool `tfsdk:"send_life_time_infinite"`
+ SendLifeTimeInfiniteVariable types.String `tfsdk:"send_life_time_infinite_variable"`
+ SendLifeTimeDuration types.Int64 `tfsdk:"send_life_time_duration"`
+ SendLifeTimeDurationVariable types.String `tfsdk:"send_life_time_duration_variable"`
+ SendLifeTimeExact types.Int64 `tfsdk:"send_life_time_exact"`
+ AcceptLifeTimeLocal types.Bool `tfsdk:"accept_life_time_local"`
+ AcceptLifeTimeLocalVariable types.String `tfsdk:"accept_life_time_local_variable"`
+ AcceptLifeTimeStartEpoch types.Int64 `tfsdk:"accept_life_time_start_epoch"`
+ AcceptLifeTimeInfinite types.Bool `tfsdk:"accept_life_time_infinite"`
+ AcceptLifeTimeInfiniteVariable types.String `tfsdk:"accept_life_time_infinite_variable"`
+ AcceptLifeTimeDuration types.Int64 `tfsdk:"accept_life_time_duration"`
+ AcceptLifeTimeDurationVariable types.String `tfsdk:"accept_life_time_duration_variable"`
+ AcceptLifeTimeExact types.Int64 `tfsdk:"accept_life_time_exact"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemSecurity) getModel() string {
+ return "system_security"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemSecurity) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/security", 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 SystemSecurity) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.RekeyVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"rekey.optionType", "variable")
+ body, _ = sjson.Set(body, path+"rekey.value", data.RekeyVariable.ValueString())
+ }
+ } else if data.Rekey.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"rekey.optionType", "default")
+ body, _ = sjson.Set(body, path+"rekey.value", 86400)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"rekey.optionType", "global")
+ body, _ = sjson.Set(body, path+"rekey.value", data.Rekey.ValueInt64())
+ }
+ }
+
+ if !data.AntiReplayWindowVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"replayWindow.optionType", "variable")
+ body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindowVariable.ValueString())
+ }
+ } else if data.AntiReplayWindow.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"replayWindow.optionType", "default")
+ body, _ = sjson.Set(body, path+"replayWindow.value", "512")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"replayWindow.optionType", "global")
+ body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindow.ValueString())
+ }
+ }
+
+ if !data.ExtendedAntiReplayWindowVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "variable")
+ body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindowVariable.ValueString())
+ }
+ } else if data.ExtendedAntiReplayWindow.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "default")
+ body, _ = sjson.Set(body, path+"extendedArWindow.value", 256)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "global")
+ body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindow.ValueInt64())
+ }
+ }
+
+ if !data.IpsecPairwiseKeyingVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "variable")
+ body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeyingVariable.ValueString())
+ }
+ } else if data.IpsecPairwiseKeying.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "default")
+ body, _ = sjson.Set(body, path+"pairwiseKeying.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "global")
+ body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeying.ValueBool())
+ }
+ }
+
+ if !data.IntegrityTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"integrityType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"integrityType.value", data.IntegrityTypeVariable.ValueString())
+ }
+ } else if !data.IntegrityType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"integrityType.optionType", "global")
+ var values []string
+ data.IntegrityType.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"integrityType.value", values)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"keychain", []interface{}{})
+ for _, item := range data.Keychains {
+ itemBody := ""
+ if !item.KeyChainName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.KeyChainName.ValueString())
+ }
+ }
+ if !item.KeyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "id.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "id.value", item.KeyId.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"keychain.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"key", []interface{}{})
+ for _, item := range data.Keys {
+ itemBody := ""
+ if !item.Id.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "id.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "id.value", item.Id.ValueInt64())
+ }
+ }
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
+ }
+ }
+
+ if !item.SendIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendIdVariable.ValueString())
+ }
+ } else if !item.SendId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendId.ValueInt64())
+ }
+ }
+
+ if !item.ReceiverIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverIdVariable.ValueString())
+ }
+ } else if !item.ReceiverId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverId.ValueInt64())
+ }
+ }
+
+ if !item.IncludeTcpOptionsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptionsVariable.ValueString())
+ }
+ } else if item.IncludeTcpOptions.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptions.ValueBool())
+ }
+ }
+
+ if !item.AcceptAoMismatchVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatchVariable.ValueString())
+ }
+ } else if item.AcceptAoMismatch.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatch.ValueBool())
+ }
+ }
+ if !item.CryptoAlgorithm.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "tcp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "tcp.value", item.CryptoAlgorithm.ValueString())
+ }
+ }
+
+ if !item.KeyStringVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyStringVariable.ValueString())
+ }
+ } else if !item.KeyString.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyString.ValueString())
+ }
+ }
+
+ if !item.SendLifeTimeLocalVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocalVariable.ValueString())
+ }
+ } else if item.SendLifeTimeLocal.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocal.ValueBool())
+ }
+ }
+ if !item.SendLifeTimeStartEpoch.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.value", item.SendLifeTimeStartEpoch.ValueInt64())
+ }
+ }
+
+ if !item.SendLifeTimeInfiniteVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfiniteVariable.ValueString())
+ }
+ } else if !item.SendLifeTimeInfinite.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfinite.ValueBool())
+ }
+ }
+
+ if !item.SendLifeTimeDurationVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDurationVariable.ValueString())
+ }
+ } else if !item.SendLifeTimeDuration.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDuration.ValueInt64())
+ }
+ }
+ if !item.SendLifeTimeExact.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.value", item.SendLifeTimeExact.ValueInt64())
+ }
+ }
+
+ if !item.AcceptLifeTimeLocalVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocalVariable.ValueString())
+ }
+ } else if item.AcceptLifeTimeLocal.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocal.ValueBool())
+ }
+ }
+ if !item.AcceptLifeTimeStartEpoch.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.value", item.AcceptLifeTimeStartEpoch.ValueInt64())
+ }
+ }
+
+ if !item.AcceptLifeTimeInfiniteVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfiniteVariable.ValueString())
+ }
+ } else if !item.AcceptLifeTimeInfinite.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfinite.ValueBool())
+ }
+ }
+
+ if !item.AcceptLifeTimeDurationVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDurationVariable.ValueString())
+ }
+ } else if !item.AcceptLifeTimeDuration.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDuration.ValueInt64())
+ }
+ }
+ if !item.AcceptLifeTimeExact.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.value", item.AcceptLifeTimeExact.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"key.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemSecurity) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Rekey = types.Int64Null()
+ data.RekeyVariable = types.StringNull()
+ if t := res.Get(path + "rekey.optionType"); t.Exists() {
+ va := res.Get(path + "rekey.value")
+ if t.String() == "variable" {
+ data.RekeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rekey = types.Int64Value(va.Int())
+ }
+ }
+ data.AntiReplayWindow = types.StringNull()
+ data.AntiReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "replayWindow.optionType"); t.Exists() {
+ va := res.Get(path + "replayWindow.value")
+ if t.String() == "variable" {
+ data.AntiReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AntiReplayWindow = types.StringValue(va.String())
+ }
+ }
+ data.ExtendedAntiReplayWindow = types.Int64Null()
+ data.ExtendedAntiReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "extendedArWindow.optionType"); t.Exists() {
+ va := res.Get(path + "extendedArWindow.value")
+ if t.String() == "variable" {
+ data.ExtendedAntiReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExtendedAntiReplayWindow = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecPairwiseKeying = types.BoolNull()
+ data.IpsecPairwiseKeyingVariable = types.StringNull()
+ if t := res.Get(path + "pairwiseKeying.optionType"); t.Exists() {
+ va := res.Get(path + "pairwiseKeying.value")
+ if t.String() == "variable" {
+ data.IpsecPairwiseKeyingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecPairwiseKeying = types.BoolValue(va.Bool())
+ }
+ }
+ data.IntegrityType = types.SetNull(types.StringType)
+ data.IntegrityTypeVariable = types.StringNull()
+ if t := res.Get(path + "integrityType.optionType"); t.Exists() {
+ va := res.Get(path + "integrityType.value")
+ if t.String() == "variable" {
+ data.IntegrityTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IntegrityType = helpers.GetStringSet(va.Array())
+ }
+ }
+ if value := res.Get(path + "keychain"); value.Exists() {
+ data.Keychains = make([]SystemSecurityKeychains, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemSecurityKeychains{}
+ item.KeyChainName = types.StringNull()
+
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "global" {
+ item.KeyChainName = types.StringValue(va.String())
+ }
+ }
+ item.KeyId = types.Int64Null()
+
+ if t := v.Get("id.optionType"); t.Exists() {
+ va := v.Get("id.value")
+ if t.String() == "global" {
+ item.KeyId = types.Int64Value(va.Int())
+ }
+ }
+ data.Keychains = append(data.Keychains, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "key"); value.Exists() {
+ data.Keys = make([]SystemSecurityKeys, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemSecurityKeys{}
+ item.Id = types.Int64Null()
+
+ if t := v.Get("id.optionType"); t.Exists() {
+ va := v.Get("id.value")
+ if t.String() == "global" {
+ item.Id = types.Int64Value(va.Int())
+ }
+ }
+ item.Name = types.StringNull()
+
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.SendId = types.Int64Null()
+ item.SendIdVariable = types.StringNull()
+ if t := v.Get("sendId.optionType"); t.Exists() {
+ va := v.Get("sendId.value")
+ if t.String() == "variable" {
+ item.SendIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendId = types.Int64Value(va.Int())
+ }
+ }
+ item.ReceiverId = types.Int64Null()
+ item.ReceiverIdVariable = types.StringNull()
+ if t := v.Get("recvId.optionType"); t.Exists() {
+ va := v.Get("recvId.value")
+ if t.String() == "variable" {
+ item.ReceiverIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ReceiverId = types.Int64Value(va.Int())
+ }
+ }
+ item.IncludeTcpOptions = types.BoolNull()
+ item.IncludeTcpOptionsVariable = types.StringNull()
+ if t := v.Get("includeTcpOptions.optionType"); t.Exists() {
+ va := v.Get("includeTcpOptions.value")
+ if t.String() == "variable" {
+ item.IncludeTcpOptionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.IncludeTcpOptions = types.BoolValue(va.Bool())
+ }
+ }
+ item.AcceptAoMismatch = types.BoolNull()
+ item.AcceptAoMismatchVariable = types.StringNull()
+ if t := v.Get("acceptAoMismatch.optionType"); t.Exists() {
+ va := v.Get("acceptAoMismatch.value")
+ if t.String() == "variable" {
+ item.AcceptAoMismatchVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AcceptAoMismatch = types.BoolValue(va.Bool())
+ }
+ }
+ item.CryptoAlgorithm = types.StringNull()
+
+ if t := v.Get("tcp.optionType"); t.Exists() {
+ va := v.Get("tcp.value")
+ if t.String() == "global" {
+ item.CryptoAlgorithm = types.StringValue(va.String())
+ }
+ }
+ item.SendLifeTimeLocal = types.BoolNull()
+ item.SendLifeTimeLocalVariable = types.StringNull()
+ if t := v.Get("sendLifetime.local.optionType"); t.Exists() {
+ va := v.Get("sendLifetime.local.value")
+ if t.String() == "variable" {
+ item.SendLifeTimeLocalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendLifeTimeLocal = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendLifeTimeStartEpoch = types.Int64Null()
+
+ if t := v.Get("sendLifetime.startEpoch.optionType"); t.Exists() {
+ va := v.Get("sendLifetime.startEpoch.value")
+ if t.String() == "global" {
+ item.SendLifeTimeStartEpoch = types.Int64Value(va.Int())
+ }
+ }
+ item.SendLifeTimeInfinite = types.BoolNull()
+ item.SendLifeTimeInfiniteVariable = types.StringNull()
+ if t := v.Get("sendLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
+ va := v.Get("sendLifetime.oneOfendChoice.infinite.value")
+ if t.String() == "variable" {
+ item.SendLifeTimeInfiniteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendLifeTimeInfinite = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendLifeTimeDuration = types.Int64Null()
+ item.SendLifeTimeDurationVariable = types.StringNull()
+ if t := v.Get("sendLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
+ va := v.Get("sendLifetime.oneOfendChoice.duration.value")
+ if t.String() == "variable" {
+ item.SendLifeTimeDurationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendLifeTimeDuration = types.Int64Value(va.Int())
+ }
+ }
+ item.SendLifeTimeExact = types.Int64Null()
+
+ if t := v.Get("sendLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
+ va := v.Get("sendLifetime.oneOfendChoice.exact.value")
+ if t.String() == "global" {
+ item.SendLifeTimeExact = types.Int64Value(va.Int())
+ }
+ }
+ item.AcceptLifeTimeLocal = types.BoolNull()
+ item.AcceptLifeTimeLocalVariable = types.StringNull()
+ if t := v.Get("acceptLifetime.local.optionType"); t.Exists() {
+ va := v.Get("acceptLifetime.local.value")
+ if t.String() == "variable" {
+ item.AcceptLifeTimeLocalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AcceptLifeTimeLocal = types.BoolValue(va.Bool())
+ }
+ }
+ item.AcceptLifeTimeStartEpoch = types.Int64Null()
+
+ if t := v.Get("acceptLifetime.startEpoch.optionType"); t.Exists() {
+ va := v.Get("acceptLifetime.startEpoch.value")
+ if t.String() == "global" {
+ item.AcceptLifeTimeStartEpoch = types.Int64Value(va.Int())
+ }
+ }
+ item.AcceptLifeTimeInfinite = types.BoolNull()
+ item.AcceptLifeTimeInfiniteVariable = types.StringNull()
+ if t := v.Get("acceptLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
+ va := v.Get("acceptLifetime.oneOfendChoice.infinite.value")
+ if t.String() == "variable" {
+ item.AcceptLifeTimeInfiniteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AcceptLifeTimeInfinite = types.BoolValue(va.Bool())
+ }
+ }
+ item.AcceptLifeTimeDuration = types.Int64Null()
+ item.AcceptLifeTimeDurationVariable = types.StringNull()
+ if t := v.Get("acceptLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
+ va := v.Get("acceptLifetime.oneOfendChoice.duration.value")
+ if t.String() == "variable" {
+ item.AcceptLifeTimeDurationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AcceptLifeTimeDuration = types.Int64Value(va.Int())
+ }
+ }
+ item.AcceptLifeTimeExact = types.Int64Null()
+
+ if t := v.Get("acceptLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
+ va := v.Get("acceptLifetime.oneOfendChoice.exact.value")
+ if t.String() == "global" {
+ item.AcceptLifeTimeExact = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys = append(data.Keys, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemSecurity) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Rekey = types.Int64Null()
+ data.RekeyVariable = types.StringNull()
+ if t := res.Get(path + "rekey.optionType"); t.Exists() {
+ va := res.Get(path + "rekey.value")
+ if t.String() == "variable" {
+ data.RekeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rekey = types.Int64Value(va.Int())
+ }
+ }
+ data.AntiReplayWindow = types.StringNull()
+ data.AntiReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "replayWindow.optionType"); t.Exists() {
+ va := res.Get(path + "replayWindow.value")
+ if t.String() == "variable" {
+ data.AntiReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AntiReplayWindow = types.StringValue(va.String())
+ }
+ }
+ data.ExtendedAntiReplayWindow = types.Int64Null()
+ data.ExtendedAntiReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "extendedArWindow.optionType"); t.Exists() {
+ va := res.Get(path + "extendedArWindow.value")
+ if t.String() == "variable" {
+ data.ExtendedAntiReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExtendedAntiReplayWindow = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecPairwiseKeying = types.BoolNull()
+ data.IpsecPairwiseKeyingVariable = types.StringNull()
+ if t := res.Get(path + "pairwiseKeying.optionType"); t.Exists() {
+ va := res.Get(path + "pairwiseKeying.value")
+ if t.String() == "variable" {
+ data.IpsecPairwiseKeyingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecPairwiseKeying = types.BoolValue(va.Bool())
+ }
+ }
+ data.IntegrityType = types.SetNull(types.StringType)
+ data.IntegrityTypeVariable = types.StringNull()
+ if t := res.Get(path + "integrityType.optionType"); t.Exists() {
+ va := res.Get(path + "integrityType.value")
+ if t.String() == "variable" {
+ data.IntegrityTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IntegrityType = helpers.GetStringSet(va.Array())
+ }
+ }
+ for i := range data.Keychains {
+ keys := [...]string{"id"}
+ keyValues := [...]string{strconv.FormatInt(data.Keychains[i].KeyId.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "keychain").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Keychains[i].KeyChainName = types.StringNull()
+
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "global" {
+ data.Keychains[i].KeyChainName = types.StringValue(va.String())
+ }
+ }
+ data.Keychains[i].KeyId = types.Int64Null()
+
+ if t := r.Get("id.optionType"); t.Exists() {
+ va := r.Get("id.value")
+ if t.String() == "global" {
+ data.Keychains[i].KeyId = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.Keys {
+ keys := [...]string{"id"}
+ keyValues := [...]string{strconv.FormatInt(data.Keys[i].Id.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "key").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Keys[i].Id = types.Int64Null()
+
+ if t := r.Get("id.optionType"); t.Exists() {
+ va := r.Get("id.value")
+ if t.String() == "global" {
+ data.Keys[i].Id = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].Name = types.StringNull()
+
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "global" {
+ data.Keys[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Keys[i].SendId = types.Int64Null()
+ data.Keys[i].SendIdVariable = types.StringNull()
+ if t := r.Get("sendId.optionType"); t.Exists() {
+ va := r.Get("sendId.value")
+ if t.String() == "variable" {
+ data.Keys[i].SendIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].SendId = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].ReceiverId = types.Int64Null()
+ data.Keys[i].ReceiverIdVariable = types.StringNull()
+ if t := r.Get("recvId.optionType"); t.Exists() {
+ va := r.Get("recvId.value")
+ if t.String() == "variable" {
+ data.Keys[i].ReceiverIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].ReceiverId = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].IncludeTcpOptions = types.BoolNull()
+ data.Keys[i].IncludeTcpOptionsVariable = types.StringNull()
+ if t := r.Get("includeTcpOptions.optionType"); t.Exists() {
+ va := r.Get("includeTcpOptions.value")
+ if t.String() == "variable" {
+ data.Keys[i].IncludeTcpOptionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].IncludeTcpOptions = types.BoolValue(va.Bool())
+ }
+ }
+ data.Keys[i].AcceptAoMismatch = types.BoolNull()
+ data.Keys[i].AcceptAoMismatchVariable = types.StringNull()
+ if t := r.Get("acceptAoMismatch.optionType"); t.Exists() {
+ va := r.Get("acceptAoMismatch.value")
+ if t.String() == "variable" {
+ data.Keys[i].AcceptAoMismatchVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].AcceptAoMismatch = types.BoolValue(va.Bool())
+ }
+ }
+ data.Keys[i].CryptoAlgorithm = types.StringNull()
+
+ if t := r.Get("tcp.optionType"); t.Exists() {
+ va := r.Get("tcp.value")
+ if t.String() == "global" {
+ data.Keys[i].CryptoAlgorithm = types.StringValue(va.String())
+ }
+ }
+ data.Keys[i].SendLifeTimeLocal = types.BoolNull()
+ data.Keys[i].SendLifeTimeLocalVariable = types.StringNull()
+ if t := r.Get("sendLifetime.local.optionType"); t.Exists() {
+ va := r.Get("sendLifetime.local.value")
+ if t.String() == "variable" {
+ data.Keys[i].SendLifeTimeLocalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].SendLifeTimeLocal = types.BoolValue(va.Bool())
+ }
+ }
+ data.Keys[i].SendLifeTimeStartEpoch = types.Int64Null()
+
+ if t := r.Get("sendLifetime.startEpoch.optionType"); t.Exists() {
+ va := r.Get("sendLifetime.startEpoch.value")
+ if t.String() == "global" {
+ data.Keys[i].SendLifeTimeStartEpoch = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].SendLifeTimeInfinite = types.BoolNull()
+ data.Keys[i].SendLifeTimeInfiniteVariable = types.StringNull()
+ if t := r.Get("sendLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
+ va := r.Get("sendLifetime.oneOfendChoice.infinite.value")
+ if t.String() == "variable" {
+ data.Keys[i].SendLifeTimeInfiniteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].SendLifeTimeInfinite = types.BoolValue(va.Bool())
+ }
+ }
+ data.Keys[i].SendLifeTimeDuration = types.Int64Null()
+ data.Keys[i].SendLifeTimeDurationVariable = types.StringNull()
+ if t := r.Get("sendLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
+ va := r.Get("sendLifetime.oneOfendChoice.duration.value")
+ if t.String() == "variable" {
+ data.Keys[i].SendLifeTimeDurationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].SendLifeTimeDuration = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].SendLifeTimeExact = types.Int64Null()
+
+ if t := r.Get("sendLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
+ va := r.Get("sendLifetime.oneOfendChoice.exact.value")
+ if t.String() == "global" {
+ data.Keys[i].SendLifeTimeExact = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].AcceptLifeTimeLocal = types.BoolNull()
+ data.Keys[i].AcceptLifeTimeLocalVariable = types.StringNull()
+ if t := r.Get("acceptLifetime.local.optionType"); t.Exists() {
+ va := r.Get("acceptLifetime.local.value")
+ if t.String() == "variable" {
+ data.Keys[i].AcceptLifeTimeLocalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].AcceptLifeTimeLocal = types.BoolValue(va.Bool())
+ }
+ }
+ data.Keys[i].AcceptLifeTimeStartEpoch = types.Int64Null()
+
+ if t := r.Get("acceptLifetime.startEpoch.optionType"); t.Exists() {
+ va := r.Get("acceptLifetime.startEpoch.value")
+ if t.String() == "global" {
+ data.Keys[i].AcceptLifeTimeStartEpoch = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].AcceptLifeTimeInfinite = types.BoolNull()
+ data.Keys[i].AcceptLifeTimeInfiniteVariable = types.StringNull()
+ if t := r.Get("acceptLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
+ va := r.Get("acceptLifetime.oneOfendChoice.infinite.value")
+ if t.String() == "variable" {
+ data.Keys[i].AcceptLifeTimeInfiniteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].AcceptLifeTimeInfinite = types.BoolValue(va.Bool())
+ }
+ }
+ data.Keys[i].AcceptLifeTimeDuration = types.Int64Null()
+ data.Keys[i].AcceptLifeTimeDurationVariable = types.StringNull()
+ if t := r.Get("acceptLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
+ va := r.Get("acceptLifetime.oneOfendChoice.duration.value")
+ if t.String() == "variable" {
+ data.Keys[i].AcceptLifeTimeDurationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Keys[i].AcceptLifeTimeDuration = types.Int64Value(va.Int())
+ }
+ }
+ data.Keys[i].AcceptLifeTimeExact = types.Int64Null()
+
+ if t := r.Get("acceptLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
+ va := r.Get("acceptLifetime.oneOfendChoice.exact.value")
+ if t.String() == "global" {
+ data.Keys[i].AcceptLifeTimeExact = types.Int64Value(va.Int())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemSecurity) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.Rekey.IsNull() {
+ return false
+ }
+ if !data.RekeyVariable.IsNull() {
+ return false
+ }
+ if !data.AntiReplayWindow.IsNull() {
+ return false
+ }
+ if !data.AntiReplayWindowVariable.IsNull() {
+ return false
+ }
+ if !data.ExtendedAntiReplayWindow.IsNull() {
+ return false
+ }
+ if !data.ExtendedAntiReplayWindowVariable.IsNull() {
+ return false
+ }
+ if !data.IpsecPairwiseKeying.IsNull() {
+ return false
+ }
+ if !data.IpsecPairwiseKeyingVariable.IsNull() {
+ return false
+ }
+ if !data.IntegrityType.IsNull() {
+ return false
+ }
+ if !data.IntegrityTypeVariable.IsNull() {
+ return false
+ }
+ if len(data.Keychains) > 0 {
+ return false
+ }
+ if len(data.Keys) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_security_profile_parcel.go b/internal/provider/model_sdwan_system_security_profile_parcel.go
deleted file mode 100644
index b33895e2d..000000000
--- a/internal/provider/model_sdwan_system_security_profile_parcel.go
+++ /dev/null
@@ -1,1006 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemSecurity 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"`
- Rekey types.Int64 `tfsdk:"rekey"`
- RekeyVariable types.String `tfsdk:"rekey_variable"`
- AntiReplayWindow types.String `tfsdk:"anti_replay_window"`
- AntiReplayWindowVariable types.String `tfsdk:"anti_replay_window_variable"`
- ExtendedAntiReplayWindow types.Int64 `tfsdk:"extended_anti_replay_window"`
- ExtendedAntiReplayWindowVariable types.String `tfsdk:"extended_anti_replay_window_variable"`
- IpsecPairwiseKeying types.Bool `tfsdk:"ipsec_pairwise_keying"`
- IpsecPairwiseKeyingVariable types.String `tfsdk:"ipsec_pairwise_keying_variable"`
- IntegrityType types.Set `tfsdk:"integrity_type"`
- IntegrityTypeVariable types.String `tfsdk:"integrity_type_variable"`
- Keychains []SystemSecurityKeychains `tfsdk:"keychains"`
- Keys []SystemSecurityKeys `tfsdk:"keys"`
-}
-
-type SystemSecurityKeychains struct {
- KeyChainName types.String `tfsdk:"key_chain_name"`
- KeyId types.Int64 `tfsdk:"key_id"`
-}
-
-type SystemSecurityKeys struct {
- Id types.Int64 `tfsdk:"id"`
- Name types.String `tfsdk:"name"`
- SendId types.Int64 `tfsdk:"send_id"`
- SendIdVariable types.String `tfsdk:"send_id_variable"`
- ReceiverId types.Int64 `tfsdk:"receiver_id"`
- ReceiverIdVariable types.String `tfsdk:"receiver_id_variable"`
- IncludeTcpOptions types.Bool `tfsdk:"include_tcp_options"`
- IncludeTcpOptionsVariable types.String `tfsdk:"include_tcp_options_variable"`
- AcceptAoMismatch types.Bool `tfsdk:"accept_ao_mismatch"`
- AcceptAoMismatchVariable types.String `tfsdk:"accept_ao_mismatch_variable"`
- CryptoAlgorithm types.String `tfsdk:"crypto_algorithm"`
- KeyString types.String `tfsdk:"key_string"`
- KeyStringVariable types.String `tfsdk:"key_string_variable"`
- SendLifeTimeLocal types.Bool `tfsdk:"send_life_time_local"`
- SendLifeTimeLocalVariable types.String `tfsdk:"send_life_time_local_variable"`
- SendLifeTimeStartEpoch types.Int64 `tfsdk:"send_life_time_start_epoch"`
- SendLifeTimeInfinite types.Bool `tfsdk:"send_life_time_infinite"`
- SendLifeTimeInfiniteVariable types.String `tfsdk:"send_life_time_infinite_variable"`
- SendLifeTimeDuration types.Int64 `tfsdk:"send_life_time_duration"`
- SendLifeTimeDurationVariable types.String `tfsdk:"send_life_time_duration_variable"`
- SendLifeTimeExact types.Int64 `tfsdk:"send_life_time_exact"`
- AcceptLifeTimeLocal types.Bool `tfsdk:"accept_life_time_local"`
- AcceptLifeTimeLocalVariable types.String `tfsdk:"accept_life_time_local_variable"`
- AcceptLifeTimeStartEpoch types.Int64 `tfsdk:"accept_life_time_start_epoch"`
- AcceptLifeTimeInfinite types.Bool `tfsdk:"accept_life_time_infinite"`
- AcceptLifeTimeInfiniteVariable types.String `tfsdk:"accept_life_time_infinite_variable"`
- AcceptLifeTimeDuration types.Int64 `tfsdk:"accept_life_time_duration"`
- AcceptLifeTimeDurationVariable types.String `tfsdk:"accept_life_time_duration_variable"`
- AcceptLifeTimeExact types.Int64 `tfsdk:"accept_life_time_exact"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemSecurity) getModel() string {
- return "system_security"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemSecurity) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/security", 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 SystemSecurity) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.RekeyVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"rekey.optionType", "variable")
- body, _ = sjson.Set(body, path+"rekey.value", data.RekeyVariable.ValueString())
- }
- } else if data.Rekey.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"rekey.optionType", "default")
- body, _ = sjson.Set(body, path+"rekey.value", 86400)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"rekey.optionType", "global")
- body, _ = sjson.Set(body, path+"rekey.value", data.Rekey.ValueInt64())
- }
- }
-
- if !data.AntiReplayWindowVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"replayWindow.optionType", "variable")
- body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindowVariable.ValueString())
- }
- } else if data.AntiReplayWindow.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"replayWindow.optionType", "default")
- body, _ = sjson.Set(body, path+"replayWindow.value", "512")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"replayWindow.optionType", "global")
- body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindow.ValueString())
- }
- }
-
- if !data.ExtendedAntiReplayWindowVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "variable")
- body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindowVariable.ValueString())
- }
- } else if data.ExtendedAntiReplayWindow.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "default")
- body, _ = sjson.Set(body, path+"extendedArWindow.value", 256)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "global")
- body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindow.ValueInt64())
- }
- }
-
- if !data.IpsecPairwiseKeyingVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "variable")
- body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeyingVariable.ValueString())
- }
- } else if data.IpsecPairwiseKeying.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "default")
- body, _ = sjson.Set(body, path+"pairwiseKeying.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "global")
- body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeying.ValueBool())
- }
- }
-
- if !data.IntegrityTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"integrityType.optionType", "variable")
- body, _ = sjson.Set(body, path+"integrityType.value", data.IntegrityTypeVariable.ValueString())
- }
- } else if !data.IntegrityType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"integrityType.optionType", "global")
- var values []string
- data.IntegrityType.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"integrityType.value", values)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"keychain", []interface{}{})
- for _, item := range data.Keychains {
- itemBody := ""
- if !item.KeyChainName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.KeyChainName.ValueString())
- }
- }
- if !item.KeyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "id.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "id.value", item.KeyId.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"keychain.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"key", []interface{}{})
- for _, item := range data.Keys {
- itemBody := ""
- if !item.Id.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "id.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "id.value", item.Id.ValueInt64())
- }
- }
- if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
- }
- }
-
- if !item.SendIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendIdVariable.ValueString())
- }
- } else if !item.SendId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendId.ValueInt64())
- }
- }
-
- if !item.ReceiverIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverIdVariable.ValueString())
- }
- } else if !item.ReceiverId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverId.ValueInt64())
- }
- }
-
- if !item.IncludeTcpOptionsVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptionsVariable.ValueString())
- }
- } else if item.IncludeTcpOptions.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptions.ValueBool())
- }
- }
-
- if !item.AcceptAoMismatchVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatchVariable.ValueString())
- }
- } else if item.AcceptAoMismatch.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatch.ValueBool())
- }
- }
- if !item.CryptoAlgorithm.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "tcp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "tcp.value", item.CryptoAlgorithm.ValueString())
- }
- }
-
- if !item.KeyStringVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyStringVariable.ValueString())
- }
- } else if !item.KeyString.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyString.ValueString())
- }
- }
-
- if !item.SendLifeTimeLocalVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocalVariable.ValueString())
- }
- } else if item.SendLifeTimeLocal.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocal.ValueBool())
- }
- }
- if !item.SendLifeTimeStartEpoch.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.value", item.SendLifeTimeStartEpoch.ValueInt64())
- }
- }
-
- if !item.SendLifeTimeInfiniteVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfiniteVariable.ValueString())
- }
- } else if !item.SendLifeTimeInfinite.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfinite.ValueBool())
- }
- }
-
- if !item.SendLifeTimeDurationVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDurationVariable.ValueString())
- }
- } else if !item.SendLifeTimeDuration.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDuration.ValueInt64())
- }
- }
- if !item.SendLifeTimeExact.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.value", item.SendLifeTimeExact.ValueInt64())
- }
- }
-
- if !item.AcceptLifeTimeLocalVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocalVariable.ValueString())
- }
- } else if item.AcceptLifeTimeLocal.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocal.ValueBool())
- }
- }
- if !item.AcceptLifeTimeStartEpoch.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.value", item.AcceptLifeTimeStartEpoch.ValueInt64())
- }
- }
-
- if !item.AcceptLifeTimeInfiniteVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfiniteVariable.ValueString())
- }
- } else if !item.AcceptLifeTimeInfinite.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfinite.ValueBool())
- }
- }
-
- if !item.AcceptLifeTimeDurationVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDurationVariable.ValueString())
- }
- } else if !item.AcceptLifeTimeDuration.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDuration.ValueInt64())
- }
- }
- if !item.AcceptLifeTimeExact.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.value", item.AcceptLifeTimeExact.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"key.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemSecurity) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Rekey = types.Int64Null()
- data.RekeyVariable = types.StringNull()
- if t := res.Get(path + "rekey.optionType"); t.Exists() {
- va := res.Get(path + "rekey.value")
- if t.String() == "variable" {
- data.RekeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Rekey = types.Int64Value(va.Int())
- }
- }
- data.AntiReplayWindow = types.StringNull()
- data.AntiReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "replayWindow.optionType"); t.Exists() {
- va := res.Get(path + "replayWindow.value")
- if t.String() == "variable" {
- data.AntiReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AntiReplayWindow = types.StringValue(va.String())
- }
- }
- data.ExtendedAntiReplayWindow = types.Int64Null()
- data.ExtendedAntiReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "extendedArWindow.optionType"); t.Exists() {
- va := res.Get(path + "extendedArWindow.value")
- if t.String() == "variable" {
- data.ExtendedAntiReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ExtendedAntiReplayWindow = types.Int64Value(va.Int())
- }
- }
- data.IpsecPairwiseKeying = types.BoolNull()
- data.IpsecPairwiseKeyingVariable = types.StringNull()
- if t := res.Get(path + "pairwiseKeying.optionType"); t.Exists() {
- va := res.Get(path + "pairwiseKeying.value")
- if t.String() == "variable" {
- data.IpsecPairwiseKeyingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecPairwiseKeying = types.BoolValue(va.Bool())
- }
- }
- data.IntegrityType = types.SetNull(types.StringType)
- data.IntegrityTypeVariable = types.StringNull()
- if t := res.Get(path + "integrityType.optionType"); t.Exists() {
- va := res.Get(path + "integrityType.value")
- if t.String() == "variable" {
- data.IntegrityTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IntegrityType = helpers.GetStringSet(va.Array())
- }
- }
- if value := res.Get(path + "keychain"); value.Exists() {
- data.Keychains = make([]SystemSecurityKeychains, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemSecurityKeychains{}
- item.KeyChainName = types.StringNull()
-
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "global" {
- item.KeyChainName = types.StringValue(va.String())
- }
- }
- item.KeyId = types.Int64Null()
-
- if t := v.Get("id.optionType"); t.Exists() {
- va := v.Get("id.value")
- if t.String() == "global" {
- item.KeyId = types.Int64Value(va.Int())
- }
- }
- data.Keychains = append(data.Keychains, item)
- return true
- })
- }
- if value := res.Get(path + "key"); value.Exists() {
- data.Keys = make([]SystemSecurityKeys, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemSecurityKeys{}
- item.Id = types.Int64Null()
-
- if t := v.Get("id.optionType"); t.Exists() {
- va := v.Get("id.value")
- if t.String() == "global" {
- item.Id = types.Int64Value(va.Int())
- }
- }
- item.Name = types.StringNull()
-
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- item.SendId = types.Int64Null()
- item.SendIdVariable = types.StringNull()
- if t := v.Get("sendId.optionType"); t.Exists() {
- va := v.Get("sendId.value")
- if t.String() == "variable" {
- item.SendIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendId = types.Int64Value(va.Int())
- }
- }
- item.ReceiverId = types.Int64Null()
- item.ReceiverIdVariable = types.StringNull()
- if t := v.Get("recvId.optionType"); t.Exists() {
- va := v.Get("recvId.value")
- if t.String() == "variable" {
- item.ReceiverIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.ReceiverId = types.Int64Value(va.Int())
- }
- }
- item.IncludeTcpOptions = types.BoolNull()
- item.IncludeTcpOptionsVariable = types.StringNull()
- if t := v.Get("includeTcpOptions.optionType"); t.Exists() {
- va := v.Get("includeTcpOptions.value")
- if t.String() == "variable" {
- item.IncludeTcpOptionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.IncludeTcpOptions = types.BoolValue(va.Bool())
- }
- }
- item.AcceptAoMismatch = types.BoolNull()
- item.AcceptAoMismatchVariable = types.StringNull()
- if t := v.Get("acceptAoMismatch.optionType"); t.Exists() {
- va := v.Get("acceptAoMismatch.value")
- if t.String() == "variable" {
- item.AcceptAoMismatchVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AcceptAoMismatch = types.BoolValue(va.Bool())
- }
- }
- item.CryptoAlgorithm = types.StringNull()
-
- if t := v.Get("tcp.optionType"); t.Exists() {
- va := v.Get("tcp.value")
- if t.String() == "global" {
- item.CryptoAlgorithm = types.StringValue(va.String())
- }
- }
- item.SendLifeTimeLocal = types.BoolNull()
- item.SendLifeTimeLocalVariable = types.StringNull()
- if t := v.Get("sendLifetime.local.optionType"); t.Exists() {
- va := v.Get("sendLifetime.local.value")
- if t.String() == "variable" {
- item.SendLifeTimeLocalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendLifeTimeLocal = types.BoolValue(va.Bool())
- }
- }
- item.SendLifeTimeStartEpoch = types.Int64Null()
-
- if t := v.Get("sendLifetime.startEpoch.optionType"); t.Exists() {
- va := v.Get("sendLifetime.startEpoch.value")
- if t.String() == "global" {
- item.SendLifeTimeStartEpoch = types.Int64Value(va.Int())
- }
- }
- item.SendLifeTimeInfinite = types.BoolNull()
- item.SendLifeTimeInfiniteVariable = types.StringNull()
- if t := v.Get("sendLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
- va := v.Get("sendLifetime.oneOfendChoice.infinite.value")
- if t.String() == "variable" {
- item.SendLifeTimeInfiniteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendLifeTimeInfinite = types.BoolValue(va.Bool())
- }
- }
- item.SendLifeTimeDuration = types.Int64Null()
- item.SendLifeTimeDurationVariable = types.StringNull()
- if t := v.Get("sendLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
- va := v.Get("sendLifetime.oneOfendChoice.duration.value")
- if t.String() == "variable" {
- item.SendLifeTimeDurationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendLifeTimeDuration = types.Int64Value(va.Int())
- }
- }
- item.SendLifeTimeExact = types.Int64Null()
-
- if t := v.Get("sendLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
- va := v.Get("sendLifetime.oneOfendChoice.exact.value")
- if t.String() == "global" {
- item.SendLifeTimeExact = types.Int64Value(va.Int())
- }
- }
- item.AcceptLifeTimeLocal = types.BoolNull()
- item.AcceptLifeTimeLocalVariable = types.StringNull()
- if t := v.Get("acceptLifetime.local.optionType"); t.Exists() {
- va := v.Get("acceptLifetime.local.value")
- if t.String() == "variable" {
- item.AcceptLifeTimeLocalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AcceptLifeTimeLocal = types.BoolValue(va.Bool())
- }
- }
- item.AcceptLifeTimeStartEpoch = types.Int64Null()
-
- if t := v.Get("acceptLifetime.startEpoch.optionType"); t.Exists() {
- va := v.Get("acceptLifetime.startEpoch.value")
- if t.String() == "global" {
- item.AcceptLifeTimeStartEpoch = types.Int64Value(va.Int())
- }
- }
- item.AcceptLifeTimeInfinite = types.BoolNull()
- item.AcceptLifeTimeInfiniteVariable = types.StringNull()
- if t := v.Get("acceptLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
- va := v.Get("acceptLifetime.oneOfendChoice.infinite.value")
- if t.String() == "variable" {
- item.AcceptLifeTimeInfiniteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AcceptLifeTimeInfinite = types.BoolValue(va.Bool())
- }
- }
- item.AcceptLifeTimeDuration = types.Int64Null()
- item.AcceptLifeTimeDurationVariable = types.StringNull()
- if t := v.Get("acceptLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
- va := v.Get("acceptLifetime.oneOfendChoice.duration.value")
- if t.String() == "variable" {
- item.AcceptLifeTimeDurationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AcceptLifeTimeDuration = types.Int64Value(va.Int())
- }
- }
- item.AcceptLifeTimeExact = types.Int64Null()
-
- if t := v.Get("acceptLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
- va := v.Get("acceptLifetime.oneOfendChoice.exact.value")
- if t.String() == "global" {
- item.AcceptLifeTimeExact = types.Int64Value(va.Int())
- }
- }
- data.Keys = append(data.Keys, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemSecurity) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Rekey = types.Int64Null()
- data.RekeyVariable = types.StringNull()
- if t := res.Get(path + "rekey.optionType"); t.Exists() {
- va := res.Get(path + "rekey.value")
- if t.String() == "variable" {
- data.RekeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Rekey = types.Int64Value(va.Int())
- }
- }
- data.AntiReplayWindow = types.StringNull()
- data.AntiReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "replayWindow.optionType"); t.Exists() {
- va := res.Get(path + "replayWindow.value")
- if t.String() == "variable" {
- data.AntiReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AntiReplayWindow = types.StringValue(va.String())
- }
- }
- data.ExtendedAntiReplayWindow = types.Int64Null()
- data.ExtendedAntiReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "extendedArWindow.optionType"); t.Exists() {
- va := res.Get(path + "extendedArWindow.value")
- if t.String() == "variable" {
- data.ExtendedAntiReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ExtendedAntiReplayWindow = types.Int64Value(va.Int())
- }
- }
- data.IpsecPairwiseKeying = types.BoolNull()
- data.IpsecPairwiseKeyingVariable = types.StringNull()
- if t := res.Get(path + "pairwiseKeying.optionType"); t.Exists() {
- va := res.Get(path + "pairwiseKeying.value")
- if t.String() == "variable" {
- data.IpsecPairwiseKeyingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecPairwiseKeying = types.BoolValue(va.Bool())
- }
- }
- data.IntegrityType = types.SetNull(types.StringType)
- data.IntegrityTypeVariable = types.StringNull()
- if t := res.Get(path + "integrityType.optionType"); t.Exists() {
- va := res.Get(path + "integrityType.value")
- if t.String() == "variable" {
- data.IntegrityTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IntegrityType = helpers.GetStringSet(va.Array())
- }
- }
- for i := range data.Keychains {
- keys := [...]string{"id"}
- keyValues := [...]string{strconv.FormatInt(data.Keychains[i].KeyId.ValueInt64(), 10)}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "keychain").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Keychains[i].KeyChainName = types.StringNull()
-
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "global" {
- data.Keychains[i].KeyChainName = types.StringValue(va.String())
- }
- }
- data.Keychains[i].KeyId = types.Int64Null()
-
- if t := r.Get("id.optionType"); t.Exists() {
- va := r.Get("id.value")
- if t.String() == "global" {
- data.Keychains[i].KeyId = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.Keys {
- keys := [...]string{"id"}
- keyValues := [...]string{strconv.FormatInt(data.Keys[i].Id.ValueInt64(), 10)}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "key").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Keys[i].Id = types.Int64Null()
-
- if t := r.Get("id.optionType"); t.Exists() {
- va := r.Get("id.value")
- if t.String() == "global" {
- data.Keys[i].Id = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].Name = types.StringNull()
-
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "global" {
- data.Keys[i].Name = types.StringValue(va.String())
- }
- }
- data.Keys[i].SendId = types.Int64Null()
- data.Keys[i].SendIdVariable = types.StringNull()
- if t := r.Get("sendId.optionType"); t.Exists() {
- va := r.Get("sendId.value")
- if t.String() == "variable" {
- data.Keys[i].SendIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].SendId = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].ReceiverId = types.Int64Null()
- data.Keys[i].ReceiverIdVariable = types.StringNull()
- if t := r.Get("recvId.optionType"); t.Exists() {
- va := r.Get("recvId.value")
- if t.String() == "variable" {
- data.Keys[i].ReceiverIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].ReceiverId = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].IncludeTcpOptions = types.BoolNull()
- data.Keys[i].IncludeTcpOptionsVariable = types.StringNull()
- if t := r.Get("includeTcpOptions.optionType"); t.Exists() {
- va := r.Get("includeTcpOptions.value")
- if t.String() == "variable" {
- data.Keys[i].IncludeTcpOptionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].IncludeTcpOptions = types.BoolValue(va.Bool())
- }
- }
- data.Keys[i].AcceptAoMismatch = types.BoolNull()
- data.Keys[i].AcceptAoMismatchVariable = types.StringNull()
- if t := r.Get("acceptAoMismatch.optionType"); t.Exists() {
- va := r.Get("acceptAoMismatch.value")
- if t.String() == "variable" {
- data.Keys[i].AcceptAoMismatchVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].AcceptAoMismatch = types.BoolValue(va.Bool())
- }
- }
- data.Keys[i].CryptoAlgorithm = types.StringNull()
-
- if t := r.Get("tcp.optionType"); t.Exists() {
- va := r.Get("tcp.value")
- if t.String() == "global" {
- data.Keys[i].CryptoAlgorithm = types.StringValue(va.String())
- }
- }
- data.Keys[i].SendLifeTimeLocal = types.BoolNull()
- data.Keys[i].SendLifeTimeLocalVariable = types.StringNull()
- if t := r.Get("sendLifetime.local.optionType"); t.Exists() {
- va := r.Get("sendLifetime.local.value")
- if t.String() == "variable" {
- data.Keys[i].SendLifeTimeLocalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].SendLifeTimeLocal = types.BoolValue(va.Bool())
- }
- }
- data.Keys[i].SendLifeTimeStartEpoch = types.Int64Null()
-
- if t := r.Get("sendLifetime.startEpoch.optionType"); t.Exists() {
- va := r.Get("sendLifetime.startEpoch.value")
- if t.String() == "global" {
- data.Keys[i].SendLifeTimeStartEpoch = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].SendLifeTimeInfinite = types.BoolNull()
- data.Keys[i].SendLifeTimeInfiniteVariable = types.StringNull()
- if t := r.Get("sendLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
- va := r.Get("sendLifetime.oneOfendChoice.infinite.value")
- if t.String() == "variable" {
- data.Keys[i].SendLifeTimeInfiniteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].SendLifeTimeInfinite = types.BoolValue(va.Bool())
- }
- }
- data.Keys[i].SendLifeTimeDuration = types.Int64Null()
- data.Keys[i].SendLifeTimeDurationVariable = types.StringNull()
- if t := r.Get("sendLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
- va := r.Get("sendLifetime.oneOfendChoice.duration.value")
- if t.String() == "variable" {
- data.Keys[i].SendLifeTimeDurationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].SendLifeTimeDuration = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].SendLifeTimeExact = types.Int64Null()
-
- if t := r.Get("sendLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
- va := r.Get("sendLifetime.oneOfendChoice.exact.value")
- if t.String() == "global" {
- data.Keys[i].SendLifeTimeExact = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].AcceptLifeTimeLocal = types.BoolNull()
- data.Keys[i].AcceptLifeTimeLocalVariable = types.StringNull()
- if t := r.Get("acceptLifetime.local.optionType"); t.Exists() {
- va := r.Get("acceptLifetime.local.value")
- if t.String() == "variable" {
- data.Keys[i].AcceptLifeTimeLocalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].AcceptLifeTimeLocal = types.BoolValue(va.Bool())
- }
- }
- data.Keys[i].AcceptLifeTimeStartEpoch = types.Int64Null()
-
- if t := r.Get("acceptLifetime.startEpoch.optionType"); t.Exists() {
- va := r.Get("acceptLifetime.startEpoch.value")
- if t.String() == "global" {
- data.Keys[i].AcceptLifeTimeStartEpoch = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].AcceptLifeTimeInfinite = types.BoolNull()
- data.Keys[i].AcceptLifeTimeInfiniteVariable = types.StringNull()
- if t := r.Get("acceptLifetime.oneOfendChoice.infinite.optionType"); t.Exists() {
- va := r.Get("acceptLifetime.oneOfendChoice.infinite.value")
- if t.String() == "variable" {
- data.Keys[i].AcceptLifeTimeInfiniteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].AcceptLifeTimeInfinite = types.BoolValue(va.Bool())
- }
- }
- data.Keys[i].AcceptLifeTimeDuration = types.Int64Null()
- data.Keys[i].AcceptLifeTimeDurationVariable = types.StringNull()
- if t := r.Get("acceptLifetime.oneOfendChoice.duration.optionType"); t.Exists() {
- va := r.Get("acceptLifetime.oneOfendChoice.duration.value")
- if t.String() == "variable" {
- data.Keys[i].AcceptLifeTimeDurationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Keys[i].AcceptLifeTimeDuration = types.Int64Value(va.Int())
- }
- }
- data.Keys[i].AcceptLifeTimeExact = types.Int64Null()
-
- if t := r.Get("acceptLifetime.oneOfendChoice.exact.optionType"); t.Exists() {
- va := r.Get("acceptLifetime.oneOfendChoice.exact.value")
- if t.String() == "global" {
- data.Keys[i].AcceptLifeTimeExact = types.Int64Value(va.Int())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemSecurity) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.Rekey.IsNull() {
- return false
- }
- if !data.RekeyVariable.IsNull() {
- return false
- }
- if !data.AntiReplayWindow.IsNull() {
- return false
- }
- if !data.AntiReplayWindowVariable.IsNull() {
- return false
- }
- if !data.ExtendedAntiReplayWindow.IsNull() {
- return false
- }
- if !data.ExtendedAntiReplayWindowVariable.IsNull() {
- return false
- }
- if !data.IpsecPairwiseKeying.IsNull() {
- return false
- }
- if !data.IpsecPairwiseKeyingVariable.IsNull() {
- return false
- }
- if !data.IntegrityType.IsNull() {
- return false
- }
- if !data.IntegrityTypeVariable.IsNull() {
- return false
- }
- if len(data.Keychains) > 0 {
- return false
- }
- if len(data.Keys) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_snmp_feature.go b/internal/provider/model_sdwan_system_snmp_feature.go
new file mode 100644
index 000000000..57e5415f2
--- /dev/null
+++ b/internal/provider/model_sdwan_system_snmp_feature.go
@@ -0,0 +1,1228 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type SystemSNMP 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"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ ContactPerson types.String `tfsdk:"contact_person"`
+ ContactPersonVariable types.String `tfsdk:"contact_person_variable"`
+ LocationOfDevice types.String `tfsdk:"location_of_device"`
+ LocationOfDeviceVariable types.String `tfsdk:"location_of_device_variable"`
+ Views []SystemSNMPViews `tfsdk:"views"`
+ Communities []SystemSNMPCommunities `tfsdk:"communities"`
+ Groups []SystemSNMPGroups `tfsdk:"groups"`
+ Users []SystemSNMPUsers `tfsdk:"users"`
+ TrapTargetServers []SystemSNMPTrapTargetServers `tfsdk:"trap_target_servers"`
+}
+
+type SystemSNMPViews struct {
+ Name types.String `tfsdk:"name"`
+ Oids []SystemSNMPViewsOids `tfsdk:"oids"`
+}
+
+type SystemSNMPCommunities struct {
+ Name types.String `tfsdk:"name"`
+ UserLabel types.String `tfsdk:"user_label"`
+ View types.String `tfsdk:"view"`
+ ViewVariable types.String `tfsdk:"view_variable"`
+ Authorization types.String `tfsdk:"authorization"`
+ AuthorizationVariable types.String `tfsdk:"authorization_variable"`
+}
+
+type SystemSNMPGroups struct {
+ Name types.String `tfsdk:"name"`
+ SecurityLevel types.String `tfsdk:"security_level"`
+ View types.String `tfsdk:"view"`
+ ViewVariable types.String `tfsdk:"view_variable"`
+}
+
+type SystemSNMPUsers struct {
+ Name types.String `tfsdk:"name"`
+ AuthenticationProtocol types.String `tfsdk:"authentication_protocol"`
+ AuthenticationProtocolVariable types.String `tfsdk:"authentication_protocol_variable"`
+ AuthenticationPassword types.String `tfsdk:"authentication_password"`
+ AuthenticationPasswordVariable types.String `tfsdk:"authentication_password_variable"`
+ PrivacyProtocol types.String `tfsdk:"privacy_protocol"`
+ PrivacyProtocolVariable types.String `tfsdk:"privacy_protocol_variable"`
+ PrivacyPassword types.String `tfsdk:"privacy_password"`
+ PrivacyPasswordVariable types.String `tfsdk:"privacy_password_variable"`
+ Group types.String `tfsdk:"group"`
+ GroupVariable types.String `tfsdk:"group_variable"`
+}
+
+type SystemSNMPTrapTargetServers struct {
+ VpnId types.Int64 `tfsdk:"vpn_id"`
+ VpnIdVariable types.String `tfsdk:"vpn_id_variable"`
+ Ip types.String `tfsdk:"ip"`
+ IpVariable types.String `tfsdk:"ip_variable"`
+ Port types.Int64 `tfsdk:"port"`
+ PortVariable types.String `tfsdk:"port_variable"`
+ UserLabel types.String `tfsdk:"user_label"`
+ User types.String `tfsdk:"user"`
+ UserVariable types.String `tfsdk:"user_variable"`
+ SourceInterface types.String `tfsdk:"source_interface"`
+ SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
+}
+
+type SystemSNMPViewsOids struct {
+ Id types.String `tfsdk:"id"`
+ IdVariable types.String `tfsdk:"id_variable"`
+ Exclude types.Bool `tfsdk:"exclude"`
+ ExcludeVariable types.String `tfsdk:"exclude_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data SystemSNMP) getModel() string {
+ return "system_snmp"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data SystemSNMP) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/snmp", 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 SystemSNMP) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.ContactPersonVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"contact.optionType", "variable")
+ body, _ = sjson.Set(body, path+"contact.value", data.ContactPersonVariable.ValueString())
+ }
+ } else if data.ContactPerson.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"contact.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"contact.optionType", "global")
+ body, _ = sjson.Set(body, path+"contact.value", data.ContactPerson.ValueString())
+ }
+ }
+
+ if !data.LocationOfDeviceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"location.optionType", "variable")
+ body, _ = sjson.Set(body, path+"location.value", data.LocationOfDeviceVariable.ValueString())
+ }
+ } else if data.LocationOfDevice.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"location.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"location.optionType", "global")
+ body, _ = sjson.Set(body, path+"location.value", data.LocationOfDevice.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"view", []interface{}{})
+ for _, item := range data.Views {
+ itemBody := ""
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oid", []interface{}{})
+ for _, childItem := range item.Oids {
+ itemChildBody := ""
+
+ if !childItem.IdVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.IdVariable.ValueString())
+ }
+ } else if !childItem.Id.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.Id.ValueString())
+ }
+ }
+
+ if !childItem.ExcludeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.ExcludeVariable.ValueString())
+ }
+ } else if childItem.Exclude.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.Exclude.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "oid.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"view.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"community", []interface{}{})
+ for _, item := range data.Communities {
+ itemBody := ""
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
+ }
+ }
+ if !item.UserLabel.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString())
+ }
+ }
+
+ if !item.ViewVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString())
+ }
+ } else if !item.View.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "view.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString())
+ }
+ }
+
+ if !item.AuthorizationVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "authorization.value", item.AuthorizationVariable.ValueString())
+ }
+ } else if !item.Authorization.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "authorization.value", item.Authorization.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"community.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"group", []interface{}{})
+ for _, item := range data.Groups {
+ itemBody := ""
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
+ }
+ }
+ if !item.SecurityLevel.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "securityLevel.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "securityLevel.value", item.SecurityLevel.ValueString())
+ }
+ }
+
+ if !item.ViewVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString())
+ }
+ } else if !item.View.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "view.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"group.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"user", []interface{}{})
+ for _, item := range data.Users {
+ itemBody := ""
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
+ }
+ }
+
+ if !item.AuthenticationProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "auth.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocolVariable.ValueString())
+ }
+ } else if item.AuthenticationProtocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "auth.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "auth.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocol.ValueString())
+ }
+ }
+
+ if !item.AuthenticationPasswordVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPasswordVariable.ValueString())
+ }
+ } else if item.AuthenticationPassword.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPassword.ValueString())
+ }
+ }
+
+ if !item.PrivacyProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priv.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocolVariable.ValueString())
+ }
+ } else if item.PrivacyProtocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priv.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "priv.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocol.ValueString())
+ }
+ }
+
+ if !item.PrivacyPasswordVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPasswordVariable.ValueString())
+ }
+ } else if item.PrivacyPassword.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPassword.ValueString())
+ }
+ }
+
+ if !item.GroupVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "group.value", item.GroupVariable.ValueString())
+ }
+ } else if !item.Group.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "group.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "group.value", item.Group.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"user.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"target", []interface{}{})
+ for _, item := range data.TrapTargetServers {
+ itemBody := ""
+
+ if !item.VpnIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnIdVariable.ValueString())
+ }
+ } else if !item.VpnId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnId.ValueInt64())
+ }
+ }
+
+ if !item.IpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ip.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ip.value", item.IpVariable.ValueString())
+ }
+ } else if !item.Ip.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ip.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ip.value", item.Ip.ValueString())
+ }
+ }
+
+ if !item.PortVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "port.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "port.value", item.PortVariable.ValueString())
+ }
+ } else if !item.Port.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "port.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "port.value", item.Port.ValueInt64())
+ }
+ }
+ if !item.UserLabel.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString())
+ }
+ }
+
+ if !item.UserVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "user.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "user.value", item.UserVariable.ValueString())
+ }
+ } else if !item.User.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "user.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "user.value", item.User.ValueString())
+ }
+ }
+
+ if !item.SourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
+ }
+ } else if !item.SourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"target.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *SystemSNMP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.ContactPerson = types.StringNull()
+ data.ContactPersonVariable = types.StringNull()
+ if t := res.Get(path + "contact.optionType"); t.Exists() {
+ va := res.Get(path + "contact.value")
+ if t.String() == "variable" {
+ data.ContactPersonVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ContactPerson = types.StringValue(va.String())
+ }
+ }
+ data.LocationOfDevice = types.StringNull()
+ data.LocationOfDeviceVariable = types.StringNull()
+ if t := res.Get(path + "location.optionType"); t.Exists() {
+ va := res.Get(path + "location.value")
+ if t.String() == "variable" {
+ data.LocationOfDeviceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LocationOfDevice = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "view"); value.Exists() {
+ data.Views = make([]SystemSNMPViews, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemSNMPViews{}
+ item.Name = types.StringNull()
+
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("oid"); cValue.Exists() {
+ item.Oids = make([]SystemSNMPViewsOids, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := SystemSNMPViewsOids{}
+ cItem.Id = types.StringNull()
+ cItem.IdVariable = types.StringNull()
+ if t := cv.Get("id.optionType"); t.Exists() {
+ va := cv.Get("id.value")
+ if t.String() == "variable" {
+ cItem.IdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Id = types.StringValue(va.String())
+ }
+ }
+ cItem.Exclude = types.BoolNull()
+ cItem.ExcludeVariable = types.StringNull()
+ if t := cv.Get("exclude.optionType"); t.Exists() {
+ va := cv.Get("exclude.value")
+ if t.String() == "variable" {
+ cItem.ExcludeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Exclude = types.BoolValue(va.Bool())
+ }
+ }
+ item.Oids = append(item.Oids, cItem)
+ return true
+ })
+ }
+ data.Views = append(data.Views, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "community"); value.Exists() {
+ data.Communities = make([]SystemSNMPCommunities, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemSNMPCommunities{}
+ item.UserLabel = types.StringNull()
+
+ if t := v.Get("userLabel.optionType"); t.Exists() {
+ va := v.Get("userLabel.value")
+ if t.String() == "global" {
+ item.UserLabel = types.StringValue(va.String())
+ }
+ }
+ item.View = types.StringNull()
+ item.ViewVariable = types.StringNull()
+ if t := v.Get("view.optionType"); t.Exists() {
+ va := v.Get("view.value")
+ if t.String() == "variable" {
+ item.ViewVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.View = types.StringValue(va.String())
+ }
+ }
+ item.Authorization = types.StringNull()
+ item.AuthorizationVariable = types.StringNull()
+ if t := v.Get("authorization.optionType"); t.Exists() {
+ va := v.Get("authorization.value")
+ if t.String() == "variable" {
+ item.AuthorizationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Authorization = types.StringValue(va.String())
+ }
+ }
+ data.Communities = append(data.Communities, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "group"); value.Exists() {
+ data.Groups = make([]SystemSNMPGroups, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemSNMPGroups{}
+ item.Name = types.StringNull()
+
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.SecurityLevel = types.StringNull()
+
+ if t := v.Get("securityLevel.optionType"); t.Exists() {
+ va := v.Get("securityLevel.value")
+ if t.String() == "global" {
+ item.SecurityLevel = types.StringValue(va.String())
+ }
+ }
+ item.View = types.StringNull()
+ item.ViewVariable = types.StringNull()
+ if t := v.Get("view.optionType"); t.Exists() {
+ va := v.Get("view.value")
+ if t.String() == "variable" {
+ item.ViewVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.View = types.StringValue(va.String())
+ }
+ }
+ data.Groups = append(data.Groups, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "user"); value.Exists() {
+ data.Users = make([]SystemSNMPUsers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemSNMPUsers{}
+ item.Name = types.StringNull()
+
+ if t := v.Get("name.optionType"); t.Exists() {
+ va := v.Get("name.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.AuthenticationProtocol = types.StringNull()
+ item.AuthenticationProtocolVariable = types.StringNull()
+ if t := v.Get("auth.optionType"); t.Exists() {
+ va := v.Get("auth.value")
+ if t.String() == "variable" {
+ item.AuthenticationProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AuthenticationProtocol = types.StringValue(va.String())
+ }
+ }
+ item.AuthenticationPassword = types.StringNull()
+ item.AuthenticationPasswordVariable = types.StringNull()
+ if t := v.Get("authPassword.optionType"); t.Exists() {
+ va := v.Get("authPassword.value")
+ if t.String() == "variable" {
+ item.AuthenticationPasswordVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AuthenticationPassword = types.StringValue(va.String())
+ }
+ }
+ item.PrivacyProtocol = types.StringNull()
+ item.PrivacyProtocolVariable = types.StringNull()
+ if t := v.Get("priv.optionType"); t.Exists() {
+ va := v.Get("priv.value")
+ if t.String() == "variable" {
+ item.PrivacyProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PrivacyProtocol = types.StringValue(va.String())
+ }
+ }
+ item.PrivacyPassword = types.StringNull()
+ item.PrivacyPasswordVariable = types.StringNull()
+ if t := v.Get("privPassword.optionType"); t.Exists() {
+ va := v.Get("privPassword.value")
+ if t.String() == "variable" {
+ item.PrivacyPasswordVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.PrivacyPassword = types.StringValue(va.String())
+ }
+ }
+ item.Group = types.StringNull()
+ item.GroupVariable = types.StringNull()
+ if t := v.Get("group.optionType"); t.Exists() {
+ va := v.Get("group.value")
+ if t.String() == "variable" {
+ item.GroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Group = types.StringValue(va.String())
+ }
+ }
+ data.Users = append(data.Users, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "target"); value.Exists() {
+ data.TrapTargetServers = make([]SystemSNMPTrapTargetServers, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := SystemSNMPTrapTargetServers{}
+ item.VpnId = types.Int64Null()
+ item.VpnIdVariable = types.StringNull()
+ if t := v.Get("vpnId.optionType"); t.Exists() {
+ va := v.Get("vpnId.value")
+ if t.String() == "variable" {
+ item.VpnIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.VpnId = types.Int64Value(va.Int())
+ }
+ }
+ item.Ip = types.StringNull()
+ item.IpVariable = types.StringNull()
+ if t := v.Get("ip.optionType"); t.Exists() {
+ va := v.Get("ip.value")
+ if t.String() == "variable" {
+ item.IpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Ip = types.StringValue(va.String())
+ }
+ }
+ item.Port = types.Int64Null()
+ item.PortVariable = types.StringNull()
+ if t := v.Get("port.optionType"); t.Exists() {
+ va := v.Get("port.value")
+ if t.String() == "variable" {
+ item.PortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Port = types.Int64Value(va.Int())
+ }
+ }
+ item.UserLabel = types.StringNull()
+
+ if t := v.Get("userLabel.optionType"); t.Exists() {
+ va := v.Get("userLabel.value")
+ if t.String() == "global" {
+ item.UserLabel = types.StringValue(va.String())
+ }
+ }
+ item.User = types.StringNull()
+ item.UserVariable = types.StringNull()
+ if t := v.Get("user.optionType"); t.Exists() {
+ va := v.Get("user.value")
+ if t.String() == "variable" {
+ item.UserVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.User = types.StringValue(va.String())
+ }
+ }
+ item.SourceInterface = types.StringNull()
+ item.SourceInterfaceVariable = types.StringNull()
+ if t := v.Get("sourceInterface.optionType"); t.Exists() {
+ va := v.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ item.SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TrapTargetServers = append(data.TrapTargetServers, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *SystemSNMP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.ContactPerson = types.StringNull()
+ data.ContactPersonVariable = types.StringNull()
+ if t := res.Get(path + "contact.optionType"); t.Exists() {
+ va := res.Get(path + "contact.value")
+ if t.String() == "variable" {
+ data.ContactPersonVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ContactPerson = types.StringValue(va.String())
+ }
+ }
+ data.LocationOfDevice = types.StringNull()
+ data.LocationOfDeviceVariable = types.StringNull()
+ if t := res.Get(path + "location.optionType"); t.Exists() {
+ va := res.Get(path + "location.value")
+ if t.String() == "variable" {
+ data.LocationOfDeviceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LocationOfDevice = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Views {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Views[i].Name.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "view").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Views[i].Name = types.StringNull()
+
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "global" {
+ data.Views[i].Name = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Views[i].Oids {
+ keys := [...]string{"id"}
+ keyValues := [...]string{data.Views[i].Oids[ci].Id.ValueString()}
+ keyValuesVariables := [...]string{data.Views[i].Oids[ci].IdVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("oid").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Views[i].Oids[ci].Id = types.StringNull()
+ data.Views[i].Oids[ci].IdVariable = types.StringNull()
+ if t := cr.Get("id.optionType"); t.Exists() {
+ va := cr.Get("id.value")
+ if t.String() == "variable" {
+ data.Views[i].Oids[ci].IdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Views[i].Oids[ci].Id = types.StringValue(va.String())
+ }
+ }
+ data.Views[i].Oids[ci].Exclude = types.BoolNull()
+ data.Views[i].Oids[ci].ExcludeVariable = types.StringNull()
+ if t := cr.Get("exclude.optionType"); t.Exists() {
+ va := cr.Get("exclude.value")
+ if t.String() == "variable" {
+ data.Views[i].Oids[ci].ExcludeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Views[i].Oids[ci].Exclude = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+ for i := range data.Communities {
+ keys := [...]string{"userLabel"}
+ keyValues := [...]string{data.Communities[i].UserLabel.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "community").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Communities[i].UserLabel = types.StringNull()
+
+ if t := r.Get("userLabel.optionType"); t.Exists() {
+ va := r.Get("userLabel.value")
+ if t.String() == "global" {
+ data.Communities[i].UserLabel = types.StringValue(va.String())
+ }
+ }
+ data.Communities[i].View = types.StringNull()
+ data.Communities[i].ViewVariable = types.StringNull()
+ if t := r.Get("view.optionType"); t.Exists() {
+ va := r.Get("view.value")
+ if t.String() == "variable" {
+ data.Communities[i].ViewVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Communities[i].View = types.StringValue(va.String())
+ }
+ }
+ data.Communities[i].Authorization = types.StringNull()
+ data.Communities[i].AuthorizationVariable = types.StringNull()
+ if t := r.Get("authorization.optionType"); t.Exists() {
+ va := r.Get("authorization.value")
+ if t.String() == "variable" {
+ data.Communities[i].AuthorizationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Communities[i].Authorization = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Groups {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Groups[i].Name.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "group").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Groups[i].Name = types.StringNull()
+
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "global" {
+ data.Groups[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Groups[i].SecurityLevel = types.StringNull()
+
+ if t := r.Get("securityLevel.optionType"); t.Exists() {
+ va := r.Get("securityLevel.value")
+ if t.String() == "global" {
+ data.Groups[i].SecurityLevel = types.StringValue(va.String())
+ }
+ }
+ data.Groups[i].View = types.StringNull()
+ data.Groups[i].ViewVariable = types.StringNull()
+ if t := r.Get("view.optionType"); t.Exists() {
+ va := r.Get("view.value")
+ if t.String() == "variable" {
+ data.Groups[i].ViewVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Groups[i].View = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Users {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Users[i].Name.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "user").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Users[i].Name = types.StringNull()
+
+ if t := r.Get("name.optionType"); t.Exists() {
+ va := r.Get("name.value")
+ if t.String() == "global" {
+ data.Users[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Users[i].AuthenticationProtocol = types.StringNull()
+ data.Users[i].AuthenticationProtocolVariable = types.StringNull()
+ if t := r.Get("auth.optionType"); t.Exists() {
+ va := r.Get("auth.value")
+ if t.String() == "variable" {
+ data.Users[i].AuthenticationProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].AuthenticationProtocol = types.StringValue(va.String())
+ }
+ }
+ data.Users[i].AuthenticationPassword = types.StringNull()
+ data.Users[i].AuthenticationPasswordVariable = types.StringNull()
+ if t := r.Get("authPassword.optionType"); t.Exists() {
+ va := r.Get("authPassword.value")
+ if t.String() == "variable" {
+ data.Users[i].AuthenticationPasswordVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].AuthenticationPassword = types.StringValue(va.String())
+ }
+ }
+ data.Users[i].PrivacyProtocol = types.StringNull()
+ data.Users[i].PrivacyProtocolVariable = types.StringNull()
+ if t := r.Get("priv.optionType"); t.Exists() {
+ va := r.Get("priv.value")
+ if t.String() == "variable" {
+ data.Users[i].PrivacyProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].PrivacyProtocol = types.StringValue(va.String())
+ }
+ }
+ data.Users[i].PrivacyPassword = types.StringNull()
+ data.Users[i].PrivacyPasswordVariable = types.StringNull()
+ if t := r.Get("privPassword.optionType"); t.Exists() {
+ va := r.Get("privPassword.value")
+ if t.String() == "variable" {
+ data.Users[i].PrivacyPasswordVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].PrivacyPassword = types.StringValue(va.String())
+ }
+ }
+ data.Users[i].Group = types.StringNull()
+ data.Users[i].GroupVariable = types.StringNull()
+ if t := r.Get("group.optionType"); t.Exists() {
+ va := r.Get("group.value")
+ if t.String() == "variable" {
+ data.Users[i].GroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Users[i].Group = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.TrapTargetServers {
+ keys := [...]string{"vpnId", "ip", "port"}
+ keyValues := [...]string{strconv.FormatInt(data.TrapTargetServers[i].VpnId.ValueInt64(), 10), data.TrapTargetServers[i].Ip.ValueString(), strconv.FormatInt(data.TrapTargetServers[i].Port.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.TrapTargetServers[i].VpnIdVariable.ValueString(), data.TrapTargetServers[i].IpVariable.ValueString(), data.TrapTargetServers[i].PortVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "target").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TrapTargetServers[i].VpnId = types.Int64Null()
+ data.TrapTargetServers[i].VpnIdVariable = types.StringNull()
+ if t := r.Get("vpnId.optionType"); t.Exists() {
+ va := r.Get("vpnId.value")
+ if t.String() == "variable" {
+ data.TrapTargetServers[i].VpnIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrapTargetServers[i].VpnId = types.Int64Value(va.Int())
+ }
+ }
+ data.TrapTargetServers[i].Ip = types.StringNull()
+ data.TrapTargetServers[i].IpVariable = types.StringNull()
+ if t := r.Get("ip.optionType"); t.Exists() {
+ va := r.Get("ip.value")
+ if t.String() == "variable" {
+ data.TrapTargetServers[i].IpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrapTargetServers[i].Ip = types.StringValue(va.String())
+ }
+ }
+ data.TrapTargetServers[i].Port = types.Int64Null()
+ data.TrapTargetServers[i].PortVariable = types.StringNull()
+ if t := r.Get("port.optionType"); t.Exists() {
+ va := r.Get("port.value")
+ if t.String() == "variable" {
+ data.TrapTargetServers[i].PortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrapTargetServers[i].Port = types.Int64Value(va.Int())
+ }
+ }
+ data.TrapTargetServers[i].UserLabel = types.StringNull()
+
+ if t := r.Get("userLabel.optionType"); t.Exists() {
+ va := r.Get("userLabel.value")
+ if t.String() == "global" {
+ data.TrapTargetServers[i].UserLabel = types.StringValue(va.String())
+ }
+ }
+ data.TrapTargetServers[i].User = types.StringNull()
+ data.TrapTargetServers[i].UserVariable = types.StringNull()
+ if t := r.Get("user.optionType"); t.Exists() {
+ va := r.Get("user.value")
+ if t.String() == "variable" {
+ data.TrapTargetServers[i].UserVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrapTargetServers[i].User = types.StringValue(va.String())
+ }
+ }
+ data.TrapTargetServers[i].SourceInterface = types.StringNull()
+ data.TrapTargetServers[i].SourceInterfaceVariable = types.StringNull()
+ if t := r.Get("sourceInterface.optionType"); t.Exists() {
+ va := r.Get("sourceInterface.value")
+ if t.String() == "variable" {
+ data.TrapTargetServers[i].SourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrapTargetServers[i].SourceInterface = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *SystemSNMP) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.ContactPerson.IsNull() {
+ return false
+ }
+ if !data.ContactPersonVariable.IsNull() {
+ return false
+ }
+ if !data.LocationOfDevice.IsNull() {
+ return false
+ }
+ if !data.LocationOfDeviceVariable.IsNull() {
+ return false
+ }
+ if len(data.Views) > 0 {
+ return false
+ }
+ if len(data.Communities) > 0 {
+ return false
+ }
+ if len(data.Groups) > 0 {
+ return false
+ }
+ if len(data.Users) > 0 {
+ return false
+ }
+ if len(data.TrapTargetServers) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_system_snmp_profile_parcel.go b/internal/provider/model_sdwan_system_snmp_profile_parcel.go
deleted file mode 100644
index f6a53f24d..000000000
--- a/internal/provider/model_sdwan_system_snmp_profile_parcel.go
+++ /dev/null
@@ -1,1210 +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"
- "strconv"
-
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type SystemSNMP 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"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- ContactPerson types.String `tfsdk:"contact_person"`
- ContactPersonVariable types.String `tfsdk:"contact_person_variable"`
- LocationOfDevice types.String `tfsdk:"location_of_device"`
- LocationOfDeviceVariable types.String `tfsdk:"location_of_device_variable"`
- Views []SystemSNMPViews `tfsdk:"views"`
- Communities []SystemSNMPCommunities `tfsdk:"communities"`
- Groups []SystemSNMPGroups `tfsdk:"groups"`
- Users []SystemSNMPUsers `tfsdk:"users"`
- TrapTargetServers []SystemSNMPTrapTargetServers `tfsdk:"trap_target_servers"`
-}
-
-type SystemSNMPViews struct {
- Name types.String `tfsdk:"name"`
- Oids []SystemSNMPViewsOids `tfsdk:"oids"`
-}
-
-type SystemSNMPCommunities struct {
- Name types.String `tfsdk:"name"`
- UserLabel types.String `tfsdk:"user_label"`
- View types.String `tfsdk:"view"`
- ViewVariable types.String `tfsdk:"view_variable"`
- Authorization types.String `tfsdk:"authorization"`
- AuthorizationVariable types.String `tfsdk:"authorization_variable"`
-}
-
-type SystemSNMPGroups struct {
- Name types.String `tfsdk:"name"`
- SecurityLevel types.String `tfsdk:"security_level"`
- View types.String `tfsdk:"view"`
- ViewVariable types.String `tfsdk:"view_variable"`
-}
-
-type SystemSNMPUsers struct {
- Name types.String `tfsdk:"name"`
- AuthenticationProtocol types.String `tfsdk:"authentication_protocol"`
- AuthenticationProtocolVariable types.String `tfsdk:"authentication_protocol_variable"`
- AuthenticationPassword types.String `tfsdk:"authentication_password"`
- AuthenticationPasswordVariable types.String `tfsdk:"authentication_password_variable"`
- PrivacyProtocol types.String `tfsdk:"privacy_protocol"`
- PrivacyProtocolVariable types.String `tfsdk:"privacy_protocol_variable"`
- PrivacyPassword types.String `tfsdk:"privacy_password"`
- PrivacyPasswordVariable types.String `tfsdk:"privacy_password_variable"`
- Group types.String `tfsdk:"group"`
- GroupVariable types.String `tfsdk:"group_variable"`
-}
-
-type SystemSNMPTrapTargetServers struct {
- VpnId types.Int64 `tfsdk:"vpn_id"`
- VpnIdVariable types.String `tfsdk:"vpn_id_variable"`
- Ip types.String `tfsdk:"ip"`
- IpVariable types.String `tfsdk:"ip_variable"`
- Port types.Int64 `tfsdk:"port"`
- PortVariable types.String `tfsdk:"port_variable"`
- UserLabel types.String `tfsdk:"user_label"`
- User types.String `tfsdk:"user"`
- UserVariable types.String `tfsdk:"user_variable"`
- SourceInterface types.String `tfsdk:"source_interface"`
- SourceInterfaceVariable types.String `tfsdk:"source_interface_variable"`
-}
-
-type SystemSNMPViewsOids struct {
- Id types.String `tfsdk:"id"`
- IdVariable types.String `tfsdk:"id_variable"`
- Exclude types.Bool `tfsdk:"exclude"`
- ExcludeVariable types.String `tfsdk:"exclude_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data SystemSNMP) getModel() string {
- return "system_snmp"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data SystemSNMP) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/system/%v/snmp", 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 SystemSNMP) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.ContactPersonVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"contact.optionType", "variable")
- body, _ = sjson.Set(body, path+"contact.value", data.ContactPersonVariable.ValueString())
- }
- } else if data.ContactPerson.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"contact.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"contact.optionType", "global")
- body, _ = sjson.Set(body, path+"contact.value", data.ContactPerson.ValueString())
- }
- }
-
- if !data.LocationOfDeviceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"location.optionType", "variable")
- body, _ = sjson.Set(body, path+"location.value", data.LocationOfDeviceVariable.ValueString())
- }
- } else if data.LocationOfDevice.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"location.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"location.optionType", "global")
- body, _ = sjson.Set(body, path+"location.value", data.LocationOfDevice.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"view", []interface{}{})
- for _, item := range data.Views {
- itemBody := ""
- if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "oid", []interface{}{})
- for _, childItem := range item.Oids {
- itemChildBody := ""
-
- if !childItem.IdVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.IdVariable.ValueString())
- }
- } else if !childItem.Id.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.Id.ValueString())
- }
- }
-
- if !childItem.ExcludeVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.ExcludeVariable.ValueString())
- }
- } else if childItem.Exclude.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", false)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.Exclude.ValueBool())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "oid.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"view.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"community", []interface{}{})
- for _, item := range data.Communities {
- itemBody := ""
- if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
- }
- }
- if !item.UserLabel.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString())
- }
- }
-
- if !item.ViewVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString())
- }
- } else if !item.View.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "view.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString())
- }
- }
-
- if !item.AuthorizationVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "authorization.value", item.AuthorizationVariable.ValueString())
- }
- } else if !item.Authorization.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "authorization.value", item.Authorization.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"community.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"group", []interface{}{})
- for _, item := range data.Groups {
- itemBody := ""
- if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
- }
- }
- if !item.SecurityLevel.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "securityLevel.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "securityLevel.value", item.SecurityLevel.ValueString())
- }
- }
-
- if !item.ViewVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString())
- }
- } else if !item.View.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "view.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"group.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"user", []interface{}{})
- for _, item := range data.Users {
- itemBody := ""
- if !item.Name.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "name.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString())
- }
- }
-
- if !item.AuthenticationProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "auth.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocolVariable.ValueString())
- }
- } else if item.AuthenticationProtocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "auth.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "auth.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocol.ValueString())
- }
- }
-
- if !item.AuthenticationPasswordVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPasswordVariable.ValueString())
- }
- } else if item.AuthenticationPassword.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPassword.ValueString())
- }
- }
-
- if !item.PrivacyProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priv.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocolVariable.ValueString())
- }
- } else if item.PrivacyProtocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priv.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "priv.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocol.ValueString())
- }
- }
-
- if !item.PrivacyPasswordVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPasswordVariable.ValueString())
- }
- } else if item.PrivacyPassword.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPassword.ValueString())
- }
- }
-
- if !item.GroupVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "group.value", item.GroupVariable.ValueString())
- }
- } else if !item.Group.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "group.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "group.value", item.Group.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"user.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"target", []interface{}{})
- for _, item := range data.TrapTargetServers {
- itemBody := ""
-
- if !item.VpnIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnIdVariable.ValueString())
- }
- } else if !item.VpnId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnId.ValueInt64())
- }
- }
-
- if !item.IpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ip.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ip.value", item.IpVariable.ValueString())
- }
- } else if !item.Ip.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ip.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ip.value", item.Ip.ValueString())
- }
- }
-
- if !item.PortVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "port.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "port.value", item.PortVariable.ValueString())
- }
- } else if !item.Port.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "port.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "port.value", item.Port.ValueInt64())
- }
- }
- if !item.UserLabel.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString())
- }
- }
-
- if !item.UserVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "user.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "user.value", item.UserVariable.ValueString())
- }
- } else if !item.User.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "user.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "user.value", item.User.ValueString())
- }
- }
-
- if !item.SourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString())
- }
- } else if !item.SourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"target.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *SystemSNMP) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.ContactPerson = types.StringNull()
- data.ContactPersonVariable = types.StringNull()
- if t := res.Get(path + "contact.optionType"); t.Exists() {
- va := res.Get(path + "contact.value")
- if t.String() == "variable" {
- data.ContactPersonVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ContactPerson = types.StringValue(va.String())
- }
- }
- data.LocationOfDevice = types.StringNull()
- data.LocationOfDeviceVariable = types.StringNull()
- if t := res.Get(path + "location.optionType"); t.Exists() {
- va := res.Get(path + "location.value")
- if t.String() == "variable" {
- data.LocationOfDeviceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LocationOfDevice = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "view"); value.Exists() {
- data.Views = make([]SystemSNMPViews, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemSNMPViews{}
- item.Name = types.StringNull()
-
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("oid"); cValue.Exists() {
- item.Oids = make([]SystemSNMPViewsOids, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := SystemSNMPViewsOids{}
- cItem.Id = types.StringNull()
- cItem.IdVariable = types.StringNull()
- if t := cv.Get("id.optionType"); t.Exists() {
- va := cv.Get("id.value")
- if t.String() == "variable" {
- cItem.IdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Id = types.StringValue(va.String())
- }
- }
- cItem.Exclude = types.BoolNull()
- cItem.ExcludeVariable = types.StringNull()
- if t := cv.Get("exclude.optionType"); t.Exists() {
- va := cv.Get("exclude.value")
- if t.String() == "variable" {
- cItem.ExcludeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Exclude = types.BoolValue(va.Bool())
- }
- }
- item.Oids = append(item.Oids, cItem)
- return true
- })
- }
- data.Views = append(data.Views, item)
- return true
- })
- }
- if value := res.Get(path + "community"); value.Exists() {
- data.Communities = make([]SystemSNMPCommunities, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemSNMPCommunities{}
- item.UserLabel = types.StringNull()
-
- if t := v.Get("userLabel.optionType"); t.Exists() {
- va := v.Get("userLabel.value")
- if t.String() == "global" {
- item.UserLabel = types.StringValue(va.String())
- }
- }
- item.View = types.StringNull()
- item.ViewVariable = types.StringNull()
- if t := v.Get("view.optionType"); t.Exists() {
- va := v.Get("view.value")
- if t.String() == "variable" {
- item.ViewVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.View = types.StringValue(va.String())
- }
- }
- item.Authorization = types.StringNull()
- item.AuthorizationVariable = types.StringNull()
- if t := v.Get("authorization.optionType"); t.Exists() {
- va := v.Get("authorization.value")
- if t.String() == "variable" {
- item.AuthorizationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Authorization = types.StringValue(va.String())
- }
- }
- data.Communities = append(data.Communities, item)
- return true
- })
- }
- if value := res.Get(path + "group"); value.Exists() {
- data.Groups = make([]SystemSNMPGroups, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemSNMPGroups{}
- item.Name = types.StringNull()
-
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- item.SecurityLevel = types.StringNull()
-
- if t := v.Get("securityLevel.optionType"); t.Exists() {
- va := v.Get("securityLevel.value")
- if t.String() == "global" {
- item.SecurityLevel = types.StringValue(va.String())
- }
- }
- item.View = types.StringNull()
- item.ViewVariable = types.StringNull()
- if t := v.Get("view.optionType"); t.Exists() {
- va := v.Get("view.value")
- if t.String() == "variable" {
- item.ViewVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.View = types.StringValue(va.String())
- }
- }
- data.Groups = append(data.Groups, item)
- return true
- })
- }
- if value := res.Get(path + "user"); value.Exists() {
- data.Users = make([]SystemSNMPUsers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemSNMPUsers{}
- item.Name = types.StringNull()
-
- if t := v.Get("name.optionType"); t.Exists() {
- va := v.Get("name.value")
- if t.String() == "global" {
- item.Name = types.StringValue(va.String())
- }
- }
- item.AuthenticationProtocol = types.StringNull()
- item.AuthenticationProtocolVariable = types.StringNull()
- if t := v.Get("auth.optionType"); t.Exists() {
- va := v.Get("auth.value")
- if t.String() == "variable" {
- item.AuthenticationProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AuthenticationProtocol = types.StringValue(va.String())
- }
- }
- item.AuthenticationPassword = types.StringNull()
- item.AuthenticationPasswordVariable = types.StringNull()
- if t := v.Get("authPassword.optionType"); t.Exists() {
- va := v.Get("authPassword.value")
- if t.String() == "variable" {
- item.AuthenticationPasswordVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AuthenticationPassword = types.StringValue(va.String())
- }
- }
- item.PrivacyProtocol = types.StringNull()
- item.PrivacyProtocolVariable = types.StringNull()
- if t := v.Get("priv.optionType"); t.Exists() {
- va := v.Get("priv.value")
- if t.String() == "variable" {
- item.PrivacyProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.PrivacyProtocol = types.StringValue(va.String())
- }
- }
- item.PrivacyPassword = types.StringNull()
- item.PrivacyPasswordVariable = types.StringNull()
- if t := v.Get("privPassword.optionType"); t.Exists() {
- va := v.Get("privPassword.value")
- if t.String() == "variable" {
- item.PrivacyPasswordVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.PrivacyPassword = types.StringValue(va.String())
- }
- }
- item.Group = types.StringNull()
- item.GroupVariable = types.StringNull()
- if t := v.Get("group.optionType"); t.Exists() {
- va := v.Get("group.value")
- if t.String() == "variable" {
- item.GroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Group = types.StringValue(va.String())
- }
- }
- data.Users = append(data.Users, item)
- return true
- })
- }
- if value := res.Get(path + "target"); value.Exists() {
- data.TrapTargetServers = make([]SystemSNMPTrapTargetServers, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := SystemSNMPTrapTargetServers{}
- item.VpnId = types.Int64Null()
- item.VpnIdVariable = types.StringNull()
- if t := v.Get("vpnId.optionType"); t.Exists() {
- va := v.Get("vpnId.value")
- if t.String() == "variable" {
- item.VpnIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.VpnId = types.Int64Value(va.Int())
- }
- }
- item.Ip = types.StringNull()
- item.IpVariable = types.StringNull()
- if t := v.Get("ip.optionType"); t.Exists() {
- va := v.Get("ip.value")
- if t.String() == "variable" {
- item.IpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Ip = types.StringValue(va.String())
- }
- }
- item.Port = types.Int64Null()
- item.PortVariable = types.StringNull()
- if t := v.Get("port.optionType"); t.Exists() {
- va := v.Get("port.value")
- if t.String() == "variable" {
- item.PortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Port = types.Int64Value(va.Int())
- }
- }
- item.UserLabel = types.StringNull()
-
- if t := v.Get("userLabel.optionType"); t.Exists() {
- va := v.Get("userLabel.value")
- if t.String() == "global" {
- item.UserLabel = types.StringValue(va.String())
- }
- }
- item.User = types.StringNull()
- item.UserVariable = types.StringNull()
- if t := v.Get("user.optionType"); t.Exists() {
- va := v.Get("user.value")
- if t.String() == "variable" {
- item.UserVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.User = types.StringValue(va.String())
- }
- }
- item.SourceInterface = types.StringNull()
- item.SourceInterfaceVariable = types.StringNull()
- if t := v.Get("sourceInterface.optionType"); t.Exists() {
- va := v.Get("sourceInterface.value")
- if t.String() == "variable" {
- item.SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceInterface = types.StringValue(va.String())
- }
- }
- data.TrapTargetServers = append(data.TrapTargetServers, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *SystemSNMP) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.ContactPerson = types.StringNull()
- data.ContactPersonVariable = types.StringNull()
- if t := res.Get(path + "contact.optionType"); t.Exists() {
- va := res.Get(path + "contact.value")
- if t.String() == "variable" {
- data.ContactPersonVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ContactPerson = types.StringValue(va.String())
- }
- }
- data.LocationOfDevice = types.StringNull()
- data.LocationOfDeviceVariable = types.StringNull()
- if t := res.Get(path + "location.optionType"); t.Exists() {
- va := res.Get(path + "location.value")
- if t.String() == "variable" {
- data.LocationOfDeviceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LocationOfDevice = types.StringValue(va.String())
- }
- }
- for i := range data.Views {
- keys := [...]string{"name"}
- keyValues := [...]string{data.Views[i].Name.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "view").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Views[i].Name = types.StringNull()
-
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "global" {
- data.Views[i].Name = types.StringValue(va.String())
- }
- }
- for ci := range data.Views[i].Oids {
- keys := [...]string{"id"}
- keyValues := [...]string{data.Views[i].Oids[ci].Id.ValueString()}
- keyValuesVariables := [...]string{data.Views[i].Oids[ci].IdVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("oid").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Views[i].Oids[ci].Id = types.StringNull()
- data.Views[i].Oids[ci].IdVariable = types.StringNull()
- if t := cr.Get("id.optionType"); t.Exists() {
- va := cr.Get("id.value")
- if t.String() == "variable" {
- data.Views[i].Oids[ci].IdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Views[i].Oids[ci].Id = types.StringValue(va.String())
- }
- }
- data.Views[i].Oids[ci].Exclude = types.BoolNull()
- data.Views[i].Oids[ci].ExcludeVariable = types.StringNull()
- if t := cr.Get("exclude.optionType"); t.Exists() {
- va := cr.Get("exclude.value")
- if t.String() == "variable" {
- data.Views[i].Oids[ci].ExcludeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Views[i].Oids[ci].Exclude = types.BoolValue(va.Bool())
- }
- }
- }
- }
- for i := range data.Communities {
- keys := [...]string{"userLabel"}
- keyValues := [...]string{data.Communities[i].UserLabel.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "community").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Communities[i].UserLabel = types.StringNull()
-
- if t := r.Get("userLabel.optionType"); t.Exists() {
- va := r.Get("userLabel.value")
- if t.String() == "global" {
- data.Communities[i].UserLabel = types.StringValue(va.String())
- }
- }
- data.Communities[i].View = types.StringNull()
- data.Communities[i].ViewVariable = types.StringNull()
- if t := r.Get("view.optionType"); t.Exists() {
- va := r.Get("view.value")
- if t.String() == "variable" {
- data.Communities[i].ViewVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Communities[i].View = types.StringValue(va.String())
- }
- }
- data.Communities[i].Authorization = types.StringNull()
- data.Communities[i].AuthorizationVariable = types.StringNull()
- if t := r.Get("authorization.optionType"); t.Exists() {
- va := r.Get("authorization.value")
- if t.String() == "variable" {
- data.Communities[i].AuthorizationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Communities[i].Authorization = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Groups {
- keys := [...]string{"name"}
- keyValues := [...]string{data.Groups[i].Name.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "group").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Groups[i].Name = types.StringNull()
-
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "global" {
- data.Groups[i].Name = types.StringValue(va.String())
- }
- }
- data.Groups[i].SecurityLevel = types.StringNull()
-
- if t := r.Get("securityLevel.optionType"); t.Exists() {
- va := r.Get("securityLevel.value")
- if t.String() == "global" {
- data.Groups[i].SecurityLevel = types.StringValue(va.String())
- }
- }
- data.Groups[i].View = types.StringNull()
- data.Groups[i].ViewVariable = types.StringNull()
- if t := r.Get("view.optionType"); t.Exists() {
- va := r.Get("view.value")
- if t.String() == "variable" {
- data.Groups[i].ViewVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Groups[i].View = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Users {
- keys := [...]string{"name"}
- keyValues := [...]string{data.Users[i].Name.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "user").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Users[i].Name = types.StringNull()
-
- if t := r.Get("name.optionType"); t.Exists() {
- va := r.Get("name.value")
- if t.String() == "global" {
- data.Users[i].Name = types.StringValue(va.String())
- }
- }
- data.Users[i].AuthenticationProtocol = types.StringNull()
- data.Users[i].AuthenticationProtocolVariable = types.StringNull()
- if t := r.Get("auth.optionType"); t.Exists() {
- va := r.Get("auth.value")
- if t.String() == "variable" {
- data.Users[i].AuthenticationProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].AuthenticationProtocol = types.StringValue(va.String())
- }
- }
- data.Users[i].AuthenticationPassword = types.StringNull()
- data.Users[i].AuthenticationPasswordVariable = types.StringNull()
- if t := r.Get("authPassword.optionType"); t.Exists() {
- va := r.Get("authPassword.value")
- if t.String() == "variable" {
- data.Users[i].AuthenticationPasswordVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].AuthenticationPassword = types.StringValue(va.String())
- }
- }
- data.Users[i].PrivacyProtocol = types.StringNull()
- data.Users[i].PrivacyProtocolVariable = types.StringNull()
- if t := r.Get("priv.optionType"); t.Exists() {
- va := r.Get("priv.value")
- if t.String() == "variable" {
- data.Users[i].PrivacyProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].PrivacyProtocol = types.StringValue(va.String())
- }
- }
- data.Users[i].PrivacyPassword = types.StringNull()
- data.Users[i].PrivacyPasswordVariable = types.StringNull()
- if t := r.Get("privPassword.optionType"); t.Exists() {
- va := r.Get("privPassword.value")
- if t.String() == "variable" {
- data.Users[i].PrivacyPasswordVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].PrivacyPassword = types.StringValue(va.String())
- }
- }
- data.Users[i].Group = types.StringNull()
- data.Users[i].GroupVariable = types.StringNull()
- if t := r.Get("group.optionType"); t.Exists() {
- va := r.Get("group.value")
- if t.String() == "variable" {
- data.Users[i].GroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Users[i].Group = types.StringValue(va.String())
- }
- }
- }
- for i := range data.TrapTargetServers {
- keys := [...]string{"vpnId", "ip", "port"}
- keyValues := [...]string{strconv.FormatInt(data.TrapTargetServers[i].VpnId.ValueInt64(), 10), data.TrapTargetServers[i].Ip.ValueString(), strconv.FormatInt(data.TrapTargetServers[i].Port.ValueInt64(), 10)}
- keyValuesVariables := [...]string{data.TrapTargetServers[i].VpnIdVariable.ValueString(), data.TrapTargetServers[i].IpVariable.ValueString(), data.TrapTargetServers[i].PortVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "target").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.TrapTargetServers[i].VpnId = types.Int64Null()
- data.TrapTargetServers[i].VpnIdVariable = types.StringNull()
- if t := r.Get("vpnId.optionType"); t.Exists() {
- va := r.Get("vpnId.value")
- if t.String() == "variable" {
- data.TrapTargetServers[i].VpnIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrapTargetServers[i].VpnId = types.Int64Value(va.Int())
- }
- }
- data.TrapTargetServers[i].Ip = types.StringNull()
- data.TrapTargetServers[i].IpVariable = types.StringNull()
- if t := r.Get("ip.optionType"); t.Exists() {
- va := r.Get("ip.value")
- if t.String() == "variable" {
- data.TrapTargetServers[i].IpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrapTargetServers[i].Ip = types.StringValue(va.String())
- }
- }
- data.TrapTargetServers[i].Port = types.Int64Null()
- data.TrapTargetServers[i].PortVariable = types.StringNull()
- if t := r.Get("port.optionType"); t.Exists() {
- va := r.Get("port.value")
- if t.String() == "variable" {
- data.TrapTargetServers[i].PortVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrapTargetServers[i].Port = types.Int64Value(va.Int())
- }
- }
- data.TrapTargetServers[i].UserLabel = types.StringNull()
-
- if t := r.Get("userLabel.optionType"); t.Exists() {
- va := r.Get("userLabel.value")
- if t.String() == "global" {
- data.TrapTargetServers[i].UserLabel = types.StringValue(va.String())
- }
- }
- data.TrapTargetServers[i].User = types.StringNull()
- data.TrapTargetServers[i].UserVariable = types.StringNull()
- if t := r.Get("user.optionType"); t.Exists() {
- va := r.Get("user.value")
- if t.String() == "variable" {
- data.TrapTargetServers[i].UserVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrapTargetServers[i].User = types.StringValue(va.String())
- }
- }
- data.TrapTargetServers[i].SourceInterface = types.StringNull()
- data.TrapTargetServers[i].SourceInterfaceVariable = types.StringNull()
- if t := r.Get("sourceInterface.optionType"); t.Exists() {
- va := r.Get("sourceInterface.value")
- if t.String() == "variable" {
- data.TrapTargetServers[i].SourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrapTargetServers[i].SourceInterface = types.StringValue(va.String())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *SystemSNMP) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.ContactPerson.IsNull() {
- return false
- }
- if !data.ContactPersonVariable.IsNull() {
- return false
- }
- if !data.LocationOfDevice.IsNull() {
- return false
- }
- if !data.LocationOfDeviceVariable.IsNull() {
- return false
- }
- if len(data.Views) > 0 {
- return false
- }
- if len(data.Communities) > 0 {
- return false
- }
- if len(data.Groups) > 0 {
- return false
- }
- if len(data.Users) > 0 {
- return false
- }
- if len(data.TrapTargetServers) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_traffic_data_policy_definition.go b/internal/provider/model_sdwan_traffic_data_policy_definition.go
index c3b57c9b5..b03d80657 100644
--- a/internal/provider/model_sdwan_traffic_data_policy_definition.go
+++ b/internal/provider/model_sdwan_traffic_data_policy_definition.go
@@ -56,6 +56,7 @@ type TrafficDataPolicyDefinitionSequencesMatchEntries struct {
ApplicationListVersion types.Int64 `tfsdk:"application_list_version"`
DnsApplicationListId types.String `tfsdk:"dns_application_list_id"`
DnsApplicationListVersion types.Int64 `tfsdk:"dns_application_list_version"`
+ IcmpMessage types.String `tfsdk:"icmp_message"`
Dns types.String `tfsdk:"dns"`
Dscp types.Int64 `tfsdk:"dscp"`
PacketLength types.Int64 `tfsdk:"packet_length"`
@@ -83,7 +84,7 @@ type TrafficDataPolicyDefinitionSequencesActionEntries struct {
LossCorrection types.String `tfsdk:"loss_correction"`
LossCorrectionFec types.String `tfsdk:"loss_correction_fec"`
LossCorrectionPacketDuplication types.String `tfsdk:"loss_correction_packet_duplication"`
- LossCorrectionFecThreshold types.Int64 `tfsdk:"loss_correction_fec_threshold"`
+ LossCorrectionFecThreshold types.String `tfsdk:"loss_correction_fec_threshold"`
NatPool types.String `tfsdk:"nat_pool"`
NatPoolId types.Int64 `tfsdk:"nat_pool_id"`
RedirectDns types.String `tfsdk:"redirect_dns"`
@@ -187,6 +188,9 @@ func (data TrafficDataPolicyDefinition) toBody(ctx context.Context) string {
if !childItem.DnsApplicationListId.IsNull() && childItem.Type.ValueString() == "dnsAppList" {
itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.DnsApplicationListId.ValueString())
}
+ if !childItem.IcmpMessage.IsNull() && childItem.Type.ValueString() == "icmpMessage" {
+ itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.IcmpMessage.ValueString())
+ }
if !childItem.Dns.IsNull() && childItem.Type.ValueString() == "dns" {
itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.Dns.ValueString())
}
@@ -272,7 +276,7 @@ func (data TrafficDataPolicyDefinition) toBody(ctx context.Context) string {
itemChildBody, _ = sjson.Set(itemChildBody, "parameter", childItem.LossCorrectionPacketDuplication.ValueString())
}
if !childItem.LossCorrectionFecThreshold.IsNull() && childItem.Type.ValueString() == "lossProtectFec" {
- itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.LossCorrectionFecThreshold.ValueInt64())
+ itemChildBody, _ = sjson.Set(itemChildBody, "value", childItem.LossCorrectionFecThreshold.ValueString())
}
if !childItem.NatPool.IsNull() && childItem.Type.ValueString() == "nat" {
itemChildBody, _ = sjson.Set(itemChildBody, "parameter.field", childItem.NatPool.ValueString())
@@ -485,6 +489,11 @@ func (data *TrafficDataPolicyDefinition) fromBody(ctx context.Context, res gjson
} else {
cItem.DnsApplicationListId = types.StringNull()
}
+ if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "icmpMessage" {
+ cItem.IcmpMessage = types.StringValue(ccValue.String())
+ } else {
+ cItem.IcmpMessage = types.StringNull()
+ }
if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "dns" {
cItem.Dns = types.StringValue(ccValue.String())
} else {
@@ -621,9 +630,9 @@ func (data *TrafficDataPolicyDefinition) fromBody(ctx context.Context, res gjson
cItem.LossCorrectionPacketDuplication = types.StringNull()
}
if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "lossProtectFec" {
- cItem.LossCorrectionFecThreshold = types.Int64Value(ccValue.Int())
+ cItem.LossCorrectionFecThreshold = types.StringValue(ccValue.String())
} else {
- cItem.LossCorrectionFecThreshold = types.Int64Null()
+ cItem.LossCorrectionFecThreshold = types.StringNull()
}
if ccValue := cv.Get("parameter.field"); ccValue.Exists() && cItem.Type.ValueString() == "nat" {
cItem.NatPool = types.StringValue(ccValue.String())
@@ -902,6 +911,9 @@ func (data *TrafficDataPolicyDefinition) hasChanges(ctx context.Context, state *
if !data.Sequences[i].MatchEntries[ii].DnsApplicationListId.Equal(state.Sequences[i].MatchEntries[ii].DnsApplicationListId) {
hasChanges = true
}
+ if !data.Sequences[i].MatchEntries[ii].IcmpMessage.Equal(state.Sequences[i].MatchEntries[ii].IcmpMessage) {
+ hasChanges = true
+ }
if !data.Sequences[i].MatchEntries[ii].Dns.Equal(state.Sequences[i].MatchEntries[ii].Dns) {
hasChanges = true
}
diff --git a/internal/provider/model_sdwan_transport_gps_feature.go b/internal/provider/model_sdwan_transport_gps_feature.go
new file mode 100644
index 000000000..3bcfbc6b3
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_gps_feature.go
@@ -0,0 +1,373 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportGPS 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"`
+ GpsEnable types.Bool `tfsdk:"gps_enable"`
+ GpsEnableVariable types.String `tfsdk:"gps_enable_variable"`
+ GpsMode types.String `tfsdk:"gps_mode"`
+ GpsModeVariable types.String `tfsdk:"gps_mode_variable"`
+ NmeaEnable types.Bool `tfsdk:"nmea_enable"`
+ NmeaEnableVariable types.String `tfsdk:"nmea_enable_variable"`
+ NmeaSourceAddress types.String `tfsdk:"nmea_source_address"`
+ NmeaSourceAddressVariable types.String `tfsdk:"nmea_source_address_variable"`
+ NmeaDestinationAddress types.String `tfsdk:"nmea_destination_address"`
+ NmeaDestinationAddressVariable types.String `tfsdk:"nmea_destination_address_variable"`
+ NmeaDestinationPort types.Int64 `tfsdk:"nmea_destination_port"`
+ NmeaDestinationPortVariable types.String `tfsdk:"nmea_destination_port_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportGPS) getModel() string {
+ return "transport_gps"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportGPS) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/gps", 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 TransportGPS) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.GpsEnableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"enable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"enable.value", data.GpsEnableVariable.ValueString())
+ }
+ } else if data.GpsEnable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"enable.optionType", "default")
+ body, _ = sjson.Set(body, path+"enable.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"enable.optionType", "global")
+ body, _ = sjson.Set(body, path+"enable.value", data.GpsEnable.ValueBool())
+ }
+ }
+
+ if !data.GpsModeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"mode.optionType", "variable")
+ body, _ = sjson.Set(body, path+"mode.value", data.GpsModeVariable.ValueString())
+ }
+ } else if data.GpsMode.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"mode.optionType", "default")
+ body, _ = sjson.Set(body, path+"mode.value", "ms-based")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"mode.optionType", "global")
+ body, _ = sjson.Set(body, path+"mode.value", data.GpsMode.ValueString())
+ }
+ }
+
+ if !data.NmeaEnableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"nmea.optionType", "variable")
+ body, _ = sjson.Set(body, path+"nmea.value", data.NmeaEnableVariable.ValueString())
+ }
+ } else if data.NmeaEnable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"nmea.optionType", "default")
+ body, _ = sjson.Set(body, path+"nmea.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"nmea.optionType", "global")
+ body, _ = sjson.Set(body, path+"nmea.value", data.NmeaEnable.ValueBool())
+ }
+ }
+
+ if !data.NmeaSourceAddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"sourceAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"sourceAddress.value", data.NmeaSourceAddressVariable.ValueString())
+ }
+ } else if data.NmeaSourceAddress.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"sourceAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"sourceAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"sourceAddress.value", data.NmeaSourceAddress.ValueString())
+ }
+ }
+
+ if !data.NmeaDestinationAddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"destinationAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"destinationAddress.value", data.NmeaDestinationAddressVariable.ValueString())
+ }
+ } else if data.NmeaDestinationAddress.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"destinationAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"destinationAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"destinationAddress.value", data.NmeaDestinationAddress.ValueString())
+ }
+ }
+
+ if !data.NmeaDestinationPortVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"destinationPort.optionType", "variable")
+ body, _ = sjson.Set(body, path+"destinationPort.value", data.NmeaDestinationPortVariable.ValueString())
+ }
+ } else if data.NmeaDestinationPort.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"destinationPort.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"destinationPort.optionType", "global")
+ body, _ = sjson.Set(body, path+"destinationPort.value", data.NmeaDestinationPort.ValueInt64())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportGPS) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.GpsEnable = types.BoolNull()
+ data.GpsEnableVariable = types.StringNull()
+ if t := res.Get(path + "enable.optionType"); t.Exists() {
+ va := res.Get(path + "enable.value")
+ if t.String() == "variable" {
+ data.GpsEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.GpsMode = types.StringNull()
+ data.GpsModeVariable = types.StringNull()
+ if t := res.Get(path + "mode.optionType"); t.Exists() {
+ va := res.Get(path + "mode.value")
+ if t.String() == "variable" {
+ data.GpsModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsMode = types.StringValue(va.String())
+ }
+ }
+ data.NmeaEnable = types.BoolNull()
+ data.NmeaEnableVariable = types.StringNull()
+ if t := res.Get(path + "nmea.optionType"); t.Exists() {
+ va := res.Get(path + "nmea.value")
+ if t.String() == "variable" {
+ data.NmeaEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.NmeaSourceAddress = types.StringNull()
+ data.NmeaSourceAddressVariable = types.StringNull()
+ if t := res.Get(path + "sourceAddress.optionType"); t.Exists() {
+ va := res.Get(path + "sourceAddress.value")
+ if t.String() == "variable" {
+ data.NmeaSourceAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaSourceAddress = types.StringValue(va.String())
+ }
+ }
+ data.NmeaDestinationAddress = types.StringNull()
+ data.NmeaDestinationAddressVariable = types.StringNull()
+ if t := res.Get(path + "destinationAddress.optionType"); t.Exists() {
+ va := res.Get(path + "destinationAddress.value")
+ if t.String() == "variable" {
+ data.NmeaDestinationAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaDestinationAddress = types.StringValue(va.String())
+ }
+ }
+ data.NmeaDestinationPort = types.Int64Null()
+ data.NmeaDestinationPortVariable = types.StringNull()
+ if t := res.Get(path + "destinationPort.optionType"); t.Exists() {
+ va := res.Get(path + "destinationPort.value")
+ if t.String() == "variable" {
+ data.NmeaDestinationPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaDestinationPort = types.Int64Value(va.Int())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportGPS) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.GpsEnable = types.BoolNull()
+ data.GpsEnableVariable = types.StringNull()
+ if t := res.Get(path + "enable.optionType"); t.Exists() {
+ va := res.Get(path + "enable.value")
+ if t.String() == "variable" {
+ data.GpsEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.GpsMode = types.StringNull()
+ data.GpsModeVariable = types.StringNull()
+ if t := res.Get(path + "mode.optionType"); t.Exists() {
+ va := res.Get(path + "mode.value")
+ if t.String() == "variable" {
+ data.GpsModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GpsMode = types.StringValue(va.String())
+ }
+ }
+ data.NmeaEnable = types.BoolNull()
+ data.NmeaEnableVariable = types.StringNull()
+ if t := res.Get(path + "nmea.optionType"); t.Exists() {
+ va := res.Get(path + "nmea.value")
+ if t.String() == "variable" {
+ data.NmeaEnableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaEnable = types.BoolValue(va.Bool())
+ }
+ }
+ data.NmeaSourceAddress = types.StringNull()
+ data.NmeaSourceAddressVariable = types.StringNull()
+ if t := res.Get(path + "sourceAddress.optionType"); t.Exists() {
+ va := res.Get(path + "sourceAddress.value")
+ if t.String() == "variable" {
+ data.NmeaSourceAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaSourceAddress = types.StringValue(va.String())
+ }
+ }
+ data.NmeaDestinationAddress = types.StringNull()
+ data.NmeaDestinationAddressVariable = types.StringNull()
+ if t := res.Get(path + "destinationAddress.optionType"); t.Exists() {
+ va := res.Get(path + "destinationAddress.value")
+ if t.String() == "variable" {
+ data.NmeaDestinationAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaDestinationAddress = types.StringValue(va.String())
+ }
+ }
+ data.NmeaDestinationPort = types.Int64Null()
+ data.NmeaDestinationPortVariable = types.StringNull()
+ if t := res.Get(path + "destinationPort.optionType"); t.Exists() {
+ va := res.Get(path + "destinationPort.value")
+ if t.String() == "variable" {
+ data.NmeaDestinationPortVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NmeaDestinationPort = types.Int64Value(va.Int())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportGPS) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.GpsEnable.IsNull() {
+ return false
+ }
+ if !data.GpsEnableVariable.IsNull() {
+ return false
+ }
+ if !data.GpsMode.IsNull() {
+ return false
+ }
+ if !data.GpsModeVariable.IsNull() {
+ return false
+ }
+ if !data.NmeaEnable.IsNull() {
+ return false
+ }
+ if !data.NmeaEnableVariable.IsNull() {
+ return false
+ }
+ if !data.NmeaSourceAddress.IsNull() {
+ return false
+ }
+ if !data.NmeaSourceAddressVariable.IsNull() {
+ return false
+ }
+ if !data.NmeaDestinationAddress.IsNull() {
+ return false
+ }
+ if !data.NmeaDestinationAddressVariable.IsNull() {
+ return false
+ }
+ if !data.NmeaDestinationPort.IsNull() {
+ return false
+ }
+ if !data.NmeaDestinationPortVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go b/internal/provider/model_sdwan_transport_ipv6_tracker_feature.go
similarity index 100%
rename from internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go
rename to internal/provider/model_sdwan_transport_ipv6_tracker_feature.go
diff --git a/internal/provider/model_sdwan_transport_ipv6_tracker_group_feature.go b/internal/provider/model_sdwan_transport_ipv6_tracker_group_feature.go
new file mode 100644
index 000000000..2323a5867
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_ipv6_tracker_group_feature.go
@@ -0,0 +1,263 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportIPv6TrackerGroup 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"`
+ TrackerName types.String `tfsdk:"tracker_name"`
+ TrackerNameVariable types.String `tfsdk:"tracker_name_variable"`
+ TrackerElements []TransportIPv6TrackerGroupTrackerElements `tfsdk:"tracker_elements"`
+ TrackerBoolean types.String `tfsdk:"tracker_boolean"`
+ TrackerBooleanVariable types.String `tfsdk:"tracker_boolean_variable"`
+}
+
+type TransportIPv6TrackerGroupTrackerElements struct {
+ TrackerId types.String `tfsdk:"tracker_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportIPv6TrackerGroup) getModel() string {
+ return "transport_ipv6_tracker_group"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportIPv6TrackerGroup) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/ipv6-trackergroup", 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 TransportIPv6TrackerGroup) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.TrackerNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackerGroupName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trackerGroupName.value", data.TrackerNameVariable.ValueString())
+ }
+ } else if !data.TrackerName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackerGroupName.optionType", "global")
+ body, _ = sjson.Set(body, path+"trackerGroupName.value", data.TrackerName.ValueString())
+ }
+ }
+ if true {
+
+ for _, item := range data.TrackerElements {
+ itemBody := ""
+ if !item.TrackerId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody)
+ }
+ }
+
+ if !data.TrackerBooleanVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString())
+ }
+ } else if data.TrackerBoolean.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", "or")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportIPv6TrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.TrackerName = types.StringNull()
+ data.TrackerNameVariable = types.StringNull()
+ if t := res.Get(path + "trackerGroupName.optionType"); t.Exists() {
+ va := res.Get(path + "trackerGroupName.value")
+ if t.String() == "variable" {
+ data.TrackerNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerName = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "trackerRefs"); value.Exists() {
+ data.TrackerElements = make([]TransportIPv6TrackerGroupTrackerElements, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportIPv6TrackerGroupTrackerElements{}
+ item.TrackerId = types.StringNull()
+
+ if t := v.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := v.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ item.TrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TrackerElements = append(data.TrackerElements, item)
+ return true
+ })
+ }
+ data.TrackerBoolean = types.StringNull()
+ data.TrackerBooleanVariable = types.StringNull()
+ if t := res.Get(path + "combineBoolean.optionType"); t.Exists() {
+ va := res.Get(path + "combineBoolean.value")
+ if t.String() == "variable" {
+ data.TrackerBooleanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerBoolean = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportIPv6TrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.TrackerName = types.StringNull()
+ data.TrackerNameVariable = types.StringNull()
+ if t := res.Get(path + "trackerGroupName.optionType"); t.Exists() {
+ va := res.Get(path + "trackerGroupName.value")
+ if t.String() == "variable" {
+ data.TrackerNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerName = types.StringValue(va.String())
+ }
+ }
+ for i := range data.TrackerElements {
+ keys := [...]string{"trackerRef.refId"}
+ keyValues := [...]string{data.TrackerElements[i].TrackerId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "trackerRefs").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TrackerElements[i].TrackerId = types.StringNull()
+
+ if t := r.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := r.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ data.TrackerElements[i].TrackerId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.TrackerBoolean = types.StringNull()
+ data.TrackerBooleanVariable = types.StringNull()
+ if t := res.Get(path + "combineBoolean.optionType"); t.Exists() {
+ va := res.Get(path + "combineBoolean.value")
+ if t.String() == "variable" {
+ data.TrackerBooleanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerBoolean = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportIPv6TrackerGroup) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TrackerName.IsNull() {
+ return false
+ }
+ if !data.TrackerNameVariable.IsNull() {
+ return false
+ }
+ if len(data.TrackerElements) > 0 {
+ return false
+ }
+ if !data.TrackerBoolean.IsNull() {
+ return false
+ }
+ if !data.TrackerBooleanVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_management_vpn_feature.go b/internal/provider/model_sdwan_transport_management_vpn_feature.go
new file mode 100644
index 000000000..5df4be26a
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_management_vpn_feature.go
@@ -0,0 +1,1030 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportManagementVPN 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"`
+ VpnDescription types.String `tfsdk:"vpn_description"`
+ VpnDescriptionVariable types.String `tfsdk:"vpn_description_variable"`
+ PrimaryDnsAddressIpv4 types.String `tfsdk:"primary_dns_address_ipv4"`
+ PrimaryDnsAddressIpv4Variable types.String `tfsdk:"primary_dns_address_ipv4_variable"`
+ SecondaryDnsAddressIpv4 types.String `tfsdk:"secondary_dns_address_ipv4"`
+ SecondaryDnsAddressIpv4Variable types.String `tfsdk:"secondary_dns_address_ipv4_variable"`
+ PrimaryDnsAddressIpv6 types.String `tfsdk:"primary_dns_address_ipv6"`
+ PrimaryDnsAddressIpv6Variable types.String `tfsdk:"primary_dns_address_ipv6_variable"`
+ SecondaryDnsAddressIpv6 types.String `tfsdk:"secondary_dns_address_ipv6"`
+ SecondaryDnsAddressIpv6Variable types.String `tfsdk:"secondary_dns_address_ipv6_variable"`
+ NewHostMappings []TransportManagementVPNNewHostMappings `tfsdk:"new_host_mappings"`
+ Ipv4StaticRoutes []TransportManagementVPNIpv4StaticRoutes `tfsdk:"ipv4_static_routes"`
+ Ipv6StaticRoutes []TransportManagementVPNIpv6StaticRoutes `tfsdk:"ipv6_static_routes"`
+}
+
+type TransportManagementVPNNewHostMappings struct {
+ HostName types.String `tfsdk:"host_name"`
+ HostNameVariable types.String `tfsdk:"host_name_variable"`
+ ListOfIpAddresses types.Set `tfsdk:"list_of_ip_addresses"`
+ ListOfIpAddressesVariable types.String `tfsdk:"list_of_ip_addresses_variable"`
+}
+
+type TransportManagementVPNIpv4StaticRoutes struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Gateway types.String `tfsdk:"gateway"`
+ NextHops []TransportManagementVPNIpv4StaticRoutesNextHops `tfsdk:"next_hops"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+
+type TransportManagementVPNIpv6StaticRoutes struct {
+ Prefix types.String `tfsdk:"prefix"`
+ PrefixVariable types.String `tfsdk:"prefix_variable"`
+ Gateway types.String `tfsdk:"gateway"`
+ NextHops []TransportManagementVPNIpv6StaticRoutesNextHops `tfsdk:"next_hops"`
+ Null0 types.Bool `tfsdk:"null0"`
+ Nat types.String `tfsdk:"nat"`
+ NatVariable types.String `tfsdk:"nat_variable"`
+}
+
+type TransportManagementVPNIpv4StaticRoutesNextHops struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+
+type TransportManagementVPNIpv6StaticRoutesNextHops struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportManagementVPN) getModel() string {
+ return "transport_management_vpn"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportManagementVPN) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/management/vpn", 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 TransportManagementVPN) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+ body, _ = sjson.Set(body, path+"vpnId.optionType", "default")
+ body, _ = sjson.Set(body, path+"vpnId.value", 512)
+ }
+
+ if !data.VpnDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"name.optionType", "variable")
+ body, _ = sjson.Set(body, path+"name.value", data.VpnDescriptionVariable.ValueString())
+ }
+ } else if data.VpnDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"name.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"name.optionType", "global")
+ body, _ = sjson.Set(body, path+"name.value", data.VpnDescription.ValueString())
+ }
+ }
+
+ if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString())
+ }
+ } else if data.PrimaryDnsAddressIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString())
+ }
+ }
+
+ if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString())
+ }
+ } else if data.SecondaryDnsAddressIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString())
+ }
+ }
+
+ if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString())
+ }
+ } else if data.PrimaryDnsAddressIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString())
+ }
+ }
+
+ if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString())
+ }
+ } else if data.SecondaryDnsAddressIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{})
+ for _, item := range data.NewHostMappings {
+ itemBody := ""
+
+ if !item.HostNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString())
+ }
+ } else if !item.HostName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString())
+ }
+ }
+
+ if !item.ListOfIpAddressesVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString())
+ }
+ } else if !item.ListOfIpAddresses.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global")
+ var values []string
+ item.ListOfIpAddresses.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{})
+ for _, item := range data.Ipv4StaticRoutes {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+ if item.Gateway.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString())
+ }
+ }
+ if true && item.Gateway.ValueString() == "nextHop" {
+ itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{})
+ for _, childItem := range item.NextHops {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AdministrativeDistanceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if childItem.AdministrativeDistance.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody)
+ }
+ }
+
+ if !item.AdministrativeDistanceVariable.IsNull() {
+ if true && item.Gateway.ValueString() == "null0" {
+ itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if item.AdministrativeDistance.IsNull() {
+ if true && item.Gateway.ValueString() == "null0" {
+ itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "distance.value", 1)
+ }
+ } else {
+ if true && item.Gateway.ValueString() == "null0" {
+ itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{})
+ for _, item := range data.Ipv6StaticRoutes {
+ itemBody := ""
+
+ if !item.PrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString())
+ }
+ } else if !item.Prefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString())
+ }
+ }
+ if true && item.Gateway.ValueString() == "next_hop" {
+
+ for _, childItem := range item.NextHops {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AdministrativeDistanceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if childItem.AdministrativeDistance.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
+ }
+ }
+ if !item.Null0.IsNull() {
+ if true && item.Gateway.ValueString() == "null0" {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
+ }
+ }
+
+ if !item.NatVariable.IsNull() {
+ if true && item.Gateway.ValueString() == "nat" {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString())
+ }
+ } else if !item.Nat.IsNull() {
+ if true && item.Gateway.ValueString() == "nat" {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportManagementVPN) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.VpnDescription = types.StringNull()
+ data.VpnDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "name.optionType"); t.Exists() {
+ va := res.Get(path + "name.value")
+ if t.String() == "variable" {
+ data.VpnDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VpnDescription = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv4 = types.StringNull()
+ data.PrimaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv4 = types.StringNull()
+ data.SecondaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv6 = types.StringNull()
+ data.PrimaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv6 = types.StringNull()
+ data.SecondaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "newHostMapping"); value.Exists() {
+ data.NewHostMappings = make([]TransportManagementVPNNewHostMappings, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportManagementVPNNewHostMappings{}
+ item.HostName = types.StringNull()
+ item.HostNameVariable = types.StringNull()
+ if t := v.Get("hostName.optionType"); t.Exists() {
+ va := v.Get("hostName.value")
+ if t.String() == "variable" {
+ item.HostNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HostName = types.StringValue(va.String())
+ }
+ }
+ item.ListOfIpAddresses = types.SetNull(types.StringType)
+ item.ListOfIpAddressesVariable = types.StringNull()
+ if t := v.Get("listOfIp.optionType"); t.Exists() {
+ va := v.Get("listOfIp.value")
+ if t.String() == "variable" {
+ item.ListOfIpAddressesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ListOfIpAddresses = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.NewHostMappings = append(data.NewHostMappings, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv4Route"); value.Exists() {
+ data.Ipv4StaticRoutes = make([]TransportManagementVPNIpv4StaticRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportManagementVPNIpv4StaticRoutes{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := v.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := v.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.Gateway = types.StringNull()
+
+ if t := v.Get("gateway.optionType"); t.Exists() {
+ va := v.Get("gateway.value")
+ if t.String() == "global" {
+ item.Gateway = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("nextHop"); cValue.Exists() {
+ item.NextHops = make([]TransportManagementVPNIpv4StaticRoutesNextHops, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportManagementVPNIpv4StaticRoutesNextHops{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AdministrativeDistance = types.Int64Null()
+ cItem.AdministrativeDistanceVariable = types.StringNull()
+ if t := cv.Get("distance.optionType"); t.Exists() {
+ va := cv.Get("distance.value")
+ if t.String() == "variable" {
+ cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ item.NextHops = append(item.NextHops, cItem)
+ return true
+ })
+ }
+ item.AdministrativeDistance = types.Int64Null()
+ item.AdministrativeDistanceVariable = types.StringNull()
+ if t := v.Get("distance.optionType"); t.Exists() {
+ va := v.Get("distance.value")
+ if t.String() == "variable" {
+ item.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4StaticRoutes = append(data.Ipv4StaticRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6Route"); value.Exists() {
+ data.Ipv6StaticRoutes = make([]TransportManagementVPNIpv6StaticRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportManagementVPNIpv6StaticRoutes{}
+ item.Prefix = types.StringNull()
+ item.PrefixVariable = types.StringNull()
+ if t := v.Get("prefix.optionType"); t.Exists() {
+ va := v.Get("prefix.value")
+ if t.String() == "variable" {
+ item.PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Prefix = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
+ item.NextHops = make([]TransportManagementVPNIpv6StaticRoutesNextHops, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportManagementVPNIpv6StaticRoutesNextHops{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AdministrativeDistance = types.Int64Null()
+ cItem.AdministrativeDistanceVariable = types.StringNull()
+ if t := cv.Get("distance.optionType"); t.Exists() {
+ va := cv.Get("distance.value")
+ if t.String() == "variable" {
+ cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ item.NextHops = append(item.NextHops, cItem)
+ return true
+ })
+ }
+ item.Null0 = types.BoolNull()
+
+ if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ item.Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ item.Nat = types.StringNull()
+ item.NatVariable = types.StringNull()
+ if t := v.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.nat.value")
+ if t.String() == "variable" {
+ item.NatVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Nat = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6StaticRoutes = append(data.Ipv6StaticRoutes, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportManagementVPN) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.VpnDescription = types.StringNull()
+ data.VpnDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "name.optionType"); t.Exists() {
+ va := res.Get(path + "name.value")
+ if t.String() == "variable" {
+ data.VpnDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.VpnDescription = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv4 = types.StringNull()
+ data.PrimaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv4 = types.StringNull()
+ data.SecondaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv6 = types.StringNull()
+ data.PrimaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv6 = types.StringNull()
+ data.SecondaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ for i := range data.NewHostMappings {
+ keys := [...]string{"hostName"}
+ keyValues := [...]string{data.NewHostMappings[i].HostName.ValueString()}
+ keyValuesVariables := [...]string{data.NewHostMappings[i].HostNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "newHostMapping").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.NewHostMappings[i].HostName = types.StringNull()
+ data.NewHostMappings[i].HostNameVariable = types.StringNull()
+ if t := r.Get("hostName.optionType"); t.Exists() {
+ va := r.Get("hostName.value")
+ if t.String() == "variable" {
+ data.NewHostMappings[i].HostNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NewHostMappings[i].HostName = types.StringValue(va.String())
+ }
+ }
+ data.NewHostMappings[i].ListOfIpAddresses = types.SetNull(types.StringType)
+ data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringNull()
+ if t := r.Get("listOfIp.optionType"); t.Exists() {
+ va := r.Get("listOfIp.value")
+ if t.String() == "variable" {
+ data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NewHostMappings[i].ListOfIpAddresses = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+ for i := range data.Ipv4StaticRoutes {
+ keys := [...]string{"prefix.ipAddress", "prefix.subnetMask", "gateway"}
+ keyValues := [...]string{data.Ipv4StaticRoutes[i].NetworkAddress.ValueString(), data.Ipv4StaticRoutes[i].SubnetMask.ValueString(), data.Ipv4StaticRoutes[i].Gateway.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NetworkAddressVariable.ValueString(), data.Ipv4StaticRoutes[i].SubnetMaskVariable.ValueString(), ""}
+
+ var r gjson.Result
+ res.Get(path + "ipv4Route").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4StaticRoutes[i].NetworkAddress = types.StringNull()
+ data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := r.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].SubnetMask = types.StringNull()
+ data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := r.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].Gateway = types.StringNull()
+
+ if t := r.Get("gateway.optionType"); t.Exists() {
+ va := r.Get("gateway.value")
+ if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].Gateway = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv4StaticRoutes[i].NextHops {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("nextHop").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringNull()
+ data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
+ if t := cr.Get("distance.optionType"); t.Exists() {
+ va := cr.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Null()
+ data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringNull()
+ if t := r.Get("distance.optionType"); t.Exists() {
+ va := r.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.Ipv6StaticRoutes {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6StaticRoutes[i].Prefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].PrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6Route").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6StaticRoutes[i].Prefix = types.StringNull()
+ data.Ipv6StaticRoutes[i].PrefixVariable = types.StringNull()
+ if t := r.Get("prefix.optionType"); t.Exists() {
+ va := r.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Prefix = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv6StaticRoutes[i].NextHops {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringNull()
+ data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
+ if t := cr.Get("distance.optionType"); t.Exists() {
+ va := cr.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Ipv6StaticRoutes[i].Null0 = types.BoolNull()
+
+ if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6StaticRoutes[i].Nat = types.StringNull()
+ data.Ipv6StaticRoutes[i].NatVariable = types.StringNull()
+ if t := r.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.nat.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NatVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Nat = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportManagementVPN) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.VpnDescription.IsNull() {
+ return false
+ }
+ if !data.VpnDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv4.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv4.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv6.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv6.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
+ return false
+ }
+ if len(data.NewHostMappings) > 0 {
+ return false
+ }
+ if len(data.Ipv4StaticRoutes) > 0 {
+ return false
+ }
+ if len(data.Ipv6StaticRoutes) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_feature.go b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..49844f151
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_feature.go
@@ -0,0 +1,1354 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportManagementVPNInterfaceEthernet 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"`
+ TransportManagementVpnFeatureId types.String `tfsdk:"transport_management_vpn_feature_id"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4ConfigurationType types.String `tfsdk:"ipv4_configuration_type"`
+ Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"`
+ Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ Ipv4SecondaryAddresses []TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
+ Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
+ Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
+ Ipv4IperfServer types.String `tfsdk:"ipv4_iperf_server"`
+ Ipv4IperfServerVariable types.String `tfsdk:"ipv4_iperf_server_variable"`
+ Ipv4AutoDetectBandwidth types.Bool `tfsdk:"ipv4_auto_detect_bandwidth"`
+ Ipv4AutoDetectBandwidthVariable types.String `tfsdk:"ipv4_auto_detect_bandwidth_variable"`
+ Ipv6ConfigurationType types.String `tfsdk:"ipv6_configuration_type"`
+ EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
+ Ipv6Address types.String `tfsdk:"ipv6_address"`
+ Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
+ ArpEntries []TransportManagementVPNInterfaceEthernetArpEntries `tfsdk:"arp_entries"`
+ Duplex types.String `tfsdk:"duplex"`
+ DuplexVariable types.String `tfsdk:"duplex_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
+ InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ Speed types.String `tfsdk:"speed"`
+ SpeedVariable types.String `tfsdk:"speed_variable"`
+ ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
+ ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
+ Autonegotiate types.Bool `tfsdk:"autonegotiate"`
+ AutonegotiateVariable types.String `tfsdk:"autonegotiate_variable"`
+ MediaType types.String `tfsdk:"media_type"`
+ MediaTypeVariable types.String `tfsdk:"media_type_variable"`
+ LoadInterval types.Int64 `tfsdk:"load_interval"`
+ LoadIntervalVariable types.String `tfsdk:"load_interval_variable"`
+ IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
+ IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
+ IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
+ IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
+}
+
+type TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+}
+
+type TransportManagementVPNInterfaceEthernetArpEntries struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportManagementVPNInterfaceEthernet) getModel() string {
+ return "transport_management_vpn_interface_ethernet"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportManagementVPNInterfaceEthernet) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/management/vpn/%s/interface/ethernet", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportManagementVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4DhcpDistanceVariable.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString())
+ }
+ } else if data.Ipv4DhcpDistance.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", 1)
+ }
+ } else {
+ if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+
+ for _, item := range data.Ipv4SecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
+ }
+ } else if data.Ipv4DhcpHelper.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
+ var values []string
+ data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
+ }
+ }
+
+ if !data.Ipv4IperfServerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable")
+ body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServerVariable.ValueString())
+ }
+ } else if data.Ipv4IperfServer.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"iperfServer.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"iperfServer.optionType", "global")
+ body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServer.ValueString())
+ }
+ }
+
+ if !data.Ipv4AutoDetectBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidthVariable.ValueString())
+ }
+ } else if data.Ipv4AutoDetectBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidth.ValueBool())
+ }
+ }
+ if !data.EnableDhcpv6.IsNull() {
+ if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool())
+ }
+ }
+
+ if !data.Ipv6AddressVariable.IsNull() {
+ if true && data.Ipv6ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString())
+ }
+ } else if !data.Ipv6Address.IsNull() {
+ if true && data.Ipv6ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"arp", []interface{}{})
+ for _, item := range data.ArpEntries {
+ itemBody := ""
+
+ if !item.IpAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
+ }
+ } else if !item.IpAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
+ }
+ }
+
+ if !item.MacAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
+ }
+ } else if !item.MacAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
+ }
+ }
+
+ if !data.DuplexVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString())
+ }
+ } else if data.Duplex.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString())
+ }
+ }
+
+ if !data.MacAddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString())
+ }
+ } else if data.MacAddress.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.InterfaceMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
+ }
+ } else if data.InterfaceMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.SpeedVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString())
+ }
+ } else if data.Speed.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString())
+ }
+ }
+
+ if !data.ArpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
+ }
+ } else if data.ArpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
+ }
+ }
+
+ if !data.AutonegotiateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString())
+ }
+ } else if data.Autonegotiate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool())
+ }
+ }
+
+ if !data.MediaTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString())
+ }
+ } else if data.MediaType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString())
+ }
+ }
+
+ if !data.LoadIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString())
+ }
+ } else if data.LoadInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64())
+ }
+ }
+
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
+ }
+ } else if data.IcmpRedirectDisable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
+ }
+ }
+
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
+ }
+ } else if data.IpDirectedBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportManagementVPNInterfaceEthernet) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpDistance = types.Int64Null()
+ data.Ipv4DhcpDistanceVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary"); value.Exists() {
+ data.Ipv4SecondaryAddresses = make([]TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("subnetMask.optionType"); t.Exists() {
+ va := v.Get("subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
+ return true
+ })
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Ipv4IperfServer = types.StringNull()
+ data.Ipv4IperfServerVariable = types.StringNull()
+ if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
+ va := res.Get(path + "iperfServer.value")
+ if t.String() == "variable" {
+ data.Ipv4IperfServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4IperfServer = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4AutoDetectBandwidth = types.BoolNull()
+ data.Ipv4AutoDetectBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "autoDetectBandwidth.value")
+ if t.String() == "variable" {
+ data.Ipv4AutoDetectBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AutoDetectBandwidth = types.BoolValue(va.Bool())
+ }
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+
+ if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
+ if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "arp"); value.Exists() {
+ data.ArpEntries = make([]TransportManagementVPNInterfaceEthernetArpEntries, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportManagementVPNInterfaceEthernetArpEntries{}
+ item.IpAddress = types.StringNull()
+ item.IpAddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.IpAddress = types.StringValue(va.String())
+ }
+ }
+ item.MacAddress = types.StringNull()
+ item.MacAddressVariable = types.StringNull()
+ if t := v.Get("macAddress.optionType"); t.Exists() {
+ va := v.Get("macAddress.value")
+ if t.String() == "variable" {
+ item.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.ArpEntries = append(data.ArpEntries, item)
+ return true
+ })
+ }
+ data.Duplex = types.StringNull()
+ data.DuplexVariable = types.StringNull()
+ if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.duplex.value")
+ if t.String() == "variable" {
+ data.DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Duplex = types.StringValue(va.String())
+ }
+ }
+ data.MacAddress = types.StringNull()
+ data.MacAddressVariable = types.StringNull()
+ if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.macAddress.value")
+ if t.String() == "variable" {
+ data.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Speed = types.StringNull()
+ data.SpeedVariable = types.StringNull()
+ if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.speed.value")
+ if t.String() == "variable" {
+ data.SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Speed = types.StringValue(va.String())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Autonegotiate = types.BoolNull()
+ data.AutonegotiateVariable = types.StringNull()
+ if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.autonegotiate.value")
+ if t.String() == "variable" {
+ data.AutonegotiateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Autonegotiate = types.BoolValue(va.Bool())
+ }
+ }
+ data.MediaType = types.StringNull()
+ data.MediaTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mediaType.value")
+ if t.String() == "variable" {
+ data.MediaTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MediaType = types.StringValue(va.String())
+ }
+ }
+ data.LoadInterval = types.Int64Null()
+ data.LoadIntervalVariable = types.StringNull()
+ if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.loadInterval.value")
+ if t.String() == "variable" {
+ data.LoadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LoadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportManagementVPNInterfaceEthernet) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpDistance = types.Int64Null()
+ data.Ipv4DhcpDistanceVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv4SecondaryAddresses {
+ keys := [...]string{"ipAddress"}
+ keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("subnetMask.optionType"); t.Exists() {
+ va := r.Get("subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Ipv4IperfServer = types.StringNull()
+ data.Ipv4IperfServerVariable = types.StringNull()
+ if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
+ va := res.Get(path + "iperfServer.value")
+ if t.String() == "variable" {
+ data.Ipv4IperfServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4IperfServer = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4AutoDetectBandwidth = types.BoolNull()
+ data.Ipv4AutoDetectBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "autoDetectBandwidth.value")
+ if t.String() == "variable" {
+ data.Ipv4AutoDetectBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AutoDetectBandwidth = types.BoolValue(va.Bool())
+ }
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+
+ if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
+ if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ for i := range data.ArpEntries {
+ keys := [...]string{"ipAddress", "macAddress"}
+ keyValues := [...]string{data.ArpEntries[i].IpAddress.ValueString(), data.ArpEntries[i].MacAddress.ValueString()}
+ keyValuesVariables := [...]string{data.ArpEntries[i].IpAddressVariable.ValueString(), data.ArpEntries[i].MacAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "arp").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.ArpEntries[i].IpAddress = types.StringNull()
+ data.ArpEntries[i].IpAddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.ArpEntries[i].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpEntries[i].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.ArpEntries[i].MacAddress = types.StringNull()
+ data.ArpEntries[i].MacAddressVariable = types.StringNull()
+ if t := r.Get("macAddress.optionType"); t.Exists() {
+ va := r.Get("macAddress.value")
+ if t.String() == "variable" {
+ data.ArpEntries[i].MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpEntries[i].MacAddress = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Duplex = types.StringNull()
+ data.DuplexVariable = types.StringNull()
+ if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.duplex.value")
+ if t.String() == "variable" {
+ data.DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Duplex = types.StringValue(va.String())
+ }
+ }
+ data.MacAddress = types.StringNull()
+ data.MacAddressVariable = types.StringNull()
+ if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.macAddress.value")
+ if t.String() == "variable" {
+ data.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Speed = types.StringNull()
+ data.SpeedVariable = types.StringNull()
+ if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.speed.value")
+ if t.String() == "variable" {
+ data.SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Speed = types.StringValue(va.String())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Autonegotiate = types.BoolNull()
+ data.AutonegotiateVariable = types.StringNull()
+ if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.autonegotiate.value")
+ if t.String() == "variable" {
+ data.AutonegotiateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Autonegotiate = types.BoolValue(va.Bool())
+ }
+ }
+ data.MediaType = types.StringNull()
+ data.MediaTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mediaType.value")
+ if t.String() == "variable" {
+ data.MediaTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MediaType = types.StringValue(va.String())
+ }
+ }
+ data.LoadInterval = types.Int64Null()
+ data.LoadIntervalVariable = types.StringNull()
+ if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.loadInterval.value")
+ if t.String() == "variable" {
+ data.LoadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LoadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportManagementVPNInterfaceEthernet) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TransportManagementVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4ConfigurationType.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpDistance.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4SecondaryAddresses) > 0 {
+ return false
+ }
+ if !data.Ipv4DhcpHelper.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4IperfServer.IsNull() {
+ return false
+ }
+ if !data.Ipv4IperfServerVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4AutoDetectBandwidth.IsNull() {
+ return false
+ }
+ if !data.Ipv4AutoDetectBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6ConfigurationType.IsNull() {
+ return false
+ }
+ if !data.EnableDhcpv6.IsNull() {
+ return false
+ }
+ if !data.Ipv6Address.IsNull() {
+ return false
+ }
+ if !data.Ipv6AddressVariable.IsNull() {
+ return false
+ }
+ if len(data.ArpEntries) > 0 {
+ return false
+ }
+ if !data.Duplex.IsNull() {
+ return false
+ }
+ if !data.DuplexVariable.IsNull() {
+ return false
+ }
+ if !data.MacAddress.IsNull() {
+ return false
+ }
+ if !data.MacAddressVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtu.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtuVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.Speed.IsNull() {
+ return false
+ }
+ if !data.SpeedVariable.IsNull() {
+ return false
+ }
+ if !data.ArpTimeout.IsNull() {
+ return false
+ }
+ if !data.ArpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.Autonegotiate.IsNull() {
+ return false
+ }
+ if !data.AutonegotiateVariable.IsNull() {
+ return false
+ }
+ if !data.MediaType.IsNull() {
+ return false
+ }
+ if !data.MediaTypeVariable.IsNull() {
+ return false
+ }
+ if !data.LoadInterval.IsNull() {
+ return false
+ }
+ if !data.LoadIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.IcmpRedirectDisable.IsNull() {
+ return false
+ }
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcast.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index ee7bde533..000000000
--- a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,1348 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportManagementVPNInterfaceEthernet 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"`
- TransportManagementVpnProfileParcelId types.String `tfsdk:"transport_management_vpn_profile_parcel_id"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4ConfigurationType types.String `tfsdk:"ipv4_configuration_type"`
- Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"`
- Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- Ipv4SecondaryAddresses []TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
- Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
- Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
- Ipv4IperfServer types.String `tfsdk:"ipv4_iperf_server"`
- Ipv4IperfServerVariable types.String `tfsdk:"ipv4_iperf_server_variable"`
- Ipv4AutoDetectBandwidth types.Bool `tfsdk:"ipv4_auto_detect_bandwidth"`
- Ipv4AutoDetectBandwidthVariable types.String `tfsdk:"ipv4_auto_detect_bandwidth_variable"`
- Ipv6ConfigurationType types.String `tfsdk:"ipv6_configuration_type"`
- EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
- Ipv6Address types.String `tfsdk:"ipv6_address"`
- Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
- ArpEntries []TransportManagementVPNInterfaceEthernetArpEntries `tfsdk:"arp_entries"`
- Duplex types.String `tfsdk:"duplex"`
- DuplexVariable types.String `tfsdk:"duplex_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
- InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- Speed types.String `tfsdk:"speed"`
- SpeedVariable types.String `tfsdk:"speed_variable"`
- ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
- ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
- Autonegotiate types.Bool `tfsdk:"autonegotiate"`
- AutonegotiateVariable types.String `tfsdk:"autonegotiate_variable"`
- MediaType types.String `tfsdk:"media_type"`
- MediaTypeVariable types.String `tfsdk:"media_type_variable"`
- LoadInterval types.Int64 `tfsdk:"load_interval"`
- LoadIntervalVariable types.String `tfsdk:"load_interval_variable"`
- IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
- IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
- IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
- IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
-}
-
-type TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
-}
-
-type TransportManagementVPNInterfaceEthernetArpEntries struct {
- IpAddress types.String `tfsdk:"ip_address"`
- IpAddressVariable types.String `tfsdk:"ip_address_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportManagementVPNInterfaceEthernet) getModel() string {
- return "transport_management_vpn_interface_ethernet"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportManagementVPNInterfaceEthernet) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/management/vpn/%s/interface/ethernet", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportManagementVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4DhcpDistanceVariable.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString())
- }
- } else if data.Ipv4DhcpDistance.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "default")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", 1)
- }
- } else {
- if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
-
- for _, item := range data.Ipv4SecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody)
- }
- }
-
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
- body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
- }
- } else if data.Ipv4DhcpHelper.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
- var values []string
- data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
- }
- }
-
- if !data.Ipv4IperfServerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable")
- body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServerVariable.ValueString())
- }
- } else if data.Ipv4IperfServer.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"iperfServer.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"iperfServer.optionType", "global")
- body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServer.ValueString())
- }
- }
-
- if !data.Ipv4AutoDetectBandwidthVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable")
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidthVariable.ValueString())
- }
- } else if data.Ipv4AutoDetectBandwidth.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default")
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global")
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidth.ValueBool())
- }
- }
- if !data.EnableDhcpv6.IsNull() {
- if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool())
- }
- }
-
- if !data.Ipv6AddressVariable.IsNull() {
- if true && data.Ipv6ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString())
- }
- } else if !data.Ipv6Address.IsNull() {
- if true && data.Ipv6ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"arp", []interface{}{})
- for _, item := range data.ArpEntries {
- itemBody := ""
-
- if !item.IpAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
- }
- } else if !item.IpAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
- }
- }
-
- if !item.MacAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
- }
- } else if !item.MacAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
- }
- }
-
- if !data.DuplexVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString())
- }
- } else if data.Duplex.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString())
- }
- }
-
- if !data.MacAddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString())
- }
- } else if data.MacAddress.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.InterfaceMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
- }
- } else if data.InterfaceMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.SpeedVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString())
- }
- } else if data.Speed.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString())
- }
- }
-
- if !data.ArpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
- }
- } else if data.ArpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
- }
- }
-
- if !data.AutonegotiateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString())
- }
- } else if data.Autonegotiate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool())
- }
- }
-
- if !data.MediaTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString())
- }
- } else if data.MediaType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString())
- }
- }
-
- if !data.LoadIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString())
- }
- } else if data.LoadInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64())
- }
- }
-
- if !data.IcmpRedirectDisableVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
- }
- } else if data.IcmpRedirectDisable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
- }
- }
-
- if !data.IpDirectedBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
- }
- } else if data.IpDirectedBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportManagementVPNInterfaceEthernet) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpDistance = types.Int64Null()
- data.Ipv4DhcpDistanceVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
- if t.String() == "variable" {
- data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary"); value.Exists() {
- data.Ipv4SecondaryAddresses = make([]TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportManagementVPNInterfaceEthernetIpv4SecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("subnetMask.optionType"); t.Exists() {
- va := v.Get("subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
- return true
- })
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.Ipv4IperfServer = types.StringNull()
- data.Ipv4IperfServerVariable = types.StringNull()
- if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
- va := res.Get(path + "iperfServer.value")
- if t.String() == "variable" {
- data.Ipv4IperfServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4IperfServer = types.StringValue(va.String())
- }
- }
- data.Ipv4AutoDetectBandwidth = types.BoolNull()
- data.Ipv4AutoDetectBandwidthVariable = types.StringNull()
- if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
- va := res.Get(path + "autoDetectBandwidth.value")
- if t.String() == "variable" {
- data.Ipv4AutoDetectBandwidthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4AutoDetectBandwidth = types.BoolValue(va.Bool())
- }
- }
- data.EnableDhcpv6 = types.BoolNull()
-
- if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
- if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "arp"); value.Exists() {
- data.ArpEntries = make([]TransportManagementVPNInterfaceEthernetArpEntries, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportManagementVPNInterfaceEthernetArpEntries{}
- item.IpAddress = types.StringNull()
- item.IpAddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.IpAddress = types.StringValue(va.String())
- }
- }
- item.MacAddress = types.StringNull()
- item.MacAddressVariable = types.StringNull()
- if t := v.Get("macAddress.optionType"); t.Exists() {
- va := v.Get("macAddress.value")
- if t.String() == "variable" {
- item.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.MacAddress = types.StringValue(va.String())
- }
- }
- data.ArpEntries = append(data.ArpEntries, item)
- return true
- })
- }
- data.Duplex = types.StringNull()
- data.DuplexVariable = types.StringNull()
- if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
- va := res.Get(path + "advanced.duplex.value")
- if t.String() == "variable" {
- data.DuplexVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Duplex = types.StringValue(va.String())
- }
- }
- data.MacAddress = types.StringNull()
- data.MacAddressVariable = types.StringNull()
- if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
- va := res.Get(path + "advanced.macAddress.value")
- if t.String() == "variable" {
- data.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MacAddress = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Speed = types.StringNull()
- data.SpeedVariable = types.StringNull()
- if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
- va := res.Get(path + "advanced.speed.value")
- if t.String() == "variable" {
- data.SpeedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Speed = types.StringValue(va.String())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Autonegotiate = types.BoolNull()
- data.AutonegotiateVariable = types.StringNull()
- if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
- va := res.Get(path + "advanced.autonegotiate.value")
- if t.String() == "variable" {
- data.AutonegotiateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Autonegotiate = types.BoolValue(va.Bool())
- }
- }
- data.MediaType = types.StringNull()
- data.MediaTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mediaType.value")
- if t.String() == "variable" {
- data.MediaTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MediaType = types.StringValue(va.String())
- }
- }
- data.LoadInterval = types.Int64Null()
- data.LoadIntervalVariable = types.StringNull()
- if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
- va := res.Get(path + "advanced.loadInterval.value")
- if t.String() == "variable" {
- data.LoadIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LoadInterval = types.Int64Value(va.Int())
- }
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportManagementVPNInterfaceEthernet) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpDistance = types.Int64Null()
- data.Ipv4DhcpDistanceVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
- if t.String() == "variable" {
- data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv4SecondaryAddresses {
- keys := [...]string{"ipAddress"}
- keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringNull()
- data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("subnetMask.optionType"); t.Exists() {
- va := r.Get("subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.Ipv4IperfServer = types.StringNull()
- data.Ipv4IperfServerVariable = types.StringNull()
- if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
- va := res.Get(path + "iperfServer.value")
- if t.String() == "variable" {
- data.Ipv4IperfServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4IperfServer = types.StringValue(va.String())
- }
- }
- data.Ipv4AutoDetectBandwidth = types.BoolNull()
- data.Ipv4AutoDetectBandwidthVariable = types.StringNull()
- if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
- va := res.Get(path + "autoDetectBandwidth.value")
- if t.String() == "variable" {
- data.Ipv4AutoDetectBandwidthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4AutoDetectBandwidth = types.BoolValue(va.Bool())
- }
- }
- data.EnableDhcpv6 = types.BoolNull()
-
- if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
- if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- for i := range data.ArpEntries {
- keys := [...]string{"ipAddress", "macAddress"}
- keyValues := [...]string{data.ArpEntries[i].IpAddress.ValueString(), data.ArpEntries[i].MacAddress.ValueString()}
- keyValuesVariables := [...]string{data.ArpEntries[i].IpAddressVariable.ValueString(), data.ArpEntries[i].MacAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "arp").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.ArpEntries[i].IpAddress = types.StringNull()
- data.ArpEntries[i].IpAddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.ArpEntries[i].IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpEntries[i].IpAddress = types.StringValue(va.String())
- }
- }
- data.ArpEntries[i].MacAddress = types.StringNull()
- data.ArpEntries[i].MacAddressVariable = types.StringNull()
- if t := r.Get("macAddress.optionType"); t.Exists() {
- va := r.Get("macAddress.value")
- if t.String() == "variable" {
- data.ArpEntries[i].MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpEntries[i].MacAddress = types.StringValue(va.String())
- }
- }
- }
- data.Duplex = types.StringNull()
- data.DuplexVariable = types.StringNull()
- if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
- va := res.Get(path + "advanced.duplex.value")
- if t.String() == "variable" {
- data.DuplexVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Duplex = types.StringValue(va.String())
- }
- }
- data.MacAddress = types.StringNull()
- data.MacAddressVariable = types.StringNull()
- if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
- va := res.Get(path + "advanced.macAddress.value")
- if t.String() == "variable" {
- data.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MacAddress = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Speed = types.StringNull()
- data.SpeedVariable = types.StringNull()
- if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
- va := res.Get(path + "advanced.speed.value")
- if t.String() == "variable" {
- data.SpeedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Speed = types.StringValue(va.String())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Autonegotiate = types.BoolNull()
- data.AutonegotiateVariable = types.StringNull()
- if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
- va := res.Get(path + "advanced.autonegotiate.value")
- if t.String() == "variable" {
- data.AutonegotiateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Autonegotiate = types.BoolValue(va.Bool())
- }
- }
- data.MediaType = types.StringNull()
- data.MediaTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mediaType.value")
- if t.String() == "variable" {
- data.MediaTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MediaType = types.StringValue(va.String())
- }
- }
- data.LoadInterval = types.Int64Null()
- data.LoadIntervalVariable = types.StringNull()
- if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
- va := res.Get(path + "advanced.loadInterval.value")
- if t.String() == "variable" {
- data.LoadIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LoadInterval = types.Int64Value(va.Int())
- }
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportManagementVPNInterfaceEthernet) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.TransportManagementVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4ConfigurationType.IsNull() {
- return false
- }
- if !data.Ipv4DhcpDistance.IsNull() {
- return false
- }
- if !data.Ipv4DhcpDistanceVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if len(data.Ipv4SecondaryAddresses) > 0 {
- return false
- }
- if !data.Ipv4DhcpHelper.IsNull() {
- return false
- }
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- return false
- }
- if !data.Ipv4IperfServer.IsNull() {
- return false
- }
- if !data.Ipv4IperfServerVariable.IsNull() {
- return false
- }
- if !data.Ipv4AutoDetectBandwidth.IsNull() {
- return false
- }
- if !data.Ipv4AutoDetectBandwidthVariable.IsNull() {
- return false
- }
- if !data.Ipv6ConfigurationType.IsNull() {
- return false
- }
- if !data.EnableDhcpv6.IsNull() {
- return false
- }
- if !data.Ipv6Address.IsNull() {
- return false
- }
- if !data.Ipv6AddressVariable.IsNull() {
- return false
- }
- if len(data.ArpEntries) > 0 {
- return false
- }
- if !data.Duplex.IsNull() {
- return false
- }
- if !data.DuplexVariable.IsNull() {
- return false
- }
- if !data.MacAddress.IsNull() {
- return false
- }
- if !data.MacAddressVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.InterfaceMtu.IsNull() {
- return false
- }
- if !data.InterfaceMtuVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.Speed.IsNull() {
- return false
- }
- if !data.SpeedVariable.IsNull() {
- return false
- }
- if !data.ArpTimeout.IsNull() {
- return false
- }
- if !data.ArpTimeoutVariable.IsNull() {
- return false
- }
- if !data.Autonegotiate.IsNull() {
- return false
- }
- if !data.AutonegotiateVariable.IsNull() {
- return false
- }
- if !data.MediaType.IsNull() {
- return false
- }
- if !data.MediaTypeVariable.IsNull() {
- return false
- }
- if !data.LoadInterval.IsNull() {
- return false
- }
- if !data.LoadIntervalVariable.IsNull() {
- return false
- }
- if !data.IcmpRedirectDisable.IsNull() {
- return false
- }
- if !data.IcmpRedirectDisableVariable.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcast.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcastVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go b/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go
deleted file mode 100644
index f61c417bf..000000000
--- a/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go
+++ /dev/null
@@ -1,1015 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportManagementVPN 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"`
- VpnDescription types.String `tfsdk:"vpn_description"`
- VpnDescriptionVariable types.String `tfsdk:"vpn_description_variable"`
- PrimaryDnsAddressIpv4 types.String `tfsdk:"primary_dns_address_ipv4"`
- PrimaryDnsAddressIpv4Variable types.String `tfsdk:"primary_dns_address_ipv4_variable"`
- SecondaryDnsAddressIpv4 types.String `tfsdk:"secondary_dns_address_ipv4"`
- SecondaryDnsAddressIpv4Variable types.String `tfsdk:"secondary_dns_address_ipv4_variable"`
- PrimaryDnsAddressIpv6 types.String `tfsdk:"primary_dns_address_ipv6"`
- PrimaryDnsAddressIpv6Variable types.String `tfsdk:"primary_dns_address_ipv6_variable"`
- SecondaryDnsAddressIpv6 types.String `tfsdk:"secondary_dns_address_ipv6"`
- SecondaryDnsAddressIpv6Variable types.String `tfsdk:"secondary_dns_address_ipv6_variable"`
- NewHostMappings []TransportManagementVPNNewHostMappings `tfsdk:"new_host_mappings"`
- Ipv4StaticRoutes []TransportManagementVPNIpv4StaticRoutes `tfsdk:"ipv4_static_routes"`
- Ipv6StaticRoutes []TransportManagementVPNIpv6StaticRoutes `tfsdk:"ipv6_static_routes"`
-}
-
-type TransportManagementVPNNewHostMappings struct {
- HostName types.String `tfsdk:"host_name"`
- HostNameVariable types.String `tfsdk:"host_name_variable"`
- ListOfIpAddresses types.Set `tfsdk:"list_of_ip_addresses"`
- ListOfIpAddressesVariable types.String `tfsdk:"list_of_ip_addresses_variable"`
-}
-
-type TransportManagementVPNIpv4StaticRoutes struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- Gateway types.String `tfsdk:"gateway"`
- NextHops []TransportManagementVPNIpv4StaticRoutesNextHops `tfsdk:"next_hops"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-
-type TransportManagementVPNIpv6StaticRoutes struct {
- Prefix types.String `tfsdk:"prefix"`
- PrefixVariable types.String `tfsdk:"prefix_variable"`
- Gateway types.String `tfsdk:"gateway"`
- NextHops []TransportManagementVPNIpv6StaticRoutesNextHops `tfsdk:"next_hops"`
- Null0 types.Bool `tfsdk:"null0"`
- Nat types.String `tfsdk:"nat"`
- NatVariable types.String `tfsdk:"nat_variable"`
-}
-
-type TransportManagementVPNIpv4StaticRoutesNextHops struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-
-type TransportManagementVPNIpv6StaticRoutesNextHops struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportManagementVPN) getModel() string {
- return "transport_management_vpn"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportManagementVPN) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/management/vpn", 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 TransportManagementVPN) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
- if true {
- body, _ = sjson.Set(body, path+"vpnId.optionType", "default")
- body, _ = sjson.Set(body, path+"vpnId.value", 512)
- }
-
- if !data.VpnDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"name.optionType", "variable")
- body, _ = sjson.Set(body, path+"name.value", data.VpnDescriptionVariable.ValueString())
- }
- } else if data.VpnDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"name.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"name.optionType", "global")
- body, _ = sjson.Set(body, path+"name.value", data.VpnDescription.ValueString())
- }
- }
-
- if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString())
- }
- } else if data.PrimaryDnsAddressIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString())
- }
- }
-
- if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString())
- }
- } else if data.SecondaryDnsAddressIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString())
- }
- }
-
- if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString())
- }
- } else if data.PrimaryDnsAddressIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString())
- }
- }
-
- if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString())
- }
- } else if data.SecondaryDnsAddressIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{})
- for _, item := range data.NewHostMappings {
- itemBody := ""
-
- if !item.HostNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString())
- }
- } else if !item.HostName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString())
- }
- }
-
- if !item.ListOfIpAddressesVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString())
- }
- } else if !item.ListOfIpAddresses.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global")
- var values []string
- item.ListOfIpAddresses.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{})
- for _, item := range data.Ipv4StaticRoutes {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
- }
- }
- if item.Gateway.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString())
- }
- }
- if true && item.Gateway.ValueString() == "nextHop" {
- itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{})
- for _, childItem := range item.NextHops {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AdministrativeDistanceVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
- }
- } else if childItem.AdministrativeDistance.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody)
- }
- }
-
- if !item.AdministrativeDistanceVariable.IsNull() {
- if true && item.Gateway.ValueString() == "null0" {
- itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString())
- }
- } else if item.AdministrativeDistance.IsNull() {
- if true && item.Gateway.ValueString() == "null0" {
- itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "distance.value", 1)
- }
- } else {
- if true && item.Gateway.ValueString() == "null0" {
- itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{})
- for _, item := range data.Ipv6StaticRoutes {
- itemBody := ""
-
- if !item.PrefixVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString())
- }
- } else if !item.Prefix.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString())
- }
- }
- if true && item.Gateway.ValueString() == "next_hop" {
-
- for _, childItem := range item.NextHops {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AdministrativeDistanceVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
- }
- } else if childItem.AdministrativeDistance.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
- }
- }
- if !item.Null0.IsNull() {
- if true && item.Gateway.ValueString() == "null0" {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
- }
- }
-
- if !item.NatVariable.IsNull() {
- if true && item.Gateway.ValueString() == "nat" {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString())
- }
- } else if !item.Nat.IsNull() {
- if true && item.Gateway.ValueString() == "nat" {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportManagementVPN) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.VpnDescription = types.StringNull()
- data.VpnDescriptionVariable = types.StringNull()
- if t := res.Get(path + "name.optionType"); t.Exists() {
- va := res.Get(path + "name.value")
- if t.String() == "variable" {
- data.VpnDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.VpnDescription = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv4 = types.StringNull()
- data.PrimaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv4 = types.StringNull()
- data.SecondaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv6 = types.StringNull()
- data.PrimaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv6 = types.StringNull()
- data.SecondaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "newHostMapping"); value.Exists() {
- data.NewHostMappings = make([]TransportManagementVPNNewHostMappings, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportManagementVPNNewHostMappings{}
- item.HostName = types.StringNull()
- item.HostNameVariable = types.StringNull()
- if t := v.Get("hostName.optionType"); t.Exists() {
- va := v.Get("hostName.value")
- if t.String() == "variable" {
- item.HostNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HostName = types.StringValue(va.String())
- }
- }
- item.ListOfIpAddresses = types.SetNull(types.StringType)
- item.ListOfIpAddressesVariable = types.StringNull()
- if t := v.Get("listOfIp.optionType"); t.Exists() {
- va := v.Get("listOfIp.value")
- if t.String() == "variable" {
- item.ListOfIpAddressesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.ListOfIpAddresses = helpers.GetStringSet(va.Array())
- }
- }
- data.NewHostMappings = append(data.NewHostMappings, item)
- return true
- })
- }
- if value := res.Get(path + "ipv4Route"); value.Exists() {
- data.Ipv4StaticRoutes = make([]TransportManagementVPNIpv4StaticRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportManagementVPNIpv4StaticRoutes{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := v.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := v.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- item.Gateway = types.StringNull()
-
- if t := v.Get("gateway.optionType"); t.Exists() {
- va := v.Get("gateway.value")
- if t.String() == "global" {
- item.Gateway = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("nextHop"); cValue.Exists() {
- item.NextHops = make([]TransportManagementVPNIpv4StaticRoutesNextHops, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := TransportManagementVPNIpv4StaticRoutesNextHops{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AdministrativeDistance = types.Int64Null()
- cItem.AdministrativeDistanceVariable = types.StringNull()
- if t := cv.Get("distance.optionType"); t.Exists() {
- va := cv.Get("distance.value")
- if t.String() == "variable" {
- cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- item.NextHops = append(item.NextHops, cItem)
- return true
- })
- }
- item.AdministrativeDistance = types.Int64Null()
- item.AdministrativeDistanceVariable = types.StringNull()
- if t := v.Get("distance.optionType"); t.Exists() {
- va := v.Get("distance.value")
- if t.String() == "variable" {
- item.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4StaticRoutes = append(data.Ipv4StaticRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6Route"); value.Exists() {
- data.Ipv6StaticRoutes = make([]TransportManagementVPNIpv6StaticRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportManagementVPNIpv6StaticRoutes{}
- item.Prefix = types.StringNull()
- item.PrefixVariable = types.StringNull()
- if t := v.Get("prefix.optionType"); t.Exists() {
- va := v.Get("prefix.value")
- if t.String() == "variable" {
- item.PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Prefix = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
- item.NextHops = make([]TransportManagementVPNIpv6StaticRoutesNextHops, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := TransportManagementVPNIpv6StaticRoutesNextHops{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AdministrativeDistance = types.Int64Null()
- cItem.AdministrativeDistanceVariable = types.StringNull()
- if t := cv.Get("distance.optionType"); t.Exists() {
- va := cv.Get("distance.value")
- if t.String() == "variable" {
- cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- item.NextHops = append(item.NextHops, cItem)
- return true
- })
- }
- item.Null0 = types.BoolNull()
-
- if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- item.Null0 = types.BoolValue(va.Bool())
- }
- }
- item.Nat = types.StringNull()
- item.NatVariable = types.StringNull()
- if t := v.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.nat.value")
- if t.String() == "variable" {
- item.NatVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Nat = types.StringValue(va.String())
- }
- }
- data.Ipv6StaticRoutes = append(data.Ipv6StaticRoutes, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportManagementVPN) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.VpnDescription = types.StringNull()
- data.VpnDescriptionVariable = types.StringNull()
- if t := res.Get(path + "name.optionType"); t.Exists() {
- va := res.Get(path + "name.value")
- if t.String() == "variable" {
- data.VpnDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.VpnDescription = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv4 = types.StringNull()
- data.PrimaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv4 = types.StringNull()
- data.SecondaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv6 = types.StringNull()
- data.PrimaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv6 = types.StringNull()
- data.SecondaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- for i := range data.NewHostMappings {
- keys := [...]string{"hostName"}
- keyValues := [...]string{data.NewHostMappings[i].HostName.ValueString()}
- keyValuesVariables := [...]string{data.NewHostMappings[i].HostNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "newHostMapping").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.NewHostMappings[i].HostName = types.StringNull()
- data.NewHostMappings[i].HostNameVariable = types.StringNull()
- if t := r.Get("hostName.optionType"); t.Exists() {
- va := r.Get("hostName.value")
- if t.String() == "variable" {
- data.NewHostMappings[i].HostNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NewHostMappings[i].HostName = types.StringValue(va.String())
- }
- }
- data.NewHostMappings[i].ListOfIpAddresses = types.SetNull(types.StringType)
- data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringNull()
- if t := r.Get("listOfIp.optionType"); t.Exists() {
- va := r.Get("listOfIp.value")
- if t.String() == "variable" {
- data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NewHostMappings[i].ListOfIpAddresses = helpers.GetStringSet(va.Array())
- }
- }
- }
- for i := range data.Ipv4StaticRoutes {
- keys := [...]string{"prefix.ipAddress", "prefix.subnetMask", "gateway"}
- keyValues := [...]string{data.Ipv4StaticRoutes[i].NetworkAddress.ValueString(), data.Ipv4StaticRoutes[i].SubnetMask.ValueString(), data.Ipv4StaticRoutes[i].Gateway.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NetworkAddressVariable.ValueString(), data.Ipv4StaticRoutes[i].SubnetMaskVariable.ValueString(), ""}
-
- var r gjson.Result
- res.Get(path + "ipv4Route").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4StaticRoutes[i].NetworkAddress = types.StringNull()
- data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := r.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].SubnetMask = types.StringNull()
- data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := r.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].Gateway = types.StringNull()
-
- if t := r.Get("gateway.optionType"); t.Exists() {
- va := r.Get("gateway.value")
- if t.String() == "global" {
- data.Ipv4StaticRoutes[i].Gateway = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv4StaticRoutes[i].NextHops {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("nextHop").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringNull()
- data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
- if t := cr.Get("distance.optionType"); t.Exists() {
- va := cr.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Null()
- data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringNull()
- if t := r.Get("distance.optionType"); t.Exists() {
- va := r.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.Ipv6StaticRoutes {
- keys := [...]string{"prefix"}
- keyValues := [...]string{data.Ipv6StaticRoutes[i].Prefix.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].PrefixVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6Route").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6StaticRoutes[i].Prefix = types.StringNull()
- data.Ipv6StaticRoutes[i].PrefixVariable = types.StringNull()
- if t := r.Get("prefix.optionType"); t.Exists() {
- va := r.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Prefix = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv6StaticRoutes[i].NextHops {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringNull()
- data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
- if t := cr.Get("distance.optionType"); t.Exists() {
- va := cr.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- data.Ipv6StaticRoutes[i].Null0 = types.BoolNull()
-
- if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6StaticRoutes[i].Nat = types.StringNull()
- data.Ipv6StaticRoutes[i].NatVariable = types.StringNull()
- if t := r.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.nat.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NatVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Nat = types.StringValue(va.String())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportManagementVPN) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.VpnDescription.IsNull() {
- return false
- }
- if !data.VpnDescriptionVariable.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv4.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv4.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv6.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv6.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
- return false
- }
- if len(data.NewHostMappings) > 0 {
- return false
- }
- if len(data.Ipv4StaticRoutes) > 0 {
- return false
- }
- if len(data.Ipv6StaticRoutes) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_route_policy_feature.go b/internal/provider/model_sdwan_transport_route_policy_feature.go
new file mode 100644
index 000000000..c694d08c2
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_route_policy_feature.go
@@ -0,0 +1,1035 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportRoutePolicy 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"`
+ DefaultAction types.String `tfsdk:"default_action"`
+ Sequences []TransportRoutePolicySequences `tfsdk:"sequences"`
+}
+
+type TransportRoutePolicySequences struct {
+ Id types.Int64 `tfsdk:"id"`
+ Name types.String `tfsdk:"name"`
+ BaseAction types.String `tfsdk:"base_action"`
+ Protocol types.String `tfsdk:"protocol"`
+ MatchEntries []TransportRoutePolicySequencesMatchEntries `tfsdk:"match_entries"`
+ Actions []TransportRoutePolicySequencesActions `tfsdk:"actions"`
+}
+
+type TransportRoutePolicySequencesMatchEntries struct {
+ AsPathListId types.String `tfsdk:"as_path_list_id"`
+ StandardCommunityListCriteria types.String `tfsdk:"standard_community_list_criteria"`
+ StandardCommunityLists []TransportRoutePolicySequencesMatchEntriesStandardCommunityLists `tfsdk:"standard_community_lists"`
+ ExpandedCommunityListId types.String `tfsdk:"expanded_community_list_id"`
+ ExtendedCommunityListId types.String `tfsdk:"extended_community_list_id"`
+ BgpLocalPreference types.Int64 `tfsdk:"bgp_local_preference"`
+ Metric types.Int64 `tfsdk:"metric"`
+ OmpTag types.Int64 `tfsdk:"omp_tag"`
+ OspfTag types.Int64 `tfsdk:"ospf_tag"`
+ Ipv4AddressPrefixListId types.String `tfsdk:"ipv4_address_prefix_list_id"`
+ Ipv4NextHopPrefixListId types.String `tfsdk:"ipv4_next_hop_prefix_list_id"`
+ Ipv6AddressPrefixListId types.String `tfsdk:"ipv6_address_prefix_list_id"`
+ Ipv6NextHopPrefixListId types.String `tfsdk:"ipv6_next_hop_prefix_list_id"`
+}
+type TransportRoutePolicySequencesActions struct {
+ AsPathPrepend types.Set `tfsdk:"as_path_prepend"`
+ CommunityAdditive types.Bool `tfsdk:"community_additive"`
+ Community types.Set `tfsdk:"community"`
+ CommunityVariable types.String `tfsdk:"community_variable"`
+ LocalPreference types.Int64 `tfsdk:"local_preference"`
+ Metric types.Int64 `tfsdk:"metric"`
+ MetricType types.String `tfsdk:"metric_type"`
+ OmpTag types.Int64 `tfsdk:"omp_tag"`
+ Origin types.String `tfsdk:"origin"`
+ OspfTag types.Int64 `tfsdk:"ospf_tag"`
+ Weight types.Int64 `tfsdk:"weight"`
+ Ipv4NextHop types.String `tfsdk:"ipv4_next_hop"`
+ Ipv6NextHop types.String `tfsdk:"ipv6_next_hop"`
+}
+
+type TransportRoutePolicySequencesMatchEntriesStandardCommunityLists struct {
+ Id types.String `tfsdk:"id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportRoutePolicy) getModel() string {
+ return "transport_route_policy"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportRoutePolicy) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/route-policy", 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 TransportRoutePolicy) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if data.DefaultAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "default")
+ body, _ = sjson.Set(body, path+"defaultAction.value", "reject")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"defaultAction.optionType", "global")
+ body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"sequences", []interface{}{})
+ for _, item := range data.Sequences {
+ itemBody := ""
+ if !item.Id.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64())
+ }
+ }
+ if !item.Name.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString())
+ }
+ }
+ if item.BaseAction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "baseAction.value", "reject")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString())
+ }
+ }
+ if item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", "IPV4")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.MatchEntries {
+ itemChildBody := ""
+ if !childItem.AsPathListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.value", childItem.AsPathListId.ValueString())
+ }
+ }
+ if !childItem.StandardCommunityListCriteria.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.value", childItem.StandardCommunityListCriteria.ValueString())
+ }
+ }
+ if true {
+
+ for _, childChildItem := range childItem.StandardCommunityLists {
+ itemChildChildBody := ""
+ if !childChildItem.Id.IsNull() {
+ if true {
+ itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.optionType", "global")
+ itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.value", childChildItem.Id.ValueString())
+ }
+ }
+ itemChildBody, _ = sjson.SetRaw(itemChildBody, "communityList.standardCommunityList.-1", itemChildChildBody)
+ }
+ }
+ if !childItem.ExpandedCommunityListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.value", childItem.ExpandedCommunityListId.ValueString())
+ }
+ }
+ if !childItem.ExtendedCommunityListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.value", childItem.ExtendedCommunityListId.ValueString())
+ }
+ }
+ if !childItem.BgpLocalPreference.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.value", childItem.BgpLocalPreference.ValueInt64())
+ }
+ }
+ if !childItem.Metric.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "metric.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "metric.value", childItem.Metric.ValueInt64())
+ }
+ }
+ if !childItem.OmpTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.value", childItem.OmpTag.ValueInt64())
+ }
+ }
+ if !childItem.OspfTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.value", childItem.OspfTag.ValueInt64())
+ }
+ }
+ if !childItem.Ipv4AddressPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.value", childItem.Ipv4AddressPrefixListId.ValueString())
+ }
+ }
+ if !childItem.Ipv4NextHopPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.value", childItem.Ipv4NextHopPrefixListId.ValueString())
+ }
+ }
+ if !childItem.Ipv6AddressPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.value", childItem.Ipv6AddressPrefixListId.ValueString())
+ }
+ }
+ if !childItem.Ipv6NextHopPrefixListId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.value", childItem.Ipv6NextHopPrefixListId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "matchEntries.-1", itemChildBody)
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Actions {
+ itemChildBody := ""
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.value", true)
+ }
+ if !childItem.AsPathPrepend.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.optionType", "global")
+ var values []int64
+ childItem.AsPathPrepend.ElementsAs(ctx, &values, false)
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.value", values)
+ }
+ }
+ if childItem.CommunityAdditive.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", childItem.CommunityAdditive.ValueBool())
+ }
+ }
+
+ if !childItem.CommunityVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.value", childItem.CommunityVariable.ValueString())
+ }
+ } else if !childItem.Community.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.optionType", "global")
+ var values []string
+ childItem.Community.ElementsAs(ctx, &values, false)
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.community.value", values)
+ }
+ }
+ if !childItem.LocalPreference.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.value", childItem.LocalPreference.ValueInt64())
+ }
+ }
+ if !childItem.Metric.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.value", childItem.Metric.ValueInt64())
+ }
+ }
+ if !childItem.MetricType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.value", childItem.MetricType.ValueString())
+ }
+ }
+ if !childItem.OmpTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.value", childItem.OmpTag.ValueInt64())
+ }
+ }
+ if !childItem.Origin.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.value", childItem.Origin.ValueString())
+ }
+ }
+ if !childItem.OspfTag.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.value", childItem.OspfTag.ValueInt64())
+ }
+ }
+ if !childItem.Weight.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.value", childItem.Weight.ValueInt64())
+ }
+ }
+ if !childItem.Ipv4NextHop.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.value", childItem.Ipv4NextHop.ValueString())
+ }
+ }
+ if !childItem.Ipv6NextHop.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.value", childItem.Ipv6NextHop.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "actions.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportRoutePolicy) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "sequences"); value.Exists() {
+ data.Sequences = make([]TransportRoutePolicySequences, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutePolicySequences{}
+ item.Id = types.Int64Null()
+
+ if t := v.Get("sequenceId.optionType"); t.Exists() {
+ va := v.Get("sequenceId.value")
+ if t.String() == "global" {
+ item.Id = types.Int64Value(va.Int())
+ }
+ }
+ item.Name = types.StringNull()
+
+ if t := v.Get("sequenceName.optionType"); t.Exists() {
+ va := v.Get("sequenceName.value")
+ if t.String() == "global" {
+ item.Name = types.StringValue(va.String())
+ }
+ }
+ item.BaseAction = types.StringNull()
+
+ if t := v.Get("baseAction.optionType"); t.Exists() {
+ va := v.Get("baseAction.value")
+ if t.String() == "global" {
+ item.BaseAction = types.StringValue(va.String())
+ }
+ }
+ item.Protocol = types.StringNull()
+
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("matchEntries"); cValue.Exists() {
+ item.MatchEntries = make([]TransportRoutePolicySequencesMatchEntries, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutePolicySequencesMatchEntries{}
+ cItem.AsPathListId = types.StringNull()
+
+ if t := cv.Get("asPathList.refId.optionType"); t.Exists() {
+ va := cv.Get("asPathList.refId.value")
+ if t.String() == "global" {
+ cItem.AsPathListId = types.StringValue(va.String())
+ }
+ }
+ cItem.StandardCommunityListCriteria = types.StringNull()
+
+ if t := cv.Get("communityList.criteria.optionType"); t.Exists() {
+ va := cv.Get("communityList.criteria.value")
+ if t.String() == "global" {
+ cItem.StandardCommunityListCriteria = types.StringValue(va.String())
+ }
+ }
+ if ccValue := cv.Get("communityList.standardCommunityList"); ccValue.Exists() {
+ cItem.StandardCommunityLists = make([]TransportRoutePolicySequencesMatchEntriesStandardCommunityLists, 0)
+ ccValue.ForEach(func(cck, ccv gjson.Result) bool {
+ ccItem := TransportRoutePolicySequencesMatchEntriesStandardCommunityLists{}
+ ccItem.Id = types.StringNull()
+
+ if t := ccv.Get("refId.optionType"); t.Exists() {
+ va := ccv.Get("refId.value")
+ if t.String() == "global" {
+ ccItem.Id = types.StringValue(va.String())
+ }
+ }
+ cItem.StandardCommunityLists = append(cItem.StandardCommunityLists, ccItem)
+ return true
+ })
+ }
+ cItem.ExpandedCommunityListId = types.StringNull()
+
+ if t := cv.Get("communityList.expandedCommunityList.refId.optionType"); t.Exists() {
+ va := cv.Get("communityList.expandedCommunityList.refId.value")
+ if t.String() == "global" {
+ cItem.ExpandedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ cItem.ExtendedCommunityListId = types.StringNull()
+
+ if t := cv.Get("extCommunityList.refId.optionType"); t.Exists() {
+ va := cv.Get("extCommunityList.refId.value")
+ if t.String() == "global" {
+ cItem.ExtendedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ cItem.BgpLocalPreference = types.Int64Null()
+
+ if t := cv.Get("bgpLocalPreference.optionType"); t.Exists() {
+ va := cv.Get("bgpLocalPreference.value")
+ if t.String() == "global" {
+ cItem.BgpLocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Metric = types.Int64Null()
+
+ if t := cv.Get("metric.optionType"); t.Exists() {
+ va := cv.Get("metric.value")
+ if t.String() == "global" {
+ cItem.Metric = types.Int64Value(va.Int())
+ }
+ }
+ cItem.OmpTag = types.Int64Null()
+
+ if t := cv.Get("ompTag.optionType"); t.Exists() {
+ va := cv.Get("ompTag.value")
+ if t.String() == "global" {
+ cItem.OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.OspfTag = types.Int64Null()
+
+ if t := cv.Get("ospfTag.optionType"); t.Exists() {
+ va := cv.Get("ospfTag.value")
+ if t.String() == "global" {
+ cItem.OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Ipv4AddressPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv4Address.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv4Address.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv4AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv4NextHopPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv4NextHop.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv4NextHop.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv4NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv6AddressPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv6Address.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv6Address.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv6AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv6NextHopPrefixListId = types.StringNull()
+
+ if t := cv.Get("ipv6NextHop.refId.optionType"); t.Exists() {
+ va := cv.Get("ipv6NextHop.refId.value")
+ if t.String() == "global" {
+ cItem.Ipv6NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ item.MatchEntries = append(item.MatchEntries, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("actions"); cValue.Exists() {
+ item.Actions = make([]TransportRoutePolicySequencesActions, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutePolicySequencesActions{}
+ cItem.AsPathPrepend = types.SetNull(types.Int64Type)
+
+ if t := cv.Get("accept.setAsPath.prepend.optionType"); t.Exists() {
+ va := cv.Get("accept.setAsPath.prepend.value")
+ if t.String() == "global" {
+ cItem.AsPathPrepend = helpers.GetInt64Set(va.Array())
+ }
+ }
+ cItem.CommunityAdditive = types.BoolNull()
+
+ if t := cv.Get("accept.setCommunity.additive.optionType"); t.Exists() {
+ va := cv.Get("accept.setCommunity.additive.value")
+ if t.String() == "global" {
+ cItem.CommunityAdditive = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.Community = types.SetNull(types.StringType)
+ cItem.CommunityVariable = types.StringNull()
+ if t := cv.Get("accept.setCommunity.community.optionType"); t.Exists() {
+ va := cv.Get("accept.setCommunity.community.value")
+ if t.String() == "variable" {
+ cItem.CommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Community = helpers.GetStringSet(va.Array())
+ }
+ }
+ cItem.LocalPreference = types.Int64Null()
+
+ if t := cv.Get("accept.setLocalPreference.optionType"); t.Exists() {
+ va := cv.Get("accept.setLocalPreference.value")
+ if t.String() == "global" {
+ cItem.LocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Metric = types.Int64Null()
+
+ if t := cv.Get("accept.setMetric.optionType"); t.Exists() {
+ va := cv.Get("accept.setMetric.value")
+ if t.String() == "global" {
+ cItem.Metric = types.Int64Value(va.Int())
+ }
+ }
+ cItem.MetricType = types.StringNull()
+
+ if t := cv.Get("accept.setMetricType.optionType"); t.Exists() {
+ va := cv.Get("accept.setMetricType.value")
+ if t.String() == "global" {
+ cItem.MetricType = types.StringValue(va.String())
+ }
+ }
+ cItem.OmpTag = types.Int64Null()
+
+ if t := cv.Get("accept.setOmpTag.optionType"); t.Exists() {
+ va := cv.Get("accept.setOmpTag.value")
+ if t.String() == "global" {
+ cItem.OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Origin = types.StringNull()
+
+ if t := cv.Get("accept.setOrigin.optionType"); t.Exists() {
+ va := cv.Get("accept.setOrigin.value")
+ if t.String() == "global" {
+ cItem.Origin = types.StringValue(va.String())
+ }
+ }
+ cItem.OspfTag = types.Int64Null()
+
+ if t := cv.Get("accept.setOspfTag.optionType"); t.Exists() {
+ va := cv.Get("accept.setOspfTag.value")
+ if t.String() == "global" {
+ cItem.OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Weight = types.Int64Null()
+
+ if t := cv.Get("accept.setWeight.optionType"); t.Exists() {
+ va := cv.Get("accept.setWeight.value")
+ if t.String() == "global" {
+ cItem.Weight = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Ipv4NextHop = types.StringNull()
+
+ if t := cv.Get("accept.setIpv4NextHop.optionType"); t.Exists() {
+ va := cv.Get("accept.setIpv4NextHop.value")
+ if t.String() == "global" {
+ cItem.Ipv4NextHop = types.StringValue(va.String())
+ }
+ }
+ cItem.Ipv6NextHop = types.StringNull()
+
+ if t := cv.Get("accept.setIpv6NextHop.optionType"); t.Exists() {
+ va := cv.Get("accept.setIpv6NextHop.value")
+ if t.String() == "global" {
+ cItem.Ipv6NextHop = types.StringValue(va.String())
+ }
+ }
+ item.Actions = append(item.Actions, cItem)
+ return true
+ })
+ }
+ data.Sequences = append(data.Sequences, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportRoutePolicy) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.DefaultAction = types.StringNull()
+
+ if t := res.Get(path + "defaultAction.optionType"); t.Exists() {
+ va := res.Get(path + "defaultAction.value")
+ if t.String() == "global" {
+ data.DefaultAction = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Sequences {
+ keys := [...]string{"sequenceId"}
+ keyValues := [...]string{strconv.FormatInt(data.Sequences[i].Id.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "sequences").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].Id = types.Int64Null()
+
+ if t := r.Get("sequenceId.optionType"); t.Exists() {
+ va := r.Get("sequenceId.value")
+ if t.String() == "global" {
+ data.Sequences[i].Id = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Name = types.StringNull()
+
+ if t := r.Get("sequenceName.optionType"); t.Exists() {
+ va := r.Get("sequenceName.value")
+ if t.String() == "global" {
+ data.Sequences[i].Name = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].BaseAction = types.StringNull()
+
+ if t := r.Get("baseAction.optionType"); t.Exists() {
+ va := r.Get("baseAction.value")
+ if t.String() == "global" {
+ data.Sequences[i].BaseAction = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Protocol = types.StringNull()
+
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "global" {
+ data.Sequences[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Sequences[i].MatchEntries {
+ keys := [...]string{"asPathList.refId", "communityList.criteria", "communityList.expandedCommunityList.refId", "extCommunityList.refId", "bgpLocalPreference", "metric", "ompTag", "ospfTag", "ipv4Address.refId", "ipv4NextHop.refId", "ipv6Address.refId", "ipv6NextHop.refId"}
+ keyValues := [...]string{data.Sequences[i].MatchEntries[ci].AsPathListId.ValueString(), data.Sequences[i].MatchEntries[ci].StandardCommunityListCriteria.ValueString(), data.Sequences[i].MatchEntries[ci].ExpandedCommunityListId.ValueString(), data.Sequences[i].MatchEntries[ci].ExtendedCommunityListId.ValueString(), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].BgpLocalPreference.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].Metric.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].OmpTag.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].MatchEntries[ci].OspfTag.ValueInt64(), 10), data.Sequences[i].MatchEntries[ci].Ipv4AddressPrefixListId.ValueString(), data.Sequences[i].MatchEntries[ci].Ipv4NextHopPrefixListId.ValueString(), data.Sequences[i].MatchEntries[ci].Ipv6AddressPrefixListId.ValueString(), data.Sequences[i].MatchEntries[ci].Ipv6NextHopPrefixListId.ValueString()}
+ keyValuesVariables := [...]string{"", "", "", "", "", "", "", "", "", "", "", "", ""}
+
+ var cr gjson.Result
+ r.Get("matchEntries").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].MatchEntries[ci].AsPathListId = types.StringNull()
+
+ if t := cr.Get("asPathList.refId.optionType"); t.Exists() {
+ va := cr.Get("asPathList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].AsPathListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].StandardCommunityListCriteria = types.StringNull()
+
+ if t := cr.Get("communityList.criteria.optionType"); t.Exists() {
+ va := cr.Get("communityList.criteria.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].StandardCommunityListCriteria = types.StringValue(va.String())
+ }
+ }
+ for cci := range data.Sequences[i].MatchEntries[ci].StandardCommunityLists {
+ keys := [...]string{"refId"}
+ keyValues := [...]string{data.Sequences[i].MatchEntries[ci].StandardCommunityLists[cci].Id.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var ccr gjson.Result
+ cr.Get("communityList.standardCommunityList").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ ccr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].MatchEntries[ci].StandardCommunityLists[cci].Id = types.StringNull()
+
+ if t := ccr.Get("refId.optionType"); t.Exists() {
+ va := ccr.Get("refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].StandardCommunityLists[cci].Id = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].ExpandedCommunityListId = types.StringNull()
+
+ if t := cr.Get("communityList.expandedCommunityList.refId.optionType"); t.Exists() {
+ va := cr.Get("communityList.expandedCommunityList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].ExpandedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].ExtendedCommunityListId = types.StringNull()
+
+ if t := cr.Get("extCommunityList.refId.optionType"); t.Exists() {
+ va := cr.Get("extCommunityList.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].ExtendedCommunityListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].BgpLocalPreference = types.Int64Null()
+
+ if t := cr.Get("bgpLocalPreference.optionType"); t.Exists() {
+ va := cr.Get("bgpLocalPreference.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].BgpLocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Metric = types.Int64Null()
+
+ if t := cr.Get("metric.optionType"); t.Exists() {
+ va := cr.Get("metric.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Metric = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].OmpTag = types.Int64Null()
+
+ if t := cr.Get("ompTag.optionType"); t.Exists() {
+ va := cr.Get("ompTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].OspfTag = types.Int64Null()
+
+ if t := cr.Get("ospfTag.optionType"); t.Exists() {
+ va := cr.Get("ospfTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv4AddressPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv4Address.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv4Address.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv4AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv4NextHopPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv4NextHop.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv4NextHop.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv4NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv6AddressPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv6Address.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv6Address.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv6AddressPrefixListId = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].MatchEntries[ci].Ipv6NextHopPrefixListId = types.StringNull()
+
+ if t := cr.Get("ipv6NextHop.refId.optionType"); t.Exists() {
+ va := cr.Get("ipv6NextHop.refId.value")
+ if t.String() == "global" {
+ data.Sequences[i].MatchEntries[ci].Ipv6NextHopPrefixListId = types.StringValue(va.String())
+ }
+ }
+ }
+ for ci := range data.Sequences[i].Actions {
+ keys := [...]string{"accept.setCommunity.additive", "accept.setLocalPreference", "accept.setMetric", "accept.setMetricType", "accept.setOmpTag", "accept.setOrigin", "accept.setOspfTag", "accept.setWeight", "accept.setIpv4NextHop", "accept.setIpv6NextHop"}
+ keyValues := [...]string{strconv.FormatBool(data.Sequences[i].Actions[ci].CommunityAdditive.ValueBool()), strconv.FormatInt(data.Sequences[i].Actions[ci].LocalPreference.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].Actions[ci].Metric.ValueInt64(), 10), data.Sequences[i].Actions[ci].MetricType.ValueString(), strconv.FormatInt(data.Sequences[i].Actions[ci].OmpTag.ValueInt64(), 10), data.Sequences[i].Actions[ci].Origin.ValueString(), strconv.FormatInt(data.Sequences[i].Actions[ci].OspfTag.ValueInt64(), 10), strconv.FormatInt(data.Sequences[i].Actions[ci].Weight.ValueInt64(), 10), data.Sequences[i].Actions[ci].Ipv4NextHop.ValueString(), data.Sequences[i].Actions[ci].Ipv6NextHop.ValueString()}
+ keyValuesVariables := [...]string{"", "", "", data.Sequences[i].Actions[ci].CommunityVariable.ValueString(), "", "", "", "", "", "", "", "", ""}
+
+ var cr gjson.Result
+ r.Get("actions").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Sequences[i].Actions[ci].AsPathPrepend = types.SetNull(types.Int64Type)
+
+ if t := cr.Get("accept.setAsPath.prepend.optionType"); t.Exists() {
+ va := cr.Get("accept.setAsPath.prepend.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].AsPathPrepend = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.Sequences[i].Actions[ci].CommunityAdditive = types.BoolNull()
+
+ if t := cr.Get("accept.setCommunity.additive.optionType"); t.Exists() {
+ va := cr.Get("accept.setCommunity.additive.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].CommunityAdditive = types.BoolValue(va.Bool())
+ }
+ }
+ data.Sequences[i].Actions[ci].Community = types.SetNull(types.StringType)
+ data.Sequences[i].Actions[ci].CommunityVariable = types.StringNull()
+ if t := cr.Get("accept.setCommunity.community.optionType"); t.Exists() {
+ va := cr.Get("accept.setCommunity.community.value")
+ if t.String() == "variable" {
+ data.Sequences[i].Actions[ci].CommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Community = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.Sequences[i].Actions[ci].LocalPreference = types.Int64Null()
+
+ if t := cr.Get("accept.setLocalPreference.optionType"); t.Exists() {
+ va := cr.Get("accept.setLocalPreference.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].LocalPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Metric = types.Int64Null()
+
+ if t := cr.Get("accept.setMetric.optionType"); t.Exists() {
+ va := cr.Get("accept.setMetric.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Metric = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].MetricType = types.StringNull()
+
+ if t := cr.Get("accept.setMetricType.optionType"); t.Exists() {
+ va := cr.Get("accept.setMetricType.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].MetricType = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Actions[ci].OmpTag = types.Int64Null()
+
+ if t := cr.Get("accept.setOmpTag.optionType"); t.Exists() {
+ va := cr.Get("accept.setOmpTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].OmpTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Origin = types.StringNull()
+
+ if t := cr.Get("accept.setOrigin.optionType"); t.Exists() {
+ va := cr.Get("accept.setOrigin.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Origin = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Actions[ci].OspfTag = types.Int64Null()
+
+ if t := cr.Get("accept.setOspfTag.optionType"); t.Exists() {
+ va := cr.Get("accept.setOspfTag.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].OspfTag = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Weight = types.Int64Null()
+
+ if t := cr.Get("accept.setWeight.optionType"); t.Exists() {
+ va := cr.Get("accept.setWeight.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Weight = types.Int64Value(va.Int())
+ }
+ }
+ data.Sequences[i].Actions[ci].Ipv4NextHop = types.StringNull()
+
+ if t := cr.Get("accept.setIpv4NextHop.optionType"); t.Exists() {
+ va := cr.Get("accept.setIpv4NextHop.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Ipv4NextHop = types.StringValue(va.String())
+ }
+ }
+ data.Sequences[i].Actions[ci].Ipv6NextHop = types.StringNull()
+
+ if t := cr.Get("accept.setIpv6NextHop.optionType"); t.Exists() {
+ va := cr.Get("accept.setIpv6NextHop.value")
+ if t.String() == "global" {
+ data.Sequences[i].Actions[ci].Ipv6NextHop = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportRoutePolicy) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.DefaultAction.IsNull() {
+ return false
+ }
+ if len(data.Sequences) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_routing_bgp_feature.go b/internal/provider/model_sdwan_transport_routing_bgp_feature.go
new file mode 100644
index 000000000..90961785a
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_routing_bgp_feature.go
@@ -0,0 +1,3703 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportRoutingBGP 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"`
+ AsNumber types.Int64 `tfsdk:"as_number"`
+ AsNumberVariable types.String `tfsdk:"as_number_variable"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ PropagateAsPath types.Bool `tfsdk:"propagate_as_path"`
+ PropagateAsPathVariable types.String `tfsdk:"propagate_as_path_variable"`
+ PropagateCommunity types.Bool `tfsdk:"propagate_community"`
+ PropagateCommunityVariable types.String `tfsdk:"propagate_community_variable"`
+ ExternalRoutesDistance types.Int64 `tfsdk:"external_routes_distance"`
+ ExternalRoutesDistanceVariable types.String `tfsdk:"external_routes_distance_variable"`
+ InternalRoutesDistance types.Int64 `tfsdk:"internal_routes_distance"`
+ InternalRoutesDistanceVariable types.String `tfsdk:"internal_routes_distance_variable"`
+ LocalRoutesDistance types.Int64 `tfsdk:"local_routes_distance"`
+ LocalRoutesDistanceVariable types.String `tfsdk:"local_routes_distance_variable"`
+ KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
+ KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
+ HoldTime types.Int64 `tfsdk:"hold_time"`
+ HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
+ AlwaysCompareMed types.Bool `tfsdk:"always_compare_med"`
+ AlwaysCompareMedVariable types.String `tfsdk:"always_compare_med_variable"`
+ DeterministicMed types.Bool `tfsdk:"deterministic_med"`
+ DeterministicMedVariable types.String `tfsdk:"deterministic_med_variable"`
+ MissingMedAsWorst types.Bool `tfsdk:"missing_med_as_worst"`
+ MissingMedAsWorstVariable types.String `tfsdk:"missing_med_as_worst_variable"`
+ CompareRouterId types.Bool `tfsdk:"compare_router_id"`
+ CompareRouterIdVariable types.String `tfsdk:"compare_router_id_variable"`
+ MultipathRelax types.Bool `tfsdk:"multipath_relax"`
+ MultipathRelaxVariable types.String `tfsdk:"multipath_relax_variable"`
+ Ipv4Neighbors []TransportRoutingBGPIpv4Neighbors `tfsdk:"ipv4_neighbors"`
+ Ipv6Neighbors []TransportRoutingBGPIpv6Neighbors `tfsdk:"ipv6_neighbors"`
+ Ipv4AggregateAddresses []TransportRoutingBGPIpv4AggregateAddresses `tfsdk:"ipv4_aggregate_addresses"`
+ Ipv4Networks []TransportRoutingBGPIpv4Networks `tfsdk:"ipv4_networks"`
+ Ipv4EibgpMaximumPaths types.Int64 `tfsdk:"ipv4_eibgp_maximum_paths"`
+ Ipv4EibgpMaximumPathsVariable types.String `tfsdk:"ipv4_eibgp_maximum_paths_variable"`
+ Ipv4Originate types.Bool `tfsdk:"ipv4_originate"`
+ Ipv4OriginateVariable types.String `tfsdk:"ipv4_originate_variable"`
+ Ipv4TableMapRoutePolicyId types.String `tfsdk:"ipv4_table_map_route_policy_id"`
+ Ipv4TableMapFilter types.Bool `tfsdk:"ipv4_table_map_filter"`
+ Ipv4TableMapFilterVariable types.String `tfsdk:"ipv4_table_map_filter_variable"`
+ Ipv4Redistributes []TransportRoutingBGPIpv4Redistributes `tfsdk:"ipv4_redistributes"`
+ Ipv6AggregateAddresses []TransportRoutingBGPIpv6AggregateAddresses `tfsdk:"ipv6_aggregate_addresses"`
+ Ipv6Networks []TransportRoutingBGPIpv6Networks `tfsdk:"ipv6_networks"`
+ Ipv6EibgpMaximumPaths types.Int64 `tfsdk:"ipv6_eibgp_maximum_paths"`
+ Ipv6EibgpMaximumPathsVariable types.String `tfsdk:"ipv6_eibgp_maximum_paths_variable"`
+ Ipv6Originate types.Bool `tfsdk:"ipv6_originate"`
+ Ipv6OriginateVariable types.String `tfsdk:"ipv6_originate_variable"`
+ Ipv6TableMapRoutePolicyId types.String `tfsdk:"ipv6_table_map_route_policy_id"`
+ Ipv6TableMapFilter types.Bool `tfsdk:"ipv6_table_map_filter"`
+ Ipv6TableMapFilterVariable types.String `tfsdk:"ipv6_table_map_filter_variable"`
+ Ipv6Redistributes []TransportRoutingBGPIpv6Redistributes `tfsdk:"ipv6_redistributes"`
+ MplsInterfaces []TransportRoutingBGPMplsInterfaces `tfsdk:"mpls_interfaces"`
+}
+
+type TransportRoutingBGPIpv4Neighbors struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ Description types.String `tfsdk:"description"`
+ DescriptionVariable types.String `tfsdk:"description_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ RemoteAs types.Int64 `tfsdk:"remote_as"`
+ RemoteAsVariable types.String `tfsdk:"remote_as_variable"`
+ LocalAs types.Int64 `tfsdk:"local_as"`
+ LocalAsVariable types.String `tfsdk:"local_as_variable"`
+ KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
+ KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
+ HoldTime types.Int64 `tfsdk:"hold_time"`
+ HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
+ UpdateSourceInterface types.String `tfsdk:"update_source_interface"`
+ UpdateSourceInterfaceVariable types.String `tfsdk:"update_source_interface_variable"`
+ NextHopSelf types.Bool `tfsdk:"next_hop_self"`
+ NextHopSelfVariable types.String `tfsdk:"next_hop_self_variable"`
+ SendCommunity types.Bool `tfsdk:"send_community"`
+ SendCommunityVariable types.String `tfsdk:"send_community_variable"`
+ SendExtendedCommunity types.Bool `tfsdk:"send_extended_community"`
+ SendExtendedCommunityVariable types.String `tfsdk:"send_extended_community_variable"`
+ EbgpMultihop types.Int64 `tfsdk:"ebgp_multihop"`
+ EbgpMultihopVariable types.String `tfsdk:"ebgp_multihop_variable"`
+ Password types.String `tfsdk:"password"`
+ PasswordVariable types.String `tfsdk:"password_variable"`
+ SendLabel types.Bool `tfsdk:"send_label"`
+ ExplicitNull types.Bool `tfsdk:"explicit_null"`
+ ExplicitNullVariable types.String `tfsdk:"explicit_null_variable"`
+ AsOverride types.Bool `tfsdk:"as_override"`
+ AsOverrideVariable types.String `tfsdk:"as_override_variable"`
+ AllowasInNumber types.Int64 `tfsdk:"allowas_in_number"`
+ AllowasInNumberVariable types.String `tfsdk:"allowas_in_number_variable"`
+ AddressFamilies []TransportRoutingBGPIpv4NeighborsAddressFamilies `tfsdk:"address_families"`
+}
+
+type TransportRoutingBGPIpv6Neighbors struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ Description types.String `tfsdk:"description"`
+ DescriptionVariable types.String `tfsdk:"description_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ RemoteAs types.Int64 `tfsdk:"remote_as"`
+ RemoteAsVariable types.String `tfsdk:"remote_as_variable"`
+ LocalAs types.Int64 `tfsdk:"local_as"`
+ LocalAsVariable types.String `tfsdk:"local_as_variable"`
+ KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
+ KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
+ HoldTime types.Int64 `tfsdk:"hold_time"`
+ HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
+ UpdateSourceInterface types.String `tfsdk:"update_source_interface"`
+ UpdateSourceInterfaceVariable types.String `tfsdk:"update_source_interface_variable"`
+ NextHopSelf types.Bool `tfsdk:"next_hop_self"`
+ NextHopSelfVariable types.String `tfsdk:"next_hop_self_variable"`
+ SendCommunity types.Bool `tfsdk:"send_community"`
+ SendCommunityVariable types.String `tfsdk:"send_community_variable"`
+ SendExtendedCommunity types.Bool `tfsdk:"send_extended_community"`
+ SendExtendedCommunityVariable types.String `tfsdk:"send_extended_community_variable"`
+ EbgpMultihop types.Int64 `tfsdk:"ebgp_multihop"`
+ EbgpMultihopVariable types.String `tfsdk:"ebgp_multihop_variable"`
+ Password types.String `tfsdk:"password"`
+ PasswordVariable types.String `tfsdk:"password_variable"`
+ AsOverride types.Bool `tfsdk:"as_override"`
+ AsOverrideVariable types.String `tfsdk:"as_override_variable"`
+ AllowasInNumber types.Int64 `tfsdk:"allowas_in_number"`
+ AllowasInNumberVariable types.String `tfsdk:"allowas_in_number_variable"`
+ AddressFamilies []TransportRoutingBGPIpv6NeighborsAddressFamilies `tfsdk:"address_families"`
+}
+
+type TransportRoutingBGPIpv4AggregateAddresses struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ AsSetPath types.Bool `tfsdk:"as_set_path"`
+ AsSetPathVariable types.String `tfsdk:"as_set_path_variable"`
+ SummaryOnly types.Bool `tfsdk:"summary_only"`
+ SummaryOnlyVariable types.String `tfsdk:"summary_only_variable"`
+}
+
+type TransportRoutingBGPIpv4Networks struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+}
+
+type TransportRoutingBGPIpv4Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type TransportRoutingBGPIpv6AggregateAddresses struct {
+ AggregatePrefix types.String `tfsdk:"aggregate_prefix"`
+ AggregatePrefixVariable types.String `tfsdk:"aggregate_prefix_variable"`
+ AsSetPath types.Bool `tfsdk:"as_set_path"`
+ AsSetPathVariable types.String `tfsdk:"as_set_path_variable"`
+ SummaryOnly types.Bool `tfsdk:"summary_only"`
+ SummaryOnlyVariable types.String `tfsdk:"summary_only_variable"`
+}
+
+type TransportRoutingBGPIpv6Networks struct {
+ NetworkPrefix types.String `tfsdk:"network_prefix"`
+ NetworkPrefixVariable types.String `tfsdk:"network_prefix_variable"`
+}
+
+type TransportRoutingBGPIpv6Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type TransportRoutingBGPMplsInterfaces struct {
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+}
+
+type TransportRoutingBGPIpv4NeighborsAddressFamilies struct {
+ FamilyType types.String `tfsdk:"family_type"`
+ MaxNumberOfPrefixes types.Int64 `tfsdk:"max_number_of_prefixes"`
+ MaxNumberOfPrefixesVariable types.String `tfsdk:"max_number_of_prefixes_variable"`
+ Threshold types.Int64 `tfsdk:"threshold"`
+ ThresholdVariable types.String `tfsdk:"threshold_variable"`
+ PolicyType types.String `tfsdk:"policy_type"`
+ RestartInterval types.Int64 `tfsdk:"restart_interval"`
+ RestartIntervalVariable types.String `tfsdk:"restart_interval_variable"`
+ InRoutePolicyId types.String `tfsdk:"in_route_policy_id"`
+ OutRoutePolicyId types.String `tfsdk:"out_route_policy_id"`
+}
+
+type TransportRoutingBGPIpv6NeighborsAddressFamilies struct {
+ FamilyType types.String `tfsdk:"family_type"`
+ MaxNumberOfPrefixes types.Int64 `tfsdk:"max_number_of_prefixes"`
+ MaxNumberOfPrefixesVariable types.String `tfsdk:"max_number_of_prefixes_variable"`
+ Threshold types.Int64 `tfsdk:"threshold"`
+ ThresholdVariable types.String `tfsdk:"threshold_variable"`
+ PolicyType types.String `tfsdk:"policy_type"`
+ RestartInterval types.Int64 `tfsdk:"restart_interval"`
+ RestartIntervalVariable types.String `tfsdk:"restart_interval_variable"`
+ InRoutePolicyId types.String `tfsdk:"in_route_policy_id"`
+ OutRoutePolicyId types.String `tfsdk:"out_route_policy_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportRoutingBGP) getModel() string {
+ return "transport_routing_bgp"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportRoutingBGP) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/routing/bgp", 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 TransportRoutingBGP) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.AsNumberVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"asNum.optionType", "variable")
+ body, _ = sjson.Set(body, path+"asNum.value", data.AsNumberVariable.ValueString())
+ }
+ } else if !data.AsNumber.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"asNum.optionType", "global")
+ body, _ = sjson.Set(body, path+"asNum.value", data.AsNumber.ValueInt64())
+ }
+ }
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.PropagateAsPathVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateAspath.optionType", "variable")
+ body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPathVariable.ValueString())
+ }
+ } else if data.PropagateAsPath.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateAspath.optionType", "default")
+ body, _ = sjson.Set(body, path+"propagateAspath.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateAspath.optionType", "global")
+ body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPath.ValueBool())
+ }
+ }
+
+ if !data.PropagateCommunityVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "variable")
+ body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunityVariable.ValueString())
+ }
+ } else if data.PropagateCommunity.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "default")
+ body, _ = sjson.Set(body, path+"propagateCommunity.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "global")
+ body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunity.ValueBool())
+ }
+ }
+
+ if !data.ExternalRoutesDistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "variable")
+ body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistanceVariable.ValueString())
+ }
+ } else if data.ExternalRoutesDistance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "default")
+ body, _ = sjson.Set(body, path+"external.value", 20)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "global")
+ body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistance.ValueInt64())
+ }
+ }
+
+ if !data.InternalRoutesDistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"internal.optionType", "variable")
+ body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistanceVariable.ValueString())
+ }
+ } else if data.InternalRoutesDistance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"internal.optionType", "default")
+ body, _ = sjson.Set(body, path+"internal.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"internal.optionType", "global")
+ body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistance.ValueInt64())
+ }
+ }
+
+ if !data.LocalRoutesDistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"local.optionType", "variable")
+ body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistanceVariable.ValueString())
+ }
+ } else if data.LocalRoutesDistance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"local.optionType", "default")
+ body, _ = sjson.Set(body, path+"local.value", 20)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"local.optionType", "global")
+ body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistance.ValueInt64())
+ }
+ }
+
+ if !data.KeepaliveTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"keepalive.optionType", "variable")
+ body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTimeVariable.ValueString())
+ }
+ } else if data.KeepaliveTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"keepalive.optionType", "default")
+ body, _ = sjson.Set(body, path+"keepalive.value", 60)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"keepalive.optionType", "global")
+ body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTime.ValueInt64())
+ }
+ }
+
+ if !data.HoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"holdtime.optionType", "variable")
+ body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTimeVariable.ValueString())
+ }
+ } else if data.HoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"holdtime.optionType", "default")
+ body, _ = sjson.Set(body, path+"holdtime.value", 180)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"holdtime.optionType", "global")
+ body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTime.ValueInt64())
+ }
+ }
+
+ if !data.AlwaysCompareMedVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "variable")
+ body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMedVariable.ValueString())
+ }
+ } else if data.AlwaysCompareMed.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "default")
+ body, _ = sjson.Set(body, path+"alwaysCompare.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "global")
+ body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMed.ValueBool())
+ }
+ }
+
+ if !data.DeterministicMedVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"deterministic.optionType", "variable")
+ body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMedVariable.ValueString())
+ }
+ } else if data.DeterministicMed.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"deterministic.optionType", "default")
+ body, _ = sjson.Set(body, path+"deterministic.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"deterministic.optionType", "global")
+ body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMed.ValueBool())
+ }
+ }
+
+ if !data.MissingMedAsWorstVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "variable")
+ body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorstVariable.ValueString())
+ }
+ } else if data.MissingMedAsWorst.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "default")
+ body, _ = sjson.Set(body, path+"missingAsWorst.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "global")
+ body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorst.ValueBool())
+ }
+ }
+
+ if !data.CompareRouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"compareRouterId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterIdVariable.ValueString())
+ }
+ } else if data.CompareRouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"compareRouterId.optionType", "default")
+ body, _ = sjson.Set(body, path+"compareRouterId.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"compareRouterId.optionType", "global")
+ body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterId.ValueBool())
+ }
+ }
+
+ if !data.MultipathRelaxVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multipathRelax.optionType", "variable")
+ body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelaxVariable.ValueString())
+ }
+ } else if data.MultipathRelax.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multipathRelax.optionType", "default")
+ body, _ = sjson.Set(body, path+"multipathRelax.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"multipathRelax.optionType", "global")
+ body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelax.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"neighbor", []interface{}{})
+ for _, item := range data.Ipv4Neighbors {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.DescriptionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString())
+ }
+ } else if item.Description.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString())
+ }
+ }
+
+ if !item.ShutdownVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString())
+ }
+ } else if item.Shutdown.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool())
+ }
+ }
+
+ if !item.RemoteAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString())
+ }
+ } else if !item.RemoteAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64())
+ }
+ }
+
+ if !item.LocalAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString())
+ }
+ } else if item.LocalAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64())
+ }
+ }
+
+ if !item.KeepaliveTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString())
+ }
+ } else if item.KeepaliveTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64())
+ }
+ }
+
+ if !item.HoldTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString())
+ }
+ } else if item.HoldTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64())
+ }
+ }
+
+ if !item.UpdateSourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString())
+ }
+ } else if item.UpdateSourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString())
+ }
+ }
+
+ if !item.NextHopSelfVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString())
+ }
+ } else if item.NextHopSelf.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool())
+ }
+ }
+
+ if !item.SendCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString())
+ }
+ } else if item.SendCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool())
+ }
+ }
+
+ if !item.SendExtendedCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString())
+ }
+ } else if item.SendExtendedCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool())
+ }
+ }
+
+ if !item.EbgpMultihopVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString())
+ }
+ } else if item.EbgpMultihop.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64())
+ }
+ }
+
+ if !item.PasswordVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
+ }
+ } else if item.Password.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
+ }
+ }
+ if item.SendLabel.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabel.ValueBool())
+ }
+ }
+
+ if !item.ExplicitNullVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNullVariable.ValueString())
+ }
+ } else if item.ExplicitNull.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNull.ValueBool())
+ }
+ }
+
+ if !item.AsOverrideVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString())
+ }
+ } else if item.AsOverride.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool())
+ }
+ }
+
+ if !item.AllowasInNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString())
+ }
+ } else if item.AllowasInNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{})
+ for _, childItem := range item.AddressFamilies {
+ itemChildBody := ""
+ if !childItem.FamilyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString())
+ }
+ }
+
+ if !childItem.MaxNumberOfPrefixesVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString())
+ }
+ } else if !childItem.MaxNumberOfPrefixes.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64())
+ }
+ }
+
+ if !childItem.ThresholdVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString())
+ }
+ } else if childItem.Threshold.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64())
+ }
+ }
+ if !childItem.PolicyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString())
+ }
+ }
+
+ if !childItem.RestartIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString())
+ }
+ } else if !childItem.RestartInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64())
+ }
+ }
+ if !childItem.InRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString())
+ }
+ }
+ if !childItem.OutRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"neighbor.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6Neighbor", []interface{}{})
+ for _, item := range data.Ipv6Neighbors {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.DescriptionVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString())
+ }
+ } else if item.Description.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "description.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString())
+ }
+ }
+
+ if !item.ShutdownVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString())
+ }
+ } else if item.Shutdown.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool())
+ }
+ }
+
+ if !item.RemoteAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString())
+ }
+ } else if !item.RemoteAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64())
+ }
+ }
+
+ if !item.LocalAsVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString())
+ }
+ } else if item.LocalAs.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64())
+ }
+ }
+
+ if !item.KeepaliveTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString())
+ }
+ } else if item.KeepaliveTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64())
+ }
+ }
+
+ if !item.HoldTimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString())
+ }
+ } else if item.HoldTime.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64())
+ }
+ }
+
+ if !item.UpdateSourceInterfaceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString())
+ }
+ } else if item.UpdateSourceInterface.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString())
+ }
+ }
+
+ if !item.NextHopSelfVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString())
+ }
+ } else if item.NextHopSelf.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool())
+ }
+ }
+
+ if !item.SendCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString())
+ }
+ } else if item.SendCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool())
+ }
+ }
+
+ if !item.SendExtendedCommunityVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString())
+ }
+ } else if item.SendExtendedCommunity.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool())
+ }
+ }
+
+ if !item.EbgpMultihopVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString())
+ }
+ } else if item.EbgpMultihop.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64())
+ }
+ }
+
+ if !item.PasswordVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
+ }
+ } else if item.Password.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
+ }
+ }
+
+ if !item.AsOverrideVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString())
+ }
+ } else if item.AsOverride.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool())
+ }
+ }
+
+ if !item.AllowasInNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString())
+ }
+ } else if item.AllowasInNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{})
+ for _, childItem := range item.AddressFamilies {
+ itemChildBody := ""
+ if !childItem.FamilyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString())
+ }
+ }
+
+ if !childItem.MaxNumberOfPrefixesVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString())
+ }
+ } else if !childItem.MaxNumberOfPrefixes.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64())
+ }
+ }
+
+ if !childItem.ThresholdVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString())
+ }
+ } else if childItem.Threshold.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64())
+ }
+ }
+ if !childItem.PolicyType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString())
+ }
+ }
+
+ if !childItem.RestartIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString())
+ }
+ } else if !childItem.RestartInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64())
+ }
+ }
+ if !childItem.InRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString())
+ }
+ }
+ if !childItem.OutRoutePolicyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6Neighbor.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.aggregateAddress", []interface{}{})
+ for _, item := range data.Ipv4AggregateAddresses {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString())
+ }
+ }
+
+ if !item.AsSetPathVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString())
+ }
+ } else if item.AsSetPath.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool())
+ }
+ }
+
+ if !item.SummaryOnlyVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString())
+ }
+ } else if item.SummaryOnly.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"addressFamily.aggregateAddress.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.network", []interface{}{})
+ for _, item := range data.Ipv4Networks {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"addressFamily.network.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv4EibgpMaximumPathsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPathsVariable.ValueString())
+ }
+ } else if data.Ipv4EibgpMaximumPaths.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPaths.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4OriginateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4OriginateVariable.ValueString())
+ }
+ } else if data.Ipv4Originate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "default")
+ body, _ = sjson.Set(body, path+"addressFamily.originate.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4Originate.ValueBool())
+ }
+ }
+ if data.Ipv4TableMapRoutePolicyId.IsNull() {
+ body, _ = sjson.Set(body, path+"addressFamily.name.optionType", "default")
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.name.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.name.refId.value", data.Ipv4TableMapRoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.Ipv4TableMapFilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilterVariable.ValueString())
+ }
+ } else if data.Ipv4TableMapFilter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"addressFamily.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"addressFamily.redistribute", []interface{}{})
+ for _, item := range data.Ipv4Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"addressFamily.redistribute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6AggregateAddress", []interface{}{})
+ for _, item := range data.Ipv6AggregateAddresses {
+ itemBody := ""
+
+ if !item.AggregatePrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefixVariable.ValueString())
+ }
+ } else if !item.AggregatePrefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefix.ValueString())
+ }
+ }
+
+ if !item.AsSetPathVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString())
+ }
+ } else if item.AsSetPath.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool())
+ }
+ }
+
+ if !item.SummaryOnlyVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString())
+ }
+ } else if item.SummaryOnly.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6AggregateAddress.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6Network", []interface{}{})
+ for _, item := range data.Ipv6Networks {
+ itemBody := ""
+
+ if !item.NetworkPrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefixVariable.ValueString())
+ }
+ } else if !item.NetworkPrefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefix.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6Network.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv6EibgpMaximumPathsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPathsVariable.ValueString())
+ }
+ } else if data.Ipv6EibgpMaximumPaths.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPaths.ValueInt64())
+ }
+ }
+
+ if !data.Ipv6OriginateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6OriginateVariable.ValueString())
+ }
+ } else if data.Ipv6Originate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6Originate.ValueBool())
+ }
+ }
+ if data.Ipv6TableMapRoutePolicyId.IsNull() {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.optionType", "default")
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.value", data.Ipv6TableMapRoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.Ipv6TableMapFilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilterVariable.ValueString())
+ }
+ } else if data.Ipv6TableMapFilter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6AddressFamily.redistribute", []interface{}{})
+ for _, item := range data.Ipv6Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.redistribute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"mplsInterface", []interface{}{})
+ for _, item := range data.MplsInterfaces {
+ itemBody := ""
+
+ if !item.InterfaceNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString())
+ }
+ } else if !item.InterfaceName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"mplsInterface.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportRoutingBGP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AsNumber = types.Int64Null()
+ data.AsNumberVariable = types.StringNull()
+ if t := res.Get(path + "asNum.optionType"); t.Exists() {
+ va := res.Get(path + "asNum.value")
+ if t.String() == "variable" {
+ data.AsNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AsNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.PropagateAsPath = types.BoolNull()
+ data.PropagateAsPathVariable = types.StringNull()
+ if t := res.Get(path + "propagateAspath.optionType"); t.Exists() {
+ va := res.Get(path + "propagateAspath.value")
+ if t.String() == "variable" {
+ data.PropagateAsPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateAsPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.PropagateCommunity = types.BoolNull()
+ data.PropagateCommunityVariable = types.StringNull()
+ if t := res.Get(path + "propagateCommunity.optionType"); t.Exists() {
+ va := res.Get(path + "propagateCommunity.value")
+ if t.String() == "variable" {
+ data.PropagateCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.ExternalRoutesDistance = types.Int64Null()
+ data.ExternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.ExternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.InternalRoutesDistance = types.Int64Null()
+ data.InternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "internal.optionType"); t.Exists() {
+ va := res.Get(path + "internal.value")
+ if t.String() == "variable" {
+ data.InternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.LocalRoutesDistance = types.Int64Null()
+ data.LocalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "local.optionType"); t.Exists() {
+ va := res.Get(path + "local.value")
+ if t.String() == "variable" {
+ data.LocalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LocalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.KeepaliveTime = types.Int64Null()
+ data.KeepaliveTimeVariable = types.StringNull()
+ if t := res.Get(path + "keepalive.optionType"); t.Exists() {
+ va := res.Get(path + "keepalive.value")
+ if t.String() == "variable" {
+ data.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.HoldTime = types.Int64Null()
+ data.HoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "holdtime.optionType"); t.Exists() {
+ va := res.Get(path + "holdtime.value")
+ if t.String() == "variable" {
+ data.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.AlwaysCompareMed = types.BoolNull()
+ data.AlwaysCompareMedVariable = types.StringNull()
+ if t := res.Get(path + "alwaysCompare.optionType"); t.Exists() {
+ va := res.Get(path + "alwaysCompare.value")
+ if t.String() == "variable" {
+ data.AlwaysCompareMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AlwaysCompareMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.DeterministicMed = types.BoolNull()
+ data.DeterministicMedVariable = types.StringNull()
+ if t := res.Get(path + "deterministic.optionType"); t.Exists() {
+ va := res.Get(path + "deterministic.value")
+ if t.String() == "variable" {
+ data.DeterministicMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DeterministicMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.MissingMedAsWorst = types.BoolNull()
+ data.MissingMedAsWorstVariable = types.StringNull()
+ if t := res.Get(path + "missingAsWorst.optionType"); t.Exists() {
+ va := res.Get(path + "missingAsWorst.value")
+ if t.String() == "variable" {
+ data.MissingMedAsWorstVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MissingMedAsWorst = types.BoolValue(va.Bool())
+ }
+ }
+ data.CompareRouterId = types.BoolNull()
+ data.CompareRouterIdVariable = types.StringNull()
+ if t := res.Get(path + "compareRouterId.optionType"); t.Exists() {
+ va := res.Get(path + "compareRouterId.value")
+ if t.String() == "variable" {
+ data.CompareRouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.CompareRouterId = types.BoolValue(va.Bool())
+ }
+ }
+ data.MultipathRelax = types.BoolNull()
+ data.MultipathRelaxVariable = types.StringNull()
+ if t := res.Get(path + "multipathRelax.optionType"); t.Exists() {
+ va := res.Get(path + "multipathRelax.value")
+ if t.String() == "variable" {
+ data.MultipathRelaxVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MultipathRelax = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "neighbor"); value.Exists() {
+ data.Ipv4Neighbors = make([]TransportRoutingBGPIpv4Neighbors, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv4Neighbors{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.Description = types.StringNull()
+ item.DescriptionVariable = types.StringNull()
+ if t := v.Get("description.optionType"); t.Exists() {
+ va := v.Get("description.value")
+ if t.String() == "variable" {
+ item.DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Description = types.StringValue(va.String())
+ }
+ }
+ item.Shutdown = types.BoolNull()
+ item.ShutdownVariable = types.StringNull()
+ if t := v.Get("shutdown.optionType"); t.Exists() {
+ va := v.Get("shutdown.value")
+ if t.String() == "variable" {
+ item.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ item.RemoteAs = types.Int64Null()
+ item.RemoteAsVariable = types.StringNull()
+ if t := v.Get("remoteAs.optionType"); t.Exists() {
+ va := v.Get("remoteAs.value")
+ if t.String() == "variable" {
+ item.RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ item.LocalAs = types.Int64Null()
+ item.LocalAsVariable = types.StringNull()
+ if t := v.Get("localAs.optionType"); t.Exists() {
+ va := v.Get("localAs.value")
+ if t.String() == "variable" {
+ item.LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ item.KeepaliveTime = types.Int64Null()
+ item.KeepaliveTimeVariable = types.StringNull()
+ if t := v.Get("keepalive.optionType"); t.Exists() {
+ va := v.Get("keepalive.value")
+ if t.String() == "variable" {
+ item.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ item.HoldTime = types.Int64Null()
+ item.HoldTimeVariable = types.StringNull()
+ if t := v.Get("holdtime.optionType"); t.Exists() {
+ va := v.Get("holdtime.value")
+ if t.String() == "variable" {
+ item.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ item.UpdateSourceInterface = types.StringNull()
+ item.UpdateSourceInterfaceVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ item.NextHopSelf = types.BoolNull()
+ item.NextHopSelfVariable = types.StringNull()
+ if t := v.Get("nextHopSelf.optionType"); t.Exists() {
+ va := v.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ item.NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendCommunity = types.BoolNull()
+ item.SendCommunityVariable = types.StringNull()
+ if t := v.Get("sendCommunity.optionType"); t.Exists() {
+ va := v.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ item.SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendExtendedCommunity = types.BoolNull()
+ item.SendExtendedCommunityVariable = types.StringNull()
+ if t := v.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := v.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ item.SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.EbgpMultihop = types.Int64Null()
+ item.EbgpMultihopVariable = types.StringNull()
+ if t := v.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := v.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ item.EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ item.SendLabel = types.BoolNull()
+
+ if t := v.Get("sendLabel.optionType"); t.Exists() {
+ va := v.Get("sendLabel.value")
+ if t.String() == "global" {
+ item.SendLabel = types.BoolValue(va.Bool())
+ }
+ }
+ item.ExplicitNull = types.BoolNull()
+ item.ExplicitNullVariable = types.StringNull()
+ if t := v.Get("sendLabelExplicit.optionType"); t.Exists() {
+ va := v.Get("sendLabelExplicit.value")
+ if t.String() == "variable" {
+ item.ExplicitNullVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ExplicitNull = types.BoolValue(va.Bool())
+ }
+ }
+ item.AsOverride = types.BoolNull()
+ item.AsOverrideVariable = types.StringNull()
+ if t := v.Get("asOverride.optionType"); t.Exists() {
+ va := v.Get("asOverride.value")
+ if t.String() == "variable" {
+ item.AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ item.AllowasInNumber = types.Int64Null()
+ item.AllowasInNumberVariable = types.StringNull()
+ if t := v.Get("asNumber.optionType"); t.Exists() {
+ va := v.Get("asNumber.value")
+ if t.String() == "variable" {
+ item.AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ if cValue := v.Get("addressFamily"); cValue.Exists() {
+ item.AddressFamilies = make([]TransportRoutingBGPIpv4NeighborsAddressFamilies, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingBGPIpv4NeighborsAddressFamilies{}
+ cItem.FamilyType = types.StringNull()
+
+ if t := cv.Get("familyType.optionType"); t.Exists() {
+ va := cv.Get("familyType.value")
+ if t.String() == "global" {
+ cItem.FamilyType = types.StringValue(va.String())
+ }
+ }
+ cItem.MaxNumberOfPrefixes = types.Int64Null()
+ cItem.MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ cItem.MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Threshold = types.Int64Null()
+ cItem.ThresholdVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ cItem.ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Threshold = types.Int64Value(va.Int())
+ }
+ }
+ cItem.PolicyType = types.StringNull()
+
+ if t := cv.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ cItem.PolicyType = types.StringValue(va.String())
+ }
+ }
+ cItem.RestartInterval = types.Int64Null()
+ cItem.RestartIntervalVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ cItem.RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.InRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ cItem.OutRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ item.AddressFamilies = append(item.AddressFamilies, cItem)
+ return true
+ })
+ }
+ data.Ipv4Neighbors = append(data.Ipv4Neighbors, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6Neighbor"); value.Exists() {
+ data.Ipv6Neighbors = make([]TransportRoutingBGPIpv6Neighbors, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv6Neighbors{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.Description = types.StringNull()
+ item.DescriptionVariable = types.StringNull()
+ if t := v.Get("description.optionType"); t.Exists() {
+ va := v.Get("description.value")
+ if t.String() == "variable" {
+ item.DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Description = types.StringValue(va.String())
+ }
+ }
+ item.Shutdown = types.BoolNull()
+ item.ShutdownVariable = types.StringNull()
+ if t := v.Get("shutdown.optionType"); t.Exists() {
+ va := v.Get("shutdown.value")
+ if t.String() == "variable" {
+ item.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ item.RemoteAs = types.Int64Null()
+ item.RemoteAsVariable = types.StringNull()
+ if t := v.Get("remoteAs.optionType"); t.Exists() {
+ va := v.Get("remoteAs.value")
+ if t.String() == "variable" {
+ item.RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ item.LocalAs = types.Int64Null()
+ item.LocalAsVariable = types.StringNull()
+ if t := v.Get("localAs.optionType"); t.Exists() {
+ va := v.Get("localAs.value")
+ if t.String() == "variable" {
+ item.LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ item.KeepaliveTime = types.Int64Null()
+ item.KeepaliveTimeVariable = types.StringNull()
+ if t := v.Get("keepalive.optionType"); t.Exists() {
+ va := v.Get("keepalive.value")
+ if t.String() == "variable" {
+ item.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ item.HoldTime = types.Int64Null()
+ item.HoldTimeVariable = types.StringNull()
+ if t := v.Get("holdtime.optionType"); t.Exists() {
+ va := v.Get("holdtime.value")
+ if t.String() == "variable" {
+ item.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ item.UpdateSourceInterface = types.StringNull()
+ item.UpdateSourceInterfaceVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ item.NextHopSelf = types.BoolNull()
+ item.NextHopSelfVariable = types.StringNull()
+ if t := v.Get("nextHopSelf.optionType"); t.Exists() {
+ va := v.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ item.NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendCommunity = types.BoolNull()
+ item.SendCommunityVariable = types.StringNull()
+ if t := v.Get("sendCommunity.optionType"); t.Exists() {
+ va := v.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ item.SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.SendExtendedCommunity = types.BoolNull()
+ item.SendExtendedCommunityVariable = types.StringNull()
+ if t := v.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := v.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ item.SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ item.EbgpMultihop = types.Int64Null()
+ item.EbgpMultihopVariable = types.StringNull()
+ if t := v.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := v.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ item.EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ item.AsOverride = types.BoolNull()
+ item.AsOverrideVariable = types.StringNull()
+ if t := v.Get("asOverride.optionType"); t.Exists() {
+ va := v.Get("asOverride.value")
+ if t.String() == "variable" {
+ item.AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ item.AllowasInNumber = types.Int64Null()
+ item.AllowasInNumberVariable = types.StringNull()
+ if t := v.Get("asNumber.optionType"); t.Exists() {
+ va := v.Get("asNumber.value")
+ if t.String() == "variable" {
+ item.AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ if cValue := v.Get("addressFamily"); cValue.Exists() {
+ item.AddressFamilies = make([]TransportRoutingBGPIpv6NeighborsAddressFamilies, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingBGPIpv6NeighborsAddressFamilies{}
+ cItem.FamilyType = types.StringNull()
+
+ if t := cv.Get("familyType.optionType"); t.Exists() {
+ va := cv.Get("familyType.value")
+ if t.String() == "global" {
+ cItem.FamilyType = types.StringValue(va.String())
+ }
+ }
+ cItem.MaxNumberOfPrefixes = types.Int64Null()
+ cItem.MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ cItem.MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Threshold = types.Int64Null()
+ cItem.ThresholdVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ cItem.ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Threshold = types.Int64Value(va.Int())
+ }
+ }
+ cItem.PolicyType = types.StringNull()
+
+ if t := cv.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ cItem.PolicyType = types.StringValue(va.String())
+ }
+ }
+ cItem.RestartInterval = types.Int64Null()
+ cItem.RestartIntervalVariable = types.StringNull()
+ if t := cv.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cv.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ cItem.RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.InRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ cItem.OutRoutePolicyId = types.StringNull()
+
+ if t := cv.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cv.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ cItem.OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ item.AddressFamilies = append(item.AddressFamilies, cItem)
+ return true
+ })
+ }
+ data.Ipv6Neighbors = append(data.Ipv6Neighbors, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "addressFamily.aggregateAddress"); value.Exists() {
+ data.Ipv4AggregateAddresses = make([]TransportRoutingBGPIpv4AggregateAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv4AggregateAddresses{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.address.optionType"); t.Exists() {
+ va := v.Get("prefix.address.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.mask.optionType"); t.Exists() {
+ va := v.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.AsSetPath = types.BoolNull()
+ item.AsSetPathVariable = types.StringNull()
+ if t := v.Get("asSet.optionType"); t.Exists() {
+ va := v.Get("asSet.value")
+ if t.String() == "variable" {
+ item.AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ item.SummaryOnly = types.BoolNull()
+ item.SummaryOnlyVariable = types.StringNull()
+ if t := v.Get("summaryOnly.optionType"); t.Exists() {
+ va := v.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ item.SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4AggregateAddresses = append(data.Ipv4AggregateAddresses, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "addressFamily.network"); value.Exists() {
+ data.Ipv4Networks = make([]TransportRoutingBGPIpv4Networks, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv4Networks{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.address.optionType"); t.Exists() {
+ va := v.Get("prefix.address.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.mask.optionType"); t.Exists() {
+ va := v.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Networks = append(data.Ipv4Networks, item)
+ return true
+ })
+ }
+ data.Ipv4EibgpMaximumPaths = types.Int64Null()
+ data.Ipv4EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv4EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Originate = types.BoolNull()
+ data.Ipv4OriginateVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv4OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "addressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv4TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4TableMapFilter = types.BoolNull()
+ data.Ipv4TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv4TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "addressFamily.redistribute"); value.Exists() {
+ data.Ipv4Redistributes = make([]TransportRoutingBGPIpv4Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv4Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Redistributes = append(data.Ipv4Redistributes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6AddressFamily.ipv6AggregateAddress"); value.Exists() {
+ data.Ipv6AggregateAddresses = make([]TransportRoutingBGPIpv6AggregateAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv6AggregateAddresses{}
+ item.AggregatePrefix = types.StringNull()
+ item.AggregatePrefixVariable = types.StringNull()
+ if t := v.Get("prefix.optionType"); t.Exists() {
+ va := v.Get("prefix.value")
+ if t.String() == "variable" {
+ item.AggregatePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AggregatePrefix = types.StringValue(va.String())
+ }
+ }
+ item.AsSetPath = types.BoolNull()
+ item.AsSetPathVariable = types.StringNull()
+ if t := v.Get("asSet.optionType"); t.Exists() {
+ va := v.Get("asSet.value")
+ if t.String() == "variable" {
+ item.AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ item.SummaryOnly = types.BoolNull()
+ item.SummaryOnlyVariable = types.StringNull()
+ if t := v.Get("summaryOnly.optionType"); t.Exists() {
+ va := v.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ item.SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6AggregateAddresses = append(data.Ipv6AggregateAddresses, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6AddressFamily.ipv6Network"); value.Exists() {
+ data.Ipv6Networks = make([]TransportRoutingBGPIpv6Networks, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv6Networks{}
+ item.NetworkPrefix = types.StringNull()
+ item.NetworkPrefixVariable = types.StringNull()
+ if t := v.Get("prefix.optionType"); t.Exists() {
+ va := v.Get("prefix.value")
+ if t.String() == "variable" {
+ item.NetworkPrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkPrefix = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Networks = append(data.Ipv6Networks, item)
+ return true
+ })
+ }
+ data.Ipv6EibgpMaximumPaths = types.Int64Null()
+ data.Ipv6EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv6EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Originate = types.BoolNull()
+ data.Ipv6OriginateVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv6OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "ipv6AddressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv6TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6TableMapFilter = types.BoolNull()
+ data.Ipv6TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv6TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "ipv6AddressFamily.redistribute"); value.Exists() {
+ data.Ipv6Redistributes = make([]TransportRoutingBGPIpv6Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPIpv6Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Redistributes = append(data.Ipv6Redistributes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "mplsInterface"); value.Exists() {
+ data.MplsInterfaces = make([]TransportRoutingBGPMplsInterfaces, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingBGPMplsInterfaces{}
+ item.InterfaceName = types.StringNull()
+ item.InterfaceNameVariable = types.StringNull()
+ if t := v.Get("ifName.optionType"); t.Exists() {
+ va := v.Get("ifName.value")
+ if t.String() == "variable" {
+ item.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.MplsInterfaces = append(data.MplsInterfaces, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportRoutingBGP) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.AsNumber = types.Int64Null()
+ data.AsNumberVariable = types.StringNull()
+ if t := res.Get(path + "asNum.optionType"); t.Exists() {
+ va := res.Get(path + "asNum.value")
+ if t.String() == "variable" {
+ data.AsNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AsNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.PropagateAsPath = types.BoolNull()
+ data.PropagateAsPathVariable = types.StringNull()
+ if t := res.Get(path + "propagateAspath.optionType"); t.Exists() {
+ va := res.Get(path + "propagateAspath.value")
+ if t.String() == "variable" {
+ data.PropagateAsPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateAsPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.PropagateCommunity = types.BoolNull()
+ data.PropagateCommunityVariable = types.StringNull()
+ if t := res.Get(path + "propagateCommunity.optionType"); t.Exists() {
+ va := res.Get(path + "propagateCommunity.value")
+ if t.String() == "variable" {
+ data.PropagateCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PropagateCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.ExternalRoutesDistance = types.Int64Null()
+ data.ExternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.ExternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ExternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.InternalRoutesDistance = types.Int64Null()
+ data.InternalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "internal.optionType"); t.Exists() {
+ va := res.Get(path + "internal.value")
+ if t.String() == "variable" {
+ data.InternalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InternalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.LocalRoutesDistance = types.Int64Null()
+ data.LocalRoutesDistanceVariable = types.StringNull()
+ if t := res.Get(path + "local.optionType"); t.Exists() {
+ va := res.Get(path + "local.value")
+ if t.String() == "variable" {
+ data.LocalRoutesDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LocalRoutesDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.KeepaliveTime = types.Int64Null()
+ data.KeepaliveTimeVariable = types.StringNull()
+ if t := res.Get(path + "keepalive.optionType"); t.Exists() {
+ va := res.Get(path + "keepalive.value")
+ if t.String() == "variable" {
+ data.KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.HoldTime = types.Int64Null()
+ data.HoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "holdtime.optionType"); t.Exists() {
+ va := res.Get(path + "holdtime.value")
+ if t.String() == "variable" {
+ data.HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.AlwaysCompareMed = types.BoolNull()
+ data.AlwaysCompareMedVariable = types.StringNull()
+ if t := res.Get(path + "alwaysCompare.optionType"); t.Exists() {
+ va := res.Get(path + "alwaysCompare.value")
+ if t.String() == "variable" {
+ data.AlwaysCompareMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AlwaysCompareMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.DeterministicMed = types.BoolNull()
+ data.DeterministicMedVariable = types.StringNull()
+ if t := res.Get(path + "deterministic.optionType"); t.Exists() {
+ va := res.Get(path + "deterministic.value")
+ if t.String() == "variable" {
+ data.DeterministicMedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DeterministicMed = types.BoolValue(va.Bool())
+ }
+ }
+ data.MissingMedAsWorst = types.BoolNull()
+ data.MissingMedAsWorstVariable = types.StringNull()
+ if t := res.Get(path + "missingAsWorst.optionType"); t.Exists() {
+ va := res.Get(path + "missingAsWorst.value")
+ if t.String() == "variable" {
+ data.MissingMedAsWorstVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MissingMedAsWorst = types.BoolValue(va.Bool())
+ }
+ }
+ data.CompareRouterId = types.BoolNull()
+ data.CompareRouterIdVariable = types.StringNull()
+ if t := res.Get(path + "compareRouterId.optionType"); t.Exists() {
+ va := res.Get(path + "compareRouterId.value")
+ if t.String() == "variable" {
+ data.CompareRouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.CompareRouterId = types.BoolValue(va.Bool())
+ }
+ }
+ data.MultipathRelax = types.BoolNull()
+ data.MultipathRelaxVariable = types.StringNull()
+ if t := res.Get(path + "multipathRelax.optionType"); t.Exists() {
+ va := res.Get(path + "multipathRelax.value")
+ if t.String() == "variable" {
+ data.MultipathRelaxVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MultipathRelax = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv4Neighbors {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv4Neighbors[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Neighbors[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "neighbor").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Neighbors[i].Address = types.StringNull()
+ data.Ipv4Neighbors[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].Description = types.StringNull()
+ data.Ipv4Neighbors[i].DescriptionVariable = types.StringNull()
+ if t := r.Get("description.optionType"); t.Exists() {
+ va := r.Get("description.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].Description = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].Shutdown = types.BoolNull()
+ data.Ipv4Neighbors[i].ShutdownVariable = types.StringNull()
+ if t := r.Get("shutdown.optionType"); t.Exists() {
+ va := r.Get("shutdown.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].RemoteAs = types.Int64Null()
+ data.Ipv4Neighbors[i].RemoteAsVariable = types.StringNull()
+ if t := r.Get("remoteAs.optionType"); t.Exists() {
+ va := r.Get("remoteAs.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].LocalAs = types.Int64Null()
+ data.Ipv4Neighbors[i].LocalAsVariable = types.StringNull()
+ if t := r.Get("localAs.optionType"); t.Exists() {
+ va := r.Get("localAs.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].KeepaliveTime = types.Int64Null()
+ data.Ipv4Neighbors[i].KeepaliveTimeVariable = types.StringNull()
+ if t := r.Get("keepalive.optionType"); t.Exists() {
+ va := r.Get("keepalive.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].HoldTime = types.Int64Null()
+ data.Ipv4Neighbors[i].HoldTimeVariable = types.StringNull()
+ if t := r.Get("holdtime.optionType"); t.Exists() {
+ va := r.Get("holdtime.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].UpdateSourceInterface = types.StringNull()
+ data.Ipv4Neighbors[i].UpdateSourceInterfaceVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].NextHopSelf = types.BoolNull()
+ data.Ipv4Neighbors[i].NextHopSelfVariable = types.StringNull()
+ if t := r.Get("nextHopSelf.optionType"); t.Exists() {
+ va := r.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].SendCommunity = types.BoolNull()
+ data.Ipv4Neighbors[i].SendCommunityVariable = types.StringNull()
+ if t := r.Get("sendCommunity.optionType"); t.Exists() {
+ va := r.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].SendExtendedCommunity = types.BoolNull()
+ data.Ipv4Neighbors[i].SendExtendedCommunityVariable = types.StringNull()
+ if t := r.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := r.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].EbgpMultihop = types.Int64Null()
+ data.Ipv4Neighbors[i].EbgpMultihopVariable = types.StringNull()
+ if t := r.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := r.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].SendLabel = types.BoolNull()
+
+ if t := r.Get("sendLabel.optionType"); t.Exists() {
+ va := r.Get("sendLabel.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].SendLabel = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].ExplicitNull = types.BoolNull()
+ data.Ipv4Neighbors[i].ExplicitNullVariable = types.StringNull()
+ if t := r.Get("sendLabelExplicit.optionType"); t.Exists() {
+ va := r.Get("sendLabelExplicit.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].ExplicitNullVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].ExplicitNull = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].AsOverride = types.BoolNull()
+ data.Ipv4Neighbors[i].AsOverrideVariable = types.StringNull()
+ if t := r.Get("asOverride.optionType"); t.Exists() {
+ va := r.Get("asOverride.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4Neighbors[i].AllowasInNumber = types.Int64Null()
+ data.Ipv4Neighbors[i].AllowasInNumberVariable = types.StringNull()
+ if t := r.Get("asNumber.optionType"); t.Exists() {
+ va := r.Get("asNumber.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ for ci := range data.Ipv4Neighbors[i].AddressFamilies {
+ keys := [...]string{"familyType"}
+ keyValues := [...]string{data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("addressFamily").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType = types.StringNull()
+
+ if t := cr.Get("familyType.optionType"); t.Exists() {
+ va := cr.Get("familyType.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Null()
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Null()
+ data.Ipv4Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].PolicyType = types.StringNull()
+
+ if t := cr.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].PolicyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Null()
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv4Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.Ipv6Neighbors {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6Neighbors[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Neighbors[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6Neighbor").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Neighbors[i].Address = types.StringNull()
+ data.Ipv6Neighbors[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].Description = types.StringNull()
+ data.Ipv6Neighbors[i].DescriptionVariable = types.StringNull()
+ if t := r.Get("description.optionType"); t.Exists() {
+ va := r.Get("description.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].DescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].Description = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].Shutdown = types.BoolNull()
+ data.Ipv6Neighbors[i].ShutdownVariable = types.StringNull()
+ if t := r.Get("shutdown.optionType"); t.Exists() {
+ va := r.Get("shutdown.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].RemoteAs = types.Int64Null()
+ data.Ipv6Neighbors[i].RemoteAsVariable = types.StringNull()
+ if t := r.Get("remoteAs.optionType"); t.Exists() {
+ va := r.Get("remoteAs.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].RemoteAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].RemoteAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].LocalAs = types.Int64Null()
+ data.Ipv6Neighbors[i].LocalAsVariable = types.StringNull()
+ if t := r.Get("localAs.optionType"); t.Exists() {
+ va := r.Get("localAs.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].LocalAsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].LocalAs = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].KeepaliveTime = types.Int64Null()
+ data.Ipv6Neighbors[i].KeepaliveTimeVariable = types.StringNull()
+ if t := r.Get("keepalive.optionType"); t.Exists() {
+ va := r.Get("keepalive.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].KeepaliveTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].KeepaliveTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].HoldTime = types.Int64Null()
+ data.Ipv6Neighbors[i].HoldTimeVariable = types.StringNull()
+ if t := r.Get("holdtime.optionType"); t.Exists() {
+ va := r.Get("holdtime.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].HoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].HoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].UpdateSourceInterface = types.StringNull()
+ data.Ipv6Neighbors[i].UpdateSourceInterfaceVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].UpdateSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].UpdateSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].NextHopSelf = types.BoolNull()
+ data.Ipv6Neighbors[i].NextHopSelfVariable = types.StringNull()
+ if t := r.Get("nextHopSelf.optionType"); t.Exists() {
+ va := r.Get("nextHopSelf.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].NextHopSelfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].NextHopSelf = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].SendCommunity = types.BoolNull()
+ data.Ipv6Neighbors[i].SendCommunityVariable = types.StringNull()
+ if t := r.Get("sendCommunity.optionType"); t.Exists() {
+ va := r.Get("sendCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].SendCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].SendCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].SendExtendedCommunity = types.BoolNull()
+ data.Ipv6Neighbors[i].SendExtendedCommunityVariable = types.StringNull()
+ if t := r.Get("sendExtCommunity.optionType"); t.Exists() {
+ va := r.Get("sendExtCommunity.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].SendExtendedCommunityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].SendExtendedCommunity = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].EbgpMultihop = types.Int64Null()
+ data.Ipv6Neighbors[i].EbgpMultihopVariable = types.StringNull()
+ if t := r.Get("ebgpMultihop.optionType"); t.Exists() {
+ va := r.Get("ebgpMultihop.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].EbgpMultihopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].EbgpMultihop = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AsOverride = types.BoolNull()
+ data.Ipv6Neighbors[i].AsOverrideVariable = types.StringNull()
+ if t := r.Get("asOverride.optionType"); t.Exists() {
+ va := r.Get("asOverride.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AsOverrideVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AsOverride = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6Neighbors[i].AllowasInNumber = types.Int64Null()
+ data.Ipv6Neighbors[i].AllowasInNumberVariable = types.StringNull()
+ if t := r.Get("asNumber.optionType"); t.Exists() {
+ va := r.Get("asNumber.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AllowasInNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AllowasInNumber = types.Int64Value(va.Int())
+ }
+ }
+ for ci := range data.Ipv6Neighbors[i].AddressFamilies {
+ keys := [...]string{"familyType"}
+ keyValues := [...]string{data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var cr gjson.Result
+ r.Get("addressFamily").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType = types.StringNull()
+
+ if t := cr.Get("familyType.optionType"); t.Exists() {
+ va := cr.Get("familyType.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Null()
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.prefixNum.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Null()
+ data.Ipv6Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.threshold.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].PolicyType = types.StringNull()
+
+ if t := cr.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.policyType.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].PolicyType = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Null()
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringNull()
+ if t := cr.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
+ va := cr.Get("maxPrefixConfig.restartInterval.value")
+ if t.String() == "variable" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("inRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("inRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringNull()
+
+ if t := cr.Get("outRoutePolicy.refId.optionType"); t.Exists() {
+ va := cr.Get("outRoutePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv6Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ }
+ for i := range data.Ipv4AggregateAddresses {
+ keys := [...]string{"prefix.address"}
+ keyValues := [...]string{data.Ipv4AggregateAddresses[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4AggregateAddresses[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "addressFamily.aggregateAddress").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4AggregateAddresses[i].NetworkAddress = types.StringNull()
+ data.Ipv4AggregateAddresses[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.address.optionType"); t.Exists() {
+ va := r.Get("prefix.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4AggregateAddresses[i].SubnetMask = types.StringNull()
+ data.Ipv4AggregateAddresses[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.mask.optionType"); t.Exists() {
+ va := r.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4AggregateAddresses[i].AsSetPath = types.BoolNull()
+ data.Ipv4AggregateAddresses[i].AsSetPathVariable = types.StringNull()
+ if t := r.Get("asSet.optionType"); t.Exists() {
+ va := r.Get("asSet.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4AggregateAddresses[i].SummaryOnly = types.BoolNull()
+ data.Ipv4AggregateAddresses[i].SummaryOnlyVariable = types.StringNull()
+ if t := r.Get("summaryOnly.optionType"); t.Exists() {
+ va := r.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ data.Ipv4AggregateAddresses[i].SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4AggregateAddresses[i].SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.Ipv4Networks {
+ keys := [...]string{"prefix.address"}
+ keyValues := [...]string{data.Ipv4Networks[i].NetworkAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Networks[i].NetworkAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "addressFamily.network").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Networks[i].NetworkAddress = types.StringNull()
+ data.Ipv4Networks[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.address.optionType"); t.Exists() {
+ va := r.Get("prefix.address.value")
+ if t.String() == "variable" {
+ data.Ipv4Networks[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Networks[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Networks[i].SubnetMask = types.StringNull()
+ data.Ipv4Networks[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.mask.optionType"); t.Exists() {
+ va := r.Get("prefix.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4Networks[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Networks[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4EibgpMaximumPaths = types.Int64Null()
+ data.Ipv4EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv4EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Originate = types.BoolNull()
+ data.Ipv4OriginateVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv4OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv4TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "addressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv4TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4TableMapFilter = types.BoolNull()
+ data.Ipv4TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "addressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "addressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv4TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv4Redistributes {
+ keys := [...]string{"protocol", "routePolicy.refId"}
+ keyValues := [...]string{data.Ipv4Redistributes[i].Protocol.ValueString(), data.Ipv4Redistributes[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4Redistributes[i].ProtocolVariable.ValueString(), ""}
+
+ var r gjson.Result
+ res.Get(path + "addressFamily.redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4Redistributes[i].Protocol = types.StringNull()
+ data.Ipv4Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Ipv4Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv4Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Ipv6AggregateAddresses {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6AggregateAddresses[i].AggregatePrefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6AggregateAddresses[i].AggregatePrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6AddressFamily.ipv6AggregateAddress").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6AggregateAddresses[i].AggregatePrefix = types.StringNull()
+ data.Ipv6AggregateAddresses[i].AggregatePrefixVariable = types.StringNull()
+ if t := r.Get("prefix.optionType"); t.Exists() {
+ va := r.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6AggregateAddresses[i].AggregatePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6AggregateAddresses[i].AggregatePrefix = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6AggregateAddresses[i].AsSetPath = types.BoolNull()
+ data.Ipv6AggregateAddresses[i].AsSetPathVariable = types.StringNull()
+ if t := r.Get("asSet.optionType"); t.Exists() {
+ va := r.Get("asSet.value")
+ if t.String() == "variable" {
+ data.Ipv6AggregateAddresses[i].AsSetPathVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6AggregateAddresses[i].AsSetPath = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6AggregateAddresses[i].SummaryOnly = types.BoolNull()
+ data.Ipv6AggregateAddresses[i].SummaryOnlyVariable = types.StringNull()
+ if t := r.Get("summaryOnly.optionType"); t.Exists() {
+ va := r.Get("summaryOnly.value")
+ if t.String() == "variable" {
+ data.Ipv6AggregateAddresses[i].SummaryOnlyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6AggregateAddresses[i].SummaryOnly = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ for i := range data.Ipv6Networks {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6Networks[i].NetworkPrefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Networks[i].NetworkPrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6AddressFamily.ipv6Network").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Networks[i].NetworkPrefix = types.StringNull()
+ data.Ipv6Networks[i].NetworkPrefixVariable = types.StringNull()
+ if t := r.Get("prefix.optionType"); t.Exists() {
+ va := r.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6Networks[i].NetworkPrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Networks[i].NetworkPrefix = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv6EibgpMaximumPaths = types.Int64Null()
+ data.Ipv6EibgpMaximumPathsVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.paths.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.paths.value")
+ if t.String() == "variable" {
+ data.Ipv6EibgpMaximumPathsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6EibgpMaximumPaths = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv6Originate = types.BoolNull()
+ data.Ipv6OriginateVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.originate.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.originate.value")
+ if t.String() == "variable" {
+ data.Ipv6OriginateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Originate = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6TableMapRoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "ipv6AddressFamily.name.refId.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.name.refId.value")
+ if t.String() == "global" {
+ data.Ipv6TableMapRoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6TableMapFilter = types.BoolNull()
+ data.Ipv6TableMapFilterVariable = types.StringNull()
+ if t := res.Get(path + "ipv6AddressFamily.filter.optionType"); t.Exists() {
+ va := res.Get(path + "ipv6AddressFamily.filter.value")
+ if t.String() == "variable" {
+ data.Ipv6TableMapFilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6TableMapFilter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv6Redistributes {
+ keys := [...]string{"protocol", "routePolicy.refId"}
+ keyValues := [...]string{data.Ipv6Redistributes[i].Protocol.ValueString(), data.Ipv6Redistributes[i].RoutePolicyId.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6Redistributes[i].ProtocolVariable.ValueString(), ""}
+
+ var r gjson.Result
+ res.Get(path + "ipv6AddressFamily.redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6Redistributes[i].Protocol = types.StringNull()
+ data.Ipv6Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Ipv6Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Ipv6Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.MplsInterfaces {
+ keys := [...]string{"ifName"}
+ keyValues := [...]string{data.MplsInterfaces[i].InterfaceName.ValueString()}
+ keyValuesVariables := [...]string{data.MplsInterfaces[i].InterfaceNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "mplsInterface").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.MplsInterfaces[i].InterfaceName = types.StringNull()
+ data.MplsInterfaces[i].InterfaceNameVariable = types.StringNull()
+ if t := r.Get("ifName.optionType"); t.Exists() {
+ va := r.Get("ifName.value")
+ if t.String() == "variable" {
+ data.MplsInterfaces[i].InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MplsInterfaces[i].InterfaceName = types.StringValue(va.String())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportRoutingBGP) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.AsNumber.IsNull() {
+ return false
+ }
+ if !data.AsNumberVariable.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.PropagateAsPath.IsNull() {
+ return false
+ }
+ if !data.PropagateAsPathVariable.IsNull() {
+ return false
+ }
+ if !data.PropagateCommunity.IsNull() {
+ return false
+ }
+ if !data.PropagateCommunityVariable.IsNull() {
+ return false
+ }
+ if !data.ExternalRoutesDistance.IsNull() {
+ return false
+ }
+ if !data.ExternalRoutesDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.InternalRoutesDistance.IsNull() {
+ return false
+ }
+ if !data.InternalRoutesDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.LocalRoutesDistance.IsNull() {
+ return false
+ }
+ if !data.LocalRoutesDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.KeepaliveTime.IsNull() {
+ return false
+ }
+ if !data.KeepaliveTimeVariable.IsNull() {
+ return false
+ }
+ if !data.HoldTime.IsNull() {
+ return false
+ }
+ if !data.HoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.AlwaysCompareMed.IsNull() {
+ return false
+ }
+ if !data.AlwaysCompareMedVariable.IsNull() {
+ return false
+ }
+ if !data.DeterministicMed.IsNull() {
+ return false
+ }
+ if !data.DeterministicMedVariable.IsNull() {
+ return false
+ }
+ if !data.MissingMedAsWorst.IsNull() {
+ return false
+ }
+ if !data.MissingMedAsWorstVariable.IsNull() {
+ return false
+ }
+ if !data.CompareRouterId.IsNull() {
+ return false
+ }
+ if !data.CompareRouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.MultipathRelax.IsNull() {
+ return false
+ }
+ if !data.MultipathRelaxVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4Neighbors) > 0 {
+ return false
+ }
+ if len(data.Ipv6Neighbors) > 0 {
+ return false
+ }
+ if len(data.Ipv4AggregateAddresses) > 0 {
+ return false
+ }
+ if len(data.Ipv4Networks) > 0 {
+ return false
+ }
+ if !data.Ipv4EibgpMaximumPaths.IsNull() {
+ return false
+ }
+ if !data.Ipv4EibgpMaximumPathsVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Originate.IsNull() {
+ return false
+ }
+ if !data.Ipv4OriginateVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4TableMapRoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Ipv4TableMapFilter.IsNull() {
+ return false
+ }
+ if !data.Ipv4TableMapFilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4Redistributes) > 0 {
+ return false
+ }
+ if len(data.Ipv6AggregateAddresses) > 0 {
+ return false
+ }
+ if len(data.Ipv6Networks) > 0 {
+ return false
+ }
+ if !data.Ipv6EibgpMaximumPaths.IsNull() {
+ return false
+ }
+ if !data.Ipv6EibgpMaximumPathsVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6Originate.IsNull() {
+ return false
+ }
+ if !data.Ipv6OriginateVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6TableMapRoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Ipv6TableMapFilter.IsNull() {
+ return false
+ }
+ if !data.Ipv6TableMapFilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv6Redistributes) > 0 {
+ return false
+ }
+ if len(data.MplsInterfaces) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go b/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go
deleted file mode 100644
index 26ff0c88c..000000000
--- a/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go
+++ /dev/null
@@ -1,3666 +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/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportRoutingBGP 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"`
- AsNumber types.Int64 `tfsdk:"as_number"`
- AsNumberVariable types.String `tfsdk:"as_number_variable"`
- RouterId types.String `tfsdk:"router_id"`
- RouterIdVariable types.String `tfsdk:"router_id_variable"`
- PropagateAsPath types.Bool `tfsdk:"propagate_as_path"`
- PropagateAsPathVariable types.String `tfsdk:"propagate_as_path_variable"`
- PropagateCommunity types.Bool `tfsdk:"propagate_community"`
- PropagateCommunityVariable types.String `tfsdk:"propagate_community_variable"`
- ExternalRoutesDistance types.Int64 `tfsdk:"external_routes_distance"`
- ExternalRoutesDistanceVariable types.String `tfsdk:"external_routes_distance_variable"`
- InternalRoutesDistance types.Int64 `tfsdk:"internal_routes_distance"`
- InternalRoutesDistanceVariable types.String `tfsdk:"internal_routes_distance_variable"`
- LocalRoutesDistance types.Int64 `tfsdk:"local_routes_distance"`
- LocalRoutesDistanceVariable types.String `tfsdk:"local_routes_distance_variable"`
- KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
- KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
- HoldTime types.Int64 `tfsdk:"hold_time"`
- HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
- AlwaysCompareMed types.Bool `tfsdk:"always_compare_med"`
- AlwaysCompareMedVariable types.String `tfsdk:"always_compare_med_variable"`
- DeterministicMed types.Bool `tfsdk:"deterministic_med"`
- DeterministicMedVariable types.String `tfsdk:"deterministic_med_variable"`
- MissingMedAsWorst types.Bool `tfsdk:"missing_med_as_worst"`
- MissingMedAsWorstVariable types.String `tfsdk:"missing_med_as_worst_variable"`
- CompareRouterId types.Bool `tfsdk:"compare_router_id"`
- CompareRouterIdVariable types.String `tfsdk:"compare_router_id_variable"`
- MultipathRelax types.Bool `tfsdk:"multipath_relax"`
- MultipathRelaxVariable types.String `tfsdk:"multipath_relax_variable"`
- Ipv4Neighbors []TransportRoutingBGPIpv4Neighbors `tfsdk:"ipv4_neighbors"`
- Ipv6Neighbors []TransportRoutingBGPIpv6Neighbors `tfsdk:"ipv6_neighbors"`
- Ipv4AggregateAddresses []TransportRoutingBGPIpv4AggregateAddresses `tfsdk:"ipv4_aggregate_addresses"`
- Ipv4Networks []TransportRoutingBGPIpv4Networks `tfsdk:"ipv4_networks"`
- Ipv4EibgpMaximumPaths types.Int64 `tfsdk:"ipv4_eibgp_maximum_paths"`
- Ipv4EibgpMaximumPathsVariable types.String `tfsdk:"ipv4_eibgp_maximum_paths_variable"`
- Ipv4Originate types.Bool `tfsdk:"ipv4_originate"`
- Ipv4OriginateVariable types.String `tfsdk:"ipv4_originate_variable"`
- Ipv4TableMapRoutePolicyId types.String `tfsdk:"ipv4_table_map_route_policy_id"`
- Ipv4TableMapFilter types.Bool `tfsdk:"ipv4_table_map_filter"`
- Ipv4TableMapFilterVariable types.String `tfsdk:"ipv4_table_map_filter_variable"`
- Ipv4Redistributes []TransportRoutingBGPIpv4Redistributes `tfsdk:"ipv4_redistributes"`
- Ipv6AggregateAddresses []TransportRoutingBGPIpv6AggregateAddresses `tfsdk:"ipv6_aggregate_addresses"`
- Ipv6Networks []TransportRoutingBGPIpv6Networks `tfsdk:"ipv6_networks"`
- Ipv6EibgpMaximumPaths types.Int64 `tfsdk:"ipv6_eibgp_maximum_paths"`
- Ipv6EibgpMaximumPathsVariable types.String `tfsdk:"ipv6_eibgp_maximum_paths_variable"`
- Ipv6Originate types.Bool `tfsdk:"ipv6_originate"`
- Ipv6OriginateVariable types.String `tfsdk:"ipv6_originate_variable"`
- Ipv6TableMapRoutePolicyId types.String `tfsdk:"ipv6_table_map_route_policy_id"`
- Ipv6TableMapFilter types.Bool `tfsdk:"ipv6_table_map_filter"`
- Ipv6TableMapFilterVariable types.String `tfsdk:"ipv6_table_map_filter_variable"`
- Ipv6Redistributes []TransportRoutingBGPIpv6Redistributes `tfsdk:"ipv6_redistributes"`
- MplsInterfaces []TransportRoutingBGPMplsInterfaces `tfsdk:"mpls_interfaces"`
-}
-
-type TransportRoutingBGPIpv4Neighbors struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- Description types.String `tfsdk:"description"`
- DescriptionVariable types.String `tfsdk:"description_variable"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- RemoteAs types.Int64 `tfsdk:"remote_as"`
- RemoteAsVariable types.String `tfsdk:"remote_as_variable"`
- LocalAs types.Int64 `tfsdk:"local_as"`
- LocalAsVariable types.String `tfsdk:"local_as_variable"`
- KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
- KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
- HoldTime types.Int64 `tfsdk:"hold_time"`
- HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
- UpdateSourceInterface types.String `tfsdk:"update_source_interface"`
- UpdateSourceInterfaceVariable types.String `tfsdk:"update_source_interface_variable"`
- NextHopSelf types.Bool `tfsdk:"next_hop_self"`
- NextHopSelfVariable types.String `tfsdk:"next_hop_self_variable"`
- SendCommunity types.Bool `tfsdk:"send_community"`
- SendCommunityVariable types.String `tfsdk:"send_community_variable"`
- SendExtendedCommunity types.Bool `tfsdk:"send_extended_community"`
- SendExtendedCommunityVariable types.String `tfsdk:"send_extended_community_variable"`
- EbgpMultihop types.Int64 `tfsdk:"ebgp_multihop"`
- EbgpMultihopVariable types.String `tfsdk:"ebgp_multihop_variable"`
- Password types.String `tfsdk:"password"`
- PasswordVariable types.String `tfsdk:"password_variable"`
- SendLabel types.Bool `tfsdk:"send_label"`
- ExplicitNull types.Bool `tfsdk:"explicit_null"`
- ExplicitNullVariable types.String `tfsdk:"explicit_null_variable"`
- AsOverride types.Bool `tfsdk:"as_override"`
- AsOverrideVariable types.String `tfsdk:"as_override_variable"`
- AllowasInNumber types.Int64 `tfsdk:"allowas_in_number"`
- AllowasInNumberVariable types.String `tfsdk:"allowas_in_number_variable"`
- AddressFamilies []TransportRoutingBGPIpv4NeighborsAddressFamilies `tfsdk:"address_families"`
-}
-
-type TransportRoutingBGPIpv6Neighbors struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- Description types.String `tfsdk:"description"`
- DescriptionVariable types.String `tfsdk:"description_variable"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- RemoteAs types.Int64 `tfsdk:"remote_as"`
- RemoteAsVariable types.String `tfsdk:"remote_as_variable"`
- LocalAs types.Int64 `tfsdk:"local_as"`
- LocalAsVariable types.String `tfsdk:"local_as_variable"`
- KeepaliveTime types.Int64 `tfsdk:"keepalive_time"`
- KeepaliveTimeVariable types.String `tfsdk:"keepalive_time_variable"`
- HoldTime types.Int64 `tfsdk:"hold_time"`
- HoldTimeVariable types.String `tfsdk:"hold_time_variable"`
- UpdateSourceInterface types.String `tfsdk:"update_source_interface"`
- UpdateSourceInterfaceVariable types.String `tfsdk:"update_source_interface_variable"`
- NextHopSelf types.Bool `tfsdk:"next_hop_self"`
- NextHopSelfVariable types.String `tfsdk:"next_hop_self_variable"`
- SendCommunity types.Bool `tfsdk:"send_community"`
- SendCommunityVariable types.String `tfsdk:"send_community_variable"`
- SendExtendedCommunity types.Bool `tfsdk:"send_extended_community"`
- SendExtendedCommunityVariable types.String `tfsdk:"send_extended_community_variable"`
- EbgpMultihop types.Int64 `tfsdk:"ebgp_multihop"`
- EbgpMultihopVariable types.String `tfsdk:"ebgp_multihop_variable"`
- Password types.String `tfsdk:"password"`
- PasswordVariable types.String `tfsdk:"password_variable"`
- AsOverride types.Bool `tfsdk:"as_override"`
- AsOverrideVariable types.String `tfsdk:"as_override_variable"`
- AllowasInNumber types.Int64 `tfsdk:"allowas_in_number"`
- AllowasInNumberVariable types.String `tfsdk:"allowas_in_number_variable"`
- AddressFamilies []TransportRoutingBGPIpv6NeighborsAddressFamilies `tfsdk:"address_families"`
-}
-
-type TransportRoutingBGPIpv4AggregateAddresses struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- AsSetPath types.Bool `tfsdk:"as_set_path"`
- AsSetPathVariable types.String `tfsdk:"as_set_path_variable"`
- SummaryOnly types.Bool `tfsdk:"summary_only"`
- SummaryOnlyVariable types.String `tfsdk:"summary_only_variable"`
-}
-
-type TransportRoutingBGPIpv4Networks struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
-}
-
-type TransportRoutingBGPIpv4Redistributes struct {
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
- RoutePolicyId types.String `tfsdk:"route_policy_id"`
-}
-
-type TransportRoutingBGPIpv6AggregateAddresses struct {
- AggregatePrefix types.String `tfsdk:"aggregate_prefix"`
- AggregatePrefixVariable types.String `tfsdk:"aggregate_prefix_variable"`
- AsSetPath types.Bool `tfsdk:"as_set_path"`
- AsSetPathVariable types.String `tfsdk:"as_set_path_variable"`
- SummaryOnly types.Bool `tfsdk:"summary_only"`
- SummaryOnlyVariable types.String `tfsdk:"summary_only_variable"`
-}
-
-type TransportRoutingBGPIpv6Networks struct {
- NetworkPrefix types.String `tfsdk:"network_prefix"`
- NetworkPrefixVariable types.String `tfsdk:"network_prefix_variable"`
-}
-
-type TransportRoutingBGPIpv6Redistributes struct {
- Protocol types.String `tfsdk:"protocol"`
- ProtocolVariable types.String `tfsdk:"protocol_variable"`
- RoutePolicyId types.String `tfsdk:"route_policy_id"`
-}
-
-type TransportRoutingBGPMplsInterfaces struct {
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
-}
-
-type TransportRoutingBGPIpv4NeighborsAddressFamilies struct {
- FamilyType types.String `tfsdk:"family_type"`
- MaxNumberOfPrefixes types.Int64 `tfsdk:"max_number_of_prefixes"`
- MaxNumberOfPrefixesVariable types.String `tfsdk:"max_number_of_prefixes_variable"`
- Threshold types.Int64 `tfsdk:"threshold"`
- ThresholdVariable types.String `tfsdk:"threshold_variable"`
- PolicyType types.String `tfsdk:"policy_type"`
- RestartInterval types.Int64 `tfsdk:"restart_interval"`
- RestartIntervalVariable types.String `tfsdk:"restart_interval_variable"`
- InRoutePolicyId types.String `tfsdk:"in_route_policy_id"`
- OutRoutePolicyId types.String `tfsdk:"out_route_policy_id"`
-}
-
-type TransportRoutingBGPIpv6NeighborsAddressFamilies struct {
- FamilyType types.String `tfsdk:"family_type"`
- MaxNumberOfPrefixes types.Int64 `tfsdk:"max_number_of_prefixes"`
- MaxNumberOfPrefixesVariable types.String `tfsdk:"max_number_of_prefixes_variable"`
- Threshold types.Int64 `tfsdk:"threshold"`
- ThresholdVariable types.String `tfsdk:"threshold_variable"`
- PolicyType types.String `tfsdk:"policy_type"`
- RestartInterval types.Int64 `tfsdk:"restart_interval"`
- RestartIntervalVariable types.String `tfsdk:"restart_interval_variable"`
- InRoutePolicyId types.String `tfsdk:"in_route_policy_id"`
- OutRoutePolicyId types.String `tfsdk:"out_route_policy_id"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportRoutingBGP) getModel() string {
- return "transport_routing_bgp"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportRoutingBGP) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/routing/bgp", 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 TransportRoutingBGP) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.AsNumberVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"asNum.optionType", "variable")
- body, _ = sjson.Set(body, path+"asNum.value", data.AsNumberVariable.ValueString())
- }
- } else if !data.AsNumber.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"asNum.optionType", "global")
- body, _ = sjson.Set(body, path+"asNum.value", data.AsNumber.ValueInt64())
- }
- }
-
- if !data.RouterIdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"routerId.optionType", "variable")
- body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString())
- }
- } else if data.RouterId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"routerId.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"routerId.optionType", "global")
- body, _ = sjson.Set(body, path+"routerId.value", data.RouterId.ValueString())
- }
- }
-
- if !data.PropagateAsPathVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"propagateAspath.optionType", "variable")
- body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPathVariable.ValueString())
- }
- } else if data.PropagateAsPath.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"propagateAspath.optionType", "default")
- body, _ = sjson.Set(body, path+"propagateAspath.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"propagateAspath.optionType", "global")
- body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPath.ValueBool())
- }
- }
-
- if !data.PropagateCommunityVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "variable")
- body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunityVariable.ValueString())
- }
- } else if data.PropagateCommunity.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "default")
- body, _ = sjson.Set(body, path+"propagateCommunity.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "global")
- body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunity.ValueBool())
- }
- }
-
- if !data.ExternalRoutesDistanceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"external.optionType", "variable")
- body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistanceVariable.ValueString())
- }
- } else if data.ExternalRoutesDistance.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"external.optionType", "default")
- body, _ = sjson.Set(body, path+"external.value", 20)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"external.optionType", "global")
- body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistance.ValueInt64())
- }
- }
-
- if !data.InternalRoutesDistanceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"internal.optionType", "variable")
- body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistanceVariable.ValueString())
- }
- } else if data.InternalRoutesDistance.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"internal.optionType", "default")
- body, _ = sjson.Set(body, path+"internal.value", 200)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"internal.optionType", "global")
- body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistance.ValueInt64())
- }
- }
-
- if !data.LocalRoutesDistanceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"local.optionType", "variable")
- body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistanceVariable.ValueString())
- }
- } else if data.LocalRoutesDistance.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"local.optionType", "default")
- body, _ = sjson.Set(body, path+"local.value", 20)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"local.optionType", "global")
- body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistance.ValueInt64())
- }
- }
-
- if !data.KeepaliveTimeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"keepalive.optionType", "variable")
- body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTimeVariable.ValueString())
- }
- } else if data.KeepaliveTime.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"keepalive.optionType", "default")
- body, _ = sjson.Set(body, path+"keepalive.value", 60)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"keepalive.optionType", "global")
- body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTime.ValueInt64())
- }
- }
-
- if !data.HoldTimeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"holdtime.optionType", "variable")
- body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTimeVariable.ValueString())
- }
- } else if data.HoldTime.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"holdtime.optionType", "default")
- body, _ = sjson.Set(body, path+"holdtime.value", 180)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"holdtime.optionType", "global")
- body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTime.ValueInt64())
- }
- }
-
- if !data.AlwaysCompareMedVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "variable")
- body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMedVariable.ValueString())
- }
- } else if data.AlwaysCompareMed.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "default")
- body, _ = sjson.Set(body, path+"alwaysCompare.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "global")
- body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMed.ValueBool())
- }
- }
-
- if !data.DeterministicMedVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"deterministic.optionType", "variable")
- body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMedVariable.ValueString())
- }
- } else if data.DeterministicMed.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"deterministic.optionType", "default")
- body, _ = sjson.Set(body, path+"deterministic.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"deterministic.optionType", "global")
- body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMed.ValueBool())
- }
- }
-
- if !data.MissingMedAsWorstVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "variable")
- body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorstVariable.ValueString())
- }
- } else if data.MissingMedAsWorst.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "default")
- body, _ = sjson.Set(body, path+"missingAsWorst.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "global")
- body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorst.ValueBool())
- }
- }
-
- if !data.CompareRouterIdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"compareRouterId.optionType", "variable")
- body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterIdVariable.ValueString())
- }
- } else if data.CompareRouterId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"compareRouterId.optionType", "default")
- body, _ = sjson.Set(body, path+"compareRouterId.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"compareRouterId.optionType", "global")
- body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterId.ValueBool())
- }
- }
-
- if !data.MultipathRelaxVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"multipathRelax.optionType", "variable")
- body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelaxVariable.ValueString())
- }
- } else if data.MultipathRelax.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"multipathRelax.optionType", "default")
- body, _ = sjson.Set(body, path+"multipathRelax.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"multipathRelax.optionType", "global")
- body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelax.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"neighbor", []interface{}{})
- for _, item := range data.Ipv4Neighbors {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
-
- if !item.DescriptionVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString())
- }
- } else if item.Description.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "description.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "description.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString())
- }
- }
-
- if !item.ShutdownVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString())
- }
- } else if item.Shutdown.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "shutdown.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool())
- }
- }
-
- if !item.RemoteAsVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString())
- }
- } else if !item.RemoteAs.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64())
- }
- }
-
- if !item.LocalAsVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString())
- }
- } else if item.LocalAs.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64())
- }
- }
-
- if !item.KeepaliveTimeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString())
- }
- } else if item.KeepaliveTime.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64())
- }
- }
-
- if !item.HoldTimeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString())
- }
- } else if item.HoldTime.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64())
- }
- }
-
- if !item.UpdateSourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString())
- }
- } else if item.UpdateSourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString())
- }
- }
-
- if !item.NextHopSelfVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString())
- }
- } else if item.NextHopSelf.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool())
- }
- }
-
- if !item.SendCommunityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString())
- }
- } else if item.SendCommunity.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool())
- }
- }
-
- if !item.SendExtendedCommunityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString())
- }
- } else if item.SendExtendedCommunity.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool())
- }
- }
-
- if !item.EbgpMultihopVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString())
- }
- } else if item.EbgpMultihop.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64())
- }
- }
-
- if !item.PasswordVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
- }
- } else if item.Password.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
- }
- }
- if item.SendLabel.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sendLabel.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabel.ValueBool())
- }
- }
-
- if !item.ExplicitNullVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNullVariable.ValueString())
- }
- } else if item.ExplicitNull.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNull.ValueBool())
- }
- }
-
- if !item.AsOverrideVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString())
- }
- } else if item.AsOverride.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "asOverride.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool())
- }
- }
-
- if !item.AllowasInNumberVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString())
- }
- } else if item.AllowasInNumber.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{})
- for _, childItem := range item.AddressFamilies {
- itemChildBody := ""
- if !childItem.FamilyType.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString())
- }
- }
-
- if !childItem.MaxNumberOfPrefixesVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString())
- }
- } else if !childItem.MaxNumberOfPrefixes.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64())
- }
- }
-
- if !childItem.ThresholdVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString())
- }
- } else if childItem.Threshold.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64())
- }
- }
- if !childItem.PolicyType.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString())
- }
- }
-
- if !childItem.RestartIntervalVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString())
- }
- } else if !childItem.RestartInterval.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64())
- }
- }
- if !childItem.InRoutePolicyId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString())
- }
- }
- if !childItem.OutRoutePolicyId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"neighbor.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6Neighbor", []interface{}{})
- for _, item := range data.Ipv6Neighbors {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
-
- if !item.DescriptionVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString())
- }
- } else if item.Description.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "description.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "description.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString())
- }
- }
-
- if !item.ShutdownVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString())
- }
- } else if item.Shutdown.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "shutdown.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool())
- }
- }
-
- if !item.RemoteAsVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString())
- }
- } else if !item.RemoteAs.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64())
- }
- }
-
- if !item.LocalAsVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString())
- }
- } else if item.LocalAs.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64())
- }
- }
-
- if !item.KeepaliveTimeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString())
- }
- } else if item.KeepaliveTime.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64())
- }
- }
-
- if !item.HoldTimeVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString())
- }
- } else if item.HoldTime.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64())
- }
- }
-
- if !item.UpdateSourceInterfaceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString())
- }
- } else if item.UpdateSourceInterface.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString())
- }
- }
-
- if !item.NextHopSelfVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString())
- }
- } else if item.NextHopSelf.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool())
- }
- }
-
- if !item.SendCommunityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString())
- }
- } else if item.SendCommunity.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool())
- }
- }
-
- if !item.SendExtendedCommunityVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString())
- }
- } else if item.SendExtendedCommunity.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool())
- }
- }
-
- if !item.EbgpMultihopVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString())
- }
- } else if item.EbgpMultihop.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64())
- }
- }
-
- if !item.PasswordVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString())
- }
- } else if item.Password.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "password.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString())
- }
- }
-
- if !item.AsOverrideVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString())
- }
- } else if item.AsOverride.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "asOverride.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool())
- }
- }
-
- if !item.AllowasInNumberVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString())
- }
- } else if item.AllowasInNumber.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64())
- }
- }
- if true {
- itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{})
- for _, childItem := range item.AddressFamilies {
- itemChildBody := ""
- if !childItem.FamilyType.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString())
- }
- }
-
- if !childItem.MaxNumberOfPrefixesVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString())
- }
- } else if !childItem.MaxNumberOfPrefixes.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64())
- }
- }
-
- if !childItem.ThresholdVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString())
- }
- } else if childItem.Threshold.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64())
- }
- }
- if !childItem.PolicyType.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString())
- }
- }
-
- if !childItem.RestartIntervalVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString())
- }
- } else if !childItem.RestartInterval.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64())
- }
- }
- if !childItem.InRoutePolicyId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString())
- }
- }
- if !childItem.OutRoutePolicyId.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody)
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6Neighbor.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.aggregateAddress", []interface{}{})
- for _, item := range data.Ipv4AggregateAddresses {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString())
- }
- }
-
- if !item.AsSetPathVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString())
- }
- } else if item.AsSetPath.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "asSet.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool())
- }
- }
-
- if !item.SummaryOnlyVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString())
- }
- } else if item.SummaryOnly.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"addressFamily.aggregateAddress.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.network", []interface{}{})
- for _, item := range data.Ipv4Networks {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"addressFamily.network.-1", itemBody)
- }
- }
-
- if !data.Ipv4EibgpMaximumPathsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "variable")
- body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPathsVariable.ValueString())
- }
- } else if data.Ipv4EibgpMaximumPaths.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "global")
- body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPaths.ValueInt64())
- }
- }
-
- if !data.Ipv4OriginateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "variable")
- body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4OriginateVariable.ValueString())
- }
- } else if data.Ipv4Originate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "default")
- body, _ = sjson.Set(body, path+"addressFamily.originate.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "global")
- body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4Originate.ValueBool())
- }
- }
- if !data.Ipv4TableMapRoutePolicyId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.name.refId.optionType", "global")
- body, _ = sjson.Set(body, path+"addressFamily.name.refId.value", data.Ipv4TableMapRoutePolicyId.ValueString())
- }
- }
-
- if !data.Ipv4TableMapFilterVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "variable")
- body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilterVariable.ValueString())
- }
- } else if data.Ipv4TableMapFilter.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "default")
- body, _ = sjson.Set(body, path+"addressFamily.filter.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "global")
- body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilter.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"addressFamily.redistribute", []interface{}{})
- for _, item := range data.Ipv4Redistributes {
- itemBody := ""
-
- if !item.ProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
- }
- } else if !item.Protocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
- }
- }
- if !item.RoutePolicyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"addressFamily.redistribute.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6AggregateAddress", []interface{}{})
- for _, item := range data.Ipv6AggregateAddresses {
- itemBody := ""
-
- if !item.AggregatePrefixVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefixVariable.ValueString())
- }
- } else if !item.AggregatePrefix.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefix.ValueString())
- }
- }
-
- if !item.AsSetPathVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString())
- }
- } else if item.AsSetPath.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "asSet.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool())
- }
- }
-
- if !item.SummaryOnlyVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString())
- }
- } else if item.SummaryOnly.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6AggregateAddress.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6Network", []interface{}{})
- for _, item := range data.Ipv6Networks {
- itemBody := ""
-
- if !item.NetworkPrefixVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefixVariable.ValueString())
- }
- } else if !item.NetworkPrefix.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefix.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6Network.-1", itemBody)
- }
- }
-
- if !data.Ipv6EibgpMaximumPathsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPathsVariable.ValueString())
- }
- } else if data.Ipv6EibgpMaximumPaths.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "global")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPaths.ValueInt64())
- }
- }
-
- if !data.Ipv6OriginateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6OriginateVariable.ValueString())
- }
- } else if data.Ipv6Originate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "default")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "global")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6Originate.ValueBool())
- }
- }
- if !data.Ipv6TableMapRoutePolicyId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.optionType", "global")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.value", data.Ipv6TableMapRoutePolicyId.ValueString())
- }
- }
-
- if !data.Ipv6TableMapFilterVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilterVariable.ValueString())
- }
- } else if data.Ipv6TableMapFilter.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "default")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "global")
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilter.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6AddressFamily.redistribute", []interface{}{})
- for _, item := range data.Ipv6Redistributes {
- itemBody := ""
-
- if !item.ProtocolVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
- }
- } else if !item.Protocol.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
- }
- }
- if !item.RoutePolicyId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.redistribute.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"mplsInterface", []interface{}{})
- for _, item := range data.MplsInterfaces {
- itemBody := ""
-
- if !item.InterfaceNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString())
- }
- } else if !item.InterfaceName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"mplsInterface.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportRoutingBGP) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.AsNumber = types.Int64Null()
- data.AsNumberVariable = types.StringNull()
- if t := res.Get(path + "asNum.optionType"); t.Exists() {
- va := res.Get(path + "asNum.value")
- if t.String() == "variable" {
- data.AsNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AsNumber = types.Int64Value(va.Int())
- }
- }
- data.RouterId = types.StringNull()
- data.RouterIdVariable = types.StringNull()
- if t := res.Get(path + "routerId.optionType"); t.Exists() {
- va := res.Get(path + "routerId.value")
- if t.String() == "variable" {
- data.RouterIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouterId = types.StringValue(va.String())
- }
- }
- data.PropagateAsPath = types.BoolNull()
- data.PropagateAsPathVariable = types.StringNull()
- if t := res.Get(path + "propagateAspath.optionType"); t.Exists() {
- va := res.Get(path + "propagateAspath.value")
- if t.String() == "variable" {
- data.PropagateAsPathVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PropagateAsPath = types.BoolValue(va.Bool())
- }
- }
- data.PropagateCommunity = types.BoolNull()
- data.PropagateCommunityVariable = types.StringNull()
- if t := res.Get(path + "propagateCommunity.optionType"); t.Exists() {
- va := res.Get(path + "propagateCommunity.value")
- if t.String() == "variable" {
- data.PropagateCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PropagateCommunity = types.BoolValue(va.Bool())
- }
- }
- data.ExternalRoutesDistance = types.Int64Null()
- data.ExternalRoutesDistanceVariable = types.StringNull()
- if t := res.Get(path + "external.optionType"); t.Exists() {
- va := res.Get(path + "external.value")
- if t.String() == "variable" {
- data.ExternalRoutesDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ExternalRoutesDistance = types.Int64Value(va.Int())
- }
- }
- data.InternalRoutesDistance = types.Int64Null()
- data.InternalRoutesDistanceVariable = types.StringNull()
- if t := res.Get(path + "internal.optionType"); t.Exists() {
- va := res.Get(path + "internal.value")
- if t.String() == "variable" {
- data.InternalRoutesDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InternalRoutesDistance = types.Int64Value(va.Int())
- }
- }
- data.LocalRoutesDistance = types.Int64Null()
- data.LocalRoutesDistanceVariable = types.StringNull()
- if t := res.Get(path + "local.optionType"); t.Exists() {
- va := res.Get(path + "local.value")
- if t.String() == "variable" {
- data.LocalRoutesDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LocalRoutesDistance = types.Int64Value(va.Int())
- }
- }
- data.KeepaliveTime = types.Int64Null()
- data.KeepaliveTimeVariable = types.StringNull()
- if t := res.Get(path + "keepalive.optionType"); t.Exists() {
- va := res.Get(path + "keepalive.value")
- if t.String() == "variable" {
- data.KeepaliveTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.KeepaliveTime = types.Int64Value(va.Int())
- }
- }
- data.HoldTime = types.Int64Null()
- data.HoldTimeVariable = types.StringNull()
- if t := res.Get(path + "holdtime.optionType"); t.Exists() {
- va := res.Get(path + "holdtime.value")
- if t.String() == "variable" {
- data.HoldTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.HoldTime = types.Int64Value(va.Int())
- }
- }
- data.AlwaysCompareMed = types.BoolNull()
- data.AlwaysCompareMedVariable = types.StringNull()
- if t := res.Get(path + "alwaysCompare.optionType"); t.Exists() {
- va := res.Get(path + "alwaysCompare.value")
- if t.String() == "variable" {
- data.AlwaysCompareMedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AlwaysCompareMed = types.BoolValue(va.Bool())
- }
- }
- data.DeterministicMed = types.BoolNull()
- data.DeterministicMedVariable = types.StringNull()
- if t := res.Get(path + "deterministic.optionType"); t.Exists() {
- va := res.Get(path + "deterministic.value")
- if t.String() == "variable" {
- data.DeterministicMedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DeterministicMed = types.BoolValue(va.Bool())
- }
- }
- data.MissingMedAsWorst = types.BoolNull()
- data.MissingMedAsWorstVariable = types.StringNull()
- if t := res.Get(path + "missingAsWorst.optionType"); t.Exists() {
- va := res.Get(path + "missingAsWorst.value")
- if t.String() == "variable" {
- data.MissingMedAsWorstVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MissingMedAsWorst = types.BoolValue(va.Bool())
- }
- }
- data.CompareRouterId = types.BoolNull()
- data.CompareRouterIdVariable = types.StringNull()
- if t := res.Get(path + "compareRouterId.optionType"); t.Exists() {
- va := res.Get(path + "compareRouterId.value")
- if t.String() == "variable" {
- data.CompareRouterIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.CompareRouterId = types.BoolValue(va.Bool())
- }
- }
- data.MultipathRelax = types.BoolNull()
- data.MultipathRelaxVariable = types.StringNull()
- if t := res.Get(path + "multipathRelax.optionType"); t.Exists() {
- va := res.Get(path + "multipathRelax.value")
- if t.String() == "variable" {
- data.MultipathRelaxVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MultipathRelax = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "neighbor"); value.Exists() {
- data.Ipv4Neighbors = make([]TransportRoutingBGPIpv4Neighbors, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv4Neighbors{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.Description = types.StringNull()
- item.DescriptionVariable = types.StringNull()
- if t := v.Get("description.optionType"); t.Exists() {
- va := v.Get("description.value")
- if t.String() == "variable" {
- item.DescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Description = types.StringValue(va.String())
- }
- }
- item.Shutdown = types.BoolNull()
- item.ShutdownVariable = types.StringNull()
- if t := v.Get("shutdown.optionType"); t.Exists() {
- va := v.Get("shutdown.value")
- if t.String() == "variable" {
- item.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Shutdown = types.BoolValue(va.Bool())
- }
- }
- item.RemoteAs = types.Int64Null()
- item.RemoteAsVariable = types.StringNull()
- if t := v.Get("remoteAs.optionType"); t.Exists() {
- va := v.Get("remoteAs.value")
- if t.String() == "variable" {
- item.RemoteAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RemoteAs = types.Int64Value(va.Int())
- }
- }
- item.LocalAs = types.Int64Null()
- item.LocalAsVariable = types.StringNull()
- if t := v.Get("localAs.optionType"); t.Exists() {
- va := v.Get("localAs.value")
- if t.String() == "variable" {
- item.LocalAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.LocalAs = types.Int64Value(va.Int())
- }
- }
- item.KeepaliveTime = types.Int64Null()
- item.KeepaliveTimeVariable = types.StringNull()
- if t := v.Get("keepalive.optionType"); t.Exists() {
- va := v.Get("keepalive.value")
- if t.String() == "variable" {
- item.KeepaliveTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.KeepaliveTime = types.Int64Value(va.Int())
- }
- }
- item.HoldTime = types.Int64Null()
- item.HoldTimeVariable = types.StringNull()
- if t := v.Get("holdtime.optionType"); t.Exists() {
- va := v.Get("holdtime.value")
- if t.String() == "variable" {
- item.HoldTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HoldTime = types.Int64Value(va.Int())
- }
- }
- item.UpdateSourceInterface = types.StringNull()
- item.UpdateSourceInterfaceVariable = types.StringNull()
- if t := v.Get("ifName.optionType"); t.Exists() {
- va := v.Get("ifName.value")
- if t.String() == "variable" {
- item.UpdateSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.UpdateSourceInterface = types.StringValue(va.String())
- }
- }
- item.NextHopSelf = types.BoolNull()
- item.NextHopSelfVariable = types.StringNull()
- if t := v.Get("nextHopSelf.optionType"); t.Exists() {
- va := v.Get("nextHopSelf.value")
- if t.String() == "variable" {
- item.NextHopSelfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NextHopSelf = types.BoolValue(va.Bool())
- }
- }
- item.SendCommunity = types.BoolNull()
- item.SendCommunityVariable = types.StringNull()
- if t := v.Get("sendCommunity.optionType"); t.Exists() {
- va := v.Get("sendCommunity.value")
- if t.String() == "variable" {
- item.SendCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendCommunity = types.BoolValue(va.Bool())
- }
- }
- item.SendExtendedCommunity = types.BoolNull()
- item.SendExtendedCommunityVariable = types.StringNull()
- if t := v.Get("sendExtCommunity.optionType"); t.Exists() {
- va := v.Get("sendExtCommunity.value")
- if t.String() == "variable" {
- item.SendExtendedCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendExtendedCommunity = types.BoolValue(va.Bool())
- }
- }
- item.EbgpMultihop = types.Int64Null()
- item.EbgpMultihopVariable = types.StringNull()
- if t := v.Get("ebgpMultihop.optionType"); t.Exists() {
- va := v.Get("ebgpMultihop.value")
- if t.String() == "variable" {
- item.EbgpMultihopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.EbgpMultihop = types.Int64Value(va.Int())
- }
- }
- item.SendLabel = types.BoolNull()
-
- if t := v.Get("sendLabel.optionType"); t.Exists() {
- va := v.Get("sendLabel.value")
- if t.String() == "global" {
- item.SendLabel = types.BoolValue(va.Bool())
- }
- }
- item.ExplicitNull = types.BoolNull()
- item.ExplicitNullVariable = types.StringNull()
- if t := v.Get("sendLabelExplicit.optionType"); t.Exists() {
- va := v.Get("sendLabelExplicit.value")
- if t.String() == "variable" {
- item.ExplicitNullVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.ExplicitNull = types.BoolValue(va.Bool())
- }
- }
- item.AsOverride = types.BoolNull()
- item.AsOverrideVariable = types.StringNull()
- if t := v.Get("asOverride.optionType"); t.Exists() {
- va := v.Get("asOverride.value")
- if t.String() == "variable" {
- item.AsOverrideVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AsOverride = types.BoolValue(va.Bool())
- }
- }
- item.AllowasInNumber = types.Int64Null()
- item.AllowasInNumberVariable = types.StringNull()
- if t := v.Get("asNumber.optionType"); t.Exists() {
- va := v.Get("asNumber.value")
- if t.String() == "variable" {
- item.AllowasInNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AllowasInNumber = types.Int64Value(va.Int())
- }
- }
- if cValue := v.Get("addressFamily"); cValue.Exists() {
- item.AddressFamilies = make([]TransportRoutingBGPIpv4NeighborsAddressFamilies, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := TransportRoutingBGPIpv4NeighborsAddressFamilies{}
- cItem.FamilyType = types.StringNull()
-
- if t := cv.Get("familyType.optionType"); t.Exists() {
- va := cv.Get("familyType.value")
- if t.String() == "global" {
- cItem.FamilyType = types.StringValue(va.String())
- }
- }
- cItem.MaxNumberOfPrefixes = types.Int64Null()
- cItem.MaxNumberOfPrefixesVariable = types.StringNull()
- if t := cv.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.prefixNum.value")
- if t.String() == "variable" {
- cItem.MaxNumberOfPrefixesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.MaxNumberOfPrefixes = types.Int64Value(va.Int())
- }
- }
- cItem.Threshold = types.Int64Null()
- cItem.ThresholdVariable = types.StringNull()
- if t := cv.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.threshold.value")
- if t.String() == "variable" {
- cItem.ThresholdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Threshold = types.Int64Value(va.Int())
- }
- }
- cItem.PolicyType = types.StringNull()
-
- if t := cv.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.policyType.value")
- if t.String() == "global" {
- cItem.PolicyType = types.StringValue(va.String())
- }
- }
- cItem.RestartInterval = types.Int64Null()
- cItem.RestartIntervalVariable = types.StringNull()
- if t := cv.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.restartInterval.value")
- if t.String() == "variable" {
- cItem.RestartIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.RestartInterval = types.Int64Value(va.Int())
- }
- }
- cItem.InRoutePolicyId = types.StringNull()
-
- if t := cv.Get("inRoutePolicy.refId.optionType"); t.Exists() {
- va := cv.Get("inRoutePolicy.refId.value")
- if t.String() == "global" {
- cItem.InRoutePolicyId = types.StringValue(va.String())
- }
- }
- cItem.OutRoutePolicyId = types.StringNull()
-
- if t := cv.Get("outRoutePolicy.refId.optionType"); t.Exists() {
- va := cv.Get("outRoutePolicy.refId.value")
- if t.String() == "global" {
- cItem.OutRoutePolicyId = types.StringValue(va.String())
- }
- }
- item.AddressFamilies = append(item.AddressFamilies, cItem)
- return true
- })
- }
- data.Ipv4Neighbors = append(data.Ipv4Neighbors, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6Neighbor"); value.Exists() {
- data.Ipv6Neighbors = make([]TransportRoutingBGPIpv6Neighbors, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv6Neighbors{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.Description = types.StringNull()
- item.DescriptionVariable = types.StringNull()
- if t := v.Get("description.optionType"); t.Exists() {
- va := v.Get("description.value")
- if t.String() == "variable" {
- item.DescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Description = types.StringValue(va.String())
- }
- }
- item.Shutdown = types.BoolNull()
- item.ShutdownVariable = types.StringNull()
- if t := v.Get("shutdown.optionType"); t.Exists() {
- va := v.Get("shutdown.value")
- if t.String() == "variable" {
- item.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Shutdown = types.BoolValue(va.Bool())
- }
- }
- item.RemoteAs = types.Int64Null()
- item.RemoteAsVariable = types.StringNull()
- if t := v.Get("remoteAs.optionType"); t.Exists() {
- va := v.Get("remoteAs.value")
- if t.String() == "variable" {
- item.RemoteAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.RemoteAs = types.Int64Value(va.Int())
- }
- }
- item.LocalAs = types.Int64Null()
- item.LocalAsVariable = types.StringNull()
- if t := v.Get("localAs.optionType"); t.Exists() {
- va := v.Get("localAs.value")
- if t.String() == "variable" {
- item.LocalAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.LocalAs = types.Int64Value(va.Int())
- }
- }
- item.KeepaliveTime = types.Int64Null()
- item.KeepaliveTimeVariable = types.StringNull()
- if t := v.Get("keepalive.optionType"); t.Exists() {
- va := v.Get("keepalive.value")
- if t.String() == "variable" {
- item.KeepaliveTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.KeepaliveTime = types.Int64Value(va.Int())
- }
- }
- item.HoldTime = types.Int64Null()
- item.HoldTimeVariable = types.StringNull()
- if t := v.Get("holdtime.optionType"); t.Exists() {
- va := v.Get("holdtime.value")
- if t.String() == "variable" {
- item.HoldTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HoldTime = types.Int64Value(va.Int())
- }
- }
- item.UpdateSourceInterface = types.StringNull()
- item.UpdateSourceInterfaceVariable = types.StringNull()
- if t := v.Get("ifName.optionType"); t.Exists() {
- va := v.Get("ifName.value")
- if t.String() == "variable" {
- item.UpdateSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.UpdateSourceInterface = types.StringValue(va.String())
- }
- }
- item.NextHopSelf = types.BoolNull()
- item.NextHopSelfVariable = types.StringNull()
- if t := v.Get("nextHopSelf.optionType"); t.Exists() {
- va := v.Get("nextHopSelf.value")
- if t.String() == "variable" {
- item.NextHopSelfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NextHopSelf = types.BoolValue(va.Bool())
- }
- }
- item.SendCommunity = types.BoolNull()
- item.SendCommunityVariable = types.StringNull()
- if t := v.Get("sendCommunity.optionType"); t.Exists() {
- va := v.Get("sendCommunity.value")
- if t.String() == "variable" {
- item.SendCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendCommunity = types.BoolValue(va.Bool())
- }
- }
- item.SendExtendedCommunity = types.BoolNull()
- item.SendExtendedCommunityVariable = types.StringNull()
- if t := v.Get("sendExtCommunity.optionType"); t.Exists() {
- va := v.Get("sendExtCommunity.value")
- if t.String() == "variable" {
- item.SendExtendedCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SendExtendedCommunity = types.BoolValue(va.Bool())
- }
- }
- item.EbgpMultihop = types.Int64Null()
- item.EbgpMultihopVariable = types.StringNull()
- if t := v.Get("ebgpMultihop.optionType"); t.Exists() {
- va := v.Get("ebgpMultihop.value")
- if t.String() == "variable" {
- item.EbgpMultihopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.EbgpMultihop = types.Int64Value(va.Int())
- }
- }
- item.AsOverride = types.BoolNull()
- item.AsOverrideVariable = types.StringNull()
- if t := v.Get("asOverride.optionType"); t.Exists() {
- va := v.Get("asOverride.value")
- if t.String() == "variable" {
- item.AsOverrideVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AsOverride = types.BoolValue(va.Bool())
- }
- }
- item.AllowasInNumber = types.Int64Null()
- item.AllowasInNumberVariable = types.StringNull()
- if t := v.Get("asNumber.optionType"); t.Exists() {
- va := v.Get("asNumber.value")
- if t.String() == "variable" {
- item.AllowasInNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AllowasInNumber = types.Int64Value(va.Int())
- }
- }
- if cValue := v.Get("addressFamily"); cValue.Exists() {
- item.AddressFamilies = make([]TransportRoutingBGPIpv6NeighborsAddressFamilies, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := TransportRoutingBGPIpv6NeighborsAddressFamilies{}
- cItem.FamilyType = types.StringNull()
-
- if t := cv.Get("familyType.optionType"); t.Exists() {
- va := cv.Get("familyType.value")
- if t.String() == "global" {
- cItem.FamilyType = types.StringValue(va.String())
- }
- }
- cItem.MaxNumberOfPrefixes = types.Int64Null()
- cItem.MaxNumberOfPrefixesVariable = types.StringNull()
- if t := cv.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.prefixNum.value")
- if t.String() == "variable" {
- cItem.MaxNumberOfPrefixesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.MaxNumberOfPrefixes = types.Int64Value(va.Int())
- }
- }
- cItem.Threshold = types.Int64Null()
- cItem.ThresholdVariable = types.StringNull()
- if t := cv.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.threshold.value")
- if t.String() == "variable" {
- cItem.ThresholdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Threshold = types.Int64Value(va.Int())
- }
- }
- cItem.PolicyType = types.StringNull()
-
- if t := cv.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.policyType.value")
- if t.String() == "global" {
- cItem.PolicyType = types.StringValue(va.String())
- }
- }
- cItem.RestartInterval = types.Int64Null()
- cItem.RestartIntervalVariable = types.StringNull()
- if t := cv.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
- va := cv.Get("maxPrefixConfig.restartInterval.value")
- if t.String() == "variable" {
- cItem.RestartIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.RestartInterval = types.Int64Value(va.Int())
- }
- }
- cItem.InRoutePolicyId = types.StringNull()
-
- if t := cv.Get("inRoutePolicy.refId.optionType"); t.Exists() {
- va := cv.Get("inRoutePolicy.refId.value")
- if t.String() == "global" {
- cItem.InRoutePolicyId = types.StringValue(va.String())
- }
- }
- cItem.OutRoutePolicyId = types.StringNull()
-
- if t := cv.Get("outRoutePolicy.refId.optionType"); t.Exists() {
- va := cv.Get("outRoutePolicy.refId.value")
- if t.String() == "global" {
- cItem.OutRoutePolicyId = types.StringValue(va.String())
- }
- }
- item.AddressFamilies = append(item.AddressFamilies, cItem)
- return true
- })
- }
- data.Ipv6Neighbors = append(data.Ipv6Neighbors, item)
- return true
- })
- }
- if value := res.Get(path + "addressFamily.aggregateAddress"); value.Exists() {
- data.Ipv4AggregateAddresses = make([]TransportRoutingBGPIpv4AggregateAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv4AggregateAddresses{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.address.optionType"); t.Exists() {
- va := v.Get("prefix.address.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.mask.optionType"); t.Exists() {
- va := v.Get("prefix.mask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- item.AsSetPath = types.BoolNull()
- item.AsSetPathVariable = types.StringNull()
- if t := v.Get("asSet.optionType"); t.Exists() {
- va := v.Get("asSet.value")
- if t.String() == "variable" {
- item.AsSetPathVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AsSetPath = types.BoolValue(va.Bool())
- }
- }
- item.SummaryOnly = types.BoolNull()
- item.SummaryOnlyVariable = types.StringNull()
- if t := v.Get("summaryOnly.optionType"); t.Exists() {
- va := v.Get("summaryOnly.value")
- if t.String() == "variable" {
- item.SummaryOnlyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SummaryOnly = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4AggregateAddresses = append(data.Ipv4AggregateAddresses, item)
- return true
- })
- }
- if value := res.Get(path + "addressFamily.network"); value.Exists() {
- data.Ipv4Networks = make([]TransportRoutingBGPIpv4Networks, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv4Networks{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.address.optionType"); t.Exists() {
- va := v.Get("prefix.address.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.mask.optionType"); t.Exists() {
- va := v.Get("prefix.mask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4Networks = append(data.Ipv4Networks, item)
- return true
- })
- }
- data.Ipv4EibgpMaximumPaths = types.Int64Null()
- data.Ipv4EibgpMaximumPathsVariable = types.StringNull()
- if t := res.Get(path + "addressFamily.paths.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.paths.value")
- if t.String() == "variable" {
- data.Ipv4EibgpMaximumPathsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4EibgpMaximumPaths = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Originate = types.BoolNull()
- data.Ipv4OriginateVariable = types.StringNull()
- if t := res.Get(path + "addressFamily.originate.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.originate.value")
- if t.String() == "variable" {
- data.Ipv4OriginateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Originate = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4TableMapRoutePolicyId = types.StringNull()
-
- if t := res.Get(path + "addressFamily.name.refId.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.name.refId.value")
- if t.String() == "global" {
- data.Ipv4TableMapRoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv4TableMapFilter = types.BoolNull()
- data.Ipv4TableMapFilterVariable = types.StringNull()
- if t := res.Get(path + "addressFamily.filter.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.filter.value")
- if t.String() == "variable" {
- data.Ipv4TableMapFilterVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4TableMapFilter = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "addressFamily.redistribute"); value.Exists() {
- data.Ipv4Redistributes = make([]TransportRoutingBGPIpv4Redistributes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv4Redistributes{}
- item.Protocol = types.StringNull()
- item.ProtocolVariable = types.StringNull()
- if t := v.Get("protocol.optionType"); t.Exists() {
- va := v.Get("protocol.value")
- if t.String() == "variable" {
- item.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Protocol = types.StringValue(va.String())
- }
- }
- item.RoutePolicyId = types.StringNull()
-
- if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
- va := v.Get("routePolicy.refId.value")
- if t.String() == "global" {
- item.RoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv4Redistributes = append(data.Ipv4Redistributes, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6AddressFamily.ipv6AggregateAddress"); value.Exists() {
- data.Ipv6AggregateAddresses = make([]TransportRoutingBGPIpv6AggregateAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv6AggregateAddresses{}
- item.AggregatePrefix = types.StringNull()
- item.AggregatePrefixVariable = types.StringNull()
- if t := v.Get("prefix.optionType"); t.Exists() {
- va := v.Get("prefix.value")
- if t.String() == "variable" {
- item.AggregatePrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AggregatePrefix = types.StringValue(va.String())
- }
- }
- item.AsSetPath = types.BoolNull()
- item.AsSetPathVariable = types.StringNull()
- if t := v.Get("asSet.optionType"); t.Exists() {
- va := v.Get("asSet.value")
- if t.String() == "variable" {
- item.AsSetPathVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AsSetPath = types.BoolValue(va.Bool())
- }
- }
- item.SummaryOnly = types.BoolNull()
- item.SummaryOnlyVariable = types.StringNull()
- if t := v.Get("summaryOnly.optionType"); t.Exists() {
- va := v.Get("summaryOnly.value")
- if t.String() == "variable" {
- item.SummaryOnlyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SummaryOnly = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6AggregateAddresses = append(data.Ipv6AggregateAddresses, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6AddressFamily.ipv6Network"); value.Exists() {
- data.Ipv6Networks = make([]TransportRoutingBGPIpv6Networks, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv6Networks{}
- item.NetworkPrefix = types.StringNull()
- item.NetworkPrefixVariable = types.StringNull()
- if t := v.Get("prefix.optionType"); t.Exists() {
- va := v.Get("prefix.value")
- if t.String() == "variable" {
- item.NetworkPrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkPrefix = types.StringValue(va.String())
- }
- }
- data.Ipv6Networks = append(data.Ipv6Networks, item)
- return true
- })
- }
- data.Ipv6EibgpMaximumPaths = types.Int64Null()
- data.Ipv6EibgpMaximumPathsVariable = types.StringNull()
- if t := res.Get(path + "ipv6AddressFamily.paths.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.paths.value")
- if t.String() == "variable" {
- data.Ipv6EibgpMaximumPathsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6EibgpMaximumPaths = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Originate = types.BoolNull()
- data.Ipv6OriginateVariable = types.StringNull()
- if t := res.Get(path + "ipv6AddressFamily.originate.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.originate.value")
- if t.String() == "variable" {
- data.Ipv6OriginateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Originate = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6TableMapRoutePolicyId = types.StringNull()
-
- if t := res.Get(path + "ipv6AddressFamily.name.refId.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.name.refId.value")
- if t.String() == "global" {
- data.Ipv6TableMapRoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv6TableMapFilter = types.BoolNull()
- data.Ipv6TableMapFilterVariable = types.StringNull()
- if t := res.Get(path + "ipv6AddressFamily.filter.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.filter.value")
- if t.String() == "variable" {
- data.Ipv6TableMapFilterVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6TableMapFilter = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "ipv6AddressFamily.redistribute"); value.Exists() {
- data.Ipv6Redistributes = make([]TransportRoutingBGPIpv6Redistributes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPIpv6Redistributes{}
- item.Protocol = types.StringNull()
- item.ProtocolVariable = types.StringNull()
- if t := v.Get("protocol.optionType"); t.Exists() {
- va := v.Get("protocol.value")
- if t.String() == "variable" {
- item.ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Protocol = types.StringValue(va.String())
- }
- }
- item.RoutePolicyId = types.StringNull()
-
- if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
- va := v.Get("routePolicy.refId.value")
- if t.String() == "global" {
- item.RoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv6Redistributes = append(data.Ipv6Redistributes, item)
- return true
- })
- }
- if value := res.Get(path + "mplsInterface"); value.Exists() {
- data.MplsInterfaces = make([]TransportRoutingBGPMplsInterfaces, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportRoutingBGPMplsInterfaces{}
- item.InterfaceName = types.StringNull()
- item.InterfaceNameVariable = types.StringNull()
- if t := v.Get("ifName.optionType"); t.Exists() {
- va := v.Get("ifName.value")
- if t.String() == "variable" {
- item.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.InterfaceName = types.StringValue(va.String())
- }
- }
- data.MplsInterfaces = append(data.MplsInterfaces, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportRoutingBGP) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.AsNumber = types.Int64Null()
- data.AsNumberVariable = types.StringNull()
- if t := res.Get(path + "asNum.optionType"); t.Exists() {
- va := res.Get(path + "asNum.value")
- if t.String() == "variable" {
- data.AsNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AsNumber = types.Int64Value(va.Int())
- }
- }
- data.RouterId = types.StringNull()
- data.RouterIdVariable = types.StringNull()
- if t := res.Get(path + "routerId.optionType"); t.Exists() {
- va := res.Get(path + "routerId.value")
- if t.String() == "variable" {
- data.RouterIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.RouterId = types.StringValue(va.String())
- }
- }
- data.PropagateAsPath = types.BoolNull()
- data.PropagateAsPathVariable = types.StringNull()
- if t := res.Get(path + "propagateAspath.optionType"); t.Exists() {
- va := res.Get(path + "propagateAspath.value")
- if t.String() == "variable" {
- data.PropagateAsPathVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PropagateAsPath = types.BoolValue(va.Bool())
- }
- }
- data.PropagateCommunity = types.BoolNull()
- data.PropagateCommunityVariable = types.StringNull()
- if t := res.Get(path + "propagateCommunity.optionType"); t.Exists() {
- va := res.Get(path + "propagateCommunity.value")
- if t.String() == "variable" {
- data.PropagateCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PropagateCommunity = types.BoolValue(va.Bool())
- }
- }
- data.ExternalRoutesDistance = types.Int64Null()
- data.ExternalRoutesDistanceVariable = types.StringNull()
- if t := res.Get(path + "external.optionType"); t.Exists() {
- va := res.Get(path + "external.value")
- if t.String() == "variable" {
- data.ExternalRoutesDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ExternalRoutesDistance = types.Int64Value(va.Int())
- }
- }
- data.InternalRoutesDistance = types.Int64Null()
- data.InternalRoutesDistanceVariable = types.StringNull()
- if t := res.Get(path + "internal.optionType"); t.Exists() {
- va := res.Get(path + "internal.value")
- if t.String() == "variable" {
- data.InternalRoutesDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InternalRoutesDistance = types.Int64Value(va.Int())
- }
- }
- data.LocalRoutesDistance = types.Int64Null()
- data.LocalRoutesDistanceVariable = types.StringNull()
- if t := res.Get(path + "local.optionType"); t.Exists() {
- va := res.Get(path + "local.value")
- if t.String() == "variable" {
- data.LocalRoutesDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LocalRoutesDistance = types.Int64Value(va.Int())
- }
- }
- data.KeepaliveTime = types.Int64Null()
- data.KeepaliveTimeVariable = types.StringNull()
- if t := res.Get(path + "keepalive.optionType"); t.Exists() {
- va := res.Get(path + "keepalive.value")
- if t.String() == "variable" {
- data.KeepaliveTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.KeepaliveTime = types.Int64Value(va.Int())
- }
- }
- data.HoldTime = types.Int64Null()
- data.HoldTimeVariable = types.StringNull()
- if t := res.Get(path + "holdtime.optionType"); t.Exists() {
- va := res.Get(path + "holdtime.value")
- if t.String() == "variable" {
- data.HoldTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.HoldTime = types.Int64Value(va.Int())
- }
- }
- data.AlwaysCompareMed = types.BoolNull()
- data.AlwaysCompareMedVariable = types.StringNull()
- if t := res.Get(path + "alwaysCompare.optionType"); t.Exists() {
- va := res.Get(path + "alwaysCompare.value")
- if t.String() == "variable" {
- data.AlwaysCompareMedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AlwaysCompareMed = types.BoolValue(va.Bool())
- }
- }
- data.DeterministicMed = types.BoolNull()
- data.DeterministicMedVariable = types.StringNull()
- if t := res.Get(path + "deterministic.optionType"); t.Exists() {
- va := res.Get(path + "deterministic.value")
- if t.String() == "variable" {
- data.DeterministicMedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DeterministicMed = types.BoolValue(va.Bool())
- }
- }
- data.MissingMedAsWorst = types.BoolNull()
- data.MissingMedAsWorstVariable = types.StringNull()
- if t := res.Get(path + "missingAsWorst.optionType"); t.Exists() {
- va := res.Get(path + "missingAsWorst.value")
- if t.String() == "variable" {
- data.MissingMedAsWorstVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MissingMedAsWorst = types.BoolValue(va.Bool())
- }
- }
- data.CompareRouterId = types.BoolNull()
- data.CompareRouterIdVariable = types.StringNull()
- if t := res.Get(path + "compareRouterId.optionType"); t.Exists() {
- va := res.Get(path + "compareRouterId.value")
- if t.String() == "variable" {
- data.CompareRouterIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.CompareRouterId = types.BoolValue(va.Bool())
- }
- }
- data.MultipathRelax = types.BoolNull()
- data.MultipathRelaxVariable = types.StringNull()
- if t := res.Get(path + "multipathRelax.optionType"); t.Exists() {
- va := res.Get(path + "multipathRelax.value")
- if t.String() == "variable" {
- data.MultipathRelaxVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MultipathRelax = types.BoolValue(va.Bool())
- }
- }
- for i := range data.Ipv4Neighbors {
- keys := [...]string{"description"}
- keyValues := [...]string{data.Ipv4Neighbors[i].Description.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4Neighbors[i].DescriptionVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "neighbor").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4Neighbors[i].Address = types.StringNull()
- data.Ipv4Neighbors[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4Neighbors[i].Description = types.StringNull()
- data.Ipv4Neighbors[i].DescriptionVariable = types.StringNull()
- if t := r.Get("description.optionType"); t.Exists() {
- va := r.Get("description.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].DescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].Description = types.StringValue(va.String())
- }
- }
- data.Ipv4Neighbors[i].Shutdown = types.BoolNull()
- data.Ipv4Neighbors[i].ShutdownVariable = types.StringNull()
- if t := r.Get("shutdown.optionType"); t.Exists() {
- va := r.Get("shutdown.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Neighbors[i].RemoteAs = types.Int64Null()
- data.Ipv4Neighbors[i].RemoteAsVariable = types.StringNull()
- if t := r.Get("remoteAs.optionType"); t.Exists() {
- va := r.Get("remoteAs.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].RemoteAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].RemoteAs = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].LocalAs = types.Int64Null()
- data.Ipv4Neighbors[i].LocalAsVariable = types.StringNull()
- if t := r.Get("localAs.optionType"); t.Exists() {
- va := r.Get("localAs.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].LocalAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].LocalAs = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].KeepaliveTime = types.Int64Null()
- data.Ipv4Neighbors[i].KeepaliveTimeVariable = types.StringNull()
- if t := r.Get("keepalive.optionType"); t.Exists() {
- va := r.Get("keepalive.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].KeepaliveTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].KeepaliveTime = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].HoldTime = types.Int64Null()
- data.Ipv4Neighbors[i].HoldTimeVariable = types.StringNull()
- if t := r.Get("holdtime.optionType"); t.Exists() {
- va := r.Get("holdtime.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].HoldTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].HoldTime = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].UpdateSourceInterface = types.StringNull()
- data.Ipv4Neighbors[i].UpdateSourceInterfaceVariable = types.StringNull()
- if t := r.Get("ifName.optionType"); t.Exists() {
- va := r.Get("ifName.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].UpdateSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].UpdateSourceInterface = types.StringValue(va.String())
- }
- }
- data.Ipv4Neighbors[i].NextHopSelf = types.BoolNull()
- data.Ipv4Neighbors[i].NextHopSelfVariable = types.StringNull()
- if t := r.Get("nextHopSelf.optionType"); t.Exists() {
- va := r.Get("nextHopSelf.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].NextHopSelfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].NextHopSelf = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Neighbors[i].SendCommunity = types.BoolNull()
- data.Ipv4Neighbors[i].SendCommunityVariable = types.StringNull()
- if t := r.Get("sendCommunity.optionType"); t.Exists() {
- va := r.Get("sendCommunity.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].SendCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].SendCommunity = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Neighbors[i].SendExtendedCommunity = types.BoolNull()
- data.Ipv4Neighbors[i].SendExtendedCommunityVariable = types.StringNull()
- if t := r.Get("sendExtCommunity.optionType"); t.Exists() {
- va := r.Get("sendExtCommunity.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].SendExtendedCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].SendExtendedCommunity = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Neighbors[i].EbgpMultihop = types.Int64Null()
- data.Ipv4Neighbors[i].EbgpMultihopVariable = types.StringNull()
- if t := r.Get("ebgpMultihop.optionType"); t.Exists() {
- va := r.Get("ebgpMultihop.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].EbgpMultihopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].EbgpMultihop = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].SendLabel = types.BoolNull()
-
- if t := r.Get("sendLabel.optionType"); t.Exists() {
- va := r.Get("sendLabel.value")
- if t.String() == "global" {
- data.Ipv4Neighbors[i].SendLabel = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Neighbors[i].ExplicitNull = types.BoolNull()
- data.Ipv4Neighbors[i].ExplicitNullVariable = types.StringNull()
- if t := r.Get("sendLabelExplicit.optionType"); t.Exists() {
- va := r.Get("sendLabelExplicit.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].ExplicitNullVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].ExplicitNull = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Neighbors[i].AsOverride = types.BoolNull()
- data.Ipv4Neighbors[i].AsOverrideVariable = types.StringNull()
- if t := r.Get("asOverride.optionType"); t.Exists() {
- va := r.Get("asOverride.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].AsOverrideVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].AsOverride = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4Neighbors[i].AllowasInNumber = types.Int64Null()
- data.Ipv4Neighbors[i].AllowasInNumberVariable = types.StringNull()
- if t := r.Get("asNumber.optionType"); t.Exists() {
- va := r.Get("asNumber.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].AllowasInNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].AllowasInNumber = types.Int64Value(va.Int())
- }
- }
- for ci := range data.Ipv4Neighbors[i].AddressFamilies {
- keys := [...]string{"familyType"}
- keyValues := [...]string{data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("addressFamily").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType = types.StringNull()
-
- if t := cr.Get("familyType.optionType"); t.Exists() {
- va := cr.Get("familyType.value")
- if t.String() == "global" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].FamilyType = types.StringValue(va.String())
- }
- }
- data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Null()
- data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringNull()
- if t := cr.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.prefixNum.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Null()
- data.Ipv4Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringNull()
- if t := cr.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.threshold.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].AddressFamilies[ci].PolicyType = types.StringNull()
-
- if t := cr.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.policyType.value")
- if t.String() == "global" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].PolicyType = types.StringValue(va.String())
- }
- }
- data.Ipv4Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Null()
- data.Ipv4Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringNull()
- if t := cr.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.restartInterval.value")
- if t.String() == "variable" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringNull()
-
- if t := cr.Get("inRoutePolicy.refId.optionType"); t.Exists() {
- va := cr.Get("inRoutePolicy.refId.value")
- if t.String() == "global" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv4Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringNull()
-
- if t := cr.Get("outRoutePolicy.refId.optionType"); t.Exists() {
- va := cr.Get("outRoutePolicy.refId.value")
- if t.String() == "global" {
- data.Ipv4Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.Ipv6Neighbors {
- keys := [...]string{"description"}
- keyValues := [...]string{data.Ipv6Neighbors[i].Description.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6Neighbors[i].DescriptionVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6Neighbor").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6Neighbors[i].Address = types.StringNull()
- data.Ipv6Neighbors[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv6Neighbors[i].Description = types.StringNull()
- data.Ipv6Neighbors[i].DescriptionVariable = types.StringNull()
- if t := r.Get("description.optionType"); t.Exists() {
- va := r.Get("description.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].DescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].Description = types.StringValue(va.String())
- }
- }
- data.Ipv6Neighbors[i].Shutdown = types.BoolNull()
- data.Ipv6Neighbors[i].ShutdownVariable = types.StringNull()
- if t := r.Get("shutdown.optionType"); t.Exists() {
- va := r.Get("shutdown.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Neighbors[i].RemoteAs = types.Int64Null()
- data.Ipv6Neighbors[i].RemoteAsVariable = types.StringNull()
- if t := r.Get("remoteAs.optionType"); t.Exists() {
- va := r.Get("remoteAs.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].RemoteAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].RemoteAs = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].LocalAs = types.Int64Null()
- data.Ipv6Neighbors[i].LocalAsVariable = types.StringNull()
- if t := r.Get("localAs.optionType"); t.Exists() {
- va := r.Get("localAs.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].LocalAsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].LocalAs = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].KeepaliveTime = types.Int64Null()
- data.Ipv6Neighbors[i].KeepaliveTimeVariable = types.StringNull()
- if t := r.Get("keepalive.optionType"); t.Exists() {
- va := r.Get("keepalive.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].KeepaliveTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].KeepaliveTime = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].HoldTime = types.Int64Null()
- data.Ipv6Neighbors[i].HoldTimeVariable = types.StringNull()
- if t := r.Get("holdtime.optionType"); t.Exists() {
- va := r.Get("holdtime.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].HoldTimeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].HoldTime = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].UpdateSourceInterface = types.StringNull()
- data.Ipv6Neighbors[i].UpdateSourceInterfaceVariable = types.StringNull()
- if t := r.Get("ifName.optionType"); t.Exists() {
- va := r.Get("ifName.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].UpdateSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].UpdateSourceInterface = types.StringValue(va.String())
- }
- }
- data.Ipv6Neighbors[i].NextHopSelf = types.BoolNull()
- data.Ipv6Neighbors[i].NextHopSelfVariable = types.StringNull()
- if t := r.Get("nextHopSelf.optionType"); t.Exists() {
- va := r.Get("nextHopSelf.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].NextHopSelfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].NextHopSelf = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Neighbors[i].SendCommunity = types.BoolNull()
- data.Ipv6Neighbors[i].SendCommunityVariable = types.StringNull()
- if t := r.Get("sendCommunity.optionType"); t.Exists() {
- va := r.Get("sendCommunity.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].SendCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].SendCommunity = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Neighbors[i].SendExtendedCommunity = types.BoolNull()
- data.Ipv6Neighbors[i].SendExtendedCommunityVariable = types.StringNull()
- if t := r.Get("sendExtCommunity.optionType"); t.Exists() {
- va := r.Get("sendExtCommunity.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].SendExtendedCommunityVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].SendExtendedCommunity = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Neighbors[i].EbgpMultihop = types.Int64Null()
- data.Ipv6Neighbors[i].EbgpMultihopVariable = types.StringNull()
- if t := r.Get("ebgpMultihop.optionType"); t.Exists() {
- va := r.Get("ebgpMultihop.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].EbgpMultihopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].EbgpMultihop = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].AsOverride = types.BoolNull()
- data.Ipv6Neighbors[i].AsOverrideVariable = types.StringNull()
- if t := r.Get("asOverride.optionType"); t.Exists() {
- va := r.Get("asOverride.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].AsOverrideVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].AsOverride = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6Neighbors[i].AllowasInNumber = types.Int64Null()
- data.Ipv6Neighbors[i].AllowasInNumberVariable = types.StringNull()
- if t := r.Get("asNumber.optionType"); t.Exists() {
- va := r.Get("asNumber.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].AllowasInNumberVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].AllowasInNumber = types.Int64Value(va.Int())
- }
- }
- for ci := range data.Ipv6Neighbors[i].AddressFamilies {
- keys := [...]string{"familyType"}
- keyValues := [...]string{data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var cr gjson.Result
- r.Get("addressFamily").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType = types.StringNull()
-
- if t := cr.Get("familyType.optionType"); t.Exists() {
- va := cr.Get("familyType.value")
- if t.String() == "global" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].FamilyType = types.StringValue(va.String())
- }
- }
- data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Null()
- data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringNull()
- if t := cr.Get("maxPrefixConfig.prefixNum.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.prefixNum.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].MaxNumberOfPrefixes = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Null()
- data.Ipv6Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringNull()
- if t := cr.Get("maxPrefixConfig.threshold.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.threshold.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].ThresholdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].Threshold = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].AddressFamilies[ci].PolicyType = types.StringNull()
-
- if t := cr.Get("maxPrefixConfig.policyType.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.policyType.value")
- if t.String() == "global" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].PolicyType = types.StringValue(va.String())
- }
- }
- data.Ipv6Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Null()
- data.Ipv6Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringNull()
- if t := cr.Get("maxPrefixConfig.restartInterval.optionType"); t.Exists() {
- va := cr.Get("maxPrefixConfig.restartInterval.value")
- if t.String() == "variable" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].RestartIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].RestartInterval = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringNull()
-
- if t := cr.Get("inRoutePolicy.refId.optionType"); t.Exists() {
- va := cr.Get("inRoutePolicy.refId.value")
- if t.String() == "global" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].InRoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv6Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringNull()
-
- if t := cr.Get("outRoutePolicy.refId.optionType"); t.Exists() {
- va := cr.Get("outRoutePolicy.refId.value")
- if t.String() == "global" {
- data.Ipv6Neighbors[i].AddressFamilies[ci].OutRoutePolicyId = types.StringValue(va.String())
- }
- }
- }
- }
- for i := range data.Ipv4AggregateAddresses {
- keys := [...]string{"prefix.address"}
- keyValues := [...]string{data.Ipv4AggregateAddresses[i].NetworkAddress.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4AggregateAddresses[i].NetworkAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "addressFamily.aggregateAddress").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4AggregateAddresses[i].NetworkAddress = types.StringNull()
- data.Ipv4AggregateAddresses[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.address.optionType"); t.Exists() {
- va := r.Get("prefix.address.value")
- if t.String() == "variable" {
- data.Ipv4AggregateAddresses[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4AggregateAddresses[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.Ipv4AggregateAddresses[i].SubnetMask = types.StringNull()
- data.Ipv4AggregateAddresses[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.mask.optionType"); t.Exists() {
- va := r.Get("prefix.mask.value")
- if t.String() == "variable" {
- data.Ipv4AggregateAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4AggregateAddresses[i].SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4AggregateAddresses[i].AsSetPath = types.BoolNull()
- data.Ipv4AggregateAddresses[i].AsSetPathVariable = types.StringNull()
- if t := r.Get("asSet.optionType"); t.Exists() {
- va := r.Get("asSet.value")
- if t.String() == "variable" {
- data.Ipv4AggregateAddresses[i].AsSetPathVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4AggregateAddresses[i].AsSetPath = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4AggregateAddresses[i].SummaryOnly = types.BoolNull()
- data.Ipv4AggregateAddresses[i].SummaryOnlyVariable = types.StringNull()
- if t := r.Get("summaryOnly.optionType"); t.Exists() {
- va := r.Get("summaryOnly.value")
- if t.String() == "variable" {
- data.Ipv4AggregateAddresses[i].SummaryOnlyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4AggregateAddresses[i].SummaryOnly = types.BoolValue(va.Bool())
- }
- }
- }
- for i := range data.Ipv4Networks {
- keys := [...]string{"prefix.address"}
- keyValues := [...]string{data.Ipv4Networks[i].NetworkAddress.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4Networks[i].NetworkAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "addressFamily.network").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4Networks[i].NetworkAddress = types.StringNull()
- data.Ipv4Networks[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.address.optionType"); t.Exists() {
- va := r.Get("prefix.address.value")
- if t.String() == "variable" {
- data.Ipv4Networks[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Networks[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.Ipv4Networks[i].SubnetMask = types.StringNull()
- data.Ipv4Networks[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.mask.optionType"); t.Exists() {
- va := r.Get("prefix.mask.value")
- if t.String() == "variable" {
- data.Ipv4Networks[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Networks[i].SubnetMask = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4EibgpMaximumPaths = types.Int64Null()
- data.Ipv4EibgpMaximumPathsVariable = types.StringNull()
- if t := res.Get(path + "addressFamily.paths.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.paths.value")
- if t.String() == "variable" {
- data.Ipv4EibgpMaximumPathsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4EibgpMaximumPaths = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Originate = types.BoolNull()
- data.Ipv4OriginateVariable = types.StringNull()
- if t := res.Get(path + "addressFamily.originate.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.originate.value")
- if t.String() == "variable" {
- data.Ipv4OriginateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Originate = types.BoolValue(va.Bool())
- }
- }
- data.Ipv4TableMapRoutePolicyId = types.StringNull()
-
- if t := res.Get(path + "addressFamily.name.refId.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.name.refId.value")
- if t.String() == "global" {
- data.Ipv4TableMapRoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv4TableMapFilter = types.BoolNull()
- data.Ipv4TableMapFilterVariable = types.StringNull()
- if t := res.Get(path + "addressFamily.filter.optionType"); t.Exists() {
- va := res.Get(path + "addressFamily.filter.value")
- if t.String() == "variable" {
- data.Ipv4TableMapFilterVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4TableMapFilter = types.BoolValue(va.Bool())
- }
- }
- for i := range data.Ipv4Redistributes {
- keys := [...]string{"routePolicy.refId"}
- keyValues := [...]string{data.Ipv4Redistributes[i].RoutePolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "addressFamily.redistribute").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4Redistributes[i].Protocol = types.StringNull()
- data.Ipv4Redistributes[i].ProtocolVariable = types.StringNull()
- if t := r.Get("protocol.optionType"); t.Exists() {
- va := r.Get("protocol.value")
- if t.String() == "variable" {
- data.Ipv4Redistributes[i].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Redistributes[i].Protocol = types.StringValue(va.String())
- }
- }
- data.Ipv4Redistributes[i].RoutePolicyId = types.StringNull()
-
- if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
- va := r.Get("routePolicy.refId.value")
- if t.String() == "global" {
- data.Ipv4Redistributes[i].RoutePolicyId = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Ipv6AggregateAddresses {
- keys := [...]string{"prefix"}
- keyValues := [...]string{data.Ipv6AggregateAddresses[i].AggregatePrefix.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6AggregateAddresses[i].AggregatePrefixVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6AddressFamily.ipv6AggregateAddress").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6AggregateAddresses[i].AggregatePrefix = types.StringNull()
- data.Ipv6AggregateAddresses[i].AggregatePrefixVariable = types.StringNull()
- if t := r.Get("prefix.optionType"); t.Exists() {
- va := r.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6AggregateAddresses[i].AggregatePrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6AggregateAddresses[i].AggregatePrefix = types.StringValue(va.String())
- }
- }
- data.Ipv6AggregateAddresses[i].AsSetPath = types.BoolNull()
- data.Ipv6AggregateAddresses[i].AsSetPathVariable = types.StringNull()
- if t := r.Get("asSet.optionType"); t.Exists() {
- va := r.Get("asSet.value")
- if t.String() == "variable" {
- data.Ipv6AggregateAddresses[i].AsSetPathVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6AggregateAddresses[i].AsSetPath = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6AggregateAddresses[i].SummaryOnly = types.BoolNull()
- data.Ipv6AggregateAddresses[i].SummaryOnlyVariable = types.StringNull()
- if t := r.Get("summaryOnly.optionType"); t.Exists() {
- va := r.Get("summaryOnly.value")
- if t.String() == "variable" {
- data.Ipv6AggregateAddresses[i].SummaryOnlyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6AggregateAddresses[i].SummaryOnly = types.BoolValue(va.Bool())
- }
- }
- }
- for i := range data.Ipv6Networks {
- keys := [...]string{"prefix"}
- keyValues := [...]string{data.Ipv6Networks[i].NetworkPrefix.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6Networks[i].NetworkPrefixVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6AddressFamily.ipv6Network").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6Networks[i].NetworkPrefix = types.StringNull()
- data.Ipv6Networks[i].NetworkPrefixVariable = types.StringNull()
- if t := r.Get("prefix.optionType"); t.Exists() {
- va := r.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6Networks[i].NetworkPrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Networks[i].NetworkPrefix = types.StringValue(va.String())
- }
- }
- }
- data.Ipv6EibgpMaximumPaths = types.Int64Null()
- data.Ipv6EibgpMaximumPathsVariable = types.StringNull()
- if t := res.Get(path + "ipv6AddressFamily.paths.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.paths.value")
- if t.String() == "variable" {
- data.Ipv6EibgpMaximumPathsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6EibgpMaximumPaths = types.Int64Value(va.Int())
- }
- }
- data.Ipv6Originate = types.BoolNull()
- data.Ipv6OriginateVariable = types.StringNull()
- if t := res.Get(path + "ipv6AddressFamily.originate.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.originate.value")
- if t.String() == "variable" {
- data.Ipv6OriginateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Originate = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6TableMapRoutePolicyId = types.StringNull()
-
- if t := res.Get(path + "ipv6AddressFamily.name.refId.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.name.refId.value")
- if t.String() == "global" {
- data.Ipv6TableMapRoutePolicyId = types.StringValue(va.String())
- }
- }
- data.Ipv6TableMapFilter = types.BoolNull()
- data.Ipv6TableMapFilterVariable = types.StringNull()
- if t := res.Get(path + "ipv6AddressFamily.filter.optionType"); t.Exists() {
- va := res.Get(path + "ipv6AddressFamily.filter.value")
- if t.String() == "variable" {
- data.Ipv6TableMapFilterVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6TableMapFilter = types.BoolValue(va.Bool())
- }
- }
- for i := range data.Ipv6Redistributes {
- keys := [...]string{"routePolicy.refId"}
- keyValues := [...]string{data.Ipv6Redistributes[i].RoutePolicyId.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "ipv6AddressFamily.redistribute").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6Redistributes[i].Protocol = types.StringNull()
- data.Ipv6Redistributes[i].ProtocolVariable = types.StringNull()
- if t := r.Get("protocol.optionType"); t.Exists() {
- va := r.Get("protocol.value")
- if t.String() == "variable" {
- data.Ipv6Redistributes[i].ProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Redistributes[i].Protocol = types.StringValue(va.String())
- }
- }
- data.Ipv6Redistributes[i].RoutePolicyId = types.StringNull()
-
- if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
- va := r.Get("routePolicy.refId.value")
- if t.String() == "global" {
- data.Ipv6Redistributes[i].RoutePolicyId = types.StringValue(va.String())
- }
- }
- }
- for i := range data.MplsInterfaces {
- keys := [...]string{"ifName"}
- keyValues := [...]string{data.MplsInterfaces[i].InterfaceName.ValueString()}
- keyValuesVariables := [...]string{data.MplsInterfaces[i].InterfaceNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "mplsInterface").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.MplsInterfaces[i].InterfaceName = types.StringNull()
- data.MplsInterfaces[i].InterfaceNameVariable = types.StringNull()
- if t := r.Get("ifName.optionType"); t.Exists() {
- va := r.Get("ifName.value")
- if t.String() == "variable" {
- data.MplsInterfaces[i].InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MplsInterfaces[i].InterfaceName = types.StringValue(va.String())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportRoutingBGP) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.AsNumber.IsNull() {
- return false
- }
- if !data.AsNumberVariable.IsNull() {
- return false
- }
- if !data.RouterId.IsNull() {
- return false
- }
- if !data.RouterIdVariable.IsNull() {
- return false
- }
- if !data.PropagateAsPath.IsNull() {
- return false
- }
- if !data.PropagateAsPathVariable.IsNull() {
- return false
- }
- if !data.PropagateCommunity.IsNull() {
- return false
- }
- if !data.PropagateCommunityVariable.IsNull() {
- return false
- }
- if !data.ExternalRoutesDistance.IsNull() {
- return false
- }
- if !data.ExternalRoutesDistanceVariable.IsNull() {
- return false
- }
- if !data.InternalRoutesDistance.IsNull() {
- return false
- }
- if !data.InternalRoutesDistanceVariable.IsNull() {
- return false
- }
- if !data.LocalRoutesDistance.IsNull() {
- return false
- }
- if !data.LocalRoutesDistanceVariable.IsNull() {
- return false
- }
- if !data.KeepaliveTime.IsNull() {
- return false
- }
- if !data.KeepaliveTimeVariable.IsNull() {
- return false
- }
- if !data.HoldTime.IsNull() {
- return false
- }
- if !data.HoldTimeVariable.IsNull() {
- return false
- }
- if !data.AlwaysCompareMed.IsNull() {
- return false
- }
- if !data.AlwaysCompareMedVariable.IsNull() {
- return false
- }
- if !data.DeterministicMed.IsNull() {
- return false
- }
- if !data.DeterministicMedVariable.IsNull() {
- return false
- }
- if !data.MissingMedAsWorst.IsNull() {
- return false
- }
- if !data.MissingMedAsWorstVariable.IsNull() {
- return false
- }
- if !data.CompareRouterId.IsNull() {
- return false
- }
- if !data.CompareRouterIdVariable.IsNull() {
- return false
- }
- if !data.MultipathRelax.IsNull() {
- return false
- }
- if !data.MultipathRelaxVariable.IsNull() {
- return false
- }
- if len(data.Ipv4Neighbors) > 0 {
- return false
- }
- if len(data.Ipv6Neighbors) > 0 {
- return false
- }
- if len(data.Ipv4AggregateAddresses) > 0 {
- return false
- }
- if len(data.Ipv4Networks) > 0 {
- return false
- }
- if !data.Ipv4EibgpMaximumPaths.IsNull() {
- return false
- }
- if !data.Ipv4EibgpMaximumPathsVariable.IsNull() {
- return false
- }
- if !data.Ipv4Originate.IsNull() {
- return false
- }
- if !data.Ipv4OriginateVariable.IsNull() {
- return false
- }
- if !data.Ipv4TableMapRoutePolicyId.IsNull() {
- return false
- }
- if !data.Ipv4TableMapFilter.IsNull() {
- return false
- }
- if !data.Ipv4TableMapFilterVariable.IsNull() {
- return false
- }
- if len(data.Ipv4Redistributes) > 0 {
- return false
- }
- if len(data.Ipv6AggregateAddresses) > 0 {
- return false
- }
- if len(data.Ipv6Networks) > 0 {
- return false
- }
- if !data.Ipv6EibgpMaximumPaths.IsNull() {
- return false
- }
- if !data.Ipv6EibgpMaximumPathsVariable.IsNull() {
- return false
- }
- if !data.Ipv6Originate.IsNull() {
- return false
- }
- if !data.Ipv6OriginateVariable.IsNull() {
- return false
- }
- if !data.Ipv6TableMapRoutePolicyId.IsNull() {
- return false
- }
- if !data.Ipv6TableMapFilter.IsNull() {
- return false
- }
- if !data.Ipv6TableMapFilterVariable.IsNull() {
- return false
- }
- if len(data.Ipv6Redistributes) > 0 {
- return false
- }
- if len(data.MplsInterfaces) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_routing_ospf_feature.go b/internal/provider/model_sdwan_transport_routing_ospf_feature.go
new file mode 100644
index 000000000..7e573488b
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_routing_ospf_feature.go
@@ -0,0 +1,1758 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportRoutingOSPF 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"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ ReferenceBandwidth types.Int64 `tfsdk:"reference_bandwidth"`
+ ReferenceBandwidthVariable types.String `tfsdk:"reference_bandwidth_variable"`
+ Rfc1583Compatible types.Bool `tfsdk:"rfc_1583_compatible"`
+ Rfc1583CompatibleVariable types.String `tfsdk:"rfc_1583_compatible_variable"`
+ DefaultInformationOriginate types.Bool `tfsdk:"default_information_originate"`
+ DefaultInformationOriginateAlways types.Bool `tfsdk:"default_information_originate_always"`
+ DefaultInformationOriginateAlwaysVariable types.String `tfsdk:"default_information_originate_always_variable"`
+ DefaultInformationOriginateMetric types.Int64 `tfsdk:"default_information_originate_metric"`
+ DefaultInformationOriginateMetricVariable types.String `tfsdk:"default_information_originate_metric_variable"`
+ DefaultInformationOriginateMetricType types.String `tfsdk:"default_information_originate_metric_type"`
+ DefaultInformationOriginateMetricTypeVariable types.String `tfsdk:"default_information_originate_metric_type_variable"`
+ DistanceExternal types.Int64 `tfsdk:"distance_external"`
+ DistanceExternalVariable types.String `tfsdk:"distance_external_variable"`
+ DistanceInterArea types.Int64 `tfsdk:"distance_inter_area"`
+ DistanceInterAreaVariable types.String `tfsdk:"distance_inter_area_variable"`
+ DistanceIntraArea types.Int64 `tfsdk:"distance_intra_area"`
+ DistanceIntraAreaVariable types.String `tfsdk:"distance_intra_area_variable"`
+ SpfCalculationDelay types.Int64 `tfsdk:"spf_calculation_delay"`
+ SpfCalculationDelayVariable types.String `tfsdk:"spf_calculation_delay_variable"`
+ SpfInitialHoldTime types.Int64 `tfsdk:"spf_initial_hold_time"`
+ SpfInitialHoldTimeVariable types.String `tfsdk:"spf_initial_hold_time_variable"`
+ SpfMaximumHoldTime types.Int64 `tfsdk:"spf_maximum_hold_time"`
+ SpfMaximumHoldTimeVariable types.String `tfsdk:"spf_maximum_hold_time_variable"`
+ Redistributes []TransportRoutingOSPFRedistributes `tfsdk:"redistributes"`
+ RouterLsas []TransportRoutingOSPFRouterLsas `tfsdk:"router_lsas"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Areas []TransportRoutingOSPFAreas `tfsdk:"areas"`
+}
+
+type TransportRoutingOSPFRedistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ NatDia types.Bool `tfsdk:"nat_dia"`
+ NatDiaVariable types.String `tfsdk:"nat_dia_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type TransportRoutingOSPFRouterLsas struct {
+ Type types.String `tfsdk:"type"`
+ Time types.Int64 `tfsdk:"time"`
+ TimeVariable types.String `tfsdk:"time_variable"`
+}
+
+type TransportRoutingOSPFAreas struct {
+ AreaNumber types.Int64 `tfsdk:"area_number"`
+ AreaNumberVariable types.String `tfsdk:"area_number_variable"`
+ AreaType types.String `tfsdk:"area_type"`
+ NoSummary types.Bool `tfsdk:"no_summary"`
+ NoSummaryVariable types.String `tfsdk:"no_summary_variable"`
+ Interfaces []TransportRoutingOSPFAreasInterfaces `tfsdk:"interfaces"`
+ Ranges []TransportRoutingOSPFAreasRanges `tfsdk:"ranges"`
+}
+
+type TransportRoutingOSPFAreasInterfaces struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ HelloInterval types.Int64 `tfsdk:"hello_interval"`
+ HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
+ DeadInterval types.Int64 `tfsdk:"dead_interval"`
+ DeadIntervalVariable types.String `tfsdk:"dead_interval_variable"`
+ LsaRetransmitInterval types.Int64 `tfsdk:"lsa_retransmit_interval"`
+ LsaRetransmitIntervalVariable types.String `tfsdk:"lsa_retransmit_interval_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ DesignatedRouterPriority types.Int64 `tfsdk:"designated_router_priority"`
+ DesignatedRouterPriorityVariable types.String `tfsdk:"designated_router_priority_variable"`
+ NetworkType types.String `tfsdk:"network_type"`
+ NetworkTypeVariable types.String `tfsdk:"network_type_variable"`
+ PassiveInterface types.Bool `tfsdk:"passive_interface"`
+ PassiveInterfaceVariable types.String `tfsdk:"passive_interface_variable"`
+ AuthenticationType types.String `tfsdk:"authentication_type"`
+ AuthenticationTypeVariable types.String `tfsdk:"authentication_type_variable"`
+ MessageDigestKeyId types.Int64 `tfsdk:"message_digest_key_id"`
+ MessageDigestKeyIdVariable types.String `tfsdk:"message_digest_key_id_variable"`
+ MessageDigestKey types.String `tfsdk:"message_digest_key"`
+ MessageDigestKeyVariable types.String `tfsdk:"message_digest_key_variable"`
+}
+type TransportRoutingOSPFAreasRanges struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NoAdvertise types.Bool `tfsdk:"no_advertise"`
+ NoAdvertiseVariable types.String `tfsdk:"no_advertise_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportRoutingOSPF) getModel() string {
+ return "transport_routing_ospf"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportRoutingOSPF) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/routing/ospf", 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 TransportRoutingOSPF) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString())
+ }
+ } else if data.ReferenceBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"referenceBandwidth.value", 100)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64())
+ }
+ }
+
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"rfc1583.optionType", "variable")
+ body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583CompatibleVariable.ValueString())
+ }
+ } else if data.Rfc1583Compatible.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"rfc1583.optionType", "default")
+ body, _ = sjson.Set(body, path+"rfc1583.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"rfc1583.optionType", "global")
+ body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583Compatible.ValueBool())
+ }
+ }
+ if data.DefaultInformationOriginate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"originate.optionType", "default")
+ body, _ = sjson.Set(body, path+"originate.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"originate.value", data.DefaultInformationOriginate.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"always.optionType", "variable")
+ body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString())
+ }
+ } else if data.DefaultInformationOriginateAlways.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"always.optionType", "default")
+ body, _ = sjson.Set(body, path+"always.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"always.optionType", "global")
+ body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlways.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metric.optionType", "variable")
+ body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetricVariable.ValueString())
+ }
+ } else if data.DefaultInformationOriginateMetric.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metric.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"metric.optionType", "global")
+ body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetric.ValueInt64())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metricType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString())
+ }
+ } else if data.DefaultInformationOriginateMetricType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"metricType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"metricType.optionType", "global")
+ body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricType.ValueString())
+ }
+ }
+
+ if !data.DistanceExternalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "variable")
+ body, _ = sjson.Set(body, path+"external.value", data.DistanceExternalVariable.ValueString())
+ }
+ } else if data.DistanceExternal.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "default")
+ body, _ = sjson.Set(body, path+"external.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"external.optionType", "global")
+ body, _ = sjson.Set(body, path+"external.value", data.DistanceExternal.ValueInt64())
+ }
+ }
+
+ if !data.DistanceInterAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interArea.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterAreaVariable.ValueString())
+ }
+ } else if data.DistanceInterArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interArea.optionType", "default")
+ body, _ = sjson.Set(body, path+"interArea.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"interArea.optionType", "global")
+ body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterArea.ValueInt64())
+ }
+ }
+
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intraArea.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraAreaVariable.ValueString())
+ }
+ } else if data.DistanceIntraArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"intraArea.optionType", "default")
+ body, _ = sjson.Set(body, path+"intraArea.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"intraArea.optionType", "global")
+ body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraArea.ValueInt64())
+ }
+ }
+
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"delay.optionType", "variable")
+ body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelayVariable.ValueString())
+ }
+ } else if data.SpfCalculationDelay.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"delay.optionType", "default")
+ body, _ = sjson.Set(body, path+"delay.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"delay.optionType", "global")
+ body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelay.ValueInt64())
+ }
+ }
+
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"initialHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfInitialHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"initialHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"initialHold.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"initialHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTime.ValueInt64())
+ }
+ }
+
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfMaximumHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"maxHold.value", 10000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"maxHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTime.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"redistribute", []interface{}{})
+ for _, item := range data.Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+
+ if !item.NatDiaVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dia.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDiaVariable.ValueString())
+ }
+ } else if item.NatDia.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dia.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "dia.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "dia.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDia.ValueBool())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"routerLsa", []interface{}{})
+ for _, item := range data.RouterLsas {
+ itemBody := ""
+ if !item.Type.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "adType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "adType.value", item.Type.ValueString())
+ }
+ }
+
+ if !item.TimeVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "time.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "time.value", item.TimeVariable.ValueString())
+ }
+ } else if !item.Time.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "time.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "time.value", item.Time.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"routerLsa.-1", itemBody)
+ }
+ }
+ if !data.RoutePolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"routePolicy.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"routePolicy.refId.value", data.RoutePolicyId.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"area", []interface{}{})
+ for _, item := range data.Areas {
+ itemBody := ""
+
+ if !item.AreaNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumberVariable.ValueString())
+ }
+ } else if !item.AreaNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumber.ValueInt64())
+ }
+ }
+ if item.AreaType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "aType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "aType.value", item.AreaType.ValueString())
+ }
+ }
+
+ if !item.NoSummaryVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummaryVariable.ValueString())
+ }
+ } else if item.NoSummary.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "noSummary.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummary.ValueBool())
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "interface", []interface{}{})
+ for _, childItem := range item.Interfaces {
+ itemChildBody := ""
+
+ if !childItem.NameVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.NameVariable.ValueString())
+ }
+ } else if !childItem.Name.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.Name.ValueString())
+ }
+ }
+
+ if !childItem.HelloIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString())
+ }
+ } else if childItem.HelloInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.DeadIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString())
+ }
+ } else if childItem.DeadInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.LsaRetransmitIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString())
+ }
+ } else if childItem.LsaRetransmitInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.DesignatedRouterPriorityVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriorityVariable.ValueString())
+ }
+ } else if childItem.DesignatedRouterPriority.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", 1)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriority.ValueInt64())
+ }
+ }
+
+ if !childItem.NetworkTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkTypeVariable.ValueString())
+ }
+ } else if childItem.NetworkType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", "broadcast")
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkType.ValueString())
+ }
+ }
+
+ if !childItem.PassiveInterfaceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString())
+ }
+ } else if childItem.PassiveInterface.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool())
+ }
+ }
+
+ if !childItem.AuthenticationTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationTypeVariable.ValueString())
+ }
+ } else if childItem.AuthenticationType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationType.ValueString())
+ }
+ }
+
+ if !childItem.MessageDigestKeyIdVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyIdVariable.ValueString())
+ }
+ } else if childItem.MessageDigestKeyId.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyId.ValueInt64())
+ }
+ }
+
+ if !childItem.MessageDigestKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKeyVariable.ValueString())
+ }
+ } else if childItem.MessageDigestKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKey.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "interface.-1", itemChildBody)
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "range", []interface{}{})
+ for _, childItem := range item.Ranges {
+ itemChildBody := ""
+
+ if !childItem.IpAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddressVariable.ValueString())
+ }
+ } else if !childItem.IpAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddress.ValueString())
+ }
+ }
+
+ if !childItem.SubnetMaskVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMaskVariable.ValueString())
+ }
+ } else if !childItem.SubnetMask.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMask.ValueString())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NoAdvertiseVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString())
+ }
+ } else if childItem.NoAdvertise.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "range.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"area.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportRoutingOSPF) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "rfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "rfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "originate.optionType"); t.Exists() {
+ va := res.Get(path + "originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "always.optionType"); t.Exists() {
+ va := res.Get(path + "always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "metric.optionType"); t.Exists() {
+ va := res.Get(path + "metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "metricType.optionType"); t.Exists() {
+ va := res.Get(path + "metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "interArea.optionType"); t.Exists() {
+ va := res.Get(path + "interArea.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "intraArea.optionType"); t.Exists() {
+ va := res.Get(path + "intraArea.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "delay.optionType"); t.Exists() {
+ va := res.Get(path + "delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "redistribute"); value.Exists() {
+ data.Redistributes = make([]TransportRoutingOSPFRedistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingOSPFRedistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.NatDia = types.BoolNull()
+ item.NatDiaVariable = types.StringNull()
+ if t := v.Get("dia.optionType"); t.Exists() {
+ va := v.Get("dia.value")
+ if t.String() == "variable" {
+ item.NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes = append(data.Redistributes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "routerLsa"); value.Exists() {
+ data.RouterLsas = make([]TransportRoutingOSPFRouterLsas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingOSPFRouterLsas{}
+ item.Type = types.StringNull()
+
+ if t := v.Get("adType.optionType"); t.Exists() {
+ va := v.Get("adType.value")
+ if t.String() == "global" {
+ item.Type = types.StringValue(va.String())
+ }
+ }
+ item.Time = types.Int64Null()
+ item.TimeVariable = types.StringNull()
+ if t := v.Get("time.optionType"); t.Exists() {
+ va := v.Get("time.value")
+ if t.String() == "variable" {
+ item.TimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Time = types.Int64Value(va.Int())
+ }
+ }
+ data.RouterLsas = append(data.RouterLsas, item)
+ return true
+ })
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "routePolicy.refId.optionType"); t.Exists() {
+ va := res.Get(path + "routePolicy.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "area"); value.Exists() {
+ data.Areas = make([]TransportRoutingOSPFAreas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingOSPFAreas{}
+ item.AreaNumber = types.Int64Null()
+ item.AreaNumberVariable = types.StringNull()
+ if t := v.Get("aNum.optionType"); t.Exists() {
+ va := v.Get("aNum.value")
+ if t.String() == "variable" {
+ item.AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ item.AreaType = types.StringNull()
+
+ if t := v.Get("aType.optionType"); t.Exists() {
+ va := v.Get("aType.value")
+ if t.String() == "global" {
+ item.AreaType = types.StringValue(va.String())
+ }
+ }
+ item.NoSummary = types.BoolNull()
+ item.NoSummaryVariable = types.StringNull()
+ if t := v.Get("noSummary.optionType"); t.Exists() {
+ va := v.Get("noSummary.value")
+ if t.String() == "variable" {
+ item.NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ if cValue := v.Get("interface"); cValue.Exists() {
+ item.Interfaces = make([]TransportRoutingOSPFAreasInterfaces, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingOSPFAreasInterfaces{}
+ cItem.Name = types.StringNull()
+ cItem.NameVariable = types.StringNull()
+ if t := cv.Get("name.optionType"); t.Exists() {
+ va := cv.Get("name.value")
+ if t.String() == "variable" {
+ cItem.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Name = types.StringValue(va.String())
+ }
+ }
+ cItem.HelloInterval = types.Int64Null()
+ cItem.HelloIntervalVariable = types.StringNull()
+ if t := cv.Get("helloInterval.optionType"); t.Exists() {
+ va := cv.Get("helloInterval.value")
+ if t.String() == "variable" {
+ cItem.HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DeadInterval = types.Int64Null()
+ cItem.DeadIntervalVariable = types.StringNull()
+ if t := cv.Get("deadInterval.optionType"); t.Exists() {
+ va := cv.Get("deadInterval.value")
+ if t.String() == "variable" {
+ cItem.DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.LsaRetransmitInterval = types.Int64Null()
+ cItem.LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cv.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cv.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ cItem.LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DesignatedRouterPriority = types.Int64Null()
+ cItem.DesignatedRouterPriorityVariable = types.StringNull()
+ if t := cv.Get("priority.optionType"); t.Exists() {
+ va := cv.Get("priority.value")
+ if t.String() == "variable" {
+ cItem.DesignatedRouterPriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DesignatedRouterPriority = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NetworkType = types.StringNull()
+ cItem.NetworkTypeVariable = types.StringNull()
+ if t := cv.Get("network.optionType"); t.Exists() {
+ va := cv.Get("network.value")
+ if t.String() == "variable" {
+ cItem.NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NetworkType = types.StringValue(va.String())
+ }
+ }
+ cItem.PassiveInterface = types.BoolNull()
+ cItem.PassiveInterfaceVariable = types.StringNull()
+ if t := cv.Get("passiveInterface.optionType"); t.Exists() {
+ va := cv.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ cItem.PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.AuthenticationType = types.StringNull()
+ cItem.AuthenticationTypeVariable = types.StringNull()
+ if t := cv.Get("type.optionType"); t.Exists() {
+ va := cv.Get("type.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ cItem.MessageDigestKeyId = types.Int64Null()
+ cItem.MessageDigestKeyIdVariable = types.StringNull()
+ if t := cv.Get("messageDigestKey.optionType"); t.Exists() {
+ va := cv.Get("messageDigestKey.value")
+ if t.String() == "variable" {
+ cItem.MessageDigestKeyIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.MessageDigestKeyId = types.Int64Value(va.Int())
+ }
+ }
+ item.Interfaces = append(item.Interfaces, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("range"); cValue.Exists() {
+ item.Ranges = make([]TransportRoutingOSPFAreasRanges, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingOSPFAreasRanges{}
+ cItem.IpAddress = types.StringNull()
+ cItem.IpAddressVariable = types.StringNull()
+ if t := cv.Get("address.ipAddress.optionType"); t.Exists() {
+ va := cv.Get("address.ipAddress.value")
+ if t.String() == "variable" {
+ cItem.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.IpAddress = types.StringValue(va.String())
+ }
+ }
+ cItem.SubnetMask = types.StringNull()
+ cItem.SubnetMaskVariable = types.StringNull()
+ if t := cv.Get("address.subnetMask.optionType"); t.Exists() {
+ va := cv.Get("address.subnetMask.value")
+ if t.String() == "variable" {
+ cItem.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NoAdvertise = types.BoolNull()
+ cItem.NoAdvertiseVariable = types.StringNull()
+ if t := cv.Get("noAdvertise.optionType"); t.Exists() {
+ va := cv.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ cItem.NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ item.Ranges = append(item.Ranges, cItem)
+ return true
+ })
+ }
+ data.Areas = append(data.Areas, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportRoutingOSPF) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "routerId.optionType"); t.Exists() {
+ va := res.Get(path + "routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "rfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "rfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "originate.optionType"); t.Exists() {
+ va := res.Get(path + "originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "always.optionType"); t.Exists() {
+ va := res.Get(path + "always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "metric.optionType"); t.Exists() {
+ va := res.Get(path + "metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "metricType.optionType"); t.Exists() {
+ va := res.Get(path + "metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "external.optionType"); t.Exists() {
+ va := res.Get(path + "external.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "interArea.optionType"); t.Exists() {
+ va := res.Get(path + "interArea.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "intraArea.optionType"); t.Exists() {
+ va := res.Get(path + "intraArea.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "delay.optionType"); t.Exists() {
+ va := res.Get(path + "delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Redistributes {
+ keys := [...]string{"protocol"}
+ keyValues := [...]string{data.Redistributes[i].Protocol.ValueString()}
+ keyValuesVariables := [...]string{data.Redistributes[i].ProtocolVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Redistributes[i].Protocol = types.StringNull()
+ data.Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes[i].NatDia = types.BoolNull()
+ data.Redistributes[i].NatDiaVariable = types.StringNull()
+ if t := r.Get("dia.optionType"); t.Exists() {
+ va := r.Get("dia.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ data.Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.RouterLsas {
+ keys := [...]string{"adType"}
+ keyValues := [...]string{data.RouterLsas[i].Type.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "routerLsa").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.RouterLsas[i].Type = types.StringNull()
+
+ if t := r.Get("adType.optionType"); t.Exists() {
+ va := r.Get("adType.value")
+ if t.String() == "global" {
+ data.RouterLsas[i].Type = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsas[i].Time = types.Int64Null()
+ data.RouterLsas[i].TimeVariable = types.StringNull()
+ if t := r.Get("time.optionType"); t.Exists() {
+ va := r.Get("time.value")
+ if t.String() == "variable" {
+ data.RouterLsas[i].TimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsas[i].Time = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "routePolicy.refId.optionType"); t.Exists() {
+ va := res.Get(path + "routePolicy.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Areas {
+ keys := [...]string{"aNum"}
+ keyValues := [...]string{strconv.FormatInt(data.Areas[i].AreaNumber.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Areas[i].AreaNumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "area").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].AreaNumber = types.Int64Null()
+ data.Areas[i].AreaNumberVariable = types.StringNull()
+ if t := r.Get("aNum.optionType"); t.Exists() {
+ va := r.Get("aNum.value")
+ if t.String() == "variable" {
+ data.Areas[i].AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].AreaType = types.StringNull()
+
+ if t := r.Get("aType.optionType"); t.Exists() {
+ va := r.Get("aType.value")
+ if t.String() == "global" {
+ data.Areas[i].AreaType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].NoSummary = types.BoolNull()
+ data.Areas[i].NoSummaryVariable = types.StringNull()
+ if t := r.Get("noSummary.optionType"); t.Exists() {
+ va := r.Get("noSummary.value")
+ if t.String() == "variable" {
+ data.Areas[i].NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ for ci := range data.Areas[i].Interfaces {
+ keys := [...]string{"name"}
+ keyValues := [...]string{data.Areas[i].Interfaces[ci].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Interfaces[ci].NameVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("interface").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Interfaces[ci].Name = types.StringNull()
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringNull()
+ if t := cr.Get("name.optionType"); t.Exists() {
+ va := cr.Get("name.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Name = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringNull()
+ if t := cr.Get("helloInterval.optionType"); t.Exists() {
+ va := cr.Get("helloInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringNull()
+ if t := cr.Get("deadInterval.optionType"); t.Exists() {
+ va := cr.Get("deadInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cr.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cr.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Null()
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriority = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriorityVariable = types.StringNull()
+ if t := cr.Get("priority.optionType"); t.Exists() {
+ va := cr.Get("priority.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriorityVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DesignatedRouterPriority = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringNull()
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringNull()
+ if t := cr.Get("network.optionType"); t.Exists() {
+ va := cr.Get("network.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolNull()
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringNull()
+ if t := cr.Get("passiveInterface.optionType"); t.Exists() {
+ va := cr.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringNull()
+ data.Areas[i].Interfaces[ci].AuthenticationTypeVariable = types.StringNull()
+ if t := cr.Get("type.optionType"); t.Exists() {
+ va := cr.Get("type.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].MessageDigestKeyId = types.Int64Null()
+ data.Areas[i].Interfaces[ci].MessageDigestKeyIdVariable = types.StringNull()
+ if t := cr.Get("messageDigestKey.optionType"); t.Exists() {
+ va := cr.Get("messageDigestKey.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].MessageDigestKeyIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].MessageDigestKeyId = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for ci := range data.Areas[i].Ranges {
+ keys := [...]string{"address.ipAddress"}
+ keyValues := [...]string{data.Areas[i].Ranges[ci].IpAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Ranges[ci].IpAddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("range").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Ranges[ci].IpAddress = types.StringNull()
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringNull()
+ if t := cr.Get("address.ipAddress.optionType"); t.Exists() {
+ va := cr.Get("address.ipAddress.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringNull()
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringNull()
+ if t := cr.Get("address.subnetMask.optionType"); t.Exists() {
+ va := cr.Get("address.subnetMask.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].Cost = types.Int64Null()
+ data.Areas[i].Ranges[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolNull()
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringNull()
+ if t := cr.Get("noAdvertise.optionType"); t.Exists() {
+ va := cr.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportRoutingOSPF) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidth.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.Rfc1583Compatible.IsNull() {
+ return false
+ }
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlways.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetric.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricType.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceExternal.IsNull() {
+ return false
+ }
+ if !data.DistanceExternalVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceInterArea.IsNull() {
+ return false
+ }
+ if !data.DistanceInterAreaVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraArea.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelay.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ return false
+ }
+ if len(data.Redistributes) > 0 {
+ return false
+ }
+ if len(data.RouterLsas) > 0 {
+ return false
+ }
+ if !data.RoutePolicyId.IsNull() {
+ return false
+ }
+ if len(data.Areas) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_routing_ospfv3_ipv4_feature.go b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv4_feature.go
new file mode 100644
index 000000000..01c296594
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv4_feature.go
@@ -0,0 +1,1764 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportRoutingOSPFv3IPv4 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"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ Distance types.Int64 `tfsdk:"distance"`
+ DistanceVariable types.String `tfsdk:"distance_variable"`
+ DistanceExternal types.Int64 `tfsdk:"distance_external"`
+ DistanceExternalVariable types.String `tfsdk:"distance_external_variable"`
+ DistanceInterArea types.Int64 `tfsdk:"distance_inter_area"`
+ DistanceInterAreaVariable types.String `tfsdk:"distance_inter_area_variable"`
+ DistanceIntraArea types.Int64 `tfsdk:"distance_intra_area"`
+ DistanceIntraAreaVariable types.String `tfsdk:"distance_intra_area_variable"`
+ ReferenceBandwidth types.Int64 `tfsdk:"reference_bandwidth"`
+ ReferenceBandwidthVariable types.String `tfsdk:"reference_bandwidth_variable"`
+ Rfc1583Compatible types.Bool `tfsdk:"rfc_1583_compatible"`
+ Rfc1583CompatibleVariable types.String `tfsdk:"rfc_1583_compatible_variable"`
+ DefaultInformationOriginate types.Bool `tfsdk:"default_information_originate"`
+ DefaultInformationOriginateAlways types.Bool `tfsdk:"default_information_originate_always"`
+ DefaultInformationOriginateAlwaysVariable types.String `tfsdk:"default_information_originate_always_variable"`
+ DefaultInformationOriginateMetric types.Int64 `tfsdk:"default_information_originate_metric"`
+ DefaultInformationOriginateMetricVariable types.String `tfsdk:"default_information_originate_metric_variable"`
+ DefaultInformationOriginateMetricType types.String `tfsdk:"default_information_originate_metric_type"`
+ DefaultInformationOriginateMetricTypeVariable types.String `tfsdk:"default_information_originate_metric_type_variable"`
+ SpfCalculationDelay types.Int64 `tfsdk:"spf_calculation_delay"`
+ SpfCalculationDelayVariable types.String `tfsdk:"spf_calculation_delay_variable"`
+ SpfInitialHoldTime types.Int64 `tfsdk:"spf_initial_hold_time"`
+ SpfInitialHoldTimeVariable types.String `tfsdk:"spf_initial_hold_time_variable"`
+ SpfMaximumHoldTime types.Int64 `tfsdk:"spf_maximum_hold_time"`
+ SpfMaximumHoldTimeVariable types.String `tfsdk:"spf_maximum_hold_time_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Filter types.Bool `tfsdk:"filter"`
+ FilterVariable types.String `tfsdk:"filter_variable"`
+ Redistributes []TransportRoutingOSPFv3IPv4Redistributes `tfsdk:"redistributes"`
+ RouterLsaAction types.String `tfsdk:"router_lsa_action"`
+ RouterLsaOnStartupTime types.Int64 `tfsdk:"router_lsa_on_startup_time"`
+ RouterLsaOnStartupTimeVariable types.String `tfsdk:"router_lsa_on_startup_time_variable"`
+ Areas []TransportRoutingOSPFv3IPv4Areas `tfsdk:"areas"`
+}
+
+type TransportRoutingOSPFv3IPv4Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ NatDia types.Bool `tfsdk:"nat_dia"`
+ NatDiaVariable types.String `tfsdk:"nat_dia_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type TransportRoutingOSPFv3IPv4Areas struct {
+ AreaNumber types.Int64 `tfsdk:"area_number"`
+ AreaNumberVariable types.String `tfsdk:"area_number_variable"`
+ AreaType types.String `tfsdk:"area_type"`
+ NoSummary types.Bool `tfsdk:"no_summary"`
+ NoSummaryVariable types.String `tfsdk:"no_summary_variable"`
+ AlwaysTranslate types.Bool `tfsdk:"always_translate"`
+ AlwaysTranslateVariable types.String `tfsdk:"always_translate_variable"`
+ Interfaces []TransportRoutingOSPFv3IPv4AreasInterfaces `tfsdk:"interfaces"`
+ Ranges []TransportRoutingOSPFv3IPv4AreasRanges `tfsdk:"ranges"`
+}
+
+type TransportRoutingOSPFv3IPv4AreasInterfaces struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ HelloInterval types.Int64 `tfsdk:"hello_interval"`
+ HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
+ DeadInterval types.Int64 `tfsdk:"dead_interval"`
+ DeadIntervalVariable types.String `tfsdk:"dead_interval_variable"`
+ LsaRetransmitInterval types.Int64 `tfsdk:"lsa_retransmit_interval"`
+ LsaRetransmitIntervalVariable types.String `tfsdk:"lsa_retransmit_interval_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NetworkType types.String `tfsdk:"network_type"`
+ NetworkTypeVariable types.String `tfsdk:"network_type_variable"`
+ PassiveInterface types.Bool `tfsdk:"passive_interface"`
+ PassiveInterfaceVariable types.String `tfsdk:"passive_interface_variable"`
+ AuthenticationType types.String `tfsdk:"authentication_type"`
+ AuthenticationSpi types.Int64 `tfsdk:"authentication_spi"`
+ AuthenticationSpiVariable types.String `tfsdk:"authentication_spi_variable"`
+ AuthenticationKey types.String `tfsdk:"authentication_key"`
+ AuthenticationKeyVariable types.String `tfsdk:"authentication_key_variable"`
+}
+type TransportRoutingOSPFv3IPv4AreasRanges struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NoAdvertise types.Bool `tfsdk:"no_advertise"`
+ NoAdvertiseVariable types.String `tfsdk:"no_advertise_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportRoutingOSPFv3IPv4) getModel() string {
+ return "transport_routing_ospfv3_ipv4"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportRoutingOSPFv3IPv4) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/routing/ospfv3/ipv4", 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 TransportRoutingOSPFv3IPv4) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.DistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString())
+ }
+ } else if data.Distance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.distance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64())
+ }
+ }
+
+ if !data.DistanceExternalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString())
+ }
+ } else if data.DistanceExternal.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64())
+ }
+ }
+
+ if !data.DistanceInterAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString())
+ }
+ } else if data.DistanceInterArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64())
+ }
+ }
+
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString())
+ }
+ } else if data.DistanceIntraArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64())
+ }
+ }
+
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString())
+ }
+ } else if data.ReferenceBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64())
+ }
+ }
+
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString())
+ }
+ } else if data.Rfc1583Compatible.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool())
+ }
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateAlways.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetric.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetricType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString())
+ }
+ }
+
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString())
+ }
+ } else if data.SpfCalculationDelay.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64())
+ }
+ }
+
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfInitialHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64())
+ }
+ }
+
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfMaximumHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64())
+ }
+ }
+ if !data.RoutePolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.FilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString())
+ }
+ } else if data.Filter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"redistribute", []interface{}{})
+ for _, item := range data.Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+
+ if !item.NatDiaVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDiaVariable.ValueString())
+ }
+ } else if item.NatDia.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "natDia.value", true)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDia.ValueBool())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody)
+ }
+ }
+ if !data.RouterLsaAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString())
+ }
+ }
+
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString())
+ }
+ } else if !data.RouterLsaOnStartupTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64())
+ }
+ }
+ if true {
+
+ for _, item := range data.Areas {
+ itemBody := ""
+
+ if !item.AreaNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString())
+ }
+ } else if !item.AreaNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64())
+ }
+ }
+ if !item.AreaType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString())
+ }
+ }
+
+ if !item.NoSummaryVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString())
+ }
+ } else if !item.NoSummary.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool())
+ }
+ }
+
+ if !item.AlwaysTranslateVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString())
+ }
+ } else if !item.AlwaysTranslate.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Interfaces {
+ itemChildBody := ""
+
+ if !childItem.NameVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString())
+ }
+ } else if !childItem.Name.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString())
+ }
+ }
+
+ if !childItem.HelloIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString())
+ }
+ } else if childItem.HelloInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.DeadIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString())
+ }
+ } else if childItem.DeadInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.LsaRetransmitIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString())
+ }
+ } else if childItem.LsaRetransmitInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NetworkTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString())
+ }
+ } else if childItem.NetworkType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString())
+ }
+ }
+
+ if !childItem.PassiveInterfaceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString())
+ }
+ } else if childItem.PassiveInterface.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool())
+ }
+ }
+ if !childItem.AuthenticationType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString())
+ }
+ }
+
+ if !childItem.AuthenticationSpiVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationSpi.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64())
+ }
+ }
+
+ if !childItem.AuthenticationKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody)
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{})
+ for _, childItem := range item.Ranges {
+ itemChildBody := ""
+
+ if !childItem.IpAddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddressVariable.ValueString())
+ }
+ } else if !childItem.IpAddress.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddress.ValueString())
+ }
+ }
+
+ if !childItem.SubnetMaskVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMaskVariable.ValueString())
+ }
+ } else if !childItem.SubnetMask.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMask.ValueString())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NoAdvertiseVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString())
+ }
+ } else if childItem.NoAdvertise.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"area.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportRoutingOSPFv3IPv4) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "redistribute"); value.Exists() {
+ data.Redistributes = make([]TransportRoutingOSPFv3IPv4Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingOSPFv3IPv4Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.NatDia = types.BoolNull()
+ item.NatDiaVariable = types.StringNull()
+ if t := v.Get("natDia.optionType"); t.Exists() {
+ va := v.Get("natDia.value")
+ if t.String() == "variable" {
+ item.NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes = append(data.Redistributes, item)
+ return true
+ })
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "area"); value.Exists() {
+ data.Areas = make([]TransportRoutingOSPFv3IPv4Areas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingOSPFv3IPv4Areas{}
+ item.AreaNumber = types.Int64Null()
+ item.AreaNumberVariable = types.StringNull()
+ if t := v.Get("areaNum.optionType"); t.Exists() {
+ va := v.Get("areaNum.value")
+ if t.String() == "variable" {
+ item.AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ item.AreaType = types.StringNull()
+
+ if t := v.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ item.AreaType = types.StringValue(va.String())
+ }
+ }
+ item.NoSummary = types.BoolNull()
+ item.NoSummaryVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ item.NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ item.AlwaysTranslate = types.BoolNull()
+ item.AlwaysTranslateVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ item.AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ if cValue := v.Get("interfaces"); cValue.Exists() {
+ item.Interfaces = make([]TransportRoutingOSPFv3IPv4AreasInterfaces, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingOSPFv3IPv4AreasInterfaces{}
+ cItem.Name = types.StringNull()
+ cItem.NameVariable = types.StringNull()
+ if t := cv.Get("ifName.optionType"); t.Exists() {
+ va := cv.Get("ifName.value")
+ if t.String() == "variable" {
+ cItem.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Name = types.StringValue(va.String())
+ }
+ }
+ cItem.HelloInterval = types.Int64Null()
+ cItem.HelloIntervalVariable = types.StringNull()
+ if t := cv.Get("helloInterval.optionType"); t.Exists() {
+ va := cv.Get("helloInterval.value")
+ if t.String() == "variable" {
+ cItem.HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DeadInterval = types.Int64Null()
+ cItem.DeadIntervalVariable = types.StringNull()
+ if t := cv.Get("deadInterval.optionType"); t.Exists() {
+ va := cv.Get("deadInterval.value")
+ if t.String() == "variable" {
+ cItem.DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.LsaRetransmitInterval = types.Int64Null()
+ cItem.LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cv.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cv.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ cItem.LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NetworkType = types.StringNull()
+ cItem.NetworkTypeVariable = types.StringNull()
+ if t := cv.Get("networkType.optionType"); t.Exists() {
+ va := cv.Get("networkType.value")
+ if t.String() == "variable" {
+ cItem.NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NetworkType = types.StringValue(va.String())
+ }
+ }
+ cItem.PassiveInterface = types.BoolNull()
+ cItem.PassiveInterfaceVariable = types.StringNull()
+ if t := cv.Get("passiveInterface.optionType"); t.Exists() {
+ va := cv.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ cItem.PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.AuthenticationType = types.StringNull()
+
+ if t := cv.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ cItem.AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ cItem.AuthenticationSpi = types.Int64Null()
+ cItem.AuthenticationSpiVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ cItem.AuthenticationKey = types.StringNull()
+ cItem.AuthenticationKeyVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ item.Interfaces = append(item.Interfaces, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("ranges"); cValue.Exists() {
+ item.Ranges = make([]TransportRoutingOSPFv3IPv4AreasRanges, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingOSPFv3IPv4AreasRanges{}
+ cItem.IpAddress = types.StringNull()
+ cItem.IpAddressVariable = types.StringNull()
+ if t := cv.Get("network.address.optionType"); t.Exists() {
+ va := cv.Get("network.address.value")
+ if t.String() == "variable" {
+ cItem.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.IpAddress = types.StringValue(va.String())
+ }
+ }
+ cItem.SubnetMask = types.StringNull()
+ cItem.SubnetMaskVariable = types.StringNull()
+ if t := cv.Get("network.mask.optionType"); t.Exists() {
+ va := cv.Get("network.mask.value")
+ if t.String() == "variable" {
+ cItem.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NoAdvertise = types.BoolNull()
+ cItem.NoAdvertiseVariable = types.StringNull()
+ if t := cv.Get("noAdvertise.optionType"); t.Exists() {
+ va := cv.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ cItem.NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ item.Ranges = append(item.Ranges, cItem)
+ return true
+ })
+ }
+ data.Areas = append(data.Areas, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportRoutingOSPFv3IPv4) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Redistributes {
+ keys := [...]string{"protocol"}
+ keyValues := [...]string{data.Redistributes[i].Protocol.ValueString()}
+ keyValuesVariables := [...]string{data.Redistributes[i].ProtocolVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Redistributes[i].Protocol = types.StringNull()
+ data.Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes[i].NatDia = types.BoolNull()
+ data.Redistributes[i].NatDiaVariable = types.StringNull()
+ if t := r.Get("natDia.optionType"); t.Exists() {
+ va := r.Get("natDia.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].NatDiaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].NatDia = types.BoolValue(va.Bool())
+ }
+ }
+ data.Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Areas {
+ keys := [...]string{"areaNum"}
+ keyValues := [...]string{strconv.FormatInt(data.Areas[i].AreaNumber.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Areas[i].AreaNumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "area").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].AreaNumber = types.Int64Null()
+ data.Areas[i].AreaNumberVariable = types.StringNull()
+ if t := r.Get("areaNum.optionType"); t.Exists() {
+ va := r.Get("areaNum.value")
+ if t.String() == "variable" {
+ data.Areas[i].AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].AreaType = types.StringNull()
+
+ if t := r.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ data.Areas[i].AreaType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].NoSummary = types.BoolNull()
+ data.Areas[i].NoSummaryVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ data.Areas[i].NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].AlwaysTranslate = types.BoolNull()
+ data.Areas[i].AlwaysTranslateVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ data.Areas[i].AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ for ci := range data.Areas[i].Interfaces {
+ keys := [...]string{"ifName"}
+ keyValues := [...]string{data.Areas[i].Interfaces[ci].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Interfaces[ci].NameVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("interfaces").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Interfaces[ci].Name = types.StringNull()
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringNull()
+ if t := cr.Get("ifName.optionType"); t.Exists() {
+ va := cr.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Name = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringNull()
+ if t := cr.Get("helloInterval.optionType"); t.Exists() {
+ va := cr.Get("helloInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringNull()
+ if t := cr.Get("deadInterval.optionType"); t.Exists() {
+ va := cr.Get("deadInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cr.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cr.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Null()
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringNull()
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringNull()
+ if t := cr.Get("networkType.optionType"); t.Exists() {
+ va := cr.Get("networkType.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolNull()
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringNull()
+ if t := cr.Get("passiveInterface.optionType"); t.Exists() {
+ va := cr.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringNull()
+
+ if t := cr.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Null()
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringNull()
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ }
+ for ci := range data.Areas[i].Ranges {
+ keys := [...]string{"network.address"}
+ keyValues := [...]string{data.Areas[i].Ranges[ci].IpAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Ranges[ci].IpAddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ranges").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Ranges[ci].IpAddress = types.StringNull()
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringNull()
+ if t := cr.Get("network.address.optionType"); t.Exists() {
+ va := cr.Get("network.address.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringNull()
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringNull()
+ if t := cr.Get("network.mask.optionType"); t.Exists() {
+ va := cr.Get("network.mask.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].Cost = types.Int64Null()
+ data.Areas[i].Ranges[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolNull()
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringNull()
+ if t := cr.Get("noAdvertise.optionType"); t.Exists() {
+ va := cr.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportRoutingOSPFv3IPv4) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.Distance.IsNull() {
+ return false
+ }
+ if !data.DistanceVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceExternal.IsNull() {
+ return false
+ }
+ if !data.DistanceExternalVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceInterArea.IsNull() {
+ return false
+ }
+ if !data.DistanceInterAreaVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraArea.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidth.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.Rfc1583Compatible.IsNull() {
+ return false
+ }
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlways.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetric.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricType.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelay.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.RoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Filter.IsNull() {
+ return false
+ }
+ if !data.FilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Redistributes) > 0 {
+ return false
+ }
+ if !data.RouterLsaAction.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTime.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ return false
+ }
+ if len(data.Areas) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_routing_ospfv3_ipv6_feature.go b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv6_feature.go
new file mode 100644
index 000000000..5720887e9
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv6_feature.go
@@ -0,0 +1,1691 @@
+// 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"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportRoutingOSPFv3IPv6 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"`
+ RouterId types.String `tfsdk:"router_id"`
+ RouterIdVariable types.String `tfsdk:"router_id_variable"`
+ Distance types.Int64 `tfsdk:"distance"`
+ DistanceVariable types.String `tfsdk:"distance_variable"`
+ DistanceExternal types.Int64 `tfsdk:"distance_external"`
+ DistanceExternalVariable types.String `tfsdk:"distance_external_variable"`
+ DistanceInterArea types.Int64 `tfsdk:"distance_inter_area"`
+ DistanceInterAreaVariable types.String `tfsdk:"distance_inter_area_variable"`
+ DistanceIntraArea types.Int64 `tfsdk:"distance_intra_area"`
+ DistanceIntraAreaVariable types.String `tfsdk:"distance_intra_area_variable"`
+ ReferenceBandwidth types.Int64 `tfsdk:"reference_bandwidth"`
+ ReferenceBandwidthVariable types.String `tfsdk:"reference_bandwidth_variable"`
+ Rfc1583Compatible types.Bool `tfsdk:"rfc_1583_compatible"`
+ Rfc1583CompatibleVariable types.String `tfsdk:"rfc_1583_compatible_variable"`
+ DefaultInformationOriginate types.Bool `tfsdk:"default_information_originate"`
+ DefaultInformationOriginateAlways types.Bool `tfsdk:"default_information_originate_always"`
+ DefaultInformationOriginateAlwaysVariable types.String `tfsdk:"default_information_originate_always_variable"`
+ DefaultInformationOriginateMetric types.Int64 `tfsdk:"default_information_originate_metric"`
+ DefaultInformationOriginateMetricVariable types.String `tfsdk:"default_information_originate_metric_variable"`
+ DefaultInformationOriginateMetricType types.String `tfsdk:"default_information_originate_metric_type"`
+ DefaultInformationOriginateMetricTypeVariable types.String `tfsdk:"default_information_originate_metric_type_variable"`
+ SpfCalculationDelay types.Int64 `tfsdk:"spf_calculation_delay"`
+ SpfCalculationDelayVariable types.String `tfsdk:"spf_calculation_delay_variable"`
+ SpfInitialHoldTime types.Int64 `tfsdk:"spf_initial_hold_time"`
+ SpfInitialHoldTimeVariable types.String `tfsdk:"spf_initial_hold_time_variable"`
+ SpfMaximumHoldTime types.Int64 `tfsdk:"spf_maximum_hold_time"`
+ SpfMaximumHoldTimeVariable types.String `tfsdk:"spf_maximum_hold_time_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+ Filter types.Bool `tfsdk:"filter"`
+ FilterVariable types.String `tfsdk:"filter_variable"`
+ Redistributes []TransportRoutingOSPFv3IPv6Redistributes `tfsdk:"redistributes"`
+ RouterLsaAction types.String `tfsdk:"router_lsa_action"`
+ RouterLsaOnStartupTime types.Int64 `tfsdk:"router_lsa_on_startup_time"`
+ RouterLsaOnStartupTimeVariable types.String `tfsdk:"router_lsa_on_startup_time_variable"`
+ Areas []TransportRoutingOSPFv3IPv6Areas `tfsdk:"areas"`
+}
+
+type TransportRoutingOSPFv3IPv6Redistributes struct {
+ Protocol types.String `tfsdk:"protocol"`
+ ProtocolVariable types.String `tfsdk:"protocol_variable"`
+ RoutePolicyId types.String `tfsdk:"route_policy_id"`
+}
+
+type TransportRoutingOSPFv3IPv6Areas struct {
+ AreaNumber types.Int64 `tfsdk:"area_number"`
+ AreaNumberVariable types.String `tfsdk:"area_number_variable"`
+ AreaType types.String `tfsdk:"area_type"`
+ NoSummary types.Bool `tfsdk:"no_summary"`
+ NoSummaryVariable types.String `tfsdk:"no_summary_variable"`
+ AlwaysTranslate types.Bool `tfsdk:"always_translate"`
+ AlwaysTranslateVariable types.String `tfsdk:"always_translate_variable"`
+ Interfaces []TransportRoutingOSPFv3IPv6AreasInterfaces `tfsdk:"interfaces"`
+ Ranges []TransportRoutingOSPFv3IPv6AreasRanges `tfsdk:"ranges"`
+}
+
+type TransportRoutingOSPFv3IPv6AreasInterfaces struct {
+ Name types.String `tfsdk:"name"`
+ NameVariable types.String `tfsdk:"name_variable"`
+ HelloInterval types.Int64 `tfsdk:"hello_interval"`
+ HelloIntervalVariable types.String `tfsdk:"hello_interval_variable"`
+ DeadInterval types.Int64 `tfsdk:"dead_interval"`
+ DeadIntervalVariable types.String `tfsdk:"dead_interval_variable"`
+ LsaRetransmitInterval types.Int64 `tfsdk:"lsa_retransmit_interval"`
+ LsaRetransmitIntervalVariable types.String `tfsdk:"lsa_retransmit_interval_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NetworkType types.String `tfsdk:"network_type"`
+ NetworkTypeVariable types.String `tfsdk:"network_type_variable"`
+ PassiveInterface types.Bool `tfsdk:"passive_interface"`
+ PassiveInterfaceVariable types.String `tfsdk:"passive_interface_variable"`
+ AuthenticationType types.String `tfsdk:"authentication_type"`
+ AuthenticationSpi types.Int64 `tfsdk:"authentication_spi"`
+ AuthenticationSpiVariable types.String `tfsdk:"authentication_spi_variable"`
+ AuthenticationKey types.String `tfsdk:"authentication_key"`
+ AuthenticationKeyVariable types.String `tfsdk:"authentication_key_variable"`
+}
+type TransportRoutingOSPFv3IPv6AreasRanges struct {
+ Prefix types.String `tfsdk:"prefix"`
+ PrefixVariable types.String `tfsdk:"prefix_variable"`
+ Cost types.Int64 `tfsdk:"cost"`
+ CostVariable types.String `tfsdk:"cost_variable"`
+ NoAdvertise types.Bool `tfsdk:"no_advertise"`
+ NoAdvertiseVariable types.String `tfsdk:"no_advertise_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportRoutingOSPFv3IPv6) getModel() string {
+ return "transport_routing_ospfv3_ipv6"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportRoutingOSPFv3IPv6) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/routing/ospfv3/ipv6", 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 TransportRoutingOSPFv3IPv6) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.RouterIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString())
+ }
+ } else if data.RouterId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString())
+ }
+ }
+
+ if !data.DistanceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString())
+ }
+ } else if data.Distance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.distance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.distance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64())
+ }
+ }
+
+ if !data.DistanceExternalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString())
+ }
+ } else if data.DistanceExternal.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64())
+ }
+ }
+
+ if !data.DistanceInterAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString())
+ }
+ } else if data.DistanceInterArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64())
+ }
+ }
+
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString())
+ }
+ } else if data.DistanceIntraArea.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64())
+ }
+ }
+
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString())
+ }
+ } else if data.ReferenceBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64())
+ }
+ }
+
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString())
+ }
+ } else if data.Rfc1583Compatible.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool())
+ }
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateAlways.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetric.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64())
+ }
+ }
+
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString())
+ }
+ } else if !data.DefaultInformationOriginateMetricType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString())
+ }
+ }
+
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString())
+ }
+ } else if data.SpfCalculationDelay.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64())
+ }
+ }
+
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfInitialHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64())
+ }
+ }
+
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString())
+ }
+ } else if data.SpfMaximumHoldTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64())
+ }
+ }
+ if !data.RoutePolicyId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString())
+ }
+ }
+
+ if !data.FilterVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString())
+ }
+ } else if data.Filter.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"redistribute", []interface{}{})
+ for _, item := range data.Redistributes {
+ itemBody := ""
+
+ if !item.ProtocolVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString())
+ }
+ } else if !item.Protocol.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString())
+ }
+ }
+ if !item.RoutePolicyId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody)
+ }
+ }
+ if !data.RouterLsaAction.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString())
+ }
+ }
+
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString())
+ }
+ } else if !data.RouterLsaOnStartupTime.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global")
+ body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64())
+ }
+ }
+ if true {
+
+ for _, item := range data.Areas {
+ itemBody := ""
+
+ if !item.AreaNumberVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString())
+ }
+ } else if !item.AreaNumber.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64())
+ }
+ }
+ if !item.AreaType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString())
+ }
+ }
+
+ if !item.NoSummaryVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString())
+ }
+ } else if !item.NoSummary.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool())
+ }
+ }
+
+ if !item.AlwaysTranslateVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString())
+ }
+ } else if !item.AlwaysTranslate.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.Interfaces {
+ itemChildBody := ""
+
+ if !childItem.NameVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString())
+ }
+ } else if !childItem.Name.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString())
+ }
+ }
+
+ if !childItem.HelloIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString())
+ }
+ } else if childItem.HelloInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.DeadIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString())
+ }
+ } else if childItem.DeadInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.LsaRetransmitIntervalVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString())
+ }
+ } else if childItem.LsaRetransmitInterval.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NetworkTypeVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString())
+ }
+ } else if childItem.NetworkType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString())
+ }
+ }
+
+ if !childItem.PassiveInterfaceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString())
+ }
+ } else if childItem.PassiveInterface.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool())
+ }
+ }
+ if !childItem.AuthenticationType.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString())
+ }
+ }
+
+ if !childItem.AuthenticationSpiVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationSpi.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64())
+ }
+ }
+
+ if !childItem.AuthenticationKeyVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString())
+ }
+ } else if !childItem.AuthenticationKey.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody)
+ }
+ }
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{})
+ for _, childItem := range item.Ranges {
+ itemChildBody := ""
+
+ if !childItem.PrefixVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.PrefixVariable.ValueString())
+ }
+ } else if !childItem.Prefix.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.Prefix.ValueString())
+ }
+ }
+
+ if !childItem.CostVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString())
+ }
+ } else if childItem.Cost.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64())
+ }
+ }
+
+ if !childItem.NoAdvertiseVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString())
+ }
+ } else if childItem.NoAdvertise.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"area.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportRoutingOSPFv3IPv6) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "redistribute"); value.Exists() {
+ data.Redistributes = make([]TransportRoutingOSPFv3IPv6Redistributes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingOSPFv3IPv6Redistributes{}
+ item.Protocol = types.StringNull()
+ item.ProtocolVariable = types.StringNull()
+ if t := v.Get("protocol.optionType"); t.Exists() {
+ va := v.Get("protocol.value")
+ if t.String() == "variable" {
+ item.ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Protocol = types.StringValue(va.String())
+ }
+ }
+ item.RoutePolicyId = types.StringNull()
+
+ if t := v.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := v.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ item.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes = append(data.Redistributes, item)
+ return true
+ })
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "area"); value.Exists() {
+ data.Areas = make([]TransportRoutingOSPFv3IPv6Areas, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportRoutingOSPFv3IPv6Areas{}
+ item.AreaNumber = types.Int64Null()
+ item.AreaNumberVariable = types.StringNull()
+ if t := v.Get("areaNum.optionType"); t.Exists() {
+ va := v.Get("areaNum.value")
+ if t.String() == "variable" {
+ item.AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ item.AreaType = types.StringNull()
+
+ if t := v.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ item.AreaType = types.StringValue(va.String())
+ }
+ }
+ item.NoSummary = types.BoolNull()
+ item.NoSummaryVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ item.NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ item.AlwaysTranslate = types.BoolNull()
+ item.AlwaysTranslateVariable = types.StringNull()
+ if t := v.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := v.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ item.AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ if cValue := v.Get("interfaces"); cValue.Exists() {
+ item.Interfaces = make([]TransportRoutingOSPFv3IPv6AreasInterfaces, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingOSPFv3IPv6AreasInterfaces{}
+ cItem.Name = types.StringNull()
+ cItem.NameVariable = types.StringNull()
+ if t := cv.Get("ifName.optionType"); t.Exists() {
+ va := cv.Get("ifName.value")
+ if t.String() == "variable" {
+ cItem.NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Name = types.StringValue(va.String())
+ }
+ }
+ cItem.HelloInterval = types.Int64Null()
+ cItem.HelloIntervalVariable = types.StringNull()
+ if t := cv.Get("helloInterval.optionType"); t.Exists() {
+ va := cv.Get("helloInterval.value")
+ if t.String() == "variable" {
+ cItem.HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.DeadInterval = types.Int64Null()
+ cItem.DeadIntervalVariable = types.StringNull()
+ if t := cv.Get("deadInterval.optionType"); t.Exists() {
+ va := cv.Get("deadInterval.value")
+ if t.String() == "variable" {
+ cItem.DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.LsaRetransmitInterval = types.Int64Null()
+ cItem.LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cv.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cv.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ cItem.LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NetworkType = types.StringNull()
+ cItem.NetworkTypeVariable = types.StringNull()
+ if t := cv.Get("networkType.optionType"); t.Exists() {
+ va := cv.Get("networkType.value")
+ if t.String() == "variable" {
+ cItem.NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NetworkType = types.StringValue(va.String())
+ }
+ }
+ cItem.PassiveInterface = types.BoolNull()
+ cItem.PassiveInterfaceVariable = types.StringNull()
+ if t := cv.Get("passiveInterface.optionType"); t.Exists() {
+ va := cv.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ cItem.PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ cItem.AuthenticationType = types.StringNull()
+
+ if t := cv.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ cItem.AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ cItem.AuthenticationSpi = types.Int64Null()
+ cItem.AuthenticationSpiVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ cItem.AuthenticationKey = types.StringNull()
+ cItem.AuthenticationKeyVariable = types.StringNull()
+ if t := cv.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cv.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ cItem.AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ item.Interfaces = append(item.Interfaces, cItem)
+ return true
+ })
+ }
+ if cValue := v.Get("ranges"); cValue.Exists() {
+ item.Ranges = make([]TransportRoutingOSPFv3IPv6AreasRanges, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportRoutingOSPFv3IPv6AreasRanges{}
+ cItem.Prefix = types.StringNull()
+ cItem.PrefixVariable = types.StringNull()
+ if t := cv.Get("network.optionType"); t.Exists() {
+ va := cv.Get("network.value")
+ if t.String() == "variable" {
+ cItem.PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Prefix = types.StringValue(va.String())
+ }
+ }
+ cItem.Cost = types.Int64Null()
+ cItem.CostVariable = types.StringNull()
+ if t := cv.Get("cost.optionType"); t.Exists() {
+ va := cv.Get("cost.value")
+ if t.String() == "variable" {
+ cItem.CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Cost = types.Int64Value(va.Int())
+ }
+ }
+ cItem.NoAdvertise = types.BoolNull()
+ cItem.NoAdvertiseVariable = types.StringNull()
+ if t := cv.Get("noAdvertise.optionType"); t.Exists() {
+ va := cv.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ cItem.NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ item.Ranges = append(item.Ranges, cItem)
+ return true
+ })
+ }
+ data.Areas = append(data.Areas, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportRoutingOSPFv3IPv6) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.RouterId = types.StringNull()
+ data.RouterIdVariable = types.StringNull()
+ if t := res.Get(path + "basic.routerId.optionType"); t.Exists() {
+ va := res.Get(path + "basic.routerId.value")
+ if t.String() == "variable" {
+ data.RouterIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterId = types.StringValue(va.String())
+ }
+ }
+ data.Distance = types.Int64Null()
+ data.DistanceVariable = types.StringNull()
+ if t := res.Get(path + "basic.distance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.distance.value")
+ if t.String() == "variable" {
+ data.DistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Distance = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceExternal = types.Int64Null()
+ data.DistanceExternalVariable = types.StringNull()
+ if t := res.Get(path + "basic.externalDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.externalDistance.value")
+ if t.String() == "variable" {
+ data.DistanceExternalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceExternal = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceInterArea = types.Int64Null()
+ data.DistanceInterAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.interAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.interAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceInterAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceInterArea = types.Int64Value(va.Int())
+ }
+ }
+ data.DistanceIntraArea = types.Int64Null()
+ data.DistanceIntraAreaVariable = types.StringNull()
+ if t := res.Get(path + "basic.intraAreaDistance.optionType"); t.Exists() {
+ va := res.Get(path + "basic.intraAreaDistance.value")
+ if t.String() == "variable" {
+ data.DistanceIntraAreaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DistanceIntraArea = types.Int64Value(va.Int())
+ }
+ }
+ data.ReferenceBandwidth = types.Int64Null()
+ data.ReferenceBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "advanced.referenceBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.referenceBandwidth.value")
+ if t.String() == "variable" {
+ data.ReferenceBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ReferenceBandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.Rfc1583Compatible = types.BoolNull()
+ data.Rfc1583CompatibleVariable = types.StringNull()
+ if t := res.Get(path + "advanced.compatibleRfc1583.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.compatibleRfc1583.value")
+ if t.String() == "variable" {
+ data.Rfc1583CompatibleVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Rfc1583Compatible = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginate = types.BoolNull()
+
+ if t := res.Get(path + "advanced.defaultOriginate.originate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.originate.value")
+ if t.String() == "global" {
+ data.DefaultInformationOriginate = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateAlways = types.BoolNull()
+ data.DefaultInformationOriginateAlwaysVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.always.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.always.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateAlwaysVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateAlways = types.BoolValue(va.Bool())
+ }
+ }
+ data.DefaultInformationOriginateMetric = types.Int64Null()
+ data.DefaultInformationOriginateMetricVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metric.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metric.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetric = types.Int64Value(va.Int())
+ }
+ }
+ data.DefaultInformationOriginateMetricType = types.StringNull()
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.defaultOriginate.metricType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.defaultOriginate.metricType.value")
+ if t.String() == "variable" {
+ data.DefaultInformationOriginateMetricTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DefaultInformationOriginateMetricType = types.StringValue(va.String())
+ }
+ }
+ data.SpfCalculationDelay = types.Int64Null()
+ data.SpfCalculationDelayVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.delay.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.delay.value")
+ if t.String() == "variable" {
+ data.SpfCalculationDelayVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfCalculationDelay = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfInitialHoldTime = types.Int64Null()
+ data.SpfInitialHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.initialHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.initialHold.value")
+ if t.String() == "variable" {
+ data.SpfInitialHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfInitialHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.SpfMaximumHoldTime = types.Int64Null()
+ data.SpfMaximumHoldTimeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.spfTimers.maxHold.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.spfTimers.maxHold.value")
+ if t.String() == "variable" {
+ data.SpfMaximumHoldTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SpfMaximumHoldTime = types.Int64Value(va.Int())
+ }
+ }
+ data.RoutePolicyId = types.StringNull()
+
+ if t := res.Get(path + "advanced.policyName.refId.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.policyName.refId.value")
+ if t.String() == "global" {
+ data.RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ data.Filter = types.BoolNull()
+ data.FilterVariable = types.StringNull()
+ if t := res.Get(path + "advanced.filter.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.filter.value")
+ if t.String() == "variable" {
+ data.FilterVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Filter = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Redistributes {
+ keys := [...]string{"protocol"}
+ keyValues := [...]string{data.Redistributes[i].Protocol.ValueString()}
+ keyValuesVariables := [...]string{data.Redistributes[i].ProtocolVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "redistribute").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Redistributes[i].Protocol = types.StringNull()
+ data.Redistributes[i].ProtocolVariable = types.StringNull()
+ if t := r.Get("protocol.optionType"); t.Exists() {
+ va := r.Get("protocol.value")
+ if t.String() == "variable" {
+ data.Redistributes[i].ProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Redistributes[i].Protocol = types.StringValue(va.String())
+ }
+ }
+ data.Redistributes[i].RoutePolicyId = types.StringNull()
+
+ if t := r.Get("routePolicy.refId.optionType"); t.Exists() {
+ va := r.Get("routePolicy.refId.value")
+ if t.String() == "global" {
+ data.Redistributes[i].RoutePolicyId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.RouterLsaAction = types.StringNull()
+
+ if t := res.Get(path + "maxMetricRouterLsa.action.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.action.value")
+ if t.String() == "global" {
+ data.RouterLsaAction = types.StringValue(va.String())
+ }
+ }
+ data.RouterLsaOnStartupTime = types.Int64Null()
+ data.RouterLsaOnStartupTimeVariable = types.StringNull()
+ if t := res.Get(path + "maxMetricRouterLsa.onStartUpTime.optionType"); t.Exists() {
+ va := res.Get(path + "maxMetricRouterLsa.onStartUpTime.value")
+ if t.String() == "variable" {
+ data.RouterLsaOnStartupTimeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.RouterLsaOnStartupTime = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Areas {
+ keys := [...]string{"areaNum"}
+ keyValues := [...]string{strconv.FormatInt(data.Areas[i].AreaNumber.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{data.Areas[i].AreaNumberVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "area").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].AreaNumber = types.Int64Null()
+ data.Areas[i].AreaNumberVariable = types.StringNull()
+ if t := r.Get("areaNum.optionType"); t.Exists() {
+ va := r.Get("areaNum.value")
+ if t.String() == "variable" {
+ data.Areas[i].AreaNumberVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AreaNumber = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].AreaType = types.StringNull()
+
+ if t := r.Get("areaTypeConfig.areaType.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.areaType.value")
+ if t.String() == "global" {
+ data.Areas[i].AreaType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].NoSummary = types.BoolNull()
+ data.Areas[i].NoSummaryVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.noSummary.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.noSummary.value")
+ if t.String() == "variable" {
+ data.Areas[i].NoSummaryVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].NoSummary = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].AlwaysTranslate = types.BoolNull()
+ data.Areas[i].AlwaysTranslateVariable = types.StringNull()
+ if t := r.Get("areaTypeConfig.alwaysTranslate.optionType"); t.Exists() {
+ va := r.Get("areaTypeConfig.alwaysTranslate.value")
+ if t.String() == "variable" {
+ data.Areas[i].AlwaysTranslateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].AlwaysTranslate = types.BoolValue(va.Bool())
+ }
+ }
+ for ci := range data.Areas[i].Interfaces {
+ keys := [...]string{"ifName"}
+ keyValues := [...]string{data.Areas[i].Interfaces[ci].Name.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Interfaces[ci].NameVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("interfaces").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Interfaces[ci].Name = types.StringNull()
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringNull()
+ if t := cr.Get("ifName.optionType"); t.Exists() {
+ va := cr.Get("ifName.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Name = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringNull()
+ if t := cr.Get("helloInterval.optionType"); t.Exists() {
+ va := cr.Get("helloInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].HelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].HelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringNull()
+ if t := cr.Get("deadInterval.optionType"); t.Exists() {
+ va := cr.Get("deadInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].DeadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].DeadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Null()
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringNull()
+ if t := cr.Get("retransmitInterval.optionType"); t.Exists() {
+ va := cr.Get("retransmitInterval.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].LsaRetransmitInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Null()
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringNull()
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringNull()
+ if t := cr.Get("networkType.optionType"); t.Exists() {
+ va := cr.Get("networkType.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].NetworkTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].NetworkType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolNull()
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringNull()
+ if t := cr.Get("passiveInterface.optionType"); t.Exists() {
+ va := cr.Get("passiveInterface.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].PassiveInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].PassiveInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringNull()
+
+ if t := cr.Get("authenticationConfig.authType.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authType.value")
+ if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationType = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Null()
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.spi.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.spi.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpiVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationSpi = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringNull()
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringNull()
+ if t := cr.Get("authenticationConfig.authKey.optionType"); t.Exists() {
+ va := cr.Get("authenticationConfig.authKey.value")
+ if t.String() == "variable" {
+ data.Areas[i].Interfaces[ci].AuthenticationKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Interfaces[ci].AuthenticationKey = types.StringValue(va.String())
+ }
+ }
+ }
+ for ci := range data.Areas[i].Ranges {
+ keys := [...]string{"network"}
+ keyValues := [...]string{data.Areas[i].Ranges[ci].Prefix.ValueString()}
+ keyValuesVariables := [...]string{data.Areas[i].Ranges[ci].PrefixVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ranges").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Areas[i].Ranges[ci].Prefix = types.StringNull()
+ data.Areas[i].Ranges[ci].PrefixVariable = types.StringNull()
+ if t := cr.Get("network.optionType"); t.Exists() {
+ va := cr.Get("network.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Prefix = types.StringValue(va.String())
+ }
+ }
+ data.Areas[i].Ranges[ci].Cost = types.Int64Null()
+ data.Areas[i].Ranges[ci].CostVariable = types.StringNull()
+ if t := cr.Get("cost.optionType"); t.Exists() {
+ va := cr.Get("cost.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].CostVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].Cost = types.Int64Value(va.Int())
+ }
+ }
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolNull()
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringNull()
+ if t := cr.Get("noAdvertise.optionType"); t.Exists() {
+ va := cr.Get("noAdvertise.value")
+ if t.String() == "variable" {
+ data.Areas[i].Ranges[ci].NoAdvertiseVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Areas[i].Ranges[ci].NoAdvertise = types.BoolValue(va.Bool())
+ }
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportRoutingOSPFv3IPv6) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.RouterId.IsNull() {
+ return false
+ }
+ if !data.RouterIdVariable.IsNull() {
+ return false
+ }
+ if !data.Distance.IsNull() {
+ return false
+ }
+ if !data.DistanceVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceExternal.IsNull() {
+ return false
+ }
+ if !data.DistanceExternalVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceInterArea.IsNull() {
+ return false
+ }
+ if !data.DistanceInterAreaVariable.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraArea.IsNull() {
+ return false
+ }
+ if !data.DistanceIntraAreaVariable.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidth.IsNull() {
+ return false
+ }
+ if !data.ReferenceBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.Rfc1583Compatible.IsNull() {
+ return false
+ }
+ if !data.Rfc1583CompatibleVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginate.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlways.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateAlwaysVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetric.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricVariable.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricType.IsNull() {
+ return false
+ }
+ if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelay.IsNull() {
+ return false
+ }
+ if !data.SpfCalculationDelayVariable.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfInitialHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTime.IsNull() {
+ return false
+ }
+ if !data.SpfMaximumHoldTimeVariable.IsNull() {
+ return false
+ }
+ if !data.RoutePolicyId.IsNull() {
+ return false
+ }
+ if !data.Filter.IsNull() {
+ return false
+ }
+ if !data.FilterVariable.IsNull() {
+ return false
+ }
+ if len(data.Redistributes) > 0 {
+ return false
+ }
+ if !data.RouterLsaAction.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTime.IsNull() {
+ return false
+ }
+ if !data.RouterLsaOnStartupTimeVariable.IsNull() {
+ return false
+ }
+ if len(data.Areas) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_tracker_feature.go b/internal/provider/model_sdwan_transport_tracker_feature.go
new file mode 100644
index 000000000..79c7ae08d
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_tracker_feature.go
@@ -0,0 +1,488 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportTracker 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"`
+ TrackerName types.String `tfsdk:"tracker_name"`
+ TrackerNameVariable types.String `tfsdk:"tracker_name_variable"`
+ EndpointApiUrl types.String `tfsdk:"endpoint_api_url"`
+ EndpointApiUrlVariable types.String `tfsdk:"endpoint_api_url_variable"`
+ EndpointDnsName types.String `tfsdk:"endpoint_dns_name"`
+ EndpointDnsNameVariable types.String `tfsdk:"endpoint_dns_name_variable"`
+ EndpointIp types.String `tfsdk:"endpoint_ip"`
+ EndpointIpVariable types.String `tfsdk:"endpoint_ip_variable"`
+ Interval types.Int64 `tfsdk:"interval"`
+ IntervalVariable types.String `tfsdk:"interval_variable"`
+ Multiplier types.Int64 `tfsdk:"multiplier"`
+ MultiplierVariable types.String `tfsdk:"multiplier_variable"`
+ Threshold types.Int64 `tfsdk:"threshold"`
+ ThresholdVariable types.String `tfsdk:"threshold_variable"`
+ EndpointTrackerType types.String `tfsdk:"endpoint_tracker_type"`
+ EndpointTrackerTypeVariable types.String `tfsdk:"endpoint_tracker_type_variable"`
+ TrackerType types.String `tfsdk:"tracker_type"`
+ TrackerTypeVariable types.String `tfsdk:"tracker_type_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportTracker) getModel() string {
+ return "transport_tracker"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportTracker) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/tracker", 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 TransportTracker) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.TrackerNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackerName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString())
+ }
+ } else if !data.TrackerName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackerName.optionType", "global")
+ body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString())
+ }
+ }
+
+ if !data.EndpointApiUrlVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "variable")
+ body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString())
+ }
+ } else if !data.EndpointApiUrl.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global")
+ body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString())
+ }
+ }
+
+ if !data.EndpointDnsNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString())
+ }
+ } else if !data.EndpointDnsName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global")
+ body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString())
+ }
+ }
+
+ if !data.EndpointIpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointIp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString())
+ }
+ } else if !data.EndpointIp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointIp.optionType", "global")
+ body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString())
+ }
+ }
+
+ if !data.IntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interval.value", data.IntervalVariable.ValueString())
+ }
+ } else if data.Interval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interval.optionType", "default")
+ body, _ = sjson.Set(body, path+"interval.value", 60)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"interval.optionType", "global")
+ body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64())
+ }
+ }
+
+ if !data.MultiplierVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multiplier.optionType", "variable")
+ body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString())
+ }
+ } else if data.Multiplier.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"multiplier.optionType", "default")
+ body, _ = sjson.Set(body, path+"multiplier.value", 3)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"multiplier.optionType", "global")
+ body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64())
+ }
+ }
+
+ if !data.ThresholdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"threshold.optionType", "variable")
+ body, _ = sjson.Set(body, path+"threshold.value", data.ThresholdVariable.ValueString())
+ }
+ } else if data.Threshold.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"threshold.optionType", "default")
+ body, _ = sjson.Set(body, path+"threshold.value", 300)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"threshold.optionType", "global")
+ body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64())
+ }
+ }
+
+ if !data.EndpointTrackerTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerTypeVariable.ValueString())
+ }
+ } else if data.EndpointTrackerType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "default")
+ body, _ = sjson.Set(body, path+"endpointTrackerType.value", "interface")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global")
+ body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString())
+ }
+ }
+
+ if !data.TrackerTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackerType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerTypeVariable.ValueString())
+ }
+ } else if data.TrackerType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"trackerType.optionType", "default")
+ body, _ = sjson.Set(body, path+"trackerType.value", "endpoint")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"trackerType.optionType", "global")
+ body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportTracker) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.TrackerName = types.StringNull()
+ data.TrackerNameVariable = types.StringNull()
+ if t := res.Get(path + "trackerName.optionType"); t.Exists() {
+ va := res.Get(path + "trackerName.value")
+ if t.String() == "variable" {
+ data.TrackerNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerName = types.StringValue(va.String())
+ }
+ }
+ data.EndpointApiUrl = types.StringNull()
+ data.EndpointApiUrlVariable = types.StringNull()
+ if t := res.Get(path + "endpointApiUrl.optionType"); t.Exists() {
+ va := res.Get(path + "endpointApiUrl.value")
+ if t.String() == "variable" {
+ data.EndpointApiUrlVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointApiUrl = types.StringValue(va.String())
+ }
+ }
+ data.EndpointDnsName = types.StringNull()
+ data.EndpointDnsNameVariable = types.StringNull()
+ if t := res.Get(path + "endpointDnsName.optionType"); t.Exists() {
+ va := res.Get(path + "endpointDnsName.value")
+ if t.String() == "variable" {
+ data.EndpointDnsNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointDnsName = types.StringValue(va.String())
+ }
+ }
+ data.EndpointIp = types.StringNull()
+ data.EndpointIpVariable = types.StringNull()
+ if t := res.Get(path + "endpointIp.optionType"); t.Exists() {
+ va := res.Get(path + "endpointIp.value")
+ if t.String() == "variable" {
+ data.EndpointIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointIp = types.StringValue(va.String())
+ }
+ }
+ data.Interval = types.Int64Null()
+ data.IntervalVariable = types.StringNull()
+ if t := res.Get(path + "interval.optionType"); t.Exists() {
+ va := res.Get(path + "interval.value")
+ if t.String() == "variable" {
+ data.IntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interval = types.Int64Value(va.Int())
+ }
+ }
+ data.Multiplier = types.Int64Null()
+ data.MultiplierVariable = types.StringNull()
+ if t := res.Get(path + "multiplier.optionType"); t.Exists() {
+ va := res.Get(path + "multiplier.value")
+ if t.String() == "variable" {
+ data.MultiplierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Multiplier = types.Int64Value(va.Int())
+ }
+ }
+ data.Threshold = types.Int64Null()
+ data.ThresholdVariable = types.StringNull()
+ if t := res.Get(path + "threshold.optionType"); t.Exists() {
+ va := res.Get(path + "threshold.value")
+ if t.String() == "variable" {
+ data.ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Threshold = types.Int64Value(va.Int())
+ }
+ }
+ data.EndpointTrackerType = types.StringNull()
+ data.EndpointTrackerTypeVariable = types.StringNull()
+ if t := res.Get(path + "endpointTrackerType.optionType"); t.Exists() {
+ va := res.Get(path + "endpointTrackerType.value")
+ if t.String() == "variable" {
+ data.EndpointTrackerTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointTrackerType = types.StringValue(va.String())
+ }
+ }
+ data.TrackerType = types.StringNull()
+ data.TrackerTypeVariable = types.StringNull()
+ if t := res.Get(path + "trackerType.optionType"); t.Exists() {
+ va := res.Get(path + "trackerType.value")
+ if t.String() == "variable" {
+ data.TrackerTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerType = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportTracker) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.TrackerName = types.StringNull()
+ data.TrackerNameVariable = types.StringNull()
+ if t := res.Get(path + "trackerName.optionType"); t.Exists() {
+ va := res.Get(path + "trackerName.value")
+ if t.String() == "variable" {
+ data.TrackerNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerName = types.StringValue(va.String())
+ }
+ }
+ data.EndpointApiUrl = types.StringNull()
+ data.EndpointApiUrlVariable = types.StringNull()
+ if t := res.Get(path + "endpointApiUrl.optionType"); t.Exists() {
+ va := res.Get(path + "endpointApiUrl.value")
+ if t.String() == "variable" {
+ data.EndpointApiUrlVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointApiUrl = types.StringValue(va.String())
+ }
+ }
+ data.EndpointDnsName = types.StringNull()
+ data.EndpointDnsNameVariable = types.StringNull()
+ if t := res.Get(path + "endpointDnsName.optionType"); t.Exists() {
+ va := res.Get(path + "endpointDnsName.value")
+ if t.String() == "variable" {
+ data.EndpointDnsNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointDnsName = types.StringValue(va.String())
+ }
+ }
+ data.EndpointIp = types.StringNull()
+ data.EndpointIpVariable = types.StringNull()
+ if t := res.Get(path + "endpointIp.optionType"); t.Exists() {
+ va := res.Get(path + "endpointIp.value")
+ if t.String() == "variable" {
+ data.EndpointIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointIp = types.StringValue(va.String())
+ }
+ }
+ data.Interval = types.Int64Null()
+ data.IntervalVariable = types.StringNull()
+ if t := res.Get(path + "interval.optionType"); t.Exists() {
+ va := res.Get(path + "interval.value")
+ if t.String() == "variable" {
+ data.IntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Interval = types.Int64Value(va.Int())
+ }
+ }
+ data.Multiplier = types.Int64Null()
+ data.MultiplierVariable = types.StringNull()
+ if t := res.Get(path + "multiplier.optionType"); t.Exists() {
+ va := res.Get(path + "multiplier.value")
+ if t.String() == "variable" {
+ data.MultiplierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Multiplier = types.Int64Value(va.Int())
+ }
+ }
+ data.Threshold = types.Int64Null()
+ data.ThresholdVariable = types.StringNull()
+ if t := res.Get(path + "threshold.optionType"); t.Exists() {
+ va := res.Get(path + "threshold.value")
+ if t.String() == "variable" {
+ data.ThresholdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Threshold = types.Int64Value(va.Int())
+ }
+ }
+ data.EndpointTrackerType = types.StringNull()
+ data.EndpointTrackerTypeVariable = types.StringNull()
+ if t := res.Get(path + "endpointTrackerType.optionType"); t.Exists() {
+ va := res.Get(path + "endpointTrackerType.value")
+ if t.String() == "variable" {
+ data.EndpointTrackerTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EndpointTrackerType = types.StringValue(va.String())
+ }
+ }
+ data.TrackerType = types.StringNull()
+ data.TrackerTypeVariable = types.StringNull()
+ if t := res.Get(path + "trackerType.optionType"); t.Exists() {
+ va := res.Get(path + "trackerType.value")
+ if t.String() == "variable" {
+ data.TrackerTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerType = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportTracker) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TrackerName.IsNull() {
+ return false
+ }
+ if !data.TrackerNameVariable.IsNull() {
+ return false
+ }
+ if !data.EndpointApiUrl.IsNull() {
+ return false
+ }
+ if !data.EndpointApiUrlVariable.IsNull() {
+ return false
+ }
+ if !data.EndpointDnsName.IsNull() {
+ return false
+ }
+ if !data.EndpointDnsNameVariable.IsNull() {
+ return false
+ }
+ if !data.EndpointIp.IsNull() {
+ return false
+ }
+ if !data.EndpointIpVariable.IsNull() {
+ return false
+ }
+ if !data.Interval.IsNull() {
+ return false
+ }
+ if !data.IntervalVariable.IsNull() {
+ return false
+ }
+ if !data.Multiplier.IsNull() {
+ return false
+ }
+ if !data.MultiplierVariable.IsNull() {
+ return false
+ }
+ if !data.Threshold.IsNull() {
+ return false
+ }
+ if !data.ThresholdVariable.IsNull() {
+ return false
+ }
+ if !data.EndpointTrackerType.IsNull() {
+ return false
+ }
+ if !data.EndpointTrackerTypeVariable.IsNull() {
+ return false
+ }
+ if !data.TrackerType.IsNull() {
+ return false
+ }
+ if !data.TrackerTypeVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_tracker_group_feature.go b/internal/provider/model_sdwan_transport_tracker_group_feature.go
new file mode 100644
index 000000000..d1127296b
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_tracker_group_feature.go
@@ -0,0 +1,223 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportTrackerGroup 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"`
+ TrackerElements []TransportTrackerGroupTrackerElements `tfsdk:"tracker_elements"`
+ TrackerBoolean types.String `tfsdk:"tracker_boolean"`
+ TrackerBooleanVariable types.String `tfsdk:"tracker_boolean_variable"`
+}
+
+type TransportTrackerGroupTrackerElements struct {
+ TrackerId types.String `tfsdk:"tracker_id"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportTrackerGroup) getModel() string {
+ return "transport_tracker_group"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportTrackerGroup) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/trackergroup", 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 TransportTrackerGroup) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if true {
+
+ for _, item := range data.TrackerElements {
+ itemBody := ""
+ if !item.TrackerId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody)
+ }
+ }
+
+ if !data.TrackerBooleanVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString())
+ }
+ } else if data.TrackerBoolean.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", "or")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global")
+ body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportTrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ if value := res.Get(path + "trackerRefs"); value.Exists() {
+ data.TrackerElements = make([]TransportTrackerGroupTrackerElements, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportTrackerGroupTrackerElements{}
+ item.TrackerId = types.StringNull()
+
+ if t := v.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := v.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ item.TrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TrackerElements = append(data.TrackerElements, item)
+ return true
+ })
+ }
+ data.TrackerBoolean = types.StringNull()
+ data.TrackerBooleanVariable = types.StringNull()
+ if t := res.Get(path + "combineBoolean.optionType"); t.Exists() {
+ va := res.Get(path + "combineBoolean.value")
+ if t.String() == "variable" {
+ data.TrackerBooleanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerBoolean = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportTrackerGroup) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ for i := range data.TrackerElements {
+ keys := [...]string{"trackerRef.refId"}
+ keyValues := [...]string{data.TrackerElements[i].TrackerId.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "trackerRefs").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TrackerElements[i].TrackerId = types.StringNull()
+
+ if t := r.Get("trackerRef.refId.optionType"); t.Exists() {
+ va := r.Get("trackerRef.refId.value")
+ if t.String() == "global" {
+ data.TrackerElements[i].TrackerId = types.StringValue(va.String())
+ }
+ }
+ }
+ data.TrackerBoolean = types.StringNull()
+ data.TrackerBooleanVariable = types.StringNull()
+ if t := res.Get(path + "combineBoolean.optionType"); t.Exists() {
+ va := res.Get(path + "combineBoolean.value")
+ if t.String() == "variable" {
+ data.TrackerBooleanVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerBoolean = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportTrackerGroup) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if len(data.TrackerElements) > 0 {
+ return false
+ }
+ if !data.TrackerBoolean.IsNull() {
+ return false
+ }
+ if !data.TrackerBooleanVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_feature.go b/internal/provider/model_sdwan_transport_wan_vpn_feature.go
new file mode 100644
index 000000000..70b4f34ef
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_wan_vpn_feature.go
@@ -0,0 +1,1299 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportWANVPN 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"`
+ Vpn types.Int64 `tfsdk:"vpn"`
+ EnhanceEcmpKeying types.Bool `tfsdk:"enhance_ecmp_keying"`
+ EnhanceEcmpKeyingVariable types.String `tfsdk:"enhance_ecmp_keying_variable"`
+ PrimaryDnsAddressIpv4 types.String `tfsdk:"primary_dns_address_ipv4"`
+ PrimaryDnsAddressIpv4Variable types.String `tfsdk:"primary_dns_address_ipv4_variable"`
+ SecondaryDnsAddressIpv4 types.String `tfsdk:"secondary_dns_address_ipv4"`
+ SecondaryDnsAddressIpv4Variable types.String `tfsdk:"secondary_dns_address_ipv4_variable"`
+ PrimaryDnsAddressIpv6 types.String `tfsdk:"primary_dns_address_ipv6"`
+ PrimaryDnsAddressIpv6Variable types.String `tfsdk:"primary_dns_address_ipv6_variable"`
+ SecondaryDnsAddressIpv6 types.String `tfsdk:"secondary_dns_address_ipv6"`
+ SecondaryDnsAddressIpv6Variable types.String `tfsdk:"secondary_dns_address_ipv6_variable"`
+ NewHostMappings []TransportWANVPNNewHostMappings `tfsdk:"new_host_mappings"`
+ Ipv4StaticRoutes []TransportWANVPNIpv4StaticRoutes `tfsdk:"ipv4_static_routes"`
+ Ipv6StaticRoutes []TransportWANVPNIpv6StaticRoutes `tfsdk:"ipv6_static_routes"`
+ Services []TransportWANVPNServices `tfsdk:"services"`
+ Nat64V4Pools []TransportWANVPNNat64V4Pools `tfsdk:"nat_64_v4_pools"`
+}
+
+type TransportWANVPNNewHostMappings struct {
+ HostName types.String `tfsdk:"host_name"`
+ HostNameVariable types.String `tfsdk:"host_name_variable"`
+ ListOfIpAddresses types.Set `tfsdk:"list_of_ip_addresses"`
+ ListOfIpAddressesVariable types.String `tfsdk:"list_of_ip_addresses_variable"`
+}
+
+type TransportWANVPNIpv4StaticRoutes struct {
+ NetworkAddress types.String `tfsdk:"network_address"`
+ NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+ Gateway types.String `tfsdk:"gateway"`
+ NextHops []TransportWANVPNIpv4StaticRoutesNextHops `tfsdk:"next_hops"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+
+type TransportWANVPNIpv6StaticRoutes struct {
+ Prefix types.String `tfsdk:"prefix"`
+ PrefixVariable types.String `tfsdk:"prefix_variable"`
+ NextHops []TransportWANVPNIpv6StaticRoutesNextHops `tfsdk:"next_hops"`
+ Null0 types.Bool `tfsdk:"null0"`
+ Nat types.String `tfsdk:"nat"`
+ NatVariable types.String `tfsdk:"nat_variable"`
+}
+
+type TransportWANVPNServices struct {
+ ServiceType types.String `tfsdk:"service_type"`
+}
+
+type TransportWANVPNNat64V4Pools struct {
+ Nat64V4PoolName types.String `tfsdk:"nat64_v4_pool_name"`
+ Nat64V4PoolNameVariable types.String `tfsdk:"nat64_v4_pool_name_variable"`
+ Nat64V4PoolRangeStart types.String `tfsdk:"nat64_v4_pool_range_start"`
+ Nat64V4PoolRangeStartVariable types.String `tfsdk:"nat64_v4_pool_range_start_variable"`
+ Nat64V4PoolRangeEnd types.String `tfsdk:"nat64_v4_pool_range_end"`
+ Nat64V4PoolRangeEndVariable types.String `tfsdk:"nat64_v4_pool_range_end_variable"`
+ Nat64V4PoolOverload types.Bool `tfsdk:"nat64_v4_pool_overload"`
+ Nat64V4PoolOverloadVariable types.String `tfsdk:"nat64_v4_pool_overload_variable"`
+}
+
+type TransportWANVPNIpv4StaticRoutesNextHops struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+
+type TransportWANVPNIpv6StaticRoutesNextHops struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
+ AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportWANVPN) getModel() string {
+ return "transport_wan_vpn"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportWANVPN) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn", 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 TransportWANVPN) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+ if data.Vpn.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"vpnId.optionType", "default")
+ body, _ = sjson.Set(body, path+"vpnId.value", 0)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"vpnId.optionType", "global")
+ body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64())
+ }
+ }
+
+ if !data.EnhanceEcmpKeyingVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "variable")
+ body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeyingVariable.ValueString())
+ }
+ } else if data.EnhanceEcmpKeying.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "default")
+ body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "global")
+ body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeying.ValueBool())
+ }
+ }
+
+ if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString())
+ }
+ } else if !data.PrimaryDnsAddressIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString())
+ }
+ }
+
+ if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString())
+ }
+ } else if !data.SecondaryDnsAddressIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString())
+ }
+ }
+
+ if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString())
+ }
+ } else if !data.PrimaryDnsAddressIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString())
+ }
+ }
+
+ if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString())
+ }
+ } else if !data.SecondaryDnsAddressIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{})
+ for _, item := range data.NewHostMappings {
+ itemBody := ""
+
+ if !item.HostNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString())
+ }
+ } else if !item.HostName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString())
+ }
+ }
+
+ if !item.ListOfIpAddressesVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString())
+ }
+ } else if !item.ListOfIpAddresses.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global")
+ var values []string
+ item.ListOfIpAddresses.ElementsAs(ctx, &values, false)
+ itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values)
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{})
+ for _, item := range data.Ipv4StaticRoutes {
+ itemBody := ""
+
+ if !item.NetworkAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
+ }
+ } else if !item.NetworkAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+ if item.Gateway.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString())
+ }
+ }
+ if true && item.Gateway.ValueString() == "nextHop" {
+ itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{})
+ for _, childItem := range item.NextHops {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AdministrativeDistanceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if childItem.AdministrativeDistance.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1)
+ }
+ } else {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody)
+ }
+ }
+
+ if !item.AdministrativeDistanceVariable.IsNull() {
+ if true && item.Gateway.ValueString() == "null0" {
+ itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if item.AdministrativeDistance.IsNull() {
+ if true && item.Gateway.ValueString() == "null0" {
+ itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "distance.value", 1)
+ }
+ } else {
+ if true && item.Gateway.ValueString() == "null0" {
+ itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{})
+ for _, item := range data.Ipv6StaticRoutes {
+ itemBody := ""
+
+ if !item.PrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString())
+ }
+ } else if !item.Prefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString())
+ }
+ }
+ if true {
+
+ for _, childItem := range item.NextHops {
+ itemChildBody := ""
+
+ if !childItem.AddressVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
+ }
+ } else if !childItem.Address.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
+ }
+ }
+
+ if !childItem.AdministrativeDistanceVariable.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
+ }
+ } else if !childItem.AdministrativeDistance.IsNull() {
+ if true {
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
+ itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
+ }
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
+ }
+ }
+ if !item.Null0.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
+ }
+ }
+
+ if !item.NatVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString())
+ }
+ } else if !item.Nat.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"service", []interface{}{})
+ for _, item := range data.Services {
+ itemBody := ""
+ if !item.ServiceType.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"service.-1", itemBody)
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{})
+ for _, item := range data.Nat64V4Pools {
+ itemBody := ""
+
+ if !item.Nat64V4PoolNameVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolNameVariable.ValueString())
+ }
+ } else if !item.Nat64V4PoolName.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolName.ValueString())
+ }
+ }
+
+ if !item.Nat64V4PoolRangeStartVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStartVariable.ValueString())
+ }
+ } else if !item.Nat64V4PoolRangeStart.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStart.ValueString())
+ }
+ }
+
+ if !item.Nat64V4PoolRangeEndVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEndVariable.ValueString())
+ }
+ } else if !item.Nat64V4PoolRangeEnd.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEnd.ValueString())
+ }
+ }
+
+ if !item.Nat64V4PoolOverloadVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverloadVariable.ValueString())
+ }
+ } else if item.Nat64V4PoolOverload.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverload.ValueBool())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportWANVPN) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Vpn = types.Int64Null()
+
+ if t := res.Get(path + "vpnId.optionType"); t.Exists() {
+ va := res.Get(path + "vpnId.value")
+ if t.String() == "global" {
+ data.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.EnhanceEcmpKeying = types.BoolNull()
+ data.EnhanceEcmpKeyingVariable = types.StringNull()
+ if t := res.Get(path + "enhanceEcmpKeying.optionType"); t.Exists() {
+ va := res.Get(path + "enhanceEcmpKeying.value")
+ if t.String() == "variable" {
+ data.EnhanceEcmpKeyingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EnhanceEcmpKeying = types.BoolValue(va.Bool())
+ }
+ }
+ data.PrimaryDnsAddressIpv4 = types.StringNull()
+ data.PrimaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv4 = types.StringNull()
+ data.SecondaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv6 = types.StringNull()
+ data.PrimaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv6 = types.StringNull()
+ data.SecondaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "newHostMapping"); value.Exists() {
+ data.NewHostMappings = make([]TransportWANVPNNewHostMappings, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNNewHostMappings{}
+ item.HostName = types.StringNull()
+ item.HostNameVariable = types.StringNull()
+ if t := v.Get("hostName.optionType"); t.Exists() {
+ va := v.Get("hostName.value")
+ if t.String() == "variable" {
+ item.HostNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.HostName = types.StringValue(va.String())
+ }
+ }
+ item.ListOfIpAddresses = types.SetNull(types.StringType)
+ item.ListOfIpAddressesVariable = types.StringNull()
+ if t := v.Get("listOfIp.optionType"); t.Exists() {
+ va := v.Get("listOfIp.value")
+ if t.String() == "variable" {
+ item.ListOfIpAddressesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.ListOfIpAddresses = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.NewHostMappings = append(data.NewHostMappings, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv4Route"); value.Exists() {
+ data.Ipv4StaticRoutes = make([]TransportWANVPNIpv4StaticRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNIpv4StaticRoutes{}
+ item.NetworkAddress = types.StringNull()
+ item.NetworkAddressVariable = types.StringNull()
+ if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := v.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ item.NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := v.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ item.Gateway = types.StringNull()
+
+ if t := v.Get("gateway.optionType"); t.Exists() {
+ va := v.Get("gateway.value")
+ if t.String() == "global" {
+ item.Gateway = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("nextHop"); cValue.Exists() {
+ item.NextHops = make([]TransportWANVPNIpv4StaticRoutesNextHops, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportWANVPNIpv4StaticRoutesNextHops{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AdministrativeDistance = types.Int64Null()
+ cItem.AdministrativeDistanceVariable = types.StringNull()
+ if t := cv.Get("distance.optionType"); t.Exists() {
+ va := cv.Get("distance.value")
+ if t.String() == "variable" {
+ cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ item.NextHops = append(item.NextHops, cItem)
+ return true
+ })
+ }
+ item.AdministrativeDistance = types.Int64Null()
+ item.AdministrativeDistanceVariable = types.StringNull()
+ if t := v.Get("distance.optionType"); t.Exists() {
+ va := v.Get("distance.value")
+ if t.String() == "variable" {
+ item.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4StaticRoutes = append(data.Ipv4StaticRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "ipv6Route"); value.Exists() {
+ data.Ipv6StaticRoutes = make([]TransportWANVPNIpv6StaticRoutes, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNIpv6StaticRoutes{}
+ item.Prefix = types.StringNull()
+ item.PrefixVariable = types.StringNull()
+ if t := v.Get("prefix.optionType"); t.Exists() {
+ va := v.Get("prefix.value")
+ if t.String() == "variable" {
+ item.PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Prefix = types.StringValue(va.String())
+ }
+ }
+ if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
+ item.NextHops = make([]TransportWANVPNIpv6StaticRoutesNextHops, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := TransportWANVPNIpv6StaticRoutesNextHops{}
+ cItem.Address = types.StringNull()
+ cItem.AddressVariable = types.StringNull()
+ if t := cv.Get("address.optionType"); t.Exists() {
+ va := cv.Get("address.value")
+ if t.String() == "variable" {
+ cItem.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.Address = types.StringValue(va.String())
+ }
+ }
+ cItem.AdministrativeDistance = types.Int64Null()
+ cItem.AdministrativeDistanceVariable = types.StringNull()
+ if t := cv.Get("distance.optionType"); t.Exists() {
+ va := cv.Get("distance.value")
+ if t.String() == "variable" {
+ cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ cItem.AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ item.NextHops = append(item.NextHops, cItem)
+ return true
+ })
+ }
+ item.Null0 = types.BoolNull()
+
+ if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ item.Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ item.Nat = types.StringNull()
+ item.NatVariable = types.StringNull()
+ if t := v.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
+ va := v.Get("oneOfIpRoute.nat.value")
+ if t.String() == "variable" {
+ item.NatVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Nat = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6StaticRoutes = append(data.Ipv6StaticRoutes, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "service"); value.Exists() {
+ data.Services = make([]TransportWANVPNServices, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNServices{}
+ item.ServiceType = types.StringNull()
+
+ if t := v.Get("serviceType.optionType"); t.Exists() {
+ va := v.Get("serviceType.value")
+ if t.String() == "global" {
+ item.ServiceType = types.StringValue(va.String())
+ }
+ }
+ data.Services = append(data.Services, item)
+ return true
+ })
+ }
+ if value := res.Get(path + "nat64V4Pool"); value.Exists() {
+ data.Nat64V4Pools = make([]TransportWANVPNNat64V4Pools, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNNat64V4Pools{}
+ item.Nat64V4PoolName = types.StringNull()
+ item.Nat64V4PoolNameVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolName.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolName.value")
+ if t.String() == "variable" {
+ item.Nat64V4PoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Nat64V4PoolName = types.StringValue(va.String())
+ }
+ }
+ item.Nat64V4PoolRangeStart = types.StringNull()
+ item.Nat64V4PoolRangeStartVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolRangeStart.value")
+ if t.String() == "variable" {
+ item.Nat64V4PoolRangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Nat64V4PoolRangeStart = types.StringValue(va.String())
+ }
+ }
+ item.Nat64V4PoolRangeEnd = types.StringNull()
+ item.Nat64V4PoolRangeEndVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolRangeEnd.value")
+ if t.String() == "variable" {
+ item.Nat64V4PoolRangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Nat64V4PoolRangeEnd = types.StringValue(va.String())
+ }
+ }
+ item.Nat64V4PoolOverload = types.BoolNull()
+ item.Nat64V4PoolOverloadVariable = types.StringNull()
+ if t := v.Get("nat64V4PoolOverload.optionType"); t.Exists() {
+ va := v.Get("nat64V4PoolOverload.value")
+ if t.String() == "variable" {
+ item.Nat64V4PoolOverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Nat64V4PoolOverload = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat64V4Pools = append(data.Nat64V4Pools, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportWANVPN) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Vpn = types.Int64Null()
+
+ if t := res.Get(path + "vpnId.optionType"); t.Exists() {
+ va := res.Get(path + "vpnId.value")
+ if t.String() == "global" {
+ data.Vpn = types.Int64Value(va.Int())
+ }
+ }
+ data.EnhanceEcmpKeying = types.BoolNull()
+ data.EnhanceEcmpKeyingVariable = types.StringNull()
+ if t := res.Get(path + "enhanceEcmpKeying.optionType"); t.Exists() {
+ va := res.Get(path + "enhanceEcmpKeying.value")
+ if t.String() == "variable" {
+ data.EnhanceEcmpKeyingVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.EnhanceEcmpKeying = types.BoolValue(va.Bool())
+ }
+ }
+ data.PrimaryDnsAddressIpv4 = types.StringNull()
+ data.PrimaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv4 = types.StringNull()
+ data.SecondaryDnsAddressIpv4Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
+ }
+ }
+ data.PrimaryDnsAddressIpv6 = types.StringNull()
+ data.PrimaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ data.SecondaryDnsAddressIpv6 = types.StringNull()
+ data.SecondaryDnsAddressIpv6Variable = types.StringNull()
+ if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
+ if t.String() == "variable" {
+ data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
+ }
+ }
+ for i := range data.NewHostMappings {
+ keys := [...]string{"hostName"}
+ keyValues := [...]string{data.NewHostMappings[i].HostName.ValueString()}
+ keyValuesVariables := [...]string{data.NewHostMappings[i].HostNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "newHostMapping").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.NewHostMappings[i].HostName = types.StringNull()
+ data.NewHostMappings[i].HostNameVariable = types.StringNull()
+ if t := r.Get("hostName.optionType"); t.Exists() {
+ va := r.Get("hostName.value")
+ if t.String() == "variable" {
+ data.NewHostMappings[i].HostNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NewHostMappings[i].HostName = types.StringValue(va.String())
+ }
+ }
+ data.NewHostMappings[i].ListOfIpAddresses = types.SetNull(types.StringType)
+ data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringNull()
+ if t := r.Get("listOfIp.optionType"); t.Exists() {
+ va := r.Get("listOfIp.value")
+ if t.String() == "variable" {
+ data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NewHostMappings[i].ListOfIpAddresses = helpers.GetStringSet(va.Array())
+ }
+ }
+ }
+ for i := range data.Ipv4StaticRoutes {
+ keys := [...]string{"prefix.ipAddress", "prefix.subnetMask", "gateway"}
+ keyValues := [...]string{data.Ipv4StaticRoutes[i].NetworkAddress.ValueString(), data.Ipv4StaticRoutes[i].SubnetMask.ValueString(), data.Ipv4StaticRoutes[i].Gateway.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NetworkAddressVariable.ValueString(), data.Ipv4StaticRoutes[i].SubnetMaskVariable.ValueString(), ""}
+
+ var r gjson.Result
+ res.Get(path + "ipv4Route").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4StaticRoutes[i].NetworkAddress = types.StringNull()
+ data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringNull()
+ if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
+ va := r.Get("prefix.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NetworkAddress = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].SubnetMask = types.StringNull()
+ data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
+ va := r.Get("prefix.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].Gateway = types.StringNull()
+
+ if t := r.Get("gateway.optionType"); t.Exists() {
+ va := r.Get("gateway.value")
+ if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].Gateway = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv4StaticRoutes[i].NextHops {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("nextHop").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringNull()
+ data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
+ if t := cr.Get("distance.optionType"); t.Exists() {
+ va := cr.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Null()
+ data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringNull()
+ if t := r.Get("distance.optionType"); t.Exists() {
+ va := r.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ for i := range data.Ipv6StaticRoutes {
+ keys := [...]string{"prefix"}
+ keyValues := [...]string{data.Ipv6StaticRoutes[i].Prefix.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].PrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "ipv6Route").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6StaticRoutes[i].Prefix = types.StringNull()
+ data.Ipv6StaticRoutes[i].PrefixVariable = types.StringNull()
+ if t := r.Get("prefix.optionType"); t.Exists() {
+ va := r.Get("prefix.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].PrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Prefix = types.StringValue(va.String())
+ }
+ }
+ for ci := range data.Ipv6StaticRoutes[i].NextHops {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
+
+ var cr gjson.Result
+ r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringNull()
+ data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
+ if t := cr.Get("address.optionType"); t.Exists() {
+ va := cr.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
+ if t := cr.Get("distance.optionType"); t.Exists() {
+ va := cr.Get("distance.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.Ipv6StaticRoutes[i].Null0 = types.BoolNull()
+
+ if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.null0.value")
+ if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Ipv6StaticRoutes[i].Nat = types.StringNull()
+ data.Ipv6StaticRoutes[i].NatVariable = types.StringNull()
+ if t := r.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
+ va := r.Get("oneOfIpRoute.nat.value")
+ if t.String() == "variable" {
+ data.Ipv6StaticRoutes[i].NatVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6StaticRoutes[i].Nat = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Services {
+ keys := [...]string{"serviceType"}
+ keyValues := [...]string{data.Services[i].ServiceType.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "service").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Services[i].ServiceType = types.StringNull()
+
+ if t := r.Get("serviceType.optionType"); t.Exists() {
+ va := r.Get("serviceType.value")
+ if t.String() == "global" {
+ data.Services[i].ServiceType = types.StringValue(va.String())
+ }
+ }
+ }
+ for i := range data.Nat64V4Pools {
+ keys := [...]string{"nat64V4PoolName"}
+ keyValues := [...]string{data.Nat64V4Pools[i].Nat64V4PoolName.ValueString()}
+ keyValuesVariables := [...]string{data.Nat64V4Pools[i].Nat64V4PoolNameVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "nat64V4Pool").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Nat64V4Pools[i].Nat64V4PoolName = types.StringNull()
+ data.Nat64V4Pools[i].Nat64V4PoolNameVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolName.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolName.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].Nat64V4PoolNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].Nat64V4PoolName = types.StringValue(va.String())
+ }
+ }
+ data.Nat64V4Pools[i].Nat64V4PoolRangeStart = types.StringNull()
+ data.Nat64V4Pools[i].Nat64V4PoolRangeStartVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolRangeStart.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].Nat64V4PoolRangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].Nat64V4PoolRangeStart = types.StringValue(va.String())
+ }
+ }
+ data.Nat64V4Pools[i].Nat64V4PoolRangeEnd = types.StringNull()
+ data.Nat64V4Pools[i].Nat64V4PoolRangeEndVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolRangeEnd.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].Nat64V4PoolRangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].Nat64V4PoolRangeEnd = types.StringValue(va.String())
+ }
+ }
+ data.Nat64V4Pools[i].Nat64V4PoolOverload = types.BoolNull()
+ data.Nat64V4Pools[i].Nat64V4PoolOverloadVariable = types.StringNull()
+ if t := r.Get("nat64V4PoolOverload.optionType"); t.Exists() {
+ va := r.Get("nat64V4PoolOverload.value")
+ if t.String() == "variable" {
+ data.Nat64V4Pools[i].Nat64V4PoolOverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Nat64V4Pools[i].Nat64V4PoolOverload = types.BoolValue(va.Bool())
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportWANVPN) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.Vpn.IsNull() {
+ return false
+ }
+ if !data.EnhanceEcmpKeying.IsNull() {
+ return false
+ }
+ if !data.EnhanceEcmpKeyingVariable.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv4.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv4.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv6.IsNull() {
+ return false
+ }
+ if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv6.IsNull() {
+ return false
+ }
+ if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
+ return false
+ }
+ if len(data.NewHostMappings) > 0 {
+ return false
+ }
+ if len(data.Ipv4StaticRoutes) > 0 {
+ return false
+ }
+ if len(data.Ipv6StaticRoutes) > 0 {
+ return false
+ }
+ if len(data.Services) > 0 {
+ return false
+ }
+ if len(data.Nat64V4Pools) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_feature.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_feature.go
new file mode 100644
index 000000000..06c1e01d1
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_feature.go
@@ -0,0 +1,3099 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportWANVPNInterfaceCellular 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"`
+ TransportWanVpnFeatureId types.String `tfsdk:"transport_wan_vpn_feature_id"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
+ Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
+ ServiceProvider types.String `tfsdk:"service_provider"`
+ ServiceProviderVariable types.String `tfsdk:"service_provider_variable"`
+ BandwidthUpstream types.Int64 `tfsdk:"bandwidth_upstream"`
+ BandwidthUpstreamVariable types.String `tfsdk:"bandwidth_upstream_variable"`
+ BandwidthDownstream types.Int64 `tfsdk:"bandwidth_downstream"`
+ BandwidthDownstreamVariable types.String `tfsdk:"bandwidth_downstream_variable"`
+ TunnelInterface types.Bool `tfsdk:"tunnel_interface"`
+ PerTunnelQos types.Bool `tfsdk:"per_tunnel_qos"`
+ PerTunnelQosVariable types.String `tfsdk:"per_tunnel_qos_variable"`
+ TunnelQosMode types.String `tfsdk:"tunnel_qos_mode"`
+ TunnelQosModeVariable types.String `tfsdk:"tunnel_qos_mode_variable"`
+ TunnelBandwidthPercent types.Int64 `tfsdk:"tunnel_bandwidth_percent"`
+ TunnelBandwidthPercentVariable types.String `tfsdk:"tunnel_bandwidth_percent_variable"`
+ TunnelInterfaceBindLoopbackTunnel types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel"`
+ TunnelInterfaceBindLoopbackTunnelVariable types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel_variable"`
+ TunnelInterfaceCarrier types.String `tfsdk:"tunnel_interface_carrier"`
+ TunnelInterfaceCarrierVariable types.String `tfsdk:"tunnel_interface_carrier_variable"`
+ TunnelInterfaceColor types.String `tfsdk:"tunnel_interface_color"`
+ TunnelInterfaceColorVariable types.String `tfsdk:"tunnel_interface_color_variable"`
+ TunnelInterfaceHelloInterval types.Int64 `tfsdk:"tunnel_interface_hello_interval"`
+ TunnelInterfaceHelloIntervalVariable types.String `tfsdk:"tunnel_interface_hello_interval_variable"`
+ TunnelInterfaceHelloTolerance types.Int64 `tfsdk:"tunnel_interface_hello_tolerance"`
+ TunnelInterfaceHelloToleranceVariable types.String `tfsdk:"tunnel_interface_hello_tolerance_variable"`
+ TunnelInterfaceLastResortCircuit types.Bool `tfsdk:"tunnel_interface_last_resort_circuit"`
+ TunnelInterfaceLastResortCircuitVariable types.String `tfsdk:"tunnel_interface_last_resort_circuit_variable"`
+ TunnelInterfaceColorRestrict types.Bool `tfsdk:"tunnel_interface_color_restrict"`
+ TunnelInterfaceColorRestrictVariable types.String `tfsdk:"tunnel_interface_color_restrict_variable"`
+ TunnelInterfaceGroups types.Int64 `tfsdk:"tunnel_interface_groups"`
+ TunnelInterfaceGroupsVariable types.String `tfsdk:"tunnel_interface_groups_variable"`
+ TunnelInterfaceBorder types.Bool `tfsdk:"tunnel_interface_border"`
+ TunnelInterfaceBorderVariable types.String `tfsdk:"tunnel_interface_border_variable"`
+ TunnelInterfaceMaxControlConnections types.Int64 `tfsdk:"tunnel_interface_max_control_connections"`
+ TunnelInterfaceMaxControlConnectionsVariable types.String `tfsdk:"tunnel_interface_max_control_connections_variable"`
+ TunnelInterfaceNatRefreshInterval types.Int64 `tfsdk:"tunnel_interface_nat_refresh_interval"`
+ TunnelInterfaceNatRefreshIntervalVariable types.String `tfsdk:"tunnel_interface_nat_refresh_interval_variable"`
+ TunnelInterfaceVbondAsStunServer types.Bool `tfsdk:"tunnel_interface_vbond_as_stun_server"`
+ TunnelInterfaceVbondAsStunServerVariable types.String `tfsdk:"tunnel_interface_vbond_as_stun_server_variable"`
+ TunnelInterfaceExcludeControllerGroupList types.Set `tfsdk:"tunnel_interface_exclude_controller_group_list"`
+ TunnelInterfaceExcludeControllerGroupListVariable types.String `tfsdk:"tunnel_interface_exclude_controller_group_list_variable"`
+ TunnelInterfaceVmanageConnectionPreference types.Int64 `tfsdk:"tunnel_interface_vmanage_connection_preference"`
+ TunnelInterfaceVmanageConnectionPreferenceVariable types.String `tfsdk:"tunnel_interface_vmanage_connection_preference_variable"`
+ TunnelInterfacePortHop types.Bool `tfsdk:"tunnel_interface_port_hop"`
+ TunnelInterfacePortHopVariable types.String `tfsdk:"tunnel_interface_port_hop_variable"`
+ TunnelInterfaceLowBandwidthLink types.Bool `tfsdk:"tunnel_interface_low_bandwidth_link"`
+ TunnelInterfaceLowBandwidthLinkVariable types.String `tfsdk:"tunnel_interface_low_bandwidth_link_variable"`
+ TunnelInterfaceTunnelTcpMss types.Int64 `tfsdk:"tunnel_interface_tunnel_tcp_mss"`
+ TunnelInterfaceTunnelTcpMssVariable types.String `tfsdk:"tunnel_interface_tunnel_tcp_mss_variable"`
+ TunnelInterfaceClearDontFragment types.Bool `tfsdk:"tunnel_interface_clear_dont_fragment"`
+ TunnelInterfaceClearDontFragmentVariable types.String `tfsdk:"tunnel_interface_clear_dont_fragment_variable"`
+ TunnelInterfaceNetworkBroadcast types.Bool `tfsdk:"tunnel_interface_network_broadcast"`
+ TunnelInterfaceNetworkBroadcastVariable types.String `tfsdk:"tunnel_interface_network_broadcast_variable"`
+ TunnelInterfaceAllowAll types.Bool `tfsdk:"tunnel_interface_allow_all"`
+ TunnelInterfaceAllowAllVariable types.String `tfsdk:"tunnel_interface_allow_all_variable"`
+ TunnelInterfaceAllowBgp types.Bool `tfsdk:"tunnel_interface_allow_bgp"`
+ TunnelInterfaceAllowBgpVariable types.String `tfsdk:"tunnel_interface_allow_bgp_variable"`
+ TunnelInterfaceAllowDhcp types.Bool `tfsdk:"tunnel_interface_allow_dhcp"`
+ TunnelInterfaceAllowDhcpVariable types.String `tfsdk:"tunnel_interface_allow_dhcp_variable"`
+ TunnelInterfaceAllowNtp types.Bool `tfsdk:"tunnel_interface_allow_ntp"`
+ TunnelInterfaceAllowNtpVariable types.String `tfsdk:"tunnel_interface_allow_ntp_variable"`
+ TunnelInterfaceAllowSsh types.Bool `tfsdk:"tunnel_interface_allow_ssh"`
+ TunnelInterfaceAllowSshVariable types.String `tfsdk:"tunnel_interface_allow_ssh_variable"`
+ TunnelInterfaceAllowDns types.Bool `tfsdk:"tunnel_interface_allow_dns"`
+ TunnelInterfaceAllowDnsVariable types.String `tfsdk:"tunnel_interface_allow_dns_variable"`
+ TunnelInterfaceAllowIcmp types.Bool `tfsdk:"tunnel_interface_allow_icmp"`
+ TunnelInterfaceAllowIcmpVariable types.String `tfsdk:"tunnel_interface_allow_icmp_variable"`
+ TunnelInterfaceAllowHttps types.Bool `tfsdk:"tunnel_interface_allow_https"`
+ TunnelInterfaceAllowHttpsVariable types.String `tfsdk:"tunnel_interface_allow_https_variable"`
+ TunnelInterfaceAllowOspf types.Bool `tfsdk:"tunnel_interface_allow_ospf"`
+ TunnelInterfaceAllowOspfVariable types.String `tfsdk:"tunnel_interface_allow_ospf_variable"`
+ TunnelInterfaceAllowStun types.Bool `tfsdk:"tunnel_interface_allow_stun"`
+ TunnelInterfaceAllowStunVariable types.String `tfsdk:"tunnel_interface_allow_stun_variable"`
+ TunnelInterfaceAllowSnmp types.Bool `tfsdk:"tunnel_interface_allow_snmp"`
+ TunnelInterfaceAllowSnmpVariable types.String `tfsdk:"tunnel_interface_allow_snmp_variable"`
+ TunnelInterfaceAllowNetconf types.Bool `tfsdk:"tunnel_interface_allow_netconf"`
+ TunnelInterfaceAllowNetconfVariable types.String `tfsdk:"tunnel_interface_allow_netconf_variable"`
+ TunnelInterfaceAllowBfd types.Bool `tfsdk:"tunnel_interface_allow_bfd"`
+ TunnelInterfaceAllowBfdVariable types.String `tfsdk:"tunnel_interface_allow_bfd_variable"`
+ TunnelInterfaceEncapsulations []TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations `tfsdk:"tunnel_interface_encapsulations"`
+ NatIpv4 types.Bool `tfsdk:"nat_ipv4"`
+ NatIpv4Variable types.String `tfsdk:"nat_ipv4_variable"`
+ NatUdpTimeout types.Int64 `tfsdk:"nat_udp_timeout"`
+ NatUdpTimeoutVariable types.String `tfsdk:"nat_udp_timeout_variable"`
+ NatTcpTimeout types.Int64 `tfsdk:"nat_tcp_timeout"`
+ NatTcpTimeoutVariable types.String `tfsdk:"nat_tcp_timeout_variable"`
+ QosAdaptive types.Bool `tfsdk:"qos_adaptive"`
+ QosAdaptivePeriod types.Int64 `tfsdk:"qos_adaptive_period"`
+ QosAdaptivePeriodVariable types.String `tfsdk:"qos_adaptive_period_variable"`
+ QosAdaptiveBandwidthUpstream types.Bool `tfsdk:"qos_adaptive_bandwidth_upstream"`
+ QosAdaptiveMinUpstream types.Int64 `tfsdk:"qos_adaptive_min_upstream"`
+ QosAdaptiveMinUpstreamVariable types.String `tfsdk:"qos_adaptive_min_upstream_variable"`
+ QosAdaptiveMaxUpstream types.Int64 `tfsdk:"qos_adaptive_max_upstream"`
+ QosAdaptiveMaxUpstreamVariable types.String `tfsdk:"qos_adaptive_max_upstream_variable"`
+ QosAdaptiveDefaultUpstream types.Int64 `tfsdk:"qos_adaptive_default_upstream"`
+ QosAdaptiveDefaultUpstreamVariable types.String `tfsdk:"qos_adaptive_default_upstream_variable"`
+ QosAdaptiveBandwidthDownstream types.Bool `tfsdk:"qos_adaptive_bandwidth_downstream"`
+ QosAdaptiveMinDownstream types.Int64 `tfsdk:"qos_adaptive_min_downstream"`
+ QosAdaptiveMinDownstreamVariable types.String `tfsdk:"qos_adaptive_min_downstream_variable"`
+ QosAdaptiveMaxDownstream types.Int64 `tfsdk:"qos_adaptive_max_downstream"`
+ QosAdaptiveMaxDownstreamVariable types.String `tfsdk:"qos_adaptive_max_downstream_variable"`
+ QosAdaptiveDefaultDownstream types.Int64 `tfsdk:"qos_adaptive_default_downstream"`
+ QosAdaptiveDefaultDownstreamVariable types.String `tfsdk:"qos_adaptive_default_downstream_variable"`
+ QosShapingRate types.Int64 `tfsdk:"qos_shaping_rate"`
+ QosShapingRateVariable types.String `tfsdk:"qos_shaping_rate_variable"`
+ Arps []TransportWANVPNInterfaceCellularArps `tfsdk:"arps"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
+ InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ TlocExtension types.String `tfsdk:"tloc_extension"`
+ TlocExtensionVariable types.String `tfsdk:"tloc_extension_variable"`
+ Tracker types.String `tfsdk:"tracker"`
+ TrackerVariable types.String `tfsdk:"tracker_variable"`
+ IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
+ IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
+}
+
+type TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations struct {
+ Encapsulation types.String `tfsdk:"encapsulation"`
+ Preference types.Int64 `tfsdk:"preference"`
+ PreferenceVariable types.String `tfsdk:"preference_variable"`
+ Weight types.Int64 `tfsdk:"weight"`
+ WeightVariable types.String `tfsdk:"weight_variable"`
+}
+
+type TransportWANVPNInterfaceCellularArps struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportWANVPNInterfaceCellular) getModel() string {
+ return "transport_wan_vpn_interface_cellular"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportWANVPNInterfaceCellular) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/cellular", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
+ }
+ } else if data.Ipv4DhcpHelper.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
+ var values []string
+ data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
+ }
+ }
+
+ if !data.ServiceProviderVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable")
+ body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString())
+ }
+ } else if data.ServiceProvider.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global")
+ body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString())
+ }
+ }
+
+ if !data.BandwidthUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString())
+ }
+ } else if data.BandwidthUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64())
+ }
+ }
+
+ if !data.BandwidthDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString())
+ }
+ } else if data.BandwidthDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64())
+ }
+ }
+ if data.TunnelInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnelInterface.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool())
+ }
+ }
+
+ if !data.PerTunnelQosVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString())
+ }
+ } else if data.PerTunnelQos.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool())
+ }
+ }
+
+ if !data.TunnelQosModeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString())
+ }
+ } else if !data.TunnelQosMode.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString())
+ }
+ }
+
+ if !data.TunnelBandwidthPercentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString())
+ }
+ } else if data.TunnelBandwidthPercent.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceCarrierVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceCarrier.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceColorVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceColor.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceHelloInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceHelloTolerance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceLastResortCircuit.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceColorRestrict.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceGroupsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceGroups.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceBorderVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceBorder.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceMaxControlConnections.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceNatRefreshInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceVbondAsStunServer.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global")
+ var values []int64
+ data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values)
+ }
+ }
+
+ if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfacePortHopVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString())
+ }
+ } else if data.TunnelInterfacePortHop.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceLowBandwidthLink.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceTunnelTcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceClearDontFragment.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceNetworkBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowAllVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowAll.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.all.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowBgp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowDhcp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString())
+ }
+ } else if !data.TunnelInterfaceAllowNtp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowSshVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString())
+ }
+ } else if !data.TunnelInterfaceAllowSsh.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowDns.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowIcmp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowHttps.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.https.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowOspf.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowStunVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowStun.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowSnmp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowNetconf.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowBfd.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"encapsulation", []interface{}{})
+ for _, item := range data.TunnelInterfaceEncapsulations {
+ itemBody := ""
+ if !item.Encapsulation.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString())
+ }
+ }
+
+ if !item.PreferenceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString())
+ }
+ } else if item.Preference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64())
+ }
+ }
+
+ if !item.WeightVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString())
+ }
+ } else if item.Weight.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", 1)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody)
+ }
+ }
+
+ if !data.NatIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "variable")
+ body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString())
+ }
+ } else if data.NatIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "default")
+ body, _ = sjson.Set(body, path+"nat.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "global")
+ body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool())
+ }
+ }
+
+ if !data.NatUdpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString())
+ }
+ } else if data.NatUdpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64())
+ }
+ }
+
+ if !data.NatTcpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString())
+ }
+ } else if data.NatTcpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64())
+ }
+ }
+ if !data.QosAdaptive.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool())
+ }
+ }
+
+ if !data.QosAdaptivePeriodVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString())
+ }
+ } else if !data.QosAdaptivePeriod.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64())
+ }
+ }
+ if !data.QosAdaptiveBandwidthUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool())
+ }
+ }
+
+ if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMinUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMaxUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveDefaultUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64())
+ }
+ }
+ if !data.QosAdaptiveBandwidthDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool())
+ }
+ }
+
+ if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMinDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMaxDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveDefaultDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64())
+ }
+ }
+
+ if !data.QosShapingRateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString())
+ }
+ } else if !data.QosShapingRate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"arp", []interface{}{})
+ for _, item := range data.Arps {
+ itemBody := ""
+
+ if !item.IpAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
+ }
+ } else if item.IpAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
+ }
+ }
+
+ if !item.MacAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
+ }
+ } else if item.MacAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.InterfaceMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
+ }
+ } else if data.InterfaceMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.TlocExtensionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString())
+ }
+ } else if data.TlocExtension.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString())
+ }
+ }
+
+ if !data.TrackerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString())
+ }
+ } else if data.Tracker.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString())
+ }
+ }
+
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
+ }
+ } else if data.IpDirectedBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportWANVPNInterfaceCellular) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.ServiceProvider = types.StringNull()
+ data.ServiceProviderVariable = types.StringNull()
+ if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
+ va := res.Get(path + "serviceProvider.value")
+ if t.String() == "variable" {
+ data.ServiceProviderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ServiceProvider = types.StringValue(va.String())
+ }
+ }
+ data.BandwidthUpstream = types.Int64Null()
+ data.BandwidthUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthUpstream.value")
+ if t.String() == "variable" {
+ data.BandwidthUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.BandwidthDownstream = types.Int64Null()
+ data.BandwidthDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthDownstream.value")
+ if t.String() == "variable" {
+ data.BandwidthDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterface = types.BoolNull()
+
+ if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelInterface.value")
+ if t.String() == "global" {
+ data.TunnelInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQos = types.BoolNull()
+ data.PerTunnelQosVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQos.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQos = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelQosMode = types.StringNull()
+ data.TunnelQosModeVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.mode.value")
+ if t.String() == "variable" {
+ data.TunnelQosModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelQosMode = types.StringValue(va.String())
+ }
+ }
+ data.TunnelBandwidthPercent = types.Int64Null()
+ data.TunnelBandwidthPercentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bandwidthPercent.value")
+ if t.String() == "variable" {
+ data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelBandwidthPercent = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bind.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceCarrier = types.StringNull()
+ data.TunnelInterfaceCarrierVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.carrier.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCarrier = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColor = types.StringNull()
+ data.TunnelInterfaceColorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.color.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColor = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceHelloInterval = types.Int64Null()
+ data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloTolerance = types.Int64Null()
+ data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloTolerance.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceLastResortCircuit = types.BoolNull()
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lastResortCircuit.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceColorRestrict = types.BoolNull()
+ data.TunnelInterfaceColorRestrictVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.restrict.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGroups = types.Int64Null()
+ data.TunnelInterfaceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.group.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGroups = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBorder = types.BoolNull()
+ data.TunnelInterfaceBorderVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.border.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceMaxControlConnections = types.Int64Null()
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.maxControlConnections.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.natRefreshInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vBondAsStunServer.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.excludeControllerGroupList.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vManageConnectionPreference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfacePortHop = types.BoolNull()
+ data.TunnelInterfacePortHopVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.portHop.value")
+ if t.String() == "variable" {
+ data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lowBandwidthLink.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tunnelTcpMss.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceClearDontFragment = types.BoolNull()
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.networkBroadcast.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowAll = types.BoolNull()
+ data.TunnelInterfaceAllowAllVariable = types.StringNull()
+ if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.all.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBgp = types.BoolNull()
+ data.TunnelInterfaceAllowBgpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bgp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDhcp = types.BoolNull()
+ data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dhcp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNtp = types.BoolNull()
+ data.TunnelInterfaceAllowNtpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ntp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSsh = types.BoolNull()
+ data.TunnelInterfaceAllowSshVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ssh.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDns = types.BoolNull()
+ data.TunnelInterfaceAllowDnsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dns.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowIcmp = types.BoolNull()
+ data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.icmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowHttps = types.BoolNull()
+ data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.https.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowOspf = types.BoolNull()
+ data.TunnelInterfaceAllowOspfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ospf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowStun = types.BoolNull()
+ data.TunnelInterfaceAllowStunVariable = types.StringNull()
+ if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.stun.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSnmp = types.BoolNull()
+ data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.snmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNetconf = types.BoolNull()
+ data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.netconf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBfd = types.BoolNull()
+ data.TunnelInterfaceAllowBfdVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bfd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "encapsulation"); value.Exists() {
+ data.TunnelInterfaceEncapsulations = make([]TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations{}
+ item.Encapsulation = types.StringNull()
+
+ if t := v.Get("encap.optionType"); t.Exists() {
+ va := v.Get("encap.value")
+ if t.String() == "global" {
+ item.Encapsulation = types.StringValue(va.String())
+ }
+ }
+ item.Preference = types.Int64Null()
+ item.PreferenceVariable = types.StringNull()
+ if t := v.Get("preference.optionType"); t.Exists() {
+ va := v.Get("preference.value")
+ if t.String() == "variable" {
+ item.PreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Preference = types.Int64Value(va.Int())
+ }
+ }
+ item.Weight = types.Int64Null()
+ item.WeightVariable = types.StringNull()
+ if t := v.Get("weight.optionType"); t.Exists() {
+ va := v.Get("weight.value")
+ if t.String() == "variable" {
+ item.WeightVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Weight = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceEncapsulations = append(data.TunnelInterfaceEncapsulations, item)
+ return true
+ })
+ }
+ data.NatIpv4 = types.BoolNull()
+ data.NatIpv4Variable = types.StringNull()
+ if t := res.Get(path + "nat.optionType"); t.Exists() {
+ va := res.Get(path + "nat.value")
+ if t.String() == "variable" {
+ data.NatIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatIpv4 = types.BoolValue(va.Bool())
+ }
+ }
+ data.NatUdpTimeout = types.Int64Null()
+ data.NatUdpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
+ if t.String() == "variable" {
+ data.NatUdpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatUdpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.NatTcpTimeout = types.Int64Null()
+ data.NatTcpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
+ if t.String() == "variable" {
+ data.NatTcpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatTcpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptive = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptiveQoS.value")
+ if t.String() == "global" {
+ data.QosAdaptive = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptivePeriod = types.Int64Null()
+ data.QosAdaptivePeriodVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptPeriod.value")
+ if t.String() == "variable" {
+ data.QosAdaptivePeriodVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptivePeriod = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthUpstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinUpstream = types.Int64Null()
+ data.QosAdaptiveMinUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxUpstream = types.Int64Null()
+ data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultUpstream = types.Int64Null()
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthDownstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinDownstream = types.Int64Null()
+ data.QosAdaptiveMinDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxDownstream = types.Int64Null()
+ data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultDownstream = types.Int64Null()
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosShapingRate = types.Int64Null()
+ data.QosShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.QosShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "arp"); value.Exists() {
+ data.Arps = make([]TransportWANVPNInterfaceCellularArps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceCellularArps{}
+ item.IpAddress = types.StringNull()
+ item.IpAddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.IpAddress = types.StringValue(va.String())
+ }
+ }
+ item.MacAddress = types.StringNull()
+ item.MacAddressVariable = types.StringNull()
+ if t := v.Get("macAddress.optionType"); t.Exists() {
+ va := v.Get("macAddress.value")
+ if t.String() == "variable" {
+ item.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps = append(data.Arps, item)
+ return true
+ })
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TlocExtension = types.StringNull()
+ data.TlocExtensionVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtension.value")
+ if t.String() == "variable" {
+ data.TlocExtensionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlocExtension = types.StringValue(va.String())
+ }
+ }
+ data.Tracker = types.StringNull()
+ data.TrackerVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tracker.value")
+ if t.String() == "variable" {
+ data.TrackerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Tracker = types.StringValue(va.String())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportWANVPNInterfaceCellular) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.ServiceProvider = types.StringNull()
+ data.ServiceProviderVariable = types.StringNull()
+ if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
+ va := res.Get(path + "serviceProvider.value")
+ if t.String() == "variable" {
+ data.ServiceProviderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ServiceProvider = types.StringValue(va.String())
+ }
+ }
+ data.BandwidthUpstream = types.Int64Null()
+ data.BandwidthUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthUpstream.value")
+ if t.String() == "variable" {
+ data.BandwidthUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.BandwidthDownstream = types.Int64Null()
+ data.BandwidthDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthDownstream.value")
+ if t.String() == "variable" {
+ data.BandwidthDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterface = types.BoolNull()
+
+ if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelInterface.value")
+ if t.String() == "global" {
+ data.TunnelInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQos = types.BoolNull()
+ data.PerTunnelQosVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQos.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQos = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelQosMode = types.StringNull()
+ data.TunnelQosModeVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.mode.value")
+ if t.String() == "variable" {
+ data.TunnelQosModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelQosMode = types.StringValue(va.String())
+ }
+ }
+ data.TunnelBandwidthPercent = types.Int64Null()
+ data.TunnelBandwidthPercentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bandwidthPercent.value")
+ if t.String() == "variable" {
+ data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelBandwidthPercent = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bind.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceCarrier = types.StringNull()
+ data.TunnelInterfaceCarrierVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.carrier.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCarrier = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColor = types.StringNull()
+ data.TunnelInterfaceColorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.color.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColor = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceHelloInterval = types.Int64Null()
+ data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloTolerance = types.Int64Null()
+ data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloTolerance.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceLastResortCircuit = types.BoolNull()
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lastResortCircuit.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceColorRestrict = types.BoolNull()
+ data.TunnelInterfaceColorRestrictVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.restrict.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGroups = types.Int64Null()
+ data.TunnelInterfaceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.group.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGroups = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBorder = types.BoolNull()
+ data.TunnelInterfaceBorderVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.border.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceMaxControlConnections = types.Int64Null()
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.maxControlConnections.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.natRefreshInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vBondAsStunServer.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.excludeControllerGroupList.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vManageConnectionPreference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfacePortHop = types.BoolNull()
+ data.TunnelInterfacePortHopVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.portHop.value")
+ if t.String() == "variable" {
+ data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lowBandwidthLink.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tunnelTcpMss.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceClearDontFragment = types.BoolNull()
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.networkBroadcast.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowAll = types.BoolNull()
+ data.TunnelInterfaceAllowAllVariable = types.StringNull()
+ if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.all.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBgp = types.BoolNull()
+ data.TunnelInterfaceAllowBgpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bgp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDhcp = types.BoolNull()
+ data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dhcp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNtp = types.BoolNull()
+ data.TunnelInterfaceAllowNtpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ntp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSsh = types.BoolNull()
+ data.TunnelInterfaceAllowSshVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ssh.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDns = types.BoolNull()
+ data.TunnelInterfaceAllowDnsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dns.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowIcmp = types.BoolNull()
+ data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.icmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowHttps = types.BoolNull()
+ data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.https.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowOspf = types.BoolNull()
+ data.TunnelInterfaceAllowOspfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ospf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowStun = types.BoolNull()
+ data.TunnelInterfaceAllowStunVariable = types.StringNull()
+ if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.stun.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSnmp = types.BoolNull()
+ data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.snmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNetconf = types.BoolNull()
+ data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.netconf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBfd = types.BoolNull()
+ data.TunnelInterfaceAllowBfdVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bfd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.TunnelInterfaceEncapsulations {
+ keys := [...]string{"encap"}
+ keyValues := [...]string{data.TunnelInterfaceEncapsulations[i].Encapsulation.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "encapsulation").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringNull()
+
+ if t := r.Get("encap.optionType"); t.Exists() {
+ va := r.Get("encap.value")
+ if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Null()
+ data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringNull()
+ if t := r.Get("preference.optionType"); t.Exists() {
+ va := r.Get("preference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Null()
+ data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringNull()
+ if t := r.Get("weight.optionType"); t.Exists() {
+ va := r.Get("weight.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.NatIpv4 = types.BoolNull()
+ data.NatIpv4Variable = types.StringNull()
+ if t := res.Get(path + "nat.optionType"); t.Exists() {
+ va := res.Get(path + "nat.value")
+ if t.String() == "variable" {
+ data.NatIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatIpv4 = types.BoolValue(va.Bool())
+ }
+ }
+ data.NatUdpTimeout = types.Int64Null()
+ data.NatUdpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
+ if t.String() == "variable" {
+ data.NatUdpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatUdpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.NatTcpTimeout = types.Int64Null()
+ data.NatTcpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
+ if t.String() == "variable" {
+ data.NatTcpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatTcpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptive = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptiveQoS.value")
+ if t.String() == "global" {
+ data.QosAdaptive = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptivePeriod = types.Int64Null()
+ data.QosAdaptivePeriodVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptPeriod.value")
+ if t.String() == "variable" {
+ data.QosAdaptivePeriodVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptivePeriod = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthUpstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinUpstream = types.Int64Null()
+ data.QosAdaptiveMinUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxUpstream = types.Int64Null()
+ data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultUpstream = types.Int64Null()
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthDownstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinDownstream = types.Int64Null()
+ data.QosAdaptiveMinDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxDownstream = types.Int64Null()
+ data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultDownstream = types.Int64Null()
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosShapingRate = types.Int64Null()
+ data.QosShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.QosShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Arps {
+ keys := [...]string{"ipAddress", "macAddress"}
+ keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "arp").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Arps[i].IpAddress = types.StringNull()
+ data.Arps[i].IpAddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps[i].MacAddress = types.StringNull()
+ data.Arps[i].MacAddressVariable = types.StringNull()
+ if t := r.Get("macAddress.optionType"); t.Exists() {
+ va := r.Get("macAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].MacAddress = types.StringValue(va.String())
+ }
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TlocExtension = types.StringNull()
+ data.TlocExtensionVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtension.value")
+ if t.String() == "variable" {
+ data.TlocExtensionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlocExtension = types.StringValue(va.String())
+ }
+ }
+ data.Tracker = types.StringNull()
+ data.TrackerVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tracker.value")
+ if t.String() == "variable" {
+ data.TrackerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Tracker = types.StringValue(va.String())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportWANVPNInterfaceCellular) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TransportWanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpHelper.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ return false
+ }
+ if !data.ServiceProvider.IsNull() {
+ return false
+ }
+ if !data.ServiceProviderVariable.IsNull() {
+ return false
+ }
+ if !data.BandwidthUpstream.IsNull() {
+ return false
+ }
+ if !data.BandwidthUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.BandwidthDownstream.IsNull() {
+ return false
+ }
+ if !data.BandwidthDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterface.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQos.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQosVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelQosMode.IsNull() {
+ return false
+ }
+ if !data.TunnelQosModeVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelBandwidthPercent.IsNull() {
+ return false
+ }
+ if !data.TunnelBandwidthPercentVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCarrier.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCarrierVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColor.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColorVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloInterval.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloTolerance.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLastResortCircuit.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColorRestrict.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGroups.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGroupsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBorder.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBorderVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceMaxControlConnections.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNatRefreshInterval.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVbondAsStunServer.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfacePortHop.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfacePortHopVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLowBandwidthLink.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceTunnelTcpMss.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearDontFragment.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNetworkBroadcast.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowAll.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowAllVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBgp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDhcp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNtp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSsh.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSshVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDns.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowIcmp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowHttps.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowOspf.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowStun.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowStunVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSnmp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNetconf.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBfd.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
+ return false
+ }
+ if len(data.TunnelInterfaceEncapsulations) > 0 {
+ return false
+ }
+ if !data.NatIpv4.IsNull() {
+ return false
+ }
+ if !data.NatIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.NatUdpTimeout.IsNull() {
+ return false
+ }
+ if !data.NatUdpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.NatTcpTimeout.IsNull() {
+ return false
+ }
+ if !data.NatTcpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptive.IsNull() {
+ return false
+ }
+ if !data.QosAdaptivePeriod.IsNull() {
+ return false
+ }
+ if !data.QosAdaptivePeriodVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveBandwidthUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveBandwidthDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosShapingRate.IsNull() {
+ return false
+ }
+ if !data.QosShapingRateVariable.IsNull() {
+ return false
+ }
+ if len(data.Arps) > 0 {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtu.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtuVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.TlocExtension.IsNull() {
+ return false
+ }
+ if !data.TlocExtensionVariable.IsNull() {
+ return false
+ }
+ if !data.Tracker.IsNull() {
+ return false
+ }
+ if !data.TrackerVariable.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcast.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go
deleted file mode 100644
index 191f75a46..000000000
--- a/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go
+++ /dev/null
@@ -1,3093 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportWANVPNInterfaceCellular 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"`
- TransportWanVpnProfileParcelId types.String `tfsdk:"transport_wan_vpn_profile_parcel_id"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
- Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
- ServiceProvider types.String `tfsdk:"service_provider"`
- ServiceProviderVariable types.String `tfsdk:"service_provider_variable"`
- BandwidthUpstream types.Int64 `tfsdk:"bandwidth_upstream"`
- BandwidthUpstreamVariable types.String `tfsdk:"bandwidth_upstream_variable"`
- BandwidthDownstream types.Int64 `tfsdk:"bandwidth_downstream"`
- BandwidthDownstreamVariable types.String `tfsdk:"bandwidth_downstream_variable"`
- TunnelInterface types.Bool `tfsdk:"tunnel_interface"`
- PerTunnelQos types.Bool `tfsdk:"per_tunnel_qos"`
- PerTunnelQosVariable types.String `tfsdk:"per_tunnel_qos_variable"`
- TunnelQosMode types.String `tfsdk:"tunnel_qos_mode"`
- TunnelQosModeVariable types.String `tfsdk:"tunnel_qos_mode_variable"`
- TunnelBandwidthPercent types.Int64 `tfsdk:"tunnel_bandwidth_percent"`
- TunnelBandwidthPercentVariable types.String `tfsdk:"tunnel_bandwidth_percent_variable"`
- TunnelInterfaceBindLoopbackTunnel types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel"`
- TunnelInterfaceBindLoopbackTunnelVariable types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel_variable"`
- TunnelInterfaceCarrier types.String `tfsdk:"tunnel_interface_carrier"`
- TunnelInterfaceCarrierVariable types.String `tfsdk:"tunnel_interface_carrier_variable"`
- TunnelInterfaceColor types.String `tfsdk:"tunnel_interface_color"`
- TunnelInterfaceColorVariable types.String `tfsdk:"tunnel_interface_color_variable"`
- TunnelInterfaceHelloInterval types.Int64 `tfsdk:"tunnel_interface_hello_interval"`
- TunnelInterfaceHelloIntervalVariable types.String `tfsdk:"tunnel_interface_hello_interval_variable"`
- TunnelInterfaceHelloTolerance types.Int64 `tfsdk:"tunnel_interface_hello_tolerance"`
- TunnelInterfaceHelloToleranceVariable types.String `tfsdk:"tunnel_interface_hello_tolerance_variable"`
- TunnelInterfaceLastResortCircuit types.Bool `tfsdk:"tunnel_interface_last_resort_circuit"`
- TunnelInterfaceLastResortCircuitVariable types.String `tfsdk:"tunnel_interface_last_resort_circuit_variable"`
- TunnelInterfaceColorRestrict types.Bool `tfsdk:"tunnel_interface_color_restrict"`
- TunnelInterfaceColorRestrictVariable types.String `tfsdk:"tunnel_interface_color_restrict_variable"`
- TunnelInterfaceGroups types.Int64 `tfsdk:"tunnel_interface_groups"`
- TunnelInterfaceGroupsVariable types.String `tfsdk:"tunnel_interface_groups_variable"`
- TunnelInterfaceBorder types.Bool `tfsdk:"tunnel_interface_border"`
- TunnelInterfaceBorderVariable types.String `tfsdk:"tunnel_interface_border_variable"`
- TunnelInterfaceMaxControlConnections types.Int64 `tfsdk:"tunnel_interface_max_control_connections"`
- TunnelInterfaceMaxControlConnectionsVariable types.String `tfsdk:"tunnel_interface_max_control_connections_variable"`
- TunnelInterfaceNatRefreshInterval types.Int64 `tfsdk:"tunnel_interface_nat_refresh_interval"`
- TunnelInterfaceNatRefreshIntervalVariable types.String `tfsdk:"tunnel_interface_nat_refresh_interval_variable"`
- TunnelInterfaceVbondAsStunServer types.Bool `tfsdk:"tunnel_interface_vbond_as_stun_server"`
- TunnelInterfaceVbondAsStunServerVariable types.String `tfsdk:"tunnel_interface_vbond_as_stun_server_variable"`
- TunnelInterfaceExcludeControllerGroupList types.Set `tfsdk:"tunnel_interface_exclude_controller_group_list"`
- TunnelInterfaceExcludeControllerGroupListVariable types.String `tfsdk:"tunnel_interface_exclude_controller_group_list_variable"`
- TunnelInterfaceVmanageConnectionPreference types.Int64 `tfsdk:"tunnel_interface_vmanage_connection_preference"`
- TunnelInterfaceVmanageConnectionPreferenceVariable types.String `tfsdk:"tunnel_interface_vmanage_connection_preference_variable"`
- TunnelInterfacePortHop types.Bool `tfsdk:"tunnel_interface_port_hop"`
- TunnelInterfacePortHopVariable types.String `tfsdk:"tunnel_interface_port_hop_variable"`
- TunnelInterfaceLowBandwidthLink types.Bool `tfsdk:"tunnel_interface_low_bandwidth_link"`
- TunnelInterfaceLowBandwidthLinkVariable types.String `tfsdk:"tunnel_interface_low_bandwidth_link_variable"`
- TunnelInterfaceTunnelTcpMss types.Int64 `tfsdk:"tunnel_interface_tunnel_tcp_mss"`
- TunnelInterfaceTunnelTcpMssVariable types.String `tfsdk:"tunnel_interface_tunnel_tcp_mss_variable"`
- TunnelInterfaceClearDontFragment types.Bool `tfsdk:"tunnel_interface_clear_dont_fragment"`
- TunnelInterfaceClearDontFragmentVariable types.String `tfsdk:"tunnel_interface_clear_dont_fragment_variable"`
- TunnelInterfaceNetworkBroadcast types.Bool `tfsdk:"tunnel_interface_network_broadcast"`
- TunnelInterfaceNetworkBroadcastVariable types.String `tfsdk:"tunnel_interface_network_broadcast_variable"`
- TunnelInterfaceAllowAll types.Bool `tfsdk:"tunnel_interface_allow_all"`
- TunnelInterfaceAllowAllVariable types.String `tfsdk:"tunnel_interface_allow_all_variable"`
- TunnelInterfaceAllowBgp types.Bool `tfsdk:"tunnel_interface_allow_bgp"`
- TunnelInterfaceAllowBgpVariable types.String `tfsdk:"tunnel_interface_allow_bgp_variable"`
- TunnelInterfaceAllowDhcp types.Bool `tfsdk:"tunnel_interface_allow_dhcp"`
- TunnelInterfaceAllowDhcpVariable types.String `tfsdk:"tunnel_interface_allow_dhcp_variable"`
- TunnelInterfaceAllowNtp types.Bool `tfsdk:"tunnel_interface_allow_ntp"`
- TunnelInterfaceAllowNtpVariable types.String `tfsdk:"tunnel_interface_allow_ntp_variable"`
- TunnelInterfaceAllowSsh types.Bool `tfsdk:"tunnel_interface_allow_ssh"`
- TunnelInterfaceAllowSshVariable types.String `tfsdk:"tunnel_interface_allow_ssh_variable"`
- TunnelInterfaceAllowDns types.Bool `tfsdk:"tunnel_interface_allow_dns"`
- TunnelInterfaceAllowDnsVariable types.String `tfsdk:"tunnel_interface_allow_dns_variable"`
- TunnelInterfaceAllowIcmp types.Bool `tfsdk:"tunnel_interface_allow_icmp"`
- TunnelInterfaceAllowIcmpVariable types.String `tfsdk:"tunnel_interface_allow_icmp_variable"`
- TunnelInterfaceAllowHttps types.Bool `tfsdk:"tunnel_interface_allow_https"`
- TunnelInterfaceAllowHttpsVariable types.String `tfsdk:"tunnel_interface_allow_https_variable"`
- TunnelInterfaceAllowOspf types.Bool `tfsdk:"tunnel_interface_allow_ospf"`
- TunnelInterfaceAllowOspfVariable types.String `tfsdk:"tunnel_interface_allow_ospf_variable"`
- TunnelInterfaceAllowStun types.Bool `tfsdk:"tunnel_interface_allow_stun"`
- TunnelInterfaceAllowStunVariable types.String `tfsdk:"tunnel_interface_allow_stun_variable"`
- TunnelInterfaceAllowSnmp types.Bool `tfsdk:"tunnel_interface_allow_snmp"`
- TunnelInterfaceAllowSnmpVariable types.String `tfsdk:"tunnel_interface_allow_snmp_variable"`
- TunnelInterfaceAllowNetconf types.Bool `tfsdk:"tunnel_interface_allow_netconf"`
- TunnelInterfaceAllowNetconfVariable types.String `tfsdk:"tunnel_interface_allow_netconf_variable"`
- TunnelInterfaceAllowBfd types.Bool `tfsdk:"tunnel_interface_allow_bfd"`
- TunnelInterfaceAllowBfdVariable types.String `tfsdk:"tunnel_interface_allow_bfd_variable"`
- TunnelInterfaceEncapsulations []TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations `tfsdk:"tunnel_interface_encapsulations"`
- NatIpv4 types.Bool `tfsdk:"nat_ipv4"`
- NatIpv4Variable types.String `tfsdk:"nat_ipv4_variable"`
- NatUdpTimeout types.Int64 `tfsdk:"nat_udp_timeout"`
- NatUdpTimeoutVariable types.String `tfsdk:"nat_udp_timeout_variable"`
- NatTcpTimeout types.Int64 `tfsdk:"nat_tcp_timeout"`
- NatTcpTimeoutVariable types.String `tfsdk:"nat_tcp_timeout_variable"`
- QosAdaptive types.Bool `tfsdk:"qos_adaptive"`
- QosAdaptivePeriod types.Int64 `tfsdk:"qos_adaptive_period"`
- QosAdaptivePeriodVariable types.String `tfsdk:"qos_adaptive_period_variable"`
- QosAdaptiveBandwidthUpstream types.Bool `tfsdk:"qos_adaptive_bandwidth_upstream"`
- QosAdaptiveMinUpstream types.Int64 `tfsdk:"qos_adaptive_min_upstream"`
- QosAdaptiveMinUpstreamVariable types.String `tfsdk:"qos_adaptive_min_upstream_variable"`
- QosAdaptiveMaxUpstream types.Int64 `tfsdk:"qos_adaptive_max_upstream"`
- QosAdaptiveMaxUpstreamVariable types.String `tfsdk:"qos_adaptive_max_upstream_variable"`
- QosAdaptiveDefaultUpstream types.Int64 `tfsdk:"qos_adaptive_default_upstream"`
- QosAdaptiveDefaultUpstreamVariable types.String `tfsdk:"qos_adaptive_default_upstream_variable"`
- QosAdaptiveBandwidthDownstream types.Bool `tfsdk:"qos_adaptive_bandwidth_downstream"`
- QosAdaptiveMinDownstream types.Int64 `tfsdk:"qos_adaptive_min_downstream"`
- QosAdaptiveMinDownstreamVariable types.String `tfsdk:"qos_adaptive_min_downstream_variable"`
- QosAdaptiveMaxDownstream types.Int64 `tfsdk:"qos_adaptive_max_downstream"`
- QosAdaptiveMaxDownstreamVariable types.String `tfsdk:"qos_adaptive_max_downstream_variable"`
- QosAdaptiveDefaultDownstream types.Int64 `tfsdk:"qos_adaptive_default_downstream"`
- QosAdaptiveDefaultDownstreamVariable types.String `tfsdk:"qos_adaptive_default_downstream_variable"`
- QosShapingRate types.Int64 `tfsdk:"qos_shaping_rate"`
- QosShapingRateVariable types.String `tfsdk:"qos_shaping_rate_variable"`
- Arps []TransportWANVPNInterfaceCellularArps `tfsdk:"arps"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
- InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- TlocExtension types.String `tfsdk:"tloc_extension"`
- TlocExtensionVariable types.String `tfsdk:"tloc_extension_variable"`
- Tracker types.String `tfsdk:"tracker"`
- TrackerVariable types.String `tfsdk:"tracker_variable"`
- IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
- IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
-}
-
-type TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations struct {
- Encapsulation types.String `tfsdk:"encapsulation"`
- Preference types.Int64 `tfsdk:"preference"`
- PreferenceVariable types.String `tfsdk:"preference_variable"`
- Weight types.Int64 `tfsdk:"weight"`
- WeightVariable types.String `tfsdk:"weight_variable"`
-}
-
-type TransportWANVPNInterfaceCellularArps struct {
- IpAddress types.String `tfsdk:"ip_address"`
- IpAddressVariable types.String `tfsdk:"ip_address_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportWANVPNInterfaceCellular) getModel() string {
- return "transport_wan_vpn_interface_cellular"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportWANVPNInterfaceCellular) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/cellular", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
- body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
- }
- } else if data.Ipv4DhcpHelper.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
- var values []string
- data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
- }
- }
-
- if !data.ServiceProviderVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable")
- body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString())
- }
- } else if data.ServiceProvider.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global")
- body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString())
- }
- }
-
- if !data.BandwidthUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString())
- }
- } else if data.BandwidthUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64())
- }
- }
-
- if !data.BandwidthDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString())
- }
- } else if data.BandwidthDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64())
- }
- }
- if data.TunnelInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnelInterface.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool())
- }
- }
-
- if !data.PerTunnelQosVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString())
- }
- } else if data.PerTunnelQos.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool())
- }
- }
-
- if !data.TunnelQosModeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString())
- }
- } else if !data.TunnelQosMode.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString())
- }
- }
-
- if !data.TunnelBandwidthPercentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString())
- }
- } else if data.TunnelBandwidthPercent.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString())
- }
- } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString())
- }
- }
-
- if !data.TunnelInterfaceCarrierVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString())
- }
- } else if data.TunnelInterfaceCarrier.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString())
- }
- }
-
- if !data.TunnelInterfaceColorVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString())
- }
- } else if data.TunnelInterfaceColor.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString())
- }
- }
-
- if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString())
- }
- } else if data.TunnelInterfaceHelloInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString())
- }
- } else if data.TunnelInterfaceHelloTolerance.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString())
- }
- } else if data.TunnelInterfaceLastResortCircuit.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString())
- }
- } else if data.TunnelInterfaceColorRestrict.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceGroupsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString())
- }
- } else if data.TunnelInterfaceGroups.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceBorderVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString())
- }
- } else if data.TunnelInterfaceBorder.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.border.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString())
- }
- } else if data.TunnelInterfaceMaxControlConnections.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString())
- }
- } else if data.TunnelInterfaceNatRefreshInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString())
- }
- } else if data.TunnelInterfaceVbondAsStunServer.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString())
- }
- } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global")
- var values []int64
- data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values)
- }
- }
-
- if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString())
- }
- } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64())
- }
- }
-
- if !data.TunnelInterfacePortHopVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString())
- }
- } else if data.TunnelInterfacePortHop.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString())
- }
- } else if data.TunnelInterfaceLowBandwidthLink.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString())
- }
- } else if data.TunnelInterfaceTunnelTcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString())
- }
- } else if data.TunnelInterfaceClearDontFragment.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString())
- }
- } else if data.TunnelInterfaceNetworkBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowAllVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowAll.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.all.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowBgp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowDhcp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString())
- }
- } else if !data.TunnelInterfaceAllowNtp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowSshVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString())
- }
- } else if !data.TunnelInterfaceAllowSsh.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowDns.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.dns.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowIcmp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowHttps.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.https.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowOspf.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowStunVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowStun.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.stun.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowSnmp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowNetconf.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowBfd.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"encapsulation", []interface{}{})
- for _, item := range data.TunnelInterfaceEncapsulations {
- itemBody := ""
- if !item.Encapsulation.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString())
- }
- }
-
- if !item.PreferenceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString())
- }
- } else if item.Preference.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64())
- }
- }
-
- if !item.WeightVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString())
- }
- } else if item.Weight.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "weight.value", 1)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody)
- }
- }
-
- if !data.NatIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "variable")
- body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString())
- }
- } else if data.NatIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "default")
- body, _ = sjson.Set(body, path+"nat.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "global")
- body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool())
- }
- }
-
- if !data.NatUdpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString())
- }
- } else if data.NatUdpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64())
- }
- }
-
- if !data.NatTcpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString())
- }
- } else if data.NatTcpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64())
- }
- }
- if !data.QosAdaptive.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool())
- }
- }
-
- if !data.QosAdaptivePeriodVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString())
- }
- } else if !data.QosAdaptivePeriod.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64())
- }
- }
- if !data.QosAdaptiveBandwidthUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool())
- }
- }
-
- if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMinUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMaxUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveDefaultUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64())
- }
- }
- if !data.QosAdaptiveBandwidthDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool())
- }
- }
-
- if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMinDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMaxDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveDefaultDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64())
- }
- }
-
- if !data.QosShapingRateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString())
- }
- } else if !data.QosShapingRate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"arp", []interface{}{})
- for _, item := range data.Arps {
- itemBody := ""
-
- if !item.IpAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
- }
- } else if item.IpAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
- }
- }
-
- if !item.MacAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
- }
- } else if item.MacAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.InterfaceMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
- }
- } else if data.InterfaceMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.TlocExtensionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString())
- }
- } else if data.TlocExtension.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString())
- }
- }
-
- if !data.TrackerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString())
- }
- } else if data.Tracker.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString())
- }
- }
-
- if !data.IpDirectedBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
- }
- } else if data.IpDirectedBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportWANVPNInterfaceCellular) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.ServiceProvider = types.StringNull()
- data.ServiceProviderVariable = types.StringNull()
- if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
- va := res.Get(path + "serviceProvider.value")
- if t.String() == "variable" {
- data.ServiceProviderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ServiceProvider = types.StringValue(va.String())
- }
- }
- data.BandwidthUpstream = types.Int64Null()
- data.BandwidthUpstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthUpstream.value")
- if t.String() == "variable" {
- data.BandwidthUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthUpstream = types.Int64Value(va.Int())
- }
- }
- data.BandwidthDownstream = types.Int64Null()
- data.BandwidthDownstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthDownstream.value")
- if t.String() == "variable" {
- data.BandwidthDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthDownstream = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterface = types.BoolNull()
-
- if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelInterface.value")
- if t.String() == "global" {
- data.TunnelInterface = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQos = types.BoolNull()
- data.PerTunnelQosVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQos.value")
- if t.String() == "variable" {
- data.PerTunnelQosVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQos = types.BoolValue(va.Bool())
- }
- }
- data.TunnelQosMode = types.StringNull()
- data.TunnelQosModeVariable = types.StringNull()
- if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.mode.value")
- if t.String() == "variable" {
- data.TunnelQosModeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelQosMode = types.StringValue(va.String())
- }
- }
- data.TunnelBandwidthPercent = types.Int64Null()
- data.TunnelBandwidthPercentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bandwidthPercent.value")
- if t.String() == "variable" {
- data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelBandwidthPercent = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bind.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceCarrier = types.StringNull()
- data.TunnelInterfaceCarrierVariable = types.StringNull()
- if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.carrier.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCarrier = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColor = types.StringNull()
- data.TunnelInterfaceColorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.color.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColor = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceHelloInterval = types.Int64Null()
- data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloTolerance = types.Int64Null()
- data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloTolerance.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceLastResortCircuit = types.BoolNull()
- data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lastResortCircuit.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceColorRestrict = types.BoolNull()
- data.TunnelInterfaceColorRestrictVariable = types.StringNull()
- if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.restrict.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGroups = types.Int64Null()
- data.TunnelInterfaceGroupsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.group.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGroups = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBorder = types.BoolNull()
- data.TunnelInterfaceBorderVariable = types.StringNull()
- if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.border.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceMaxControlConnections = types.Int64Null()
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.maxControlConnections.value")
- if t.String() == "variable" {
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.natRefreshInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vBondAsStunServer.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
- if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.excludeControllerGroupList.value")
- if t.String() == "variable" {
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
- }
- }
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vManageConnectionPreference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfacePortHop = types.BoolNull()
- data.TunnelInterfacePortHopVariable = types.StringNull()
- if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.portHop.value")
- if t.String() == "variable" {
- data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lowBandwidthLink.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tunnelTcpMss.value")
- if t.String() == "variable" {
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceClearDontFragment = types.BoolNull()
- data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.clearDontFragment.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
- if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.networkBroadcast.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowAll = types.BoolNull()
- data.TunnelInterfaceAllowAllVariable = types.StringNull()
- if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
- va := res.Get(path + "allowService.all.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBgp = types.BoolNull()
- data.TunnelInterfaceAllowBgpVariable = types.StringNull()
- if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bgp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDhcp = types.BoolNull()
- data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
- if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dhcp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNtp = types.BoolNull()
- data.TunnelInterfaceAllowNtpVariable = types.StringNull()
- if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ntp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSsh = types.BoolNull()
- data.TunnelInterfaceAllowSshVariable = types.StringNull()
- if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ssh.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDns = types.BoolNull()
- data.TunnelInterfaceAllowDnsVariable = types.StringNull()
- if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dns.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowIcmp = types.BoolNull()
- data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.icmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowHttps = types.BoolNull()
- data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
- if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
- va := res.Get(path + "allowService.https.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowOspf = types.BoolNull()
- data.TunnelInterfaceAllowOspfVariable = types.StringNull()
- if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ospf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowStun = types.BoolNull()
- data.TunnelInterfaceAllowStunVariable = types.StringNull()
- if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
- va := res.Get(path + "allowService.stun.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSnmp = types.BoolNull()
- data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.snmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNetconf = types.BoolNull()
- data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
- if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.netconf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBfd = types.BoolNull()
- data.TunnelInterfaceAllowBfdVariable = types.StringNull()
- if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bfd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "encapsulation"); value.Exists() {
- data.TunnelInterfaceEncapsulations = make([]TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceCellularTunnelInterfaceEncapsulations{}
- item.Encapsulation = types.StringNull()
-
- if t := v.Get("encap.optionType"); t.Exists() {
- va := v.Get("encap.value")
- if t.String() == "global" {
- item.Encapsulation = types.StringValue(va.String())
- }
- }
- item.Preference = types.Int64Null()
- item.PreferenceVariable = types.StringNull()
- if t := v.Get("preference.optionType"); t.Exists() {
- va := v.Get("preference.value")
- if t.String() == "variable" {
- item.PreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Preference = types.Int64Value(va.Int())
- }
- }
- item.Weight = types.Int64Null()
- item.WeightVariable = types.StringNull()
- if t := v.Get("weight.optionType"); t.Exists() {
- va := v.Get("weight.value")
- if t.String() == "variable" {
- item.WeightVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Weight = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceEncapsulations = append(data.TunnelInterfaceEncapsulations, item)
- return true
- })
- }
- data.NatIpv4 = types.BoolNull()
- data.NatIpv4Variable = types.StringNull()
- if t := res.Get(path + "nat.optionType"); t.Exists() {
- va := res.Get(path + "nat.value")
- if t.String() == "variable" {
- data.NatIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatIpv4 = types.BoolValue(va.Bool())
- }
- }
- data.NatUdpTimeout = types.Int64Null()
- data.NatUdpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
- if t.String() == "variable" {
- data.NatUdpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatUdpTimeout = types.Int64Value(va.Int())
- }
- }
- data.NatTcpTimeout = types.Int64Null()
- data.NatTcpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
- if t.String() == "variable" {
- data.NatTcpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatTcpTimeout = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptive = types.BoolNull()
-
- if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptiveQoS.value")
- if t.String() == "global" {
- data.QosAdaptive = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptivePeriod = types.Int64Null()
- data.QosAdaptivePeriodVariable = types.StringNull()
- if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptPeriod.value")
- if t.String() == "variable" {
- data.QosAdaptivePeriodVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptivePeriod = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthUpstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinUpstream = types.Int64Null()
- data.QosAdaptiveMinUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxUpstream = types.Int64Null()
- data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultUpstream = types.Int64Null()
- data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthDownstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinDownstream = types.Int64Null()
- data.QosAdaptiveMinDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxDownstream = types.Int64Null()
- data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultDownstream = types.Int64Null()
- data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosShapingRate = types.Int64Null()
- data.QosShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.QosShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosShapingRate = types.Int64Value(va.Int())
- }
- }
- if value := res.Get(path + "arp"); value.Exists() {
- data.Arps = make([]TransportWANVPNInterfaceCellularArps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceCellularArps{}
- item.IpAddress = types.StringNull()
- item.IpAddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.IpAddress = types.StringValue(va.String())
- }
- }
- item.MacAddress = types.StringNull()
- item.MacAddressVariable = types.StringNull()
- if t := v.Get("macAddress.optionType"); t.Exists() {
- va := v.Get("macAddress.value")
- if t.String() == "variable" {
- item.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.MacAddress = types.StringValue(va.String())
- }
- }
- data.Arps = append(data.Arps, item)
- return true
- })
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.TlocExtension = types.StringNull()
- data.TlocExtensionVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtension.value")
- if t.String() == "variable" {
- data.TlocExtensionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlocExtension = types.StringValue(va.String())
- }
- }
- data.Tracker = types.StringNull()
- data.TrackerVariable = types.StringNull()
- if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tracker.value")
- if t.String() == "variable" {
- data.TrackerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Tracker = types.StringValue(va.String())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportWANVPNInterfaceCellular) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.ServiceProvider = types.StringNull()
- data.ServiceProviderVariable = types.StringNull()
- if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
- va := res.Get(path + "serviceProvider.value")
- if t.String() == "variable" {
- data.ServiceProviderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ServiceProvider = types.StringValue(va.String())
- }
- }
- data.BandwidthUpstream = types.Int64Null()
- data.BandwidthUpstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthUpstream.value")
- if t.String() == "variable" {
- data.BandwidthUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthUpstream = types.Int64Value(va.Int())
- }
- }
- data.BandwidthDownstream = types.Int64Null()
- data.BandwidthDownstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthDownstream.value")
- if t.String() == "variable" {
- data.BandwidthDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthDownstream = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterface = types.BoolNull()
-
- if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelInterface.value")
- if t.String() == "global" {
- data.TunnelInterface = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQos = types.BoolNull()
- data.PerTunnelQosVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQos.value")
- if t.String() == "variable" {
- data.PerTunnelQosVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQos = types.BoolValue(va.Bool())
- }
- }
- data.TunnelQosMode = types.StringNull()
- data.TunnelQosModeVariable = types.StringNull()
- if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.mode.value")
- if t.String() == "variable" {
- data.TunnelQosModeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelQosMode = types.StringValue(va.String())
- }
- }
- data.TunnelBandwidthPercent = types.Int64Null()
- data.TunnelBandwidthPercentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bandwidthPercent.value")
- if t.String() == "variable" {
- data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelBandwidthPercent = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bind.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceCarrier = types.StringNull()
- data.TunnelInterfaceCarrierVariable = types.StringNull()
- if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.carrier.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCarrier = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColor = types.StringNull()
- data.TunnelInterfaceColorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.color.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColor = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceHelloInterval = types.Int64Null()
- data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloTolerance = types.Int64Null()
- data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloTolerance.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceLastResortCircuit = types.BoolNull()
- data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lastResortCircuit.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceColorRestrict = types.BoolNull()
- data.TunnelInterfaceColorRestrictVariable = types.StringNull()
- if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.restrict.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGroups = types.Int64Null()
- data.TunnelInterfaceGroupsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.group.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGroups = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBorder = types.BoolNull()
- data.TunnelInterfaceBorderVariable = types.StringNull()
- if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.border.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceMaxControlConnections = types.Int64Null()
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.maxControlConnections.value")
- if t.String() == "variable" {
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.natRefreshInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vBondAsStunServer.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
- if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.excludeControllerGroupList.value")
- if t.String() == "variable" {
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
- }
- }
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vManageConnectionPreference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfacePortHop = types.BoolNull()
- data.TunnelInterfacePortHopVariable = types.StringNull()
- if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.portHop.value")
- if t.String() == "variable" {
- data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lowBandwidthLink.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tunnelTcpMss.value")
- if t.String() == "variable" {
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceClearDontFragment = types.BoolNull()
- data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.clearDontFragment.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
- if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.networkBroadcast.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowAll = types.BoolNull()
- data.TunnelInterfaceAllowAllVariable = types.StringNull()
- if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
- va := res.Get(path + "allowService.all.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBgp = types.BoolNull()
- data.TunnelInterfaceAllowBgpVariable = types.StringNull()
- if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bgp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDhcp = types.BoolNull()
- data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
- if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dhcp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNtp = types.BoolNull()
- data.TunnelInterfaceAllowNtpVariable = types.StringNull()
- if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ntp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSsh = types.BoolNull()
- data.TunnelInterfaceAllowSshVariable = types.StringNull()
- if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ssh.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDns = types.BoolNull()
- data.TunnelInterfaceAllowDnsVariable = types.StringNull()
- if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dns.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowIcmp = types.BoolNull()
- data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.icmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowHttps = types.BoolNull()
- data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
- if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
- va := res.Get(path + "allowService.https.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowOspf = types.BoolNull()
- data.TunnelInterfaceAllowOspfVariable = types.StringNull()
- if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ospf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowStun = types.BoolNull()
- data.TunnelInterfaceAllowStunVariable = types.StringNull()
- if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
- va := res.Get(path + "allowService.stun.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSnmp = types.BoolNull()
- data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.snmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNetconf = types.BoolNull()
- data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
- if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.netconf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBfd = types.BoolNull()
- data.TunnelInterfaceAllowBfdVariable = types.StringNull()
- if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bfd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
- }
- }
- for i := range data.TunnelInterfaceEncapsulations {
- keys := [...]string{"encap"}
- keyValues := [...]string{data.TunnelInterfaceEncapsulations[i].Encapsulation.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "encapsulation").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringNull()
-
- if t := r.Get("encap.optionType"); t.Exists() {
- va := r.Get("encap.value")
- if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Null()
- data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringNull()
- if t := r.Get("preference.optionType"); t.Exists() {
- va := r.Get("preference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Null()
- data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringNull()
- if t := r.Get("weight.optionType"); t.Exists() {
- va := r.Get("weight.value")
- if t.String() == "variable" {
- data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Value(va.Int())
- }
- }
- }
- data.NatIpv4 = types.BoolNull()
- data.NatIpv4Variable = types.StringNull()
- if t := res.Get(path + "nat.optionType"); t.Exists() {
- va := res.Get(path + "nat.value")
- if t.String() == "variable" {
- data.NatIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatIpv4 = types.BoolValue(va.Bool())
- }
- }
- data.NatUdpTimeout = types.Int64Null()
- data.NatUdpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
- if t.String() == "variable" {
- data.NatUdpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatUdpTimeout = types.Int64Value(va.Int())
- }
- }
- data.NatTcpTimeout = types.Int64Null()
- data.NatTcpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
- if t.String() == "variable" {
- data.NatTcpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatTcpTimeout = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptive = types.BoolNull()
-
- if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptiveQoS.value")
- if t.String() == "global" {
- data.QosAdaptive = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptivePeriod = types.Int64Null()
- data.QosAdaptivePeriodVariable = types.StringNull()
- if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptPeriod.value")
- if t.String() == "variable" {
- data.QosAdaptivePeriodVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptivePeriod = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthUpstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinUpstream = types.Int64Null()
- data.QosAdaptiveMinUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxUpstream = types.Int64Null()
- data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultUpstream = types.Int64Null()
- data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthDownstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinDownstream = types.Int64Null()
- data.QosAdaptiveMinDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxDownstream = types.Int64Null()
- data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultDownstream = types.Int64Null()
- data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosShapingRate = types.Int64Null()
- data.QosShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.QosShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosShapingRate = types.Int64Value(va.Int())
- }
- }
- for i := range data.Arps {
- keys := [...]string{"ipAddress", "macAddress"}
- keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
- keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "arp").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Arps[i].IpAddress = types.StringNull()
- data.Arps[i].IpAddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Arps[i].IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].IpAddress = types.StringValue(va.String())
- }
- }
- data.Arps[i].MacAddress = types.StringNull()
- data.Arps[i].MacAddressVariable = types.StringNull()
- if t := r.Get("macAddress.optionType"); t.Exists() {
- va := r.Get("macAddress.value")
- if t.String() == "variable" {
- data.Arps[i].MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].MacAddress = types.StringValue(va.String())
- }
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.TlocExtension = types.StringNull()
- data.TlocExtensionVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtension.value")
- if t.String() == "variable" {
- data.TlocExtensionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlocExtension = types.StringValue(va.String())
- }
- }
- data.Tracker = types.StringNull()
- data.TrackerVariable = types.StringNull()
- if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tracker.value")
- if t.String() == "variable" {
- data.TrackerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Tracker = types.StringValue(va.String())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportWANVPNInterfaceCellular) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.TransportWanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4DhcpHelper.IsNull() {
- return false
- }
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- return false
- }
- if !data.ServiceProvider.IsNull() {
- return false
- }
- if !data.ServiceProviderVariable.IsNull() {
- return false
- }
- if !data.BandwidthUpstream.IsNull() {
- return false
- }
- if !data.BandwidthUpstreamVariable.IsNull() {
- return false
- }
- if !data.BandwidthDownstream.IsNull() {
- return false
- }
- if !data.BandwidthDownstreamVariable.IsNull() {
- return false
- }
- if !data.TunnelInterface.IsNull() {
- return false
- }
- if !data.PerTunnelQos.IsNull() {
- return false
- }
- if !data.PerTunnelQosVariable.IsNull() {
- return false
- }
- if !data.TunnelQosMode.IsNull() {
- return false
- }
- if !data.TunnelQosModeVariable.IsNull() {
- return false
- }
- if !data.TunnelBandwidthPercent.IsNull() {
- return false
- }
- if !data.TunnelBandwidthPercentVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCarrier.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCarrierVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColor.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColorVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloInterval.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloTolerance.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLastResortCircuit.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColorRestrict.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGroups.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGroupsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBorder.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBorderVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceMaxControlConnections.IsNull() {
- return false
- }
- if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNatRefreshInterval.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVbondAsStunServer.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
- return false
- }
- if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfacePortHop.IsNull() {
- return false
- }
- if !data.TunnelInterfacePortHopVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLowBandwidthLink.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceTunnelTcpMss.IsNull() {
- return false
- }
- if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearDontFragment.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNetworkBroadcast.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowAll.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowAllVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBgp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDhcp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNtp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSsh.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSshVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDns.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowIcmp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowHttps.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowOspf.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowStun.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowStunVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSnmp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNetconf.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBfd.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
- return false
- }
- if len(data.TunnelInterfaceEncapsulations) > 0 {
- return false
- }
- if !data.NatIpv4.IsNull() {
- return false
- }
- if !data.NatIpv4Variable.IsNull() {
- return false
- }
- if !data.NatUdpTimeout.IsNull() {
- return false
- }
- if !data.NatUdpTimeoutVariable.IsNull() {
- return false
- }
- if !data.NatTcpTimeout.IsNull() {
- return false
- }
- if !data.NatTcpTimeoutVariable.IsNull() {
- return false
- }
- if !data.QosAdaptive.IsNull() {
- return false
- }
- if !data.QosAdaptivePeriod.IsNull() {
- return false
- }
- if !data.QosAdaptivePeriodVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveBandwidthUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveBandwidthDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
- return false
- }
- if !data.QosShapingRate.IsNull() {
- return false
- }
- if !data.QosShapingRateVariable.IsNull() {
- return false
- }
- if len(data.Arps) > 0 {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.InterfaceMtu.IsNull() {
- return false
- }
- if !data.InterfaceMtuVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.TlocExtension.IsNull() {
- return false
- }
- if !data.TlocExtensionVariable.IsNull() {
- return false
- }
- if !data.Tracker.IsNull() {
- return false
- }
- if !data.TrackerVariable.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcast.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcastVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..bc9b410d2
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go
@@ -0,0 +1,4953 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportWANVPNInterfaceEthernet 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"`
+ TransportWanVpnFeatureId types.String `tfsdk:"transport_wan_vpn_feature_id"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4ConfigurationType types.String `tfsdk:"ipv4_configuration_type"`
+ Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"`
+ Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ Ipv4SecondaryAddresses []TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
+ Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
+ Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
+ Ipv6ConfigurationType types.String `tfsdk:"ipv6_configuration_type"`
+ EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
+ Ipv6DhcpSecondaryAddress []TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress `tfsdk:"ipv6_dhcp_secondary_address"`
+ Ipv6Address types.String `tfsdk:"ipv6_address"`
+ Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
+ Ipv6SecondaryAddresses []TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses `tfsdk:"ipv6_secondary_addresses"`
+ IperfServer types.String `tfsdk:"iperf_server"`
+ IperfServerVariable types.String `tfsdk:"iperf_server_variable"`
+ BlockNonSourceIp types.Bool `tfsdk:"block_non_source_ip"`
+ BlockNonSourceIpVariable types.String `tfsdk:"block_non_source_ip_variable"`
+ ServiceProvider types.String `tfsdk:"service_provider"`
+ ServiceProviderVariable types.String `tfsdk:"service_provider_variable"`
+ BandwidthUpstream types.Int64 `tfsdk:"bandwidth_upstream"`
+ BandwidthUpstreamVariable types.String `tfsdk:"bandwidth_upstream_variable"`
+ BandwidthDownstream types.Int64 `tfsdk:"bandwidth_downstream"`
+ BandwidthDownstreamVariable types.String `tfsdk:"bandwidth_downstream_variable"`
+ AutoDetectBandwidth types.Bool `tfsdk:"auto_detect_bandwidth"`
+ AutoDetectBandwidthVariable types.String `tfsdk:"auto_detect_bandwidth_variable"`
+ TunnelInterface types.Bool `tfsdk:"tunnel_interface"`
+ PerTunnelQos types.Bool `tfsdk:"per_tunnel_qos"`
+ PerTunnelQosVariable types.String `tfsdk:"per_tunnel_qos_variable"`
+ TunnelQosMode types.String `tfsdk:"tunnel_qos_mode"`
+ TunnelQosModeVariable types.String `tfsdk:"tunnel_qos_mode_variable"`
+ TunnelBandwidthPercent types.Int64 `tfsdk:"tunnel_bandwidth_percent"`
+ TunnelBandwidthPercentVariable types.String `tfsdk:"tunnel_bandwidth_percent_variable"`
+ TunnelInterfaceBindLoopbackTunnel types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel"`
+ TunnelInterfaceBindLoopbackTunnelVariable types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel_variable"`
+ TunnelInterfaceCarrier types.String `tfsdk:"tunnel_interface_carrier"`
+ TunnelInterfaceCarrierVariable types.String `tfsdk:"tunnel_interface_carrier_variable"`
+ TunnelInterfaceColor types.String `tfsdk:"tunnel_interface_color"`
+ TunnelInterfaceColorVariable types.String `tfsdk:"tunnel_interface_color_variable"`
+ TunnelInterfaceHelloInterval types.Int64 `tfsdk:"tunnel_interface_hello_interval"`
+ TunnelInterfaceHelloIntervalVariable types.String `tfsdk:"tunnel_interface_hello_interval_variable"`
+ TunnelInterfaceHelloTolerance types.Int64 `tfsdk:"tunnel_interface_hello_tolerance"`
+ TunnelInterfaceHelloToleranceVariable types.String `tfsdk:"tunnel_interface_hello_tolerance_variable"`
+ TunnelInterfaceLastResortCircuit types.Bool `tfsdk:"tunnel_interface_last_resort_circuit"`
+ TunnelInterfaceLastResortCircuitVariable types.String `tfsdk:"tunnel_interface_last_resort_circuit_variable"`
+ TunnelInterfaceGreTunnelDestinationIp types.String `tfsdk:"tunnel_interface_gre_tunnel_destination_ip"`
+ TunnelInterfaceGreTunnelDestinationIpVariable types.String `tfsdk:"tunnel_interface_gre_tunnel_destination_ip_variable"`
+ TunnelInterfaceColorRestrict types.Bool `tfsdk:"tunnel_interface_color_restrict"`
+ TunnelInterfaceColorRestrictVariable types.String `tfsdk:"tunnel_interface_color_restrict_variable"`
+ TunnelInterfaceGroups types.Int64 `tfsdk:"tunnel_interface_groups"`
+ TunnelInterfaceGroupsVariable types.String `tfsdk:"tunnel_interface_groups_variable"`
+ TunnelInterfaceBorder types.Bool `tfsdk:"tunnel_interface_border"`
+ TunnelInterfaceBorderVariable types.String `tfsdk:"tunnel_interface_border_variable"`
+ TunnelInterfaceMaxControlConnections types.Int64 `tfsdk:"tunnel_interface_max_control_connections"`
+ TunnelInterfaceMaxControlConnectionsVariable types.String `tfsdk:"tunnel_interface_max_control_connections_variable"`
+ TunnelInterfaceNatRefreshInterval types.Int64 `tfsdk:"tunnel_interface_nat_refresh_interval"`
+ TunnelInterfaceNatRefreshIntervalVariable types.String `tfsdk:"tunnel_interface_nat_refresh_interval_variable"`
+ TunnelInterfaceVbondAsStunServer types.Bool `tfsdk:"tunnel_interface_vbond_as_stun_server"`
+ TunnelInterfaceVbondAsStunServerVariable types.String `tfsdk:"tunnel_interface_vbond_as_stun_server_variable"`
+ TunnelInterfaceExcludeControllerGroupList types.Set `tfsdk:"tunnel_interface_exclude_controller_group_list"`
+ TunnelInterfaceExcludeControllerGroupListVariable types.String `tfsdk:"tunnel_interface_exclude_controller_group_list_variable"`
+ TunnelInterfaceVmanageConnectionPreference types.Int64 `tfsdk:"tunnel_interface_vmanage_connection_preference"`
+ TunnelInterfaceVmanageConnectionPreferenceVariable types.String `tfsdk:"tunnel_interface_vmanage_connection_preference_variable"`
+ TunnelInterfacePortHop types.Bool `tfsdk:"tunnel_interface_port_hop"`
+ TunnelInterfacePortHopVariable types.String `tfsdk:"tunnel_interface_port_hop_variable"`
+ TunnelInterfaceLowBandwidthLink types.Bool `tfsdk:"tunnel_interface_low_bandwidth_link"`
+ TunnelInterfaceLowBandwidthLinkVariable types.String `tfsdk:"tunnel_interface_low_bandwidth_link_variable"`
+ TunnelInterfaceTunnelTcpMss types.Int64 `tfsdk:"tunnel_interface_tunnel_tcp_mss"`
+ TunnelInterfaceTunnelTcpMssVariable types.String `tfsdk:"tunnel_interface_tunnel_tcp_mss_variable"`
+ TunnelInterfaceClearDontFragment types.Bool `tfsdk:"tunnel_interface_clear_dont_fragment"`
+ TunnelInterfaceClearDontFragmentVariable types.String `tfsdk:"tunnel_interface_clear_dont_fragment_variable"`
+ TunnelInterfaceCtsSgtPropagation types.Bool `tfsdk:"tunnel_interface_cts_sgt_propagation"`
+ TunnelInterfaceCtsSgtPropagationVariable types.String `tfsdk:"tunnel_interface_cts_sgt_propagation_variable"`
+ TunnelInterfaceNetworkBroadcast types.Bool `tfsdk:"tunnel_interface_network_broadcast"`
+ TunnelInterfaceNetworkBroadcastVariable types.String `tfsdk:"tunnel_interface_network_broadcast_variable"`
+ TunnelInterfaceAllowAll types.Bool `tfsdk:"tunnel_interface_allow_all"`
+ TunnelInterfaceAllowAllVariable types.String `tfsdk:"tunnel_interface_allow_all_variable"`
+ TunnelInterfaceAllowBgp types.Bool `tfsdk:"tunnel_interface_allow_bgp"`
+ TunnelInterfaceAllowBgpVariable types.String `tfsdk:"tunnel_interface_allow_bgp_variable"`
+ TunnelInterfaceAllowDhcp types.Bool `tfsdk:"tunnel_interface_allow_dhcp"`
+ TunnelInterfaceAllowDhcpVariable types.String `tfsdk:"tunnel_interface_allow_dhcp_variable"`
+ TunnelInterfaceAllowNtp types.Bool `tfsdk:"tunnel_interface_allow_ntp"`
+ TunnelInterfaceAllowNtpVariable types.String `tfsdk:"tunnel_interface_allow_ntp_variable"`
+ TunnelInterfaceAllowSsh types.Bool `tfsdk:"tunnel_interface_allow_ssh"`
+ TunnelInterfaceAllowSshVariable types.String `tfsdk:"tunnel_interface_allow_ssh_variable"`
+ TunnelInterfaceAllowDns types.Bool `tfsdk:"tunnel_interface_allow_dns"`
+ TunnelInterfaceAllowDnsVariable types.String `tfsdk:"tunnel_interface_allow_dns_variable"`
+ TunnelInterfaceAllowIcmp types.Bool `tfsdk:"tunnel_interface_allow_icmp"`
+ TunnelInterfaceAllowIcmpVariable types.String `tfsdk:"tunnel_interface_allow_icmp_variable"`
+ TunnelInterfaceAllowHttps types.Bool `tfsdk:"tunnel_interface_allow_https"`
+ TunnelInterfaceAllowHttpsVariable types.String `tfsdk:"tunnel_interface_allow_https_variable"`
+ TunnelInterfaceAllowOspf types.Bool `tfsdk:"tunnel_interface_allow_ospf"`
+ TunnelInterfaceAllowOspfVariable types.String `tfsdk:"tunnel_interface_allow_ospf_variable"`
+ TunnelInterfaceAllowStun types.Bool `tfsdk:"tunnel_interface_allow_stun"`
+ TunnelInterfaceAllowStunVariable types.String `tfsdk:"tunnel_interface_allow_stun_variable"`
+ TunnelInterfaceAllowSnmp types.Bool `tfsdk:"tunnel_interface_allow_snmp"`
+ TunnelInterfaceAllowSnmpVariable types.String `tfsdk:"tunnel_interface_allow_snmp_variable"`
+ TunnelInterfaceAllowNetconf types.Bool `tfsdk:"tunnel_interface_allow_netconf"`
+ TunnelInterfaceAllowNetconfVariable types.String `tfsdk:"tunnel_interface_allow_netconf_variable"`
+ TunnelInterfaceAllowBfd types.Bool `tfsdk:"tunnel_interface_allow_bfd"`
+ TunnelInterfaceAllowBfdVariable types.String `tfsdk:"tunnel_interface_allow_bfd_variable"`
+ TunnelInterfaceEncapsulations []TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations `tfsdk:"tunnel_interface_encapsulations"`
+ NatIpv4 types.Bool `tfsdk:"nat_ipv4"`
+ NatIpv4Variable types.String `tfsdk:"nat_ipv4_variable"`
+ NatType types.String `tfsdk:"nat_type"`
+ NatTypeVariable types.String `tfsdk:"nat_type_variable"`
+ NatRangeStart types.String `tfsdk:"nat_range_start"`
+ NatRangeStartVariable types.String `tfsdk:"nat_range_start_variable"`
+ NatRangeEnd types.String `tfsdk:"nat_range_end"`
+ NatRangeEndVariable types.String `tfsdk:"nat_range_end_variable"`
+ NatPrefixLength types.Int64 `tfsdk:"nat_prefix_length"`
+ NatPrefixLengthVariable types.String `tfsdk:"nat_prefix_length_variable"`
+ NatOverload types.Bool `tfsdk:"nat_overload"`
+ NatOverloadVariable types.String `tfsdk:"nat_overload_variable"`
+ NatLoopback types.String `tfsdk:"nat_loopback"`
+ NatLoopbackVariable types.String `tfsdk:"nat_loopback_variable"`
+ NatUdpTimeout types.Int64 `tfsdk:"nat_udp_timeout"`
+ NatUdpTimeoutVariable types.String `tfsdk:"nat_udp_timeout_variable"`
+ NatTcpTimeout types.Int64 `tfsdk:"nat_tcp_timeout"`
+ NatTcpTimeoutVariable types.String `tfsdk:"nat_tcp_timeout_variable"`
+ NewStaticNats []TransportWANVPNInterfaceEthernetNewStaticNats `tfsdk:"new_static_nats"`
+ NatIpv6 types.Bool `tfsdk:"nat_ipv6"`
+ NatIpv6Variable types.String `tfsdk:"nat_ipv6_variable"`
+ Nat64 types.Bool `tfsdk:"nat64"`
+ Nat66 types.Bool `tfsdk:"nat66"`
+ StaticNat66 []TransportWANVPNInterfaceEthernetStaticNat66 `tfsdk:"static_nat66"`
+ QosAdaptive types.Bool `tfsdk:"qos_adaptive"`
+ QosAdaptivePeriod types.Int64 `tfsdk:"qos_adaptive_period"`
+ QosAdaptivePeriodVariable types.String `tfsdk:"qos_adaptive_period_variable"`
+ QosAdaptiveBandwidthUpstream types.Bool `tfsdk:"qos_adaptive_bandwidth_upstream"`
+ QosAdaptiveMinUpstream types.Int64 `tfsdk:"qos_adaptive_min_upstream"`
+ QosAdaptiveMinUpstreamVariable types.String `tfsdk:"qos_adaptive_min_upstream_variable"`
+ QosAdaptiveMaxUpstream types.Int64 `tfsdk:"qos_adaptive_max_upstream"`
+ QosAdaptiveMaxUpstreamVariable types.String `tfsdk:"qos_adaptive_max_upstream_variable"`
+ QosAdaptiveDefaultUpstream types.Int64 `tfsdk:"qos_adaptive_default_upstream"`
+ QosAdaptiveDefaultUpstreamVariable types.String `tfsdk:"qos_adaptive_default_upstream_variable"`
+ QosAdaptiveBandwidthDownstream types.Bool `tfsdk:"qos_adaptive_bandwidth_downstream"`
+ QosAdaptiveMinDownstream types.Int64 `tfsdk:"qos_adaptive_min_downstream"`
+ QosAdaptiveMinDownstreamVariable types.String `tfsdk:"qos_adaptive_min_downstream_variable"`
+ QosAdaptiveMaxDownstream types.Int64 `tfsdk:"qos_adaptive_max_downstream"`
+ QosAdaptiveMaxDownstreamVariable types.String `tfsdk:"qos_adaptive_max_downstream_variable"`
+ QosAdaptiveDefaultDownstream types.Int64 `tfsdk:"qos_adaptive_default_downstream"`
+ QosAdaptiveDefaultDownstreamVariable types.String `tfsdk:"qos_adaptive_default_downstream_variable"`
+ QosShapingRate types.Int64 `tfsdk:"qos_shaping_rate"`
+ QosShapingRateVariable types.String `tfsdk:"qos_shaping_rate_variable"`
+ Arps []TransportWANVPNInterfaceEthernetArps `tfsdk:"arps"`
+ IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
+ IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
+ Duplex types.String `tfsdk:"duplex"`
+ DuplexVariable types.String `tfsdk:"duplex_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
+ InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ Speed types.String `tfsdk:"speed"`
+ SpeedVariable types.String `tfsdk:"speed_variable"`
+ ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
+ ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
+ Autonegotiate types.Bool `tfsdk:"autonegotiate"`
+ AutonegotiateVariable types.String `tfsdk:"autonegotiate_variable"`
+ MediaType types.String `tfsdk:"media_type"`
+ MediaTypeVariable types.String `tfsdk:"media_type_variable"`
+ TlocExtension types.String `tfsdk:"tloc_extension"`
+ TlocExtensionVariable types.String `tfsdk:"tloc_extension_variable"`
+ GreTunnelSourceIp types.String `tfsdk:"gre_tunnel_source_ip"`
+ GreTunnelSourceIpVariable types.String `tfsdk:"gre_tunnel_source_ip_variable"`
+ Xconnect types.String `tfsdk:"xconnect"`
+ XconnectVariable types.String `tfsdk:"xconnect_variable"`
+ LoadInterval types.Int64 `tfsdk:"load_interval"`
+ LoadIntervalVariable types.String `tfsdk:"load_interval_variable"`
+ Tracker types.String `tfsdk:"tracker"`
+ TrackerVariable types.String `tfsdk:"tracker_variable"`
+ IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
+ IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
+}
+
+type TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+ SubnetMask types.String `tfsdk:"subnet_mask"`
+ SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
+}
+
+type TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+}
+
+type TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses struct {
+ Address types.String `tfsdk:"address"`
+ AddressVariable types.String `tfsdk:"address_variable"`
+}
+
+type TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations struct {
+ Encapsulation types.String `tfsdk:"encapsulation"`
+ Preference types.Int64 `tfsdk:"preference"`
+ PreferenceVariable types.String `tfsdk:"preference_variable"`
+ Weight types.Int64 `tfsdk:"weight"`
+ WeightVariable types.String `tfsdk:"weight_variable"`
+}
+
+type TransportWANVPNInterfaceEthernetNewStaticNats struct {
+ SourceIp types.String `tfsdk:"source_ip"`
+ SourceIpVariable types.String `tfsdk:"source_ip_variable"`
+ TranslatedIp types.String `tfsdk:"translated_ip"`
+ TranslatedIpVariable types.String `tfsdk:"translated_ip_variable"`
+ Direction types.String `tfsdk:"direction"`
+ SourceVpn types.Int64 `tfsdk:"source_vpn"`
+ SourceVpnVariable types.String `tfsdk:"source_vpn_variable"`
+}
+
+type TransportWANVPNInterfaceEthernetStaticNat66 struct {
+ SourcePrefix types.String `tfsdk:"source_prefix"`
+ SourcePrefixVariable types.String `tfsdk:"source_prefix_variable"`
+ TranslatedSourcePrefix types.String `tfsdk:"translated_source_prefix"`
+ TranslatedSourcePrefixVariable types.String `tfsdk:"translated_source_prefix_variable"`
+ SourceVpnId types.Int64 `tfsdk:"source_vpn_id"`
+ SourceVpnIdVariable types.String `tfsdk:"source_vpn_id_variable"`
+}
+
+type TransportWANVPNInterfaceEthernetArps struct {
+ IpAddress types.String `tfsdk:"ip_address"`
+ IpAddressVariable types.String `tfsdk:"ip_address_variable"`
+ MacAddress types.String `tfsdk:"mac_address"`
+ MacAddressVariable types.String `tfsdk:"mac_address_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportWANVPNInterfaceEthernet) getModel() string {
+ return "transport_wan_vpn_interface_ethernet"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportWANVPNInterfaceEthernet) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/ethernet", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4DhcpDistanceVariable.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString())
+ }
+ } else if data.Ipv4DhcpDistance.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "default")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", 1)
+ }
+ } else {
+ if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+ if true && data.Ipv4ConfigurationType.ValueString() == "static" {
+
+ for _, item := range data.Ipv4SecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
+ }
+ }
+
+ if !item.SubnetMaskVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString())
+ }
+ } else if !item.SubnetMask.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
+ }
+ } else if data.Ipv4DhcpHelper.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
+ var values []string
+ data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
+ }
+ }
+ if !data.EnableDhcpv6.IsNull() {
+ if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool())
+ }
+ }
+ if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" {
+
+ for _, item := range data.Ipv6DhcpSecondaryAddress {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody)
+ }
+ }
+
+ if !data.Ipv6AddressVariable.IsNull() {
+ if true && data.Ipv6ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString())
+ }
+ } else if !data.Ipv6Address.IsNull() {
+ if true && data.Ipv6ConfigurationType.ValueString() == "static" {
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString())
+ }
+ }
+ if true && data.Ipv6ConfigurationType.ValueString() == "static" {
+
+ for _, item := range data.Ipv6SecondaryAddresses {
+ itemBody := ""
+
+ if !item.AddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
+ }
+ } else if !item.Address.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody)
+ }
+ }
+
+ if !data.IperfServerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable")
+ body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServerVariable.ValueString())
+ }
+ } else if data.IperfServer.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"iperfServer.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"iperfServer.optionType", "global")
+ body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServer.ValueString())
+ }
+ }
+
+ if !data.BlockNonSourceIpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIpVariable.ValueString())
+ }
+ } else if data.BlockNonSourceIp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "default")
+ body, _ = sjson.Set(body, path+"blockNonSourceIp.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "global")
+ body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIp.ValueBool())
+ }
+ }
+
+ if !data.ServiceProviderVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable")
+ body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString())
+ }
+ } else if data.ServiceProvider.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global")
+ body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString())
+ }
+ }
+
+ if !data.BandwidthUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString())
+ }
+ } else if data.BandwidthUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64())
+ }
+ }
+
+ if !data.BandwidthDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString())
+ }
+ } else if data.BandwidthDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64())
+ }
+ }
+
+ if !data.AutoDetectBandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidthVariable.ValueString())
+ }
+ } else if data.AutoDetectBandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default")
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidth.ValueBool())
+ }
+ }
+ if data.TunnelInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnelInterface.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool())
+ }
+ }
+
+ if !data.PerTunnelQosVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString())
+ }
+ } else if data.PerTunnelQos.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool())
+ }
+ }
+
+ if !data.TunnelQosModeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString())
+ }
+ } else if !data.TunnelQosMode.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString())
+ }
+ }
+
+ if !data.TunnelBandwidthPercentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString())
+ }
+ } else if data.TunnelBandwidthPercent.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceCarrierVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceCarrier.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceColorVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceColor.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceHelloInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceHelloTolerance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceLastResortCircuit.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceGreTunnelDestinationIpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceGreTunnelDestinationIp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIp.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceColorRestrict.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceGroupsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceGroups.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceBorderVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceBorder.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceMaxControlConnections.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceNatRefreshInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceVbondAsStunServer.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global")
+ var values []int64
+ data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values)
+ }
+ }
+
+ if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfacePortHopVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString())
+ }
+ } else if data.TunnelInterfacePortHop.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceLowBandwidthLink.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceTunnelTcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceClearDontFragment.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceCtsSgtPropagationVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagationVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceCtsSgtPropagation.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagation.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceNetworkBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowAllVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowAll.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.all.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowBgp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowDhcp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString())
+ }
+ } else if !data.TunnelInterfaceAllowNtp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowSshVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString())
+ }
+ } else if !data.TunnelInterfaceAllowSsh.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowDns.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowIcmp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowHttps.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.https.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowOspf.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowStunVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowStun.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowSnmp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowNetconf.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowBfd.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"encapsulation", []interface{}{})
+ for _, item := range data.TunnelInterfaceEncapsulations {
+ itemBody := ""
+ if !item.Encapsulation.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString())
+ }
+ }
+
+ if !item.PreferenceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString())
+ }
+ } else if item.Preference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64())
+ }
+ }
+
+ if !item.WeightVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString())
+ }
+ } else if item.Weight.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", 1)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody)
+ }
+ }
+
+ if !data.NatIpv4Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "variable")
+ body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString())
+ }
+ } else if data.NatIpv4.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "default")
+ body, _ = sjson.Set(body, path+"nat.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"nat.optionType", "global")
+ body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool())
+ }
+ }
+
+ if !data.NatTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatTypeVariable.ValueString())
+ }
+ } else if data.NatType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", "interface")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatType.ValueString())
+ }
+ }
+
+ if !data.NatRangeStartVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStartVariable.ValueString())
+ }
+ } else if !data.NatRangeStart.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStart.ValueString())
+ }
+ }
+
+ if !data.NatRangeEndVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEndVariable.ValueString())
+ }
+ } else if !data.NatRangeEnd.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEnd.ValueString())
+ }
+ }
+
+ if !data.NatPrefixLengthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLengthVariable.ValueString())
+ }
+ } else if !data.NatPrefixLength.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLength.ValueInt64())
+ }
+ }
+
+ if !data.NatOverloadVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverloadVariable.ValueString())
+ }
+ } else if !data.NatOverload.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverload.ValueBool())
+ }
+ }
+
+ if !data.NatLoopbackVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopbackVariable.ValueString())
+ }
+ } else if !data.NatLoopback.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopback.ValueString())
+ }
+ }
+
+ if !data.NatUdpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString())
+ }
+ } else if data.NatUdpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64())
+ }
+ }
+
+ if !data.NatTcpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString())
+ }
+ } else if data.NatTcpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{})
+ for _, item := range data.NewStaticNats {
+ itemBody := ""
+
+ if !item.SourceIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
+ }
+ } else if !item.SourceIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
+ }
+ }
+
+ if !item.TranslatedIpVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIpVariable.ValueString())
+ }
+ } else if !item.TranslatedIp.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIp.ValueString())
+ }
+ }
+ if item.Direction.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside")
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString())
+ }
+ }
+
+ if !item.SourceVpnVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString())
+ }
+ } else if item.SourceVpn.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody)
+ }
+ }
+
+ if !data.NatIpv6Variable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natIpv6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6Variable.ValueString())
+ }
+ } else if data.NatIpv6.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natIpv6.optionType", "default")
+ body, _ = sjson.Set(body, path+"natIpv6.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"natIpv6.optionType", "global")
+ body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6.ValueBool())
+ }
+ }
+ if !data.Nat64.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool())
+ }
+ }
+ if !data.Nat66.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.optionType", "global")
+ body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.value", data.Nat66.ValueBool())
+ }
+ }
+ if true {
+
+ for _, item := range data.StaticNat66 {
+ itemBody := ""
+
+ if !item.SourcePrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefixVariable.ValueString())
+ }
+ } else if !item.SourcePrefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefix.ValueString())
+ }
+ }
+
+ if !item.TranslatedSourcePrefixVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefixVariable.ValueString())
+ }
+ } else if !item.TranslatedSourcePrefix.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefix.ValueString())
+ }
+ }
+
+ if !item.SourceVpnIdVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnIdVariable.ValueString())
+ }
+ } else if item.SourceVpnId.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnId.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"natAttributesIpv6.staticNat66.-1", itemBody)
+ }
+ }
+ if !data.QosAdaptive.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool())
+ }
+ }
+
+ if !data.QosAdaptivePeriodVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString())
+ }
+ } else if !data.QosAdaptivePeriod.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64())
+ }
+ }
+ if !data.QosAdaptiveBandwidthUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool())
+ }
+ }
+
+ if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMinUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMaxUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveDefaultUpstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64())
+ }
+ }
+ if !data.QosAdaptiveBandwidthDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool())
+ }
+ }
+
+ if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMinDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveMaxDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64())
+ }
+ }
+
+ if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString())
+ }
+ } else if !data.QosAdaptiveDefaultDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64())
+ }
+ }
+
+ if !data.QosShapingRateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString())
+ }
+ } else if !data.QosShapingRate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"arp", []interface{}{})
+ for _, item := range data.Arps {
+ itemBody := ""
+
+ if !item.IpAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
+ }
+ } else if item.IpAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
+ }
+ }
+
+ if !item.MacAddressVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
+ }
+ } else if item.MacAddress.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
+ }
+ }
+
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
+ }
+ } else if data.IcmpRedirectDisable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
+ }
+ }
+
+ if !data.DuplexVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString())
+ }
+ } else if data.Duplex.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString())
+ }
+ }
+
+ if !data.MacAddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString())
+ }
+ } else if data.MacAddress.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.InterfaceMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
+ }
+ } else if data.InterfaceMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.SpeedVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString())
+ }
+ } else if data.Speed.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString())
+ }
+ }
+
+ if !data.ArpTimeoutVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
+ }
+ } else if data.ArpTimeout.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
+ }
+ }
+
+ if !data.AutonegotiateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString())
+ }
+ } else if data.Autonegotiate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool())
+ }
+ }
+
+ if !data.MediaTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString())
+ }
+ } else if data.MediaType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString())
+ }
+ }
+
+ if !data.TlocExtensionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString())
+ }
+ } else if data.TlocExtension.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString())
+ }
+ }
+
+ if !data.GreTunnelSourceIpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIpVariable.ValueString())
+ }
+ } else if data.GreTunnelSourceIp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIp.ValueString())
+ }
+ }
+
+ if !data.XconnectVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.XconnectVariable.ValueString())
+ }
+ } else if data.Xconnect.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.Xconnect.ValueString())
+ }
+ }
+
+ if !data.LoadIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString())
+ }
+ } else if data.LoadInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64())
+ }
+ }
+
+ if !data.TrackerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString())
+ }
+ } else if data.Tracker.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString())
+ }
+ }
+
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
+ }
+ } else if data.IpDirectedBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportWANVPNInterfaceEthernet) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpDistance = types.Int64Null()
+ data.Ipv4DhcpDistanceVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary"); value.Exists() {
+ data.Ipv4SecondaryAddresses = make([]TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ item.SubnetMask = types.StringNull()
+ item.SubnetMaskVariable = types.StringNull()
+ if t := v.Get("subnetMask.optionType"); t.Exists() {
+ va := v.Get("subnetMask.value")
+ if t.String() == "variable" {
+ item.SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
+ return true
+ })
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+
+ if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
+ if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address"); value.Exists() {
+ data.Ipv6DhcpSecondaryAddress = make([]TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6DhcpSecondaryAddress = append(data.Ipv6DhcpSecondaryAddress, item)
+ return true
+ })
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ if value := res.Get(path + "intfIpV6Address.static.secondaryIpV6Address"); value.Exists() {
+ data.Ipv6SecondaryAddresses = make([]TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses{}
+ item.Address = types.StringNull()
+ item.AddressVariable = types.StringNull()
+ if t := v.Get("address.optionType"); t.Exists() {
+ va := v.Get("address.value")
+ if t.String() == "variable" {
+ item.AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6SecondaryAddresses = append(data.Ipv6SecondaryAddresses, item)
+ return true
+ })
+ }
+ data.IperfServer = types.StringNull()
+ data.IperfServerVariable = types.StringNull()
+ if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
+ va := res.Get(path + "iperfServer.value")
+ if t.String() == "variable" {
+ data.IperfServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IperfServer = types.StringValue(va.String())
+ }
+ }
+ data.BlockNonSourceIp = types.BoolNull()
+ data.BlockNonSourceIpVariable = types.StringNull()
+ if t := res.Get(path + "blockNonSourceIp.optionType"); t.Exists() {
+ va := res.Get(path + "blockNonSourceIp.value")
+ if t.String() == "variable" {
+ data.BlockNonSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BlockNonSourceIp = types.BoolValue(va.Bool())
+ }
+ }
+ data.ServiceProvider = types.StringNull()
+ data.ServiceProviderVariable = types.StringNull()
+ if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
+ va := res.Get(path + "serviceProvider.value")
+ if t.String() == "variable" {
+ data.ServiceProviderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ServiceProvider = types.StringValue(va.String())
+ }
+ }
+ data.BandwidthUpstream = types.Int64Null()
+ data.BandwidthUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthUpstream.value")
+ if t.String() == "variable" {
+ data.BandwidthUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.BandwidthDownstream = types.Int64Null()
+ data.BandwidthDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthDownstream.value")
+ if t.String() == "variable" {
+ data.BandwidthDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.AutoDetectBandwidth = types.BoolNull()
+ data.AutoDetectBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "autoDetectBandwidth.value")
+ if t.String() == "variable" {
+ data.AutoDetectBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AutoDetectBandwidth = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterface = types.BoolNull()
+
+ if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelInterface.value")
+ if t.String() == "global" {
+ data.TunnelInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQos = types.BoolNull()
+ data.PerTunnelQosVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQos.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQos = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelQosMode = types.StringNull()
+ data.TunnelQosModeVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.mode.value")
+ if t.String() == "variable" {
+ data.TunnelQosModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelQosMode = types.StringValue(va.String())
+ }
+ }
+ data.TunnelBandwidthPercent = types.Int64Null()
+ data.TunnelBandwidthPercentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bandwidthPercent.value")
+ if t.String() == "variable" {
+ data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelBandwidthPercent = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bind.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceCarrier = types.StringNull()
+ data.TunnelInterfaceCarrierVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.carrier.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCarrier = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColor = types.StringNull()
+ data.TunnelInterfaceColorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.color.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColor = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceHelloInterval = types.Int64Null()
+ data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloTolerance = types.Int64Null()
+ data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloTolerance.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceLastResortCircuit = types.BoolNull()
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lastResortCircuit.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGreTunnelDestinationIp = types.StringNull()
+ data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tlocExtensionGreTo.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tlocExtensionGreTo.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGreTunnelDestinationIp = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColorRestrict = types.BoolNull()
+ data.TunnelInterfaceColorRestrictVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.restrict.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGroups = types.Int64Null()
+ data.TunnelInterfaceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.group.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGroups = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBorder = types.BoolNull()
+ data.TunnelInterfaceBorderVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.border.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceMaxControlConnections = types.Int64Null()
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.maxControlConnections.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.natRefreshInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vBondAsStunServer.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.excludeControllerGroupList.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vManageConnectionPreference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfacePortHop = types.BoolNull()
+ data.TunnelInterfacePortHopVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.portHop.value")
+ if t.String() == "variable" {
+ data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lowBandwidthLink.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tunnelTcpMss.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceClearDontFragment = types.BoolNull()
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceCtsSgtPropagation = types.BoolNull()
+ data.TunnelInterfaceCtsSgtPropagationVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.ctsSgtPropagation.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.ctsSgtPropagation.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCtsSgtPropagationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCtsSgtPropagation = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.networkBroadcast.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowAll = types.BoolNull()
+ data.TunnelInterfaceAllowAllVariable = types.StringNull()
+ if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.all.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBgp = types.BoolNull()
+ data.TunnelInterfaceAllowBgpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bgp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDhcp = types.BoolNull()
+ data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dhcp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNtp = types.BoolNull()
+ data.TunnelInterfaceAllowNtpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ntp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSsh = types.BoolNull()
+ data.TunnelInterfaceAllowSshVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ssh.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDns = types.BoolNull()
+ data.TunnelInterfaceAllowDnsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dns.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowIcmp = types.BoolNull()
+ data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.icmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowHttps = types.BoolNull()
+ data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.https.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowOspf = types.BoolNull()
+ data.TunnelInterfaceAllowOspfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ospf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowStun = types.BoolNull()
+ data.TunnelInterfaceAllowStunVariable = types.StringNull()
+ if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.stun.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSnmp = types.BoolNull()
+ data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.snmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNetconf = types.BoolNull()
+ data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.netconf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBfd = types.BoolNull()
+ data.TunnelInterfaceAllowBfdVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bfd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "encapsulation"); value.Exists() {
+ data.TunnelInterfaceEncapsulations = make([]TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations{}
+ item.Encapsulation = types.StringNull()
+
+ if t := v.Get("encap.optionType"); t.Exists() {
+ va := v.Get("encap.value")
+ if t.String() == "global" {
+ item.Encapsulation = types.StringValue(va.String())
+ }
+ }
+ item.Preference = types.Int64Null()
+ item.PreferenceVariable = types.StringNull()
+ if t := v.Get("preference.optionType"); t.Exists() {
+ va := v.Get("preference.value")
+ if t.String() == "variable" {
+ item.PreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Preference = types.Int64Value(va.Int())
+ }
+ }
+ item.Weight = types.Int64Null()
+ item.WeightVariable = types.StringNull()
+ if t := v.Get("weight.optionType"); t.Exists() {
+ va := v.Get("weight.value")
+ if t.String() == "variable" {
+ item.WeightVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Weight = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceEncapsulations = append(data.TunnelInterfaceEncapsulations, item)
+ return true
+ })
+ }
+ data.NatIpv4 = types.BoolNull()
+ data.NatIpv4Variable = types.StringNull()
+ if t := res.Get(path + "nat.optionType"); t.Exists() {
+ va := res.Get(path + "nat.value")
+ if t.String() == "variable" {
+ data.NatIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatIpv4 = types.BoolValue(va.Bool())
+ }
+ }
+ data.NatType = types.StringNull()
+ data.NatTypeVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natType.value")
+ if t.String() == "variable" {
+ data.NatTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatType = types.StringValue(va.String())
+ }
+ }
+ data.NatRangeStart = types.StringNull()
+ data.NatRangeStartVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
+ if t.String() == "variable" {
+ data.NatRangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatRangeStart = types.StringValue(va.String())
+ }
+ }
+ data.NatRangeEnd = types.StringNull()
+ data.NatRangeEndVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
+ if t.String() == "variable" {
+ data.NatRangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatRangeEnd = types.StringValue(va.String())
+ }
+ }
+ data.NatPrefixLength = types.Int64Null()
+ data.NatPrefixLengthVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
+ if t.String() == "variable" {
+ data.NatPrefixLengthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.NatOverload = types.BoolNull()
+ data.NatOverloadVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
+ if t.String() == "variable" {
+ data.NatOverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatOverload = types.BoolValue(va.Bool())
+ }
+ }
+ data.NatLoopback = types.StringNull()
+ data.NatLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natLookback.value")
+ if t.String() == "variable" {
+ data.NatLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatLoopback = types.StringValue(va.String())
+ }
+ }
+ data.NatUdpTimeout = types.Int64Null()
+ data.NatUdpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
+ if t.String() == "variable" {
+ data.NatUdpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatUdpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.NatTcpTimeout = types.Int64Null()
+ data.NatTcpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
+ if t.String() == "variable" {
+ data.NatTcpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatTcpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "natAttributesIpv4.newStaticNat"); value.Exists() {
+ data.NewStaticNats = make([]TransportWANVPNInterfaceEthernetNewStaticNats, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceEthernetNewStaticNats{}
+ item.SourceIp = types.StringNull()
+ item.SourceIpVariable = types.StringNull()
+ if t := v.Get("sourceIp.optionType"); t.Exists() {
+ va := v.Get("sourceIp.value")
+ if t.String() == "variable" {
+ item.SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceIp = types.StringValue(va.String())
+ }
+ }
+ item.TranslatedIp = types.StringNull()
+ item.TranslatedIpVariable = types.StringNull()
+ if t := v.Get("translateIp.optionType"); t.Exists() {
+ va := v.Get("translateIp.value")
+ if t.String() == "variable" {
+ item.TranslatedIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TranslatedIp = types.StringValue(va.String())
+ }
+ }
+ item.Direction = types.StringNull()
+
+ if t := v.Get("staticNatDirection.optionType"); t.Exists() {
+ va := v.Get("staticNatDirection.value")
+ if t.String() == "global" {
+ item.Direction = types.StringValue(va.String())
+ }
+ }
+ item.SourceVpn = types.Int64Null()
+ item.SourceVpnVariable = types.StringNull()
+ if t := v.Get("sourceVpn.optionType"); t.Exists() {
+ va := v.Get("sourceVpn.value")
+ if t.String() == "variable" {
+ item.SourceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceVpn = types.Int64Value(va.Int())
+ }
+ }
+ data.NewStaticNats = append(data.NewStaticNats, item)
+ return true
+ })
+ }
+ data.NatIpv6 = types.BoolNull()
+ data.NatIpv6Variable = types.StringNull()
+ if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "natIpv6.value")
+ if t.String() == "variable" {
+ data.NatIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatIpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat64 = types.BoolNull()
+
+ if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv6.nat64.value")
+ if t.String() == "global" {
+ data.Nat64 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat66 = types.BoolNull()
+
+ if t := res.Get(path + "natAttributesIpv6.nat66.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv6.nat66.value")
+ if t.String() == "global" {
+ data.Nat66 = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "natAttributesIpv6.staticNat66"); value.Exists() {
+ data.StaticNat66 = make([]TransportWANVPNInterfaceEthernetStaticNat66, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceEthernetStaticNat66{}
+ item.SourcePrefix = types.StringNull()
+ item.SourcePrefixVariable = types.StringNull()
+ if t := v.Get("sourcePrefix.optionType"); t.Exists() {
+ va := v.Get("sourcePrefix.value")
+ if t.String() == "variable" {
+ item.SourcePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourcePrefix = types.StringValue(va.String())
+ }
+ }
+ item.TranslatedSourcePrefix = types.StringNull()
+ item.TranslatedSourcePrefixVariable = types.StringNull()
+ if t := v.Get("translatedSourcePrefix.optionType"); t.Exists() {
+ va := v.Get("translatedSourcePrefix.value")
+ if t.String() == "variable" {
+ item.TranslatedSourcePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.TranslatedSourcePrefix = types.StringValue(va.String())
+ }
+ }
+ item.SourceVpnId = types.Int64Null()
+ item.SourceVpnIdVariable = types.StringNull()
+ if t := v.Get("sourceVpnId.optionType"); t.Exists() {
+ va := v.Get("sourceVpnId.value")
+ if t.String() == "variable" {
+ item.SourceVpnIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.SourceVpnId = types.Int64Value(va.Int())
+ }
+ }
+ data.StaticNat66 = append(data.StaticNat66, item)
+ return true
+ })
+ }
+ data.QosAdaptive = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptiveQoS.value")
+ if t.String() == "global" {
+ data.QosAdaptive = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptivePeriod = types.Int64Null()
+ data.QosAdaptivePeriodVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptPeriod.value")
+ if t.String() == "variable" {
+ data.QosAdaptivePeriodVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptivePeriod = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthUpstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinUpstream = types.Int64Null()
+ data.QosAdaptiveMinUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxUpstream = types.Int64Null()
+ data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultUpstream = types.Int64Null()
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthDownstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinDownstream = types.Int64Null()
+ data.QosAdaptiveMinDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxDownstream = types.Int64Null()
+ data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultDownstream = types.Int64Null()
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosShapingRate = types.Int64Null()
+ data.QosShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.QosShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ if value := res.Get(path + "arp"); value.Exists() {
+ data.Arps = make([]TransportWANVPNInterfaceEthernetArps, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceEthernetArps{}
+ item.IpAddress = types.StringNull()
+ item.IpAddressVariable = types.StringNull()
+ if t := v.Get("ipAddress.optionType"); t.Exists() {
+ va := v.Get("ipAddress.value")
+ if t.String() == "variable" {
+ item.IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.IpAddress = types.StringValue(va.String())
+ }
+ }
+ item.MacAddress = types.StringNull()
+ item.MacAddressVariable = types.StringNull()
+ if t := v.Get("macAddress.optionType"); t.Exists() {
+ va := v.Get("macAddress.value")
+ if t.String() == "variable" {
+ item.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps = append(data.Arps, item)
+ return true
+ })
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+ data.Duplex = types.StringNull()
+ data.DuplexVariable = types.StringNull()
+ if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.duplex.value")
+ if t.String() == "variable" {
+ data.DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Duplex = types.StringValue(va.String())
+ }
+ }
+ data.MacAddress = types.StringNull()
+ data.MacAddressVariable = types.StringNull()
+ if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.macAddress.value")
+ if t.String() == "variable" {
+ data.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Speed = types.StringNull()
+ data.SpeedVariable = types.StringNull()
+ if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.speed.value")
+ if t.String() == "variable" {
+ data.SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Speed = types.StringValue(va.String())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Autonegotiate = types.BoolNull()
+ data.AutonegotiateVariable = types.StringNull()
+ if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.autonegotiate.value")
+ if t.String() == "variable" {
+ data.AutonegotiateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Autonegotiate = types.BoolValue(va.Bool())
+ }
+ }
+ data.MediaType = types.StringNull()
+ data.MediaTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mediaType.value")
+ if t.String() == "variable" {
+ data.MediaTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MediaType = types.StringValue(va.String())
+ }
+ }
+ data.TlocExtension = types.StringNull()
+ data.TlocExtensionVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtension.value")
+ if t.String() == "variable" {
+ data.TlocExtensionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlocExtension = types.StringValue(va.String())
+ }
+ }
+ data.GreTunnelSourceIp = types.StringNull()
+ data.GreTunnelSourceIpVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.value")
+ if t.String() == "variable" {
+ data.GreTunnelSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GreTunnelSourceIp = types.StringValue(va.String())
+ }
+ }
+ data.Xconnect = types.StringNull()
+ data.XconnectVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.value")
+ if t.String() == "variable" {
+ data.XconnectVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Xconnect = types.StringValue(va.String())
+ }
+ }
+ data.LoadInterval = types.Int64Null()
+ data.LoadIntervalVariable = types.StringNull()
+ if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.loadInterval.value")
+ if t.String() == "variable" {
+ data.LoadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LoadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Tracker = types.StringNull()
+ data.TrackerVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tracker.value")
+ if t.String() == "variable" {
+ data.TrackerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Tracker = types.StringValue(va.String())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportWANVPNInterfaceEthernet) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4DhcpDistance = types.Int64Null()
+ data.Ipv4DhcpDistanceVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpDistance = types.Int64Value(va.Int())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv4SecondaryAddresses {
+ keys := [...]string{"ipAddress"}
+ keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringNull()
+ data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringNull()
+ if t := r.Get("subnetMask.optionType"); t.Exists() {
+ va := r.Get("subnetMask.value")
+ if t.String() == "variable" {
+ data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv4DhcpHelper = types.SetNull(types.StringType)
+ data.Ipv4DhcpHelperVariable = types.StringNull()
+ if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
+ va := res.Get(path + "dhcpHelper.value")
+ if t.String() == "variable" {
+ data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
+ }
+ }
+ data.EnableDhcpv6 = types.BoolNull()
+
+ if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
+ if t.String() == "global" {
+ data.EnableDhcpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.Ipv6DhcpSecondaryAddress {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6DhcpSecondaryAddress[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6DhcpSecondaryAddress[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6DhcpSecondaryAddress[i].Address = types.StringNull()
+ data.Ipv6DhcpSecondaryAddress[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6DhcpSecondaryAddress[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6DhcpSecondaryAddress[i].Address = types.StringValue(va.String())
+ }
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
+ va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ for i := range data.Ipv6SecondaryAddresses {
+ keys := [...]string{"address"}
+ keyValues := [...]string{data.Ipv6SecondaryAddresses[i].Address.ValueString()}
+ keyValuesVariables := [...]string{data.Ipv6SecondaryAddresses[i].AddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "intfIpV6Address.static.secondaryIpV6Address").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Ipv6SecondaryAddresses[i].Address = types.StringNull()
+ data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringNull()
+ if t := r.Get("address.optionType"); t.Exists() {
+ va := r.Get("address.value")
+ if t.String() == "variable" {
+ data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6SecondaryAddresses[i].Address = types.StringValue(va.String())
+ }
+ }
+ }
+ data.IperfServer = types.StringNull()
+ data.IperfServerVariable = types.StringNull()
+ if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
+ va := res.Get(path + "iperfServer.value")
+ if t.String() == "variable" {
+ data.IperfServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IperfServer = types.StringValue(va.String())
+ }
+ }
+ data.BlockNonSourceIp = types.BoolNull()
+ data.BlockNonSourceIpVariable = types.StringNull()
+ if t := res.Get(path + "blockNonSourceIp.optionType"); t.Exists() {
+ va := res.Get(path + "blockNonSourceIp.value")
+ if t.String() == "variable" {
+ data.BlockNonSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BlockNonSourceIp = types.BoolValue(va.Bool())
+ }
+ }
+ data.ServiceProvider = types.StringNull()
+ data.ServiceProviderVariable = types.StringNull()
+ if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
+ va := res.Get(path + "serviceProvider.value")
+ if t.String() == "variable" {
+ data.ServiceProviderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ServiceProvider = types.StringValue(va.String())
+ }
+ }
+ data.BandwidthUpstream = types.Int64Null()
+ data.BandwidthUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthUpstream.value")
+ if t.String() == "variable" {
+ data.BandwidthUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.BandwidthDownstream = types.Int64Null()
+ data.BandwidthDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthDownstream.value")
+ if t.String() == "variable" {
+ data.BandwidthDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.AutoDetectBandwidth = types.BoolNull()
+ data.AutoDetectBandwidthVariable = types.StringNull()
+ if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "autoDetectBandwidth.value")
+ if t.String() == "variable" {
+ data.AutoDetectBandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.AutoDetectBandwidth = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterface = types.BoolNull()
+
+ if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelInterface.value")
+ if t.String() == "global" {
+ data.TunnelInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQos = types.BoolNull()
+ data.PerTunnelQosVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQos.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQos = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelQosMode = types.StringNull()
+ data.TunnelQosModeVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.mode.value")
+ if t.String() == "variable" {
+ data.TunnelQosModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelQosMode = types.StringValue(va.String())
+ }
+ }
+ data.TunnelBandwidthPercent = types.Int64Null()
+ data.TunnelBandwidthPercentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bandwidthPercent.value")
+ if t.String() == "variable" {
+ data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelBandwidthPercent = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bind.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceCarrier = types.StringNull()
+ data.TunnelInterfaceCarrierVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.carrier.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCarrier = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColor = types.StringNull()
+ data.TunnelInterfaceColorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.color.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColor = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceHelloInterval = types.Int64Null()
+ data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloTolerance = types.Int64Null()
+ data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloTolerance.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceLastResortCircuit = types.BoolNull()
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lastResortCircuit.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGreTunnelDestinationIp = types.StringNull()
+ data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tlocExtensionGreTo.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tlocExtensionGreTo.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGreTunnelDestinationIp = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColorRestrict = types.BoolNull()
+ data.TunnelInterfaceColorRestrictVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.restrict.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGroups = types.Int64Null()
+ data.TunnelInterfaceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.group.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGroups = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBorder = types.BoolNull()
+ data.TunnelInterfaceBorderVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.border.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceMaxControlConnections = types.Int64Null()
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.maxControlConnections.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.natRefreshInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vBondAsStunServer.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.excludeControllerGroupList.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vManageConnectionPreference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfacePortHop = types.BoolNull()
+ data.TunnelInterfacePortHopVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.portHop.value")
+ if t.String() == "variable" {
+ data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lowBandwidthLink.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tunnelTcpMss.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceClearDontFragment = types.BoolNull()
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceCtsSgtPropagation = types.BoolNull()
+ data.TunnelInterfaceCtsSgtPropagationVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.ctsSgtPropagation.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.ctsSgtPropagation.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCtsSgtPropagationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCtsSgtPropagation = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.networkBroadcast.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowAll = types.BoolNull()
+ data.TunnelInterfaceAllowAllVariable = types.StringNull()
+ if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.all.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBgp = types.BoolNull()
+ data.TunnelInterfaceAllowBgpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bgp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDhcp = types.BoolNull()
+ data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dhcp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNtp = types.BoolNull()
+ data.TunnelInterfaceAllowNtpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ntp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSsh = types.BoolNull()
+ data.TunnelInterfaceAllowSshVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ssh.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDns = types.BoolNull()
+ data.TunnelInterfaceAllowDnsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dns.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowIcmp = types.BoolNull()
+ data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.icmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowHttps = types.BoolNull()
+ data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.https.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowOspf = types.BoolNull()
+ data.TunnelInterfaceAllowOspfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ospf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowStun = types.BoolNull()
+ data.TunnelInterfaceAllowStunVariable = types.StringNull()
+ if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.stun.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSnmp = types.BoolNull()
+ data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.snmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNetconf = types.BoolNull()
+ data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.netconf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBfd = types.BoolNull()
+ data.TunnelInterfaceAllowBfdVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bfd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.TunnelInterfaceEncapsulations {
+ keys := [...]string{"encap"}
+ keyValues := [...]string{data.TunnelInterfaceEncapsulations[i].Encapsulation.ValueString()}
+ keyValuesVariables := [...]string{""}
+
+ var r gjson.Result
+ res.Get(path + "encapsulation").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringNull()
+
+ if t := r.Get("encap.optionType"); t.Exists() {
+ va := r.Get("encap.value")
+ if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Null()
+ data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringNull()
+ if t := r.Get("preference.optionType"); t.Exists() {
+ va := r.Get("preference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Null()
+ data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringNull()
+ if t := r.Get("weight.optionType"); t.Exists() {
+ va := r.Get("weight.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.NatIpv4 = types.BoolNull()
+ data.NatIpv4Variable = types.StringNull()
+ if t := res.Get(path + "nat.optionType"); t.Exists() {
+ va := res.Get(path + "nat.value")
+ if t.String() == "variable" {
+ data.NatIpv4Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatIpv4 = types.BoolValue(va.Bool())
+ }
+ }
+ data.NatType = types.StringNull()
+ data.NatTypeVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natType.value")
+ if t.String() == "variable" {
+ data.NatTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatType = types.StringValue(va.String())
+ }
+ }
+ data.NatRangeStart = types.StringNull()
+ data.NatRangeStartVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
+ if t.String() == "variable" {
+ data.NatRangeStartVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatRangeStart = types.StringValue(va.String())
+ }
+ }
+ data.NatRangeEnd = types.StringNull()
+ data.NatRangeEndVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
+ if t.String() == "variable" {
+ data.NatRangeEndVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatRangeEnd = types.StringValue(va.String())
+ }
+ }
+ data.NatPrefixLength = types.Int64Null()
+ data.NatPrefixLengthVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
+ if t.String() == "variable" {
+ data.NatPrefixLengthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatPrefixLength = types.Int64Value(va.Int())
+ }
+ }
+ data.NatOverload = types.BoolNull()
+ data.NatOverloadVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
+ if t.String() == "variable" {
+ data.NatOverloadVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatOverload = types.BoolValue(va.Bool())
+ }
+ }
+ data.NatLoopback = types.StringNull()
+ data.NatLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.natLookback.value")
+ if t.String() == "variable" {
+ data.NatLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatLoopback = types.StringValue(va.String())
+ }
+ }
+ data.NatUdpTimeout = types.Int64Null()
+ data.NatUdpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
+ if t.String() == "variable" {
+ data.NatUdpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatUdpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.NatTcpTimeout = types.Int64Null()
+ data.NatTcpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
+ if t.String() == "variable" {
+ data.NatTcpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatTcpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.NewStaticNats {
+ keys := [...]string{"sourceIp", "translateIp"}
+ keyValues := [...]string{data.NewStaticNats[i].SourceIp.ValueString(), data.NewStaticNats[i].TranslatedIp.ValueString()}
+ keyValuesVariables := [...]string{data.NewStaticNats[i].SourceIpVariable.ValueString(), data.NewStaticNats[i].TranslatedIpVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "natAttributesIpv4.newStaticNat").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.NewStaticNats[i].SourceIp = types.StringNull()
+ data.NewStaticNats[i].SourceIpVariable = types.StringNull()
+ if t := r.Get("sourceIp.optionType"); t.Exists() {
+ va := r.Get("sourceIp.value")
+ if t.String() == "variable" {
+ data.NewStaticNats[i].SourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NewStaticNats[i].SourceIp = types.StringValue(va.String())
+ }
+ }
+ data.NewStaticNats[i].TranslatedIp = types.StringNull()
+ data.NewStaticNats[i].TranslatedIpVariable = types.StringNull()
+ if t := r.Get("translateIp.optionType"); t.Exists() {
+ va := r.Get("translateIp.value")
+ if t.String() == "variable" {
+ data.NewStaticNats[i].TranslatedIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NewStaticNats[i].TranslatedIp = types.StringValue(va.String())
+ }
+ }
+ data.NewStaticNats[i].Direction = types.StringNull()
+
+ if t := r.Get("staticNatDirection.optionType"); t.Exists() {
+ va := r.Get("staticNatDirection.value")
+ if t.String() == "global" {
+ data.NewStaticNats[i].Direction = types.StringValue(va.String())
+ }
+ }
+ data.NewStaticNats[i].SourceVpn = types.Int64Null()
+ data.NewStaticNats[i].SourceVpnVariable = types.StringNull()
+ if t := r.Get("sourceVpn.optionType"); t.Exists() {
+ va := r.Get("sourceVpn.value")
+ if t.String() == "variable" {
+ data.NewStaticNats[i].SourceVpnVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NewStaticNats[i].SourceVpn = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.NatIpv6 = types.BoolNull()
+ data.NatIpv6Variable = types.StringNull()
+ if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
+ va := res.Get(path + "natIpv6.value")
+ if t.String() == "variable" {
+ data.NatIpv6Variable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.NatIpv6 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat64 = types.BoolNull()
+
+ if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv6.nat64.value")
+ if t.String() == "global" {
+ data.Nat64 = types.BoolValue(va.Bool())
+ }
+ }
+ data.Nat66 = types.BoolNull()
+
+ if t := res.Get(path + "natAttributesIpv6.nat66.optionType"); t.Exists() {
+ va := res.Get(path + "natAttributesIpv6.nat66.value")
+ if t.String() == "global" {
+ data.Nat66 = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.StaticNat66 {
+ keys := [...]string{"sourcePrefix", "translatedSourcePrefix"}
+ keyValues := [...]string{data.StaticNat66[i].SourcePrefix.ValueString(), data.StaticNat66[i].TranslatedSourcePrefix.ValueString()}
+ keyValuesVariables := [...]string{data.StaticNat66[i].SourcePrefixVariable.ValueString(), data.StaticNat66[i].TranslatedSourcePrefixVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "natAttributesIpv6.staticNat66").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.StaticNat66[i].SourcePrefix = types.StringNull()
+ data.StaticNat66[i].SourcePrefixVariable = types.StringNull()
+ if t := r.Get("sourcePrefix.optionType"); t.Exists() {
+ va := r.Get("sourcePrefix.value")
+ if t.String() == "variable" {
+ data.StaticNat66[i].SourcePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNat66[i].SourcePrefix = types.StringValue(va.String())
+ }
+ }
+ data.StaticNat66[i].TranslatedSourcePrefix = types.StringNull()
+ data.StaticNat66[i].TranslatedSourcePrefixVariable = types.StringNull()
+ if t := r.Get("translatedSourcePrefix.optionType"); t.Exists() {
+ va := r.Get("translatedSourcePrefix.value")
+ if t.String() == "variable" {
+ data.StaticNat66[i].TranslatedSourcePrefixVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNat66[i].TranslatedSourcePrefix = types.StringValue(va.String())
+ }
+ }
+ data.StaticNat66[i].SourceVpnId = types.Int64Null()
+ data.StaticNat66[i].SourceVpnIdVariable = types.StringNull()
+ if t := r.Get("sourceVpnId.optionType"); t.Exists() {
+ va := r.Get("sourceVpnId.value")
+ if t.String() == "variable" {
+ data.StaticNat66[i].SourceVpnIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.StaticNat66[i].SourceVpnId = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.QosAdaptive = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptiveQoS.value")
+ if t.String() == "global" {
+ data.QosAdaptive = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptivePeriod = types.Int64Null()
+ data.QosAdaptivePeriodVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.adaptPeriod.value")
+ if t.String() == "variable" {
+ data.QosAdaptivePeriodVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptivePeriod = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthUpstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinUpstream = types.Int64Null()
+ data.QosAdaptiveMinUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxUpstream = types.Int64Null()
+ data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultUpstream = types.Int64Null()
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveBandwidthDownstream = types.BoolNull()
+
+ if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstream.value")
+ if t.String() == "global" {
+ data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
+ }
+ }
+ data.QosAdaptiveMinDownstream = types.Int64Null()
+ data.QosAdaptiveMinDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveMaxDownstream = types.Int64Null()
+ data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosAdaptiveDefaultDownstream = types.Int64Null()
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
+ if t.String() == "variable" {
+ data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.QosShapingRate = types.Int64Null()
+ data.QosShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.QosShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ for i := range data.Arps {
+ keys := [...]string{"ipAddress", "macAddress"}
+ keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
+ keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "arp").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.Arps[i].IpAddress = types.StringNull()
+ data.Arps[i].IpAddressVariable = types.StringNull()
+ if t := r.Get("ipAddress.optionType"); t.Exists() {
+ va := r.Get("ipAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].IpAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].IpAddress = types.StringValue(va.String())
+ }
+ }
+ data.Arps[i].MacAddress = types.StringNull()
+ data.Arps[i].MacAddressVariable = types.StringNull()
+ if t := r.Get("macAddress.optionType"); t.Exists() {
+ va := r.Get("macAddress.value")
+ if t.String() == "variable" {
+ data.Arps[i].MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Arps[i].MacAddress = types.StringValue(va.String())
+ }
+ }
+ }
+ data.IcmpRedirectDisable = types.BoolNull()
+ data.IcmpRedirectDisableVariable = types.StringNull()
+ if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.icmpRedirectDisable.value")
+ if t.String() == "variable" {
+ data.IcmpRedirectDisableVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IcmpRedirectDisable = types.BoolValue(va.Bool())
+ }
+ }
+ data.Duplex = types.StringNull()
+ data.DuplexVariable = types.StringNull()
+ if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.duplex.value")
+ if t.String() == "variable" {
+ data.DuplexVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Duplex = types.StringValue(va.String())
+ }
+ }
+ data.MacAddress = types.StringNull()
+ data.MacAddressVariable = types.StringNull()
+ if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.macAddress.value")
+ if t.String() == "variable" {
+ data.MacAddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MacAddress = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.InterfaceMtu = types.Int64Null()
+ data.InterfaceMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.intrfMtu.value")
+ if t.String() == "variable" {
+ data.InterfaceMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMss.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Speed = types.StringNull()
+ data.SpeedVariable = types.StringNull()
+ if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.speed.value")
+ if t.String() == "variable" {
+ data.SpeedVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Speed = types.StringValue(va.String())
+ }
+ }
+ data.ArpTimeout = types.Int64Null()
+ data.ArpTimeoutVariable = types.StringNull()
+ if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.arpTimeout.value")
+ if t.String() == "variable" {
+ data.ArpTimeoutVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ArpTimeout = types.Int64Value(va.Int())
+ }
+ }
+ data.Autonegotiate = types.BoolNull()
+ data.AutonegotiateVariable = types.StringNull()
+ if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.autonegotiate.value")
+ if t.String() == "variable" {
+ data.AutonegotiateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Autonegotiate = types.BoolValue(va.Bool())
+ }
+ }
+ data.MediaType = types.StringNull()
+ data.MediaTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mediaType.value")
+ if t.String() == "variable" {
+ data.MediaTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.MediaType = types.StringValue(va.String())
+ }
+ }
+ data.TlocExtension = types.StringNull()
+ data.TlocExtensionVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtension.value")
+ if t.String() == "variable" {
+ data.TlocExtensionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlocExtension = types.StringValue(va.String())
+ }
+ }
+ data.GreTunnelSourceIp = types.StringNull()
+ data.GreTunnelSourceIpVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.value")
+ if t.String() == "variable" {
+ data.GreTunnelSourceIpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.GreTunnelSourceIp = types.StringValue(va.String())
+ }
+ }
+ data.Xconnect = types.StringNull()
+ data.XconnectVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.value")
+ if t.String() == "variable" {
+ data.XconnectVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Xconnect = types.StringValue(va.String())
+ }
+ }
+ data.LoadInterval = types.Int64Null()
+ data.LoadIntervalVariable = types.StringNull()
+ if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.loadInterval.value")
+ if t.String() == "variable" {
+ data.LoadIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.LoadInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.Tracker = types.StringNull()
+ data.TrackerVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tracker.value")
+ if t.String() == "variable" {
+ data.TrackerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Tracker = types.StringValue(va.String())
+ }
+ }
+ data.IpDirectedBroadcast = types.BoolNull()
+ data.IpDirectedBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipDirectedBroadcast.value")
+ if t.String() == "variable" {
+ data.IpDirectedBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpDirectedBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportWANVPNInterfaceEthernet) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TransportWanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4ConfigurationType.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpDistance.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpDistanceVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv4SecondaryAddresses) > 0 {
+ return false
+ }
+ if !data.Ipv4DhcpHelper.IsNull() {
+ return false
+ }
+ if !data.Ipv4DhcpHelperVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6ConfigurationType.IsNull() {
+ return false
+ }
+ if !data.EnableDhcpv6.IsNull() {
+ return false
+ }
+ if len(data.Ipv6DhcpSecondaryAddress) > 0 {
+ return false
+ }
+ if !data.Ipv6Address.IsNull() {
+ return false
+ }
+ if !data.Ipv6AddressVariable.IsNull() {
+ return false
+ }
+ if len(data.Ipv6SecondaryAddresses) > 0 {
+ return false
+ }
+ if !data.IperfServer.IsNull() {
+ return false
+ }
+ if !data.IperfServerVariable.IsNull() {
+ return false
+ }
+ if !data.BlockNonSourceIp.IsNull() {
+ return false
+ }
+ if !data.BlockNonSourceIpVariable.IsNull() {
+ return false
+ }
+ if !data.ServiceProvider.IsNull() {
+ return false
+ }
+ if !data.ServiceProviderVariable.IsNull() {
+ return false
+ }
+ if !data.BandwidthUpstream.IsNull() {
+ return false
+ }
+ if !data.BandwidthUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.BandwidthDownstream.IsNull() {
+ return false
+ }
+ if !data.BandwidthDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.AutoDetectBandwidth.IsNull() {
+ return false
+ }
+ if !data.AutoDetectBandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterface.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQos.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQosVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelQosMode.IsNull() {
+ return false
+ }
+ if !data.TunnelQosModeVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelBandwidthPercent.IsNull() {
+ return false
+ }
+ if !data.TunnelBandwidthPercentVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCarrier.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCarrierVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColor.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColorVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloInterval.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloTolerance.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLastResortCircuit.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGreTunnelDestinationIp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGreTunnelDestinationIpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColorRestrict.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGroups.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGroupsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBorder.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBorderVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceMaxControlConnections.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNatRefreshInterval.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVbondAsStunServer.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfacePortHop.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfacePortHopVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLowBandwidthLink.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceTunnelTcpMss.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearDontFragment.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCtsSgtPropagation.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCtsSgtPropagationVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNetworkBroadcast.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowAll.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowAllVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBgp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDhcp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNtp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSsh.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSshVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDns.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowIcmp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowHttps.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowOspf.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowStun.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowStunVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSnmp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNetconf.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBfd.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
+ return false
+ }
+ if len(data.TunnelInterfaceEncapsulations) > 0 {
+ return false
+ }
+ if !data.NatIpv4.IsNull() {
+ return false
+ }
+ if !data.NatIpv4Variable.IsNull() {
+ return false
+ }
+ if !data.NatType.IsNull() {
+ return false
+ }
+ if !data.NatTypeVariable.IsNull() {
+ return false
+ }
+ if !data.NatRangeStart.IsNull() {
+ return false
+ }
+ if !data.NatRangeStartVariable.IsNull() {
+ return false
+ }
+ if !data.NatRangeEnd.IsNull() {
+ return false
+ }
+ if !data.NatRangeEndVariable.IsNull() {
+ return false
+ }
+ if !data.NatPrefixLength.IsNull() {
+ return false
+ }
+ if !data.NatPrefixLengthVariable.IsNull() {
+ return false
+ }
+ if !data.NatOverload.IsNull() {
+ return false
+ }
+ if !data.NatOverloadVariable.IsNull() {
+ return false
+ }
+ if !data.NatLoopback.IsNull() {
+ return false
+ }
+ if !data.NatLoopbackVariable.IsNull() {
+ return false
+ }
+ if !data.NatUdpTimeout.IsNull() {
+ return false
+ }
+ if !data.NatUdpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.NatTcpTimeout.IsNull() {
+ return false
+ }
+ if !data.NatTcpTimeoutVariable.IsNull() {
+ return false
+ }
+ if len(data.NewStaticNats) > 0 {
+ return false
+ }
+ if !data.NatIpv6.IsNull() {
+ return false
+ }
+ if !data.NatIpv6Variable.IsNull() {
+ return false
+ }
+ if !data.Nat64.IsNull() {
+ return false
+ }
+ if !data.Nat66.IsNull() {
+ return false
+ }
+ if len(data.StaticNat66) > 0 {
+ return false
+ }
+ if !data.QosAdaptive.IsNull() {
+ return false
+ }
+ if !data.QosAdaptivePeriod.IsNull() {
+ return false
+ }
+ if !data.QosAdaptivePeriodVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveBandwidthUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultUpstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveBandwidthDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultDownstream.IsNull() {
+ return false
+ }
+ if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.QosShapingRate.IsNull() {
+ return false
+ }
+ if !data.QosShapingRateVariable.IsNull() {
+ return false
+ }
+ if len(data.Arps) > 0 {
+ return false
+ }
+ if !data.IcmpRedirectDisable.IsNull() {
+ return false
+ }
+ if !data.IcmpRedirectDisableVariable.IsNull() {
+ return false
+ }
+ if !data.Duplex.IsNull() {
+ return false
+ }
+ if !data.DuplexVariable.IsNull() {
+ return false
+ }
+ if !data.MacAddress.IsNull() {
+ return false
+ }
+ if !data.MacAddressVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtu.IsNull() {
+ return false
+ }
+ if !data.InterfaceMtuVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.Speed.IsNull() {
+ return false
+ }
+ if !data.SpeedVariable.IsNull() {
+ return false
+ }
+ if !data.ArpTimeout.IsNull() {
+ return false
+ }
+ if !data.ArpTimeoutVariable.IsNull() {
+ return false
+ }
+ if !data.Autonegotiate.IsNull() {
+ return false
+ }
+ if !data.AutonegotiateVariable.IsNull() {
+ return false
+ }
+ if !data.MediaType.IsNull() {
+ return false
+ }
+ if !data.MediaTypeVariable.IsNull() {
+ return false
+ }
+ if !data.TlocExtension.IsNull() {
+ return false
+ }
+ if !data.TlocExtensionVariable.IsNull() {
+ return false
+ }
+ if !data.GreTunnelSourceIp.IsNull() {
+ return false
+ }
+ if !data.GreTunnelSourceIpVariable.IsNull() {
+ return false
+ }
+ if !data.Xconnect.IsNull() {
+ return false
+ }
+ if !data.XconnectVariable.IsNull() {
+ return false
+ }
+ if !data.LoadInterval.IsNull() {
+ return false
+ }
+ if !data.LoadIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.Tracker.IsNull() {
+ return false
+ }
+ if !data.TrackerVariable.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcast.IsNull() {
+ return false
+ }
+ if !data.IpDirectedBroadcastVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index 248ba82b6..000000000
--- a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,4932 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportWANVPNInterfaceEthernet 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"`
- TransportWanVpnProfileParcelId types.String `tfsdk:"transport_wan_vpn_profile_parcel_id"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4ConfigurationType types.String `tfsdk:"ipv4_configuration_type"`
- Ipv4DhcpDistance types.Int64 `tfsdk:"ipv4_dhcp_distance"`
- Ipv4DhcpDistanceVariable types.String `tfsdk:"ipv4_dhcp_distance_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- Ipv4SecondaryAddresses []TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses `tfsdk:"ipv4_secondary_addresses"`
- Ipv4DhcpHelper types.Set `tfsdk:"ipv4_dhcp_helper"`
- Ipv4DhcpHelperVariable types.String `tfsdk:"ipv4_dhcp_helper_variable"`
- Ipv6ConfigurationType types.String `tfsdk:"ipv6_configuration_type"`
- EnableDhcpv6 types.Bool `tfsdk:"enable_dhcpv6"`
- Ipv6DhcpSecondaryAddress []TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress `tfsdk:"ipv6_dhcp_secondary_address"`
- Ipv6Address types.String `tfsdk:"ipv6_address"`
- Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
- Ipv6SecondaryAddresses []TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses `tfsdk:"ipv6_secondary_addresses"`
- IperfServer types.String `tfsdk:"iperf_server"`
- IperfServerVariable types.String `tfsdk:"iperf_server_variable"`
- BlockNonSourceIp types.Bool `tfsdk:"block_non_source_ip"`
- BlockNonSourceIpVariable types.String `tfsdk:"block_non_source_ip_variable"`
- ServiceProvider types.String `tfsdk:"service_provider"`
- ServiceProviderVariable types.String `tfsdk:"service_provider_variable"`
- BandwidthUpstream types.Int64 `tfsdk:"bandwidth_upstream"`
- BandwidthUpstreamVariable types.String `tfsdk:"bandwidth_upstream_variable"`
- BandwidthDownstream types.Int64 `tfsdk:"bandwidth_downstream"`
- BandwidthDownstreamVariable types.String `tfsdk:"bandwidth_downstream_variable"`
- AutoDetectBandwidth types.Bool `tfsdk:"auto_detect_bandwidth"`
- AutoDetectBandwidthVariable types.String `tfsdk:"auto_detect_bandwidth_variable"`
- TunnelInterface types.Bool `tfsdk:"tunnel_interface"`
- PerTunnelQos types.Bool `tfsdk:"per_tunnel_qos"`
- PerTunnelQosVariable types.String `tfsdk:"per_tunnel_qos_variable"`
- TunnelQosMode types.String `tfsdk:"tunnel_qos_mode"`
- TunnelQosModeVariable types.String `tfsdk:"tunnel_qos_mode_variable"`
- TunnelBandwidthPercent types.Int64 `tfsdk:"tunnel_bandwidth_percent"`
- TunnelBandwidthPercentVariable types.String `tfsdk:"tunnel_bandwidth_percent_variable"`
- TunnelInterfaceBindLoopbackTunnel types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel"`
- TunnelInterfaceBindLoopbackTunnelVariable types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel_variable"`
- TunnelInterfaceCarrier types.String `tfsdk:"tunnel_interface_carrier"`
- TunnelInterfaceCarrierVariable types.String `tfsdk:"tunnel_interface_carrier_variable"`
- TunnelInterfaceColor types.String `tfsdk:"tunnel_interface_color"`
- TunnelInterfaceColorVariable types.String `tfsdk:"tunnel_interface_color_variable"`
- TunnelInterfaceHelloInterval types.Int64 `tfsdk:"tunnel_interface_hello_interval"`
- TunnelInterfaceHelloIntervalVariable types.String `tfsdk:"tunnel_interface_hello_interval_variable"`
- TunnelInterfaceHelloTolerance types.Int64 `tfsdk:"tunnel_interface_hello_tolerance"`
- TunnelInterfaceHelloToleranceVariable types.String `tfsdk:"tunnel_interface_hello_tolerance_variable"`
- TunnelInterfaceLastResortCircuit types.Bool `tfsdk:"tunnel_interface_last_resort_circuit"`
- TunnelInterfaceLastResortCircuitVariable types.String `tfsdk:"tunnel_interface_last_resort_circuit_variable"`
- TunnelInterfaceGreTunnelDestinationIp types.String `tfsdk:"tunnel_interface_gre_tunnel_destination_ip"`
- TunnelInterfaceGreTunnelDestinationIpVariable types.String `tfsdk:"tunnel_interface_gre_tunnel_destination_ip_variable"`
- TunnelInterfaceColorRestrict types.Bool `tfsdk:"tunnel_interface_color_restrict"`
- TunnelInterfaceColorRestrictVariable types.String `tfsdk:"tunnel_interface_color_restrict_variable"`
- TunnelInterfaceGroups types.Int64 `tfsdk:"tunnel_interface_groups"`
- TunnelInterfaceGroupsVariable types.String `tfsdk:"tunnel_interface_groups_variable"`
- TunnelInterfaceBorder types.Bool `tfsdk:"tunnel_interface_border"`
- TunnelInterfaceBorderVariable types.String `tfsdk:"tunnel_interface_border_variable"`
- TunnelInterfaceMaxControlConnections types.Int64 `tfsdk:"tunnel_interface_max_control_connections"`
- TunnelInterfaceMaxControlConnectionsVariable types.String `tfsdk:"tunnel_interface_max_control_connections_variable"`
- TunnelInterfaceNatRefreshInterval types.Int64 `tfsdk:"tunnel_interface_nat_refresh_interval"`
- TunnelInterfaceNatRefreshIntervalVariable types.String `tfsdk:"tunnel_interface_nat_refresh_interval_variable"`
- TunnelInterfaceVbondAsStunServer types.Bool `tfsdk:"tunnel_interface_vbond_as_stun_server"`
- TunnelInterfaceVbondAsStunServerVariable types.String `tfsdk:"tunnel_interface_vbond_as_stun_server_variable"`
- TunnelInterfaceExcludeControllerGroupList types.Set `tfsdk:"tunnel_interface_exclude_controller_group_list"`
- TunnelInterfaceExcludeControllerGroupListVariable types.String `tfsdk:"tunnel_interface_exclude_controller_group_list_variable"`
- TunnelInterfaceVmanageConnectionPreference types.Int64 `tfsdk:"tunnel_interface_vmanage_connection_preference"`
- TunnelInterfaceVmanageConnectionPreferenceVariable types.String `tfsdk:"tunnel_interface_vmanage_connection_preference_variable"`
- TunnelInterfacePortHop types.Bool `tfsdk:"tunnel_interface_port_hop"`
- TunnelInterfacePortHopVariable types.String `tfsdk:"tunnel_interface_port_hop_variable"`
- TunnelInterfaceLowBandwidthLink types.Bool `tfsdk:"tunnel_interface_low_bandwidth_link"`
- TunnelInterfaceLowBandwidthLinkVariable types.String `tfsdk:"tunnel_interface_low_bandwidth_link_variable"`
- TunnelInterfaceTunnelTcpMss types.Int64 `tfsdk:"tunnel_interface_tunnel_tcp_mss"`
- TunnelInterfaceTunnelTcpMssVariable types.String `tfsdk:"tunnel_interface_tunnel_tcp_mss_variable"`
- TunnelInterfaceClearDontFragment types.Bool `tfsdk:"tunnel_interface_clear_dont_fragment"`
- TunnelInterfaceClearDontFragmentVariable types.String `tfsdk:"tunnel_interface_clear_dont_fragment_variable"`
- TunnelInterfaceCtsSgtPropagation types.Bool `tfsdk:"tunnel_interface_cts_sgt_propagation"`
- TunnelInterfaceCtsSgtPropagationVariable types.String `tfsdk:"tunnel_interface_cts_sgt_propagation_variable"`
- TunnelInterfaceNetworkBroadcast types.Bool `tfsdk:"tunnel_interface_network_broadcast"`
- TunnelInterfaceNetworkBroadcastVariable types.String `tfsdk:"tunnel_interface_network_broadcast_variable"`
- TunnelInterfaceAllowAll types.Bool `tfsdk:"tunnel_interface_allow_all"`
- TunnelInterfaceAllowAllVariable types.String `tfsdk:"tunnel_interface_allow_all_variable"`
- TunnelInterfaceAllowBgp types.Bool `tfsdk:"tunnel_interface_allow_bgp"`
- TunnelInterfaceAllowBgpVariable types.String `tfsdk:"tunnel_interface_allow_bgp_variable"`
- TunnelInterfaceAllowDhcp types.Bool `tfsdk:"tunnel_interface_allow_dhcp"`
- TunnelInterfaceAllowDhcpVariable types.String `tfsdk:"tunnel_interface_allow_dhcp_variable"`
- TunnelInterfaceAllowNtp types.Bool `tfsdk:"tunnel_interface_allow_ntp"`
- TunnelInterfaceAllowNtpVariable types.String `tfsdk:"tunnel_interface_allow_ntp_variable"`
- TunnelInterfaceAllowSsh types.Bool `tfsdk:"tunnel_interface_allow_ssh"`
- TunnelInterfaceAllowSshVariable types.String `tfsdk:"tunnel_interface_allow_ssh_variable"`
- TunnelInterfaceAllowDns types.Bool `tfsdk:"tunnel_interface_allow_dns"`
- TunnelInterfaceAllowDnsVariable types.String `tfsdk:"tunnel_interface_allow_dns_variable"`
- TunnelInterfaceAllowIcmp types.Bool `tfsdk:"tunnel_interface_allow_icmp"`
- TunnelInterfaceAllowIcmpVariable types.String `tfsdk:"tunnel_interface_allow_icmp_variable"`
- TunnelInterfaceAllowHttps types.Bool `tfsdk:"tunnel_interface_allow_https"`
- TunnelInterfaceAllowHttpsVariable types.String `tfsdk:"tunnel_interface_allow_https_variable"`
- TunnelInterfaceAllowOspf types.Bool `tfsdk:"tunnel_interface_allow_ospf"`
- TunnelInterfaceAllowOspfVariable types.String `tfsdk:"tunnel_interface_allow_ospf_variable"`
- TunnelInterfaceAllowStun types.Bool `tfsdk:"tunnel_interface_allow_stun"`
- TunnelInterfaceAllowStunVariable types.String `tfsdk:"tunnel_interface_allow_stun_variable"`
- TunnelInterfaceAllowSnmp types.Bool `tfsdk:"tunnel_interface_allow_snmp"`
- TunnelInterfaceAllowSnmpVariable types.String `tfsdk:"tunnel_interface_allow_snmp_variable"`
- TunnelInterfaceAllowNetconf types.Bool `tfsdk:"tunnel_interface_allow_netconf"`
- TunnelInterfaceAllowNetconfVariable types.String `tfsdk:"tunnel_interface_allow_netconf_variable"`
- TunnelInterfaceAllowBfd types.Bool `tfsdk:"tunnel_interface_allow_bfd"`
- TunnelInterfaceAllowBfdVariable types.String `tfsdk:"tunnel_interface_allow_bfd_variable"`
- TunnelInterfaceEncapsulations []TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations `tfsdk:"tunnel_interface_encapsulations"`
- NatIpv4 types.Bool `tfsdk:"nat_ipv4"`
- NatIpv4Variable types.String `tfsdk:"nat_ipv4_variable"`
- NatType types.String `tfsdk:"nat_type"`
- NatTypeVariable types.String `tfsdk:"nat_type_variable"`
- NatRangeStart types.String `tfsdk:"nat_range_start"`
- NatRangeStartVariable types.String `tfsdk:"nat_range_start_variable"`
- NatRangeEnd types.String `tfsdk:"nat_range_end"`
- NatRangeEndVariable types.String `tfsdk:"nat_range_end_variable"`
- NatPrefixLength types.Int64 `tfsdk:"nat_prefix_length"`
- NatPrefixLengthVariable types.String `tfsdk:"nat_prefix_length_variable"`
- NatOverload types.Bool `tfsdk:"nat_overload"`
- NatOverloadVariable types.String `tfsdk:"nat_overload_variable"`
- NatLoopback types.String `tfsdk:"nat_loopback"`
- NatLoopbackVariable types.String `tfsdk:"nat_loopback_variable"`
- NatUdpTimeout types.Int64 `tfsdk:"nat_udp_timeout"`
- NatUdpTimeoutVariable types.String `tfsdk:"nat_udp_timeout_variable"`
- NatTcpTimeout types.Int64 `tfsdk:"nat_tcp_timeout"`
- NatTcpTimeoutVariable types.String `tfsdk:"nat_tcp_timeout_variable"`
- NewStaticNats []TransportWANVPNInterfaceEthernetNewStaticNats `tfsdk:"new_static_nats"`
- NatIpv6 types.Bool `tfsdk:"nat_ipv6"`
- NatIpv6Variable types.String `tfsdk:"nat_ipv6_variable"`
- Nat64 types.Bool `tfsdk:"nat64"`
- Nat66 types.Bool `tfsdk:"nat66"`
- StaticNat66 []TransportWANVPNInterfaceEthernetStaticNat66 `tfsdk:"static_nat66"`
- QosAdaptive types.Bool `tfsdk:"qos_adaptive"`
- QosAdaptivePeriod types.Int64 `tfsdk:"qos_adaptive_period"`
- QosAdaptivePeriodVariable types.String `tfsdk:"qos_adaptive_period_variable"`
- QosAdaptiveBandwidthUpstream types.Bool `tfsdk:"qos_adaptive_bandwidth_upstream"`
- QosAdaptiveMinUpstream types.Int64 `tfsdk:"qos_adaptive_min_upstream"`
- QosAdaptiveMinUpstreamVariable types.String `tfsdk:"qos_adaptive_min_upstream_variable"`
- QosAdaptiveMaxUpstream types.Int64 `tfsdk:"qos_adaptive_max_upstream"`
- QosAdaptiveMaxUpstreamVariable types.String `tfsdk:"qos_adaptive_max_upstream_variable"`
- QosAdaptiveDefaultUpstream types.Int64 `tfsdk:"qos_adaptive_default_upstream"`
- QosAdaptiveDefaultUpstreamVariable types.String `tfsdk:"qos_adaptive_default_upstream_variable"`
- QosAdaptiveBandwidthDownstream types.Bool `tfsdk:"qos_adaptive_bandwidth_downstream"`
- QosAdaptiveMinDownstream types.Int64 `tfsdk:"qos_adaptive_min_downstream"`
- QosAdaptiveMinDownstreamVariable types.String `tfsdk:"qos_adaptive_min_downstream_variable"`
- QosAdaptiveMaxDownstream types.Int64 `tfsdk:"qos_adaptive_max_downstream"`
- QosAdaptiveMaxDownstreamVariable types.String `tfsdk:"qos_adaptive_max_downstream_variable"`
- QosAdaptiveDefaultDownstream types.Int64 `tfsdk:"qos_adaptive_default_downstream"`
- QosAdaptiveDefaultDownstreamVariable types.String `tfsdk:"qos_adaptive_default_downstream_variable"`
- QosShapingRate types.Int64 `tfsdk:"qos_shaping_rate"`
- QosShapingRateVariable types.String `tfsdk:"qos_shaping_rate_variable"`
- Arps []TransportWANVPNInterfaceEthernetArps `tfsdk:"arps"`
- IcmpRedirectDisable types.Bool `tfsdk:"icmp_redirect_disable"`
- IcmpRedirectDisableVariable types.String `tfsdk:"icmp_redirect_disable_variable"`
- Duplex types.String `tfsdk:"duplex"`
- DuplexVariable types.String `tfsdk:"duplex_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- InterfaceMtu types.Int64 `tfsdk:"interface_mtu"`
- InterfaceMtuVariable types.String `tfsdk:"interface_mtu_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- Speed types.String `tfsdk:"speed"`
- SpeedVariable types.String `tfsdk:"speed_variable"`
- ArpTimeout types.Int64 `tfsdk:"arp_timeout"`
- ArpTimeoutVariable types.String `tfsdk:"arp_timeout_variable"`
- Autonegotiate types.Bool `tfsdk:"autonegotiate"`
- AutonegotiateVariable types.String `tfsdk:"autonegotiate_variable"`
- MediaType types.String `tfsdk:"media_type"`
- MediaTypeVariable types.String `tfsdk:"media_type_variable"`
- TlocExtension types.String `tfsdk:"tloc_extension"`
- TlocExtensionVariable types.String `tfsdk:"tloc_extension_variable"`
- GreTunnelSourceIp types.String `tfsdk:"gre_tunnel_source_ip"`
- GreTunnelSourceIpVariable types.String `tfsdk:"gre_tunnel_source_ip_variable"`
- Xconnect types.String `tfsdk:"xconnect"`
- XconnectVariable types.String `tfsdk:"xconnect_variable"`
- LoadInterval types.Int64 `tfsdk:"load_interval"`
- LoadIntervalVariable types.String `tfsdk:"load_interval_variable"`
- Tracker types.String `tfsdk:"tracker"`
- TrackerVariable types.String `tfsdk:"tracker_variable"`
- IpDirectedBroadcast types.Bool `tfsdk:"ip_directed_broadcast"`
- IpDirectedBroadcastVariable types.String `tfsdk:"ip_directed_broadcast_variable"`
-}
-
-type TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
-}
-
-type TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
-}
-
-type TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
-}
-
-type TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations struct {
- Encapsulation types.String `tfsdk:"encapsulation"`
- Preference types.Int64 `tfsdk:"preference"`
- PreferenceVariable types.String `tfsdk:"preference_variable"`
- Weight types.Int64 `tfsdk:"weight"`
- WeightVariable types.String `tfsdk:"weight_variable"`
-}
-
-type TransportWANVPNInterfaceEthernetNewStaticNats struct {
- SourceIp types.String `tfsdk:"source_ip"`
- SourceIpVariable types.String `tfsdk:"source_ip_variable"`
- TranslatedIp types.String `tfsdk:"translated_ip"`
- TranslatedIpVariable types.String `tfsdk:"translated_ip_variable"`
- Direction types.String `tfsdk:"direction"`
- SourceVpn types.Int64 `tfsdk:"source_vpn"`
- SourceVpnVariable types.String `tfsdk:"source_vpn_variable"`
-}
-
-type TransportWANVPNInterfaceEthernetStaticNat66 struct {
- SourcePrefix types.String `tfsdk:"source_prefix"`
- SourcePrefixVariable types.String `tfsdk:"source_prefix_variable"`
- TranslatedSourcePrefix types.String `tfsdk:"translated_source_prefix"`
- TranslatedSourcePrefixVariable types.String `tfsdk:"translated_source_prefix_variable"`
- SourceVpnId types.Int64 `tfsdk:"source_vpn_id"`
- SourceVpnIdVariable types.String `tfsdk:"source_vpn_id_variable"`
-}
-
-type TransportWANVPNInterfaceEthernetArps struct {
- IpAddress types.String `tfsdk:"ip_address"`
- IpAddressVariable types.String `tfsdk:"ip_address_variable"`
- MacAddress types.String `tfsdk:"mac_address"`
- MacAddressVariable types.String `tfsdk:"mac_address_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportWANVPNInterfaceEthernet) getModel() string {
- return "transport_wan_vpn_interface_ethernet"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportWANVPNInterfaceEthernet) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/ethernet", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4DhcpDistanceVariable.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString())
- }
- } else if data.Ipv4DhcpDistance.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "default")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", 1)
- }
- } else {
- if true && data.Ipv4ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
- if true && data.Ipv4ConfigurationType.ValueString() == "static" {
-
- for _, item := range data.Ipv4SecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody)
- }
- }
-
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable")
- body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString())
- }
- } else if data.Ipv4DhcpHelper.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global")
- var values []string
- data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"dhcpHelper.value", values)
- }
- }
- if !data.EnableDhcpv6.IsNull() {
- if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" {
- body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool())
- }
- }
- if true && data.Ipv6ConfigurationType.ValueString() == "dynamic" {
-
- for _, item := range data.Ipv6DhcpSecondaryAddress {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody)
- }
- }
-
- if !data.Ipv6AddressVariable.IsNull() {
- if true && data.Ipv6ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString())
- }
- } else if !data.Ipv6Address.IsNull() {
- if true && data.Ipv6ConfigurationType.ValueString() == "static" {
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global")
- body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString())
- }
- }
- if true && data.Ipv6ConfigurationType.ValueString() == "static" {
-
- for _, item := range data.Ipv6SecondaryAddresses {
- itemBody := ""
-
- if !item.AddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString())
- }
- } else if !item.Address.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "address.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody)
- }
- }
-
- if !data.IperfServerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable")
- body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServerVariable.ValueString())
- }
- } else if data.IperfServer.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"iperfServer.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"iperfServer.optionType", "global")
- body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServer.ValueString())
- }
- }
-
- if !data.BlockNonSourceIpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "variable")
- body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIpVariable.ValueString())
- }
- } else if data.BlockNonSourceIp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "default")
- body, _ = sjson.Set(body, path+"blockNonSourceIp.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "global")
- body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIp.ValueBool())
- }
- }
-
- if !data.ServiceProviderVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable")
- body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString())
- }
- } else if data.ServiceProvider.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global")
- body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString())
- }
- }
-
- if !data.BandwidthUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString())
- }
- } else if data.BandwidthUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64())
- }
- }
-
- if !data.BandwidthDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString())
- }
- } else if data.BandwidthDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64())
- }
- }
-
- if !data.AutoDetectBandwidthVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable")
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidthVariable.ValueString())
- }
- } else if data.AutoDetectBandwidth.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default")
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global")
- body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidth.ValueBool())
- }
- }
- if data.TunnelInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnelInterface.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool())
- }
- }
-
- if !data.PerTunnelQosVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString())
- }
- } else if data.PerTunnelQos.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool())
- }
- }
-
- if !data.TunnelQosModeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString())
- }
- } else if !data.TunnelQosMode.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString())
- }
- }
-
- if !data.TunnelBandwidthPercentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString())
- }
- } else if data.TunnelBandwidthPercent.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString())
- }
- } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString())
- }
- }
-
- if !data.TunnelInterfaceCarrierVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString())
- }
- } else if data.TunnelInterfaceCarrier.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString())
- }
- }
-
- if !data.TunnelInterfaceColorVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString())
- }
- } else if data.TunnelInterfaceColor.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString())
- }
- }
-
- if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString())
- }
- } else if data.TunnelInterfaceHelloInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString())
- }
- } else if data.TunnelInterfaceHelloTolerance.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString())
- }
- } else if data.TunnelInterfaceLastResortCircuit.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceGreTunnelDestinationIpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIpVariable.ValueString())
- }
- } else if data.TunnelInterfaceGreTunnelDestinationIp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIp.ValueString())
- }
- }
-
- if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString())
- }
- } else if data.TunnelInterfaceColorRestrict.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceGroupsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString())
- }
- } else if data.TunnelInterfaceGroups.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceBorderVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString())
- }
- } else if data.TunnelInterfaceBorder.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.border.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString())
- }
- } else if data.TunnelInterfaceMaxControlConnections.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString())
- }
- } else if data.TunnelInterfaceNatRefreshInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString())
- }
- } else if data.TunnelInterfaceVbondAsStunServer.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString())
- }
- } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global")
- var values []int64
- data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values)
- }
- }
-
- if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString())
- }
- } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64())
- }
- }
-
- if !data.TunnelInterfacePortHopVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString())
- }
- } else if data.TunnelInterfacePortHop.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString())
- }
- } else if data.TunnelInterfaceLowBandwidthLink.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString())
- }
- } else if data.TunnelInterfaceTunnelTcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString())
- }
- } else if data.TunnelInterfaceClearDontFragment.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceCtsSgtPropagationVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagationVariable.ValueString())
- }
- } else if data.TunnelInterfaceCtsSgtPropagation.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagation.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString())
- }
- } else if data.TunnelInterfaceNetworkBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowAllVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowAll.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.all.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowBgp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowDhcp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString())
- }
- } else if !data.TunnelInterfaceAllowNtp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowSshVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString())
- }
- } else if !data.TunnelInterfaceAllowSsh.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowDns.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.dns.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowIcmp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowHttps.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.https.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowOspf.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowStunVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowStun.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.stun.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowSnmp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowNetconf.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowBfd.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"encapsulation", []interface{}{})
- for _, item := range data.TunnelInterfaceEncapsulations {
- itemBody := ""
- if !item.Encapsulation.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString())
- }
- }
-
- if !item.PreferenceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString())
- }
- } else if item.Preference.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64())
- }
- }
-
- if !item.WeightVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString())
- }
- } else if item.Weight.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "weight.value", 1)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody)
- }
- }
-
- if !data.NatIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "variable")
- body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString())
- }
- } else if data.NatIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "default")
- body, _ = sjson.Set(body, path+"nat.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"nat.optionType", "global")
- body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool())
- }
- }
-
- if !data.NatTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatTypeVariable.ValueString())
- }
- } else if data.NatType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", "interface")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatType.ValueString())
- }
- }
-
- if !data.NatRangeStartVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStartVariable.ValueString())
- }
- } else if !data.NatRangeStart.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStart.ValueString())
- }
- }
-
- if !data.NatRangeEndVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEndVariable.ValueString())
- }
- } else if !data.NatRangeEnd.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEnd.ValueString())
- }
- }
-
- if !data.NatPrefixLengthVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLengthVariable.ValueString())
- }
- } else if !data.NatPrefixLength.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLength.ValueInt64())
- }
- }
-
- if !data.NatOverloadVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverloadVariable.ValueString())
- }
- } else if !data.NatOverload.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverload.ValueBool())
- }
- }
-
- if !data.NatLoopbackVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopbackVariable.ValueString())
- }
- } else if !data.NatLoopback.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopback.ValueString())
- }
- }
-
- if !data.NatUdpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString())
- }
- } else if data.NatUdpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64())
- }
- }
-
- if !data.NatTcpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString())
- }
- } else if data.NatTcpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{})
- for _, item := range data.NewStaticNats {
- itemBody := ""
-
- if !item.SourceIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString())
- }
- } else if !item.SourceIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString())
- }
- }
-
- if !item.TranslatedIpVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIpVariable.ValueString())
- }
- } else if !item.TranslatedIp.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIp.ValueString())
- }
- }
- if item.Direction.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString())
- }
- }
-
- if !item.SourceVpnVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString())
- }
- } else if item.SourceVpn.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody)
- }
- }
-
- if !data.NatIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6Variable.ValueString())
- }
- } else if data.NatIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natIpv6.optionType", "default")
- body, _ = sjson.Set(body, path+"natIpv6.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"natIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6.ValueBool())
- }
- }
- if !data.Nat64.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool())
- }
- }
- if !data.Nat66.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.optionType", "global")
- body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.value", data.Nat66.ValueBool())
- }
- }
- if true {
-
- for _, item := range data.StaticNat66 {
- itemBody := ""
-
- if !item.SourcePrefixVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefixVariable.ValueString())
- }
- } else if !item.SourcePrefix.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefix.ValueString())
- }
- }
-
- if !item.TranslatedSourcePrefixVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefixVariable.ValueString())
- }
- } else if !item.TranslatedSourcePrefix.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefix.ValueString())
- }
- }
-
- if !item.SourceVpnIdVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnIdVariable.ValueString())
- }
- } else if item.SourceVpnId.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnId.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"natAttributesIpv6.staticNat66.-1", itemBody)
- }
- }
- if !data.QosAdaptive.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool())
- }
- }
-
- if !data.QosAdaptivePeriodVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString())
- }
- } else if !data.QosAdaptivePeriod.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64())
- }
- }
- if !data.QosAdaptiveBandwidthUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool())
- }
- }
-
- if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMinUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMaxUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveDefaultUpstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64())
- }
- }
- if !data.QosAdaptiveBandwidthDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool())
- }
- }
-
- if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMinDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveMaxDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64())
- }
- }
-
- if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString())
- }
- } else if !data.QosAdaptiveDefaultDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64())
- }
- }
-
- if !data.QosShapingRateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString())
- }
- } else if !data.QosShapingRate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"arp", []interface{}{})
- for _, item := range data.Arps {
- itemBody := ""
-
- if !item.IpAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString())
- }
- } else if item.IpAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString())
- }
- }
-
- if !item.MacAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString())
- }
- } else if item.MacAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody)
- }
- }
-
- if !data.IcmpRedirectDisableVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString())
- }
- } else if data.IcmpRedirectDisable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool())
- }
- }
-
- if !data.DuplexVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString())
- }
- } else if data.Duplex.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString())
- }
- }
-
- if !data.MacAddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString())
- }
- } else if data.MacAddress.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.InterfaceMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
- }
- } else if data.InterfaceMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.SpeedVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString())
- }
- } else if data.Speed.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString())
- }
- }
-
- if !data.ArpTimeoutVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString())
- }
- } else if data.ArpTimeout.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64())
- }
- }
-
- if !data.AutonegotiateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString())
- }
- } else if data.Autonegotiate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool())
- }
- }
-
- if !data.MediaTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString())
- }
- } else if data.MediaType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString())
- }
- }
-
- if !data.TlocExtensionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString())
- }
- } else if data.TlocExtension.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString())
- }
- }
-
- if !data.GreTunnelSourceIpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIpVariable.ValueString())
- }
- } else if data.GreTunnelSourceIp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIp.ValueString())
- }
- }
-
- if !data.XconnectVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.XconnectVariable.ValueString())
- }
- } else if data.Xconnect.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.Xconnect.ValueString())
- }
- }
-
- if !data.LoadIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString())
- }
- } else if data.LoadInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64())
- }
- }
-
- if !data.TrackerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString())
- }
- } else if data.Tracker.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString())
- }
- }
-
- if !data.IpDirectedBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString())
- }
- } else if data.IpDirectedBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportWANVPNInterfaceEthernet) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpDistance = types.Int64Null()
- data.Ipv4DhcpDistanceVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
- if t.String() == "variable" {
- data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary"); value.Exists() {
- data.Ipv4SecondaryAddresses = make([]TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceEthernetIpv4SecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("subnetMask.optionType"); t.Exists() {
- va := v.Get("subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses = append(data.Ipv4SecondaryAddresses, item)
- return true
- })
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.EnableDhcpv6 = types.BoolNull()
-
- if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
- if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address"); value.Exists() {
- data.Ipv6DhcpSecondaryAddress = make([]TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceEthernetIpv6DhcpSecondaryAddress{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- data.Ipv6DhcpSecondaryAddress = append(data.Ipv6DhcpSecondaryAddress, item)
- return true
- })
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "intfIpV6Address.static.secondaryIpV6Address"); value.Exists() {
- data.Ipv6SecondaryAddresses = make([]TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceEthernetIpv6SecondaryAddresses{}
- item.Address = types.StringNull()
- item.AddressVariable = types.StringNull()
- if t := v.Get("address.optionType"); t.Exists() {
- va := v.Get("address.value")
- if t.String() == "variable" {
- item.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Address = types.StringValue(va.String())
- }
- }
- data.Ipv6SecondaryAddresses = append(data.Ipv6SecondaryAddresses, item)
- return true
- })
- }
- data.IperfServer = types.StringNull()
- data.IperfServerVariable = types.StringNull()
- if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
- va := res.Get(path + "iperfServer.value")
- if t.String() == "variable" {
- data.IperfServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IperfServer = types.StringValue(va.String())
- }
- }
- data.BlockNonSourceIp = types.BoolNull()
- data.BlockNonSourceIpVariable = types.StringNull()
- if t := res.Get(path + "blockNonSourceIp.optionType"); t.Exists() {
- va := res.Get(path + "blockNonSourceIp.value")
- if t.String() == "variable" {
- data.BlockNonSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BlockNonSourceIp = types.BoolValue(va.Bool())
- }
- }
- data.ServiceProvider = types.StringNull()
- data.ServiceProviderVariable = types.StringNull()
- if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
- va := res.Get(path + "serviceProvider.value")
- if t.String() == "variable" {
- data.ServiceProviderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ServiceProvider = types.StringValue(va.String())
- }
- }
- data.BandwidthUpstream = types.Int64Null()
- data.BandwidthUpstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthUpstream.value")
- if t.String() == "variable" {
- data.BandwidthUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthUpstream = types.Int64Value(va.Int())
- }
- }
- data.BandwidthDownstream = types.Int64Null()
- data.BandwidthDownstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthDownstream.value")
- if t.String() == "variable" {
- data.BandwidthDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthDownstream = types.Int64Value(va.Int())
- }
- }
- data.AutoDetectBandwidth = types.BoolNull()
- data.AutoDetectBandwidthVariable = types.StringNull()
- if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
- va := res.Get(path + "autoDetectBandwidth.value")
- if t.String() == "variable" {
- data.AutoDetectBandwidthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AutoDetectBandwidth = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterface = types.BoolNull()
-
- if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelInterface.value")
- if t.String() == "global" {
- data.TunnelInterface = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQos = types.BoolNull()
- data.PerTunnelQosVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQos.value")
- if t.String() == "variable" {
- data.PerTunnelQosVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQos = types.BoolValue(va.Bool())
- }
- }
- data.TunnelQosMode = types.StringNull()
- data.TunnelQosModeVariable = types.StringNull()
- if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.mode.value")
- if t.String() == "variable" {
- data.TunnelQosModeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelQosMode = types.StringValue(va.String())
- }
- }
- data.TunnelBandwidthPercent = types.Int64Null()
- data.TunnelBandwidthPercentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bandwidthPercent.value")
- if t.String() == "variable" {
- data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelBandwidthPercent = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bind.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceCarrier = types.StringNull()
- data.TunnelInterfaceCarrierVariable = types.StringNull()
- if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.carrier.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCarrier = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColor = types.StringNull()
- data.TunnelInterfaceColorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.color.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColor = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceHelloInterval = types.Int64Null()
- data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloTolerance = types.Int64Null()
- data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloTolerance.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceLastResortCircuit = types.BoolNull()
- data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lastResortCircuit.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGreTunnelDestinationIp = types.StringNull()
- data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tlocExtensionGreTo.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tlocExtensionGreTo.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGreTunnelDestinationIp = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColorRestrict = types.BoolNull()
- data.TunnelInterfaceColorRestrictVariable = types.StringNull()
- if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.restrict.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGroups = types.Int64Null()
- data.TunnelInterfaceGroupsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.group.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGroups = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBorder = types.BoolNull()
- data.TunnelInterfaceBorderVariable = types.StringNull()
- if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.border.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceMaxControlConnections = types.Int64Null()
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.maxControlConnections.value")
- if t.String() == "variable" {
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.natRefreshInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vBondAsStunServer.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
- if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.excludeControllerGroupList.value")
- if t.String() == "variable" {
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
- }
- }
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vManageConnectionPreference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfacePortHop = types.BoolNull()
- data.TunnelInterfacePortHopVariable = types.StringNull()
- if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.portHop.value")
- if t.String() == "variable" {
- data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lowBandwidthLink.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tunnelTcpMss.value")
- if t.String() == "variable" {
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceClearDontFragment = types.BoolNull()
- data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.clearDontFragment.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceCtsSgtPropagation = types.BoolNull()
- data.TunnelInterfaceCtsSgtPropagationVariable = types.StringNull()
- if t := res.Get(path + "tunnel.ctsSgtPropagation.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.ctsSgtPropagation.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCtsSgtPropagationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCtsSgtPropagation = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
- if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.networkBroadcast.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowAll = types.BoolNull()
- data.TunnelInterfaceAllowAllVariable = types.StringNull()
- if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
- va := res.Get(path + "allowService.all.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBgp = types.BoolNull()
- data.TunnelInterfaceAllowBgpVariable = types.StringNull()
- if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bgp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDhcp = types.BoolNull()
- data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
- if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dhcp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNtp = types.BoolNull()
- data.TunnelInterfaceAllowNtpVariable = types.StringNull()
- if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ntp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSsh = types.BoolNull()
- data.TunnelInterfaceAllowSshVariable = types.StringNull()
- if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ssh.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDns = types.BoolNull()
- data.TunnelInterfaceAllowDnsVariable = types.StringNull()
- if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dns.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowIcmp = types.BoolNull()
- data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.icmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowHttps = types.BoolNull()
- data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
- if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
- va := res.Get(path + "allowService.https.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowOspf = types.BoolNull()
- data.TunnelInterfaceAllowOspfVariable = types.StringNull()
- if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ospf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowStun = types.BoolNull()
- data.TunnelInterfaceAllowStunVariable = types.StringNull()
- if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
- va := res.Get(path + "allowService.stun.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSnmp = types.BoolNull()
- data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.snmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNetconf = types.BoolNull()
- data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
- if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.netconf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBfd = types.BoolNull()
- data.TunnelInterfaceAllowBfdVariable = types.StringNull()
- if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bfd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "encapsulation"); value.Exists() {
- data.TunnelInterfaceEncapsulations = make([]TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceEthernetTunnelInterfaceEncapsulations{}
- item.Encapsulation = types.StringNull()
-
- if t := v.Get("encap.optionType"); t.Exists() {
- va := v.Get("encap.value")
- if t.String() == "global" {
- item.Encapsulation = types.StringValue(va.String())
- }
- }
- item.Preference = types.Int64Null()
- item.PreferenceVariable = types.StringNull()
- if t := v.Get("preference.optionType"); t.Exists() {
- va := v.Get("preference.value")
- if t.String() == "variable" {
- item.PreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Preference = types.Int64Value(va.Int())
- }
- }
- item.Weight = types.Int64Null()
- item.WeightVariable = types.StringNull()
- if t := v.Get("weight.optionType"); t.Exists() {
- va := v.Get("weight.value")
- if t.String() == "variable" {
- item.WeightVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Weight = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceEncapsulations = append(data.TunnelInterfaceEncapsulations, item)
- return true
- })
- }
- data.NatIpv4 = types.BoolNull()
- data.NatIpv4Variable = types.StringNull()
- if t := res.Get(path + "nat.optionType"); t.Exists() {
- va := res.Get(path + "nat.value")
- if t.String() == "variable" {
- data.NatIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatIpv4 = types.BoolValue(va.Bool())
- }
- }
- data.NatType = types.StringNull()
- data.NatTypeVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natType.value")
- if t.String() == "variable" {
- data.NatTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatType = types.StringValue(va.String())
- }
- }
- data.NatRangeStart = types.StringNull()
- data.NatRangeStartVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
- if t.String() == "variable" {
- data.NatRangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatRangeStart = types.StringValue(va.String())
- }
- }
- data.NatRangeEnd = types.StringNull()
- data.NatRangeEndVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
- if t.String() == "variable" {
- data.NatRangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatRangeEnd = types.StringValue(va.String())
- }
- }
- data.NatPrefixLength = types.Int64Null()
- data.NatPrefixLengthVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
- if t.String() == "variable" {
- data.NatPrefixLengthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPrefixLength = types.Int64Value(va.Int())
- }
- }
- data.NatOverload = types.BoolNull()
- data.NatOverloadVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
- if t.String() == "variable" {
- data.NatOverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatOverload = types.BoolValue(va.Bool())
- }
- }
- data.NatLoopback = types.StringNull()
- data.NatLoopbackVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natLookback.value")
- if t.String() == "variable" {
- data.NatLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatLoopback = types.StringValue(va.String())
- }
- }
- data.NatUdpTimeout = types.Int64Null()
- data.NatUdpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
- if t.String() == "variable" {
- data.NatUdpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatUdpTimeout = types.Int64Value(va.Int())
- }
- }
- data.NatTcpTimeout = types.Int64Null()
- data.NatTcpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
- if t.String() == "variable" {
- data.NatTcpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatTcpTimeout = types.Int64Value(va.Int())
- }
- }
- if value := res.Get(path + "natAttributesIpv4.newStaticNat"); value.Exists() {
- data.NewStaticNats = make([]TransportWANVPNInterfaceEthernetNewStaticNats, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceEthernetNewStaticNats{}
- item.SourceIp = types.StringNull()
- item.SourceIpVariable = types.StringNull()
- if t := v.Get("sourceIp.optionType"); t.Exists() {
- va := v.Get("sourceIp.value")
- if t.String() == "variable" {
- item.SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceIp = types.StringValue(va.String())
- }
- }
- item.TranslatedIp = types.StringNull()
- item.TranslatedIpVariable = types.StringNull()
- if t := v.Get("translateIp.optionType"); t.Exists() {
- va := v.Get("translateIp.value")
- if t.String() == "variable" {
- item.TranslatedIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TranslatedIp = types.StringValue(va.String())
- }
- }
- item.Direction = types.StringNull()
-
- if t := v.Get("staticNatDirection.optionType"); t.Exists() {
- va := v.Get("staticNatDirection.value")
- if t.String() == "global" {
- item.Direction = types.StringValue(va.String())
- }
- }
- item.SourceVpn = types.Int64Null()
- item.SourceVpnVariable = types.StringNull()
- if t := v.Get("sourceVpn.optionType"); t.Exists() {
- va := v.Get("sourceVpn.value")
- if t.String() == "variable" {
- item.SourceVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceVpn = types.Int64Value(va.Int())
- }
- }
- data.NewStaticNats = append(data.NewStaticNats, item)
- return true
- })
- }
- data.NatIpv6 = types.BoolNull()
- data.NatIpv6Variable = types.StringNull()
- if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
- va := res.Get(path + "natIpv6.value")
- if t.String() == "variable" {
- data.NatIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatIpv6 = types.BoolValue(va.Bool())
- }
- }
- data.Nat64 = types.BoolNull()
-
- if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv6.nat64.value")
- if t.String() == "global" {
- data.Nat64 = types.BoolValue(va.Bool())
- }
- }
- data.Nat66 = types.BoolNull()
-
- if t := res.Get(path + "natAttributesIpv6.nat66.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv6.nat66.value")
- if t.String() == "global" {
- data.Nat66 = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "natAttributesIpv6.staticNat66"); value.Exists() {
- data.StaticNat66 = make([]TransportWANVPNInterfaceEthernetStaticNat66, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceEthernetStaticNat66{}
- item.SourcePrefix = types.StringNull()
- item.SourcePrefixVariable = types.StringNull()
- if t := v.Get("sourcePrefix.optionType"); t.Exists() {
- va := v.Get("sourcePrefix.value")
- if t.String() == "variable" {
- item.SourcePrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourcePrefix = types.StringValue(va.String())
- }
- }
- item.TranslatedSourcePrefix = types.StringNull()
- item.TranslatedSourcePrefixVariable = types.StringNull()
- if t := v.Get("translatedSourcePrefix.optionType"); t.Exists() {
- va := v.Get("translatedSourcePrefix.value")
- if t.String() == "variable" {
- item.TranslatedSourcePrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.TranslatedSourcePrefix = types.StringValue(va.String())
- }
- }
- item.SourceVpnId = types.Int64Null()
- item.SourceVpnIdVariable = types.StringNull()
- if t := v.Get("sourceVpnId.optionType"); t.Exists() {
- va := v.Get("sourceVpnId.value")
- if t.String() == "variable" {
- item.SourceVpnIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SourceVpnId = types.Int64Value(va.Int())
- }
- }
- data.StaticNat66 = append(data.StaticNat66, item)
- return true
- })
- }
- data.QosAdaptive = types.BoolNull()
-
- if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptiveQoS.value")
- if t.String() == "global" {
- data.QosAdaptive = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptivePeriod = types.Int64Null()
- data.QosAdaptivePeriodVariable = types.StringNull()
- if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptPeriod.value")
- if t.String() == "variable" {
- data.QosAdaptivePeriodVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptivePeriod = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthUpstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinUpstream = types.Int64Null()
- data.QosAdaptiveMinUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxUpstream = types.Int64Null()
- data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultUpstream = types.Int64Null()
- data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthDownstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinDownstream = types.Int64Null()
- data.QosAdaptiveMinDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxDownstream = types.Int64Null()
- data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultDownstream = types.Int64Null()
- data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosShapingRate = types.Int64Null()
- data.QosShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.QosShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosShapingRate = types.Int64Value(va.Int())
- }
- }
- if value := res.Get(path + "arp"); value.Exists() {
- data.Arps = make([]TransportWANVPNInterfaceEthernetArps, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceEthernetArps{}
- item.IpAddress = types.StringNull()
- item.IpAddressVariable = types.StringNull()
- if t := v.Get("ipAddress.optionType"); t.Exists() {
- va := v.Get("ipAddress.value")
- if t.String() == "variable" {
- item.IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.IpAddress = types.StringValue(va.String())
- }
- }
- item.MacAddress = types.StringNull()
- item.MacAddressVariable = types.StringNull()
- if t := v.Get("macAddress.optionType"); t.Exists() {
- va := v.Get("macAddress.value")
- if t.String() == "variable" {
- item.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.MacAddress = types.StringValue(va.String())
- }
- }
- data.Arps = append(data.Arps, item)
- return true
- })
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
- data.Duplex = types.StringNull()
- data.DuplexVariable = types.StringNull()
- if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
- va := res.Get(path + "advanced.duplex.value")
- if t.String() == "variable" {
- data.DuplexVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Duplex = types.StringValue(va.String())
- }
- }
- data.MacAddress = types.StringNull()
- data.MacAddressVariable = types.StringNull()
- if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
- va := res.Get(path + "advanced.macAddress.value")
- if t.String() == "variable" {
- data.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MacAddress = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Speed = types.StringNull()
- data.SpeedVariable = types.StringNull()
- if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
- va := res.Get(path + "advanced.speed.value")
- if t.String() == "variable" {
- data.SpeedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Speed = types.StringValue(va.String())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Autonegotiate = types.BoolNull()
- data.AutonegotiateVariable = types.StringNull()
- if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
- va := res.Get(path + "advanced.autonegotiate.value")
- if t.String() == "variable" {
- data.AutonegotiateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Autonegotiate = types.BoolValue(va.Bool())
- }
- }
- data.MediaType = types.StringNull()
- data.MediaTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mediaType.value")
- if t.String() == "variable" {
- data.MediaTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MediaType = types.StringValue(va.String())
- }
- }
- data.TlocExtension = types.StringNull()
- data.TlocExtensionVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtension.value")
- if t.String() == "variable" {
- data.TlocExtensionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlocExtension = types.StringValue(va.String())
- }
- }
- data.GreTunnelSourceIp = types.StringNull()
- data.GreTunnelSourceIpVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.value")
- if t.String() == "variable" {
- data.GreTunnelSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GreTunnelSourceIp = types.StringValue(va.String())
- }
- }
- data.Xconnect = types.StringNull()
- data.XconnectVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.value")
- if t.String() == "variable" {
- data.XconnectVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Xconnect = types.StringValue(va.String())
- }
- }
- data.LoadInterval = types.Int64Null()
- data.LoadIntervalVariable = types.StringNull()
- if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
- va := res.Get(path + "advanced.loadInterval.value")
- if t.String() == "variable" {
- data.LoadIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LoadInterval = types.Int64Value(va.Int())
- }
- }
- data.Tracker = types.StringNull()
- data.TrackerVariable = types.StringNull()
- if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tracker.value")
- if t.String() == "variable" {
- data.TrackerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Tracker = types.StringValue(va.String())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportWANVPNInterfaceEthernet) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4DhcpDistance = types.Int64Null()
- data.Ipv4DhcpDistanceVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.dynamic.dynamicDhcpDistance.value")
- if t.String() == "variable" {
- data.Ipv4DhcpDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType"); t.Exists() {
- va := res.Get(path + "intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv4SecondaryAddresses {
- keys := [...]string{"ipAddress"}
- keyValues := [...]string{data.Ipv4SecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4SecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpAddress.static.staticIpV4AddressSecondary").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4SecondaryAddresses[i].Address = types.StringNull()
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringNull()
- data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("subnetMask.optionType"); t.Exists() {
- va := r.Get("subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4SecondaryAddresses[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SecondaryAddresses[i].SubnetMask = types.StringValue(va.String())
- }
- }
- }
- data.Ipv4DhcpHelper = types.SetNull(types.StringType)
- data.Ipv4DhcpHelperVariable = types.StringNull()
- if t := res.Get(path + "dhcpHelper.optionType"); t.Exists() {
- va := res.Get(path + "dhcpHelper.value")
- if t.String() == "variable" {
- data.Ipv4DhcpHelperVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4DhcpHelper = helpers.GetStringSet(va.Array())
- }
- }
- data.EnableDhcpv6 = types.BoolNull()
-
- if t := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.dynamic.dhcpClient.value")
- if t.String() == "global" {
- data.EnableDhcpv6 = types.BoolValue(va.Bool())
- }
- }
- for i := range data.Ipv6DhcpSecondaryAddress {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6DhcpSecondaryAddress[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6DhcpSecondaryAddress[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpV6Address.dynamic.secondaryIpV6Address").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6DhcpSecondaryAddress[i].Address = types.StringNull()
- data.Ipv6DhcpSecondaryAddress[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6DhcpSecondaryAddress[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6DhcpSecondaryAddress[i].Address = types.StringValue(va.String())
- }
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.optionType"); t.Exists() {
- va := res.Get(path + "intfIpV6Address.static.primaryIpV6Address.address.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- for i := range data.Ipv6SecondaryAddresses {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6SecondaryAddresses[i].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6SecondaryAddresses[i].AddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "intfIpV6Address.static.secondaryIpV6Address").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6SecondaryAddresses[i].Address = types.StringNull()
- data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringNull()
- if t := r.Get("address.optionType"); t.Exists() {
- va := r.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6SecondaryAddresses[i].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6SecondaryAddresses[i].Address = types.StringValue(va.String())
- }
- }
- }
- data.IperfServer = types.StringNull()
- data.IperfServerVariable = types.StringNull()
- if t := res.Get(path + "iperfServer.optionType"); t.Exists() {
- va := res.Get(path + "iperfServer.value")
- if t.String() == "variable" {
- data.IperfServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IperfServer = types.StringValue(va.String())
- }
- }
- data.BlockNonSourceIp = types.BoolNull()
- data.BlockNonSourceIpVariable = types.StringNull()
- if t := res.Get(path + "blockNonSourceIp.optionType"); t.Exists() {
- va := res.Get(path + "blockNonSourceIp.value")
- if t.String() == "variable" {
- data.BlockNonSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BlockNonSourceIp = types.BoolValue(va.Bool())
- }
- }
- data.ServiceProvider = types.StringNull()
- data.ServiceProviderVariable = types.StringNull()
- if t := res.Get(path + "serviceProvider.optionType"); t.Exists() {
- va := res.Get(path + "serviceProvider.value")
- if t.String() == "variable" {
- data.ServiceProviderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ServiceProvider = types.StringValue(va.String())
- }
- }
- data.BandwidthUpstream = types.Int64Null()
- data.BandwidthUpstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthUpstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthUpstream.value")
- if t.String() == "variable" {
- data.BandwidthUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthUpstream = types.Int64Value(va.Int())
- }
- }
- data.BandwidthDownstream = types.Int64Null()
- data.BandwidthDownstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthDownstream.value")
- if t.String() == "variable" {
- data.BandwidthDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthDownstream = types.Int64Value(va.Int())
- }
- }
- data.AutoDetectBandwidth = types.BoolNull()
- data.AutoDetectBandwidthVariable = types.StringNull()
- if t := res.Get(path + "autoDetectBandwidth.optionType"); t.Exists() {
- va := res.Get(path + "autoDetectBandwidth.value")
- if t.String() == "variable" {
- data.AutoDetectBandwidthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.AutoDetectBandwidth = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterface = types.BoolNull()
-
- if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelInterface.value")
- if t.String() == "global" {
- data.TunnelInterface = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQos = types.BoolNull()
- data.PerTunnelQosVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQos.value")
- if t.String() == "variable" {
- data.PerTunnelQosVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQos = types.BoolValue(va.Bool())
- }
- }
- data.TunnelQosMode = types.StringNull()
- data.TunnelQosModeVariable = types.StringNull()
- if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.mode.value")
- if t.String() == "variable" {
- data.TunnelQosModeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelQosMode = types.StringValue(va.String())
- }
- }
- data.TunnelBandwidthPercent = types.Int64Null()
- data.TunnelBandwidthPercentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bandwidthPercent.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bandwidthPercent.value")
- if t.String() == "variable" {
- data.TunnelBandwidthPercentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelBandwidthPercent = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bind.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceCarrier = types.StringNull()
- data.TunnelInterfaceCarrierVariable = types.StringNull()
- if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.carrier.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCarrier = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColor = types.StringNull()
- data.TunnelInterfaceColorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.color.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColor = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceHelloInterval = types.Int64Null()
- data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloTolerance = types.Int64Null()
- data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloTolerance.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceLastResortCircuit = types.BoolNull()
- data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lastResortCircuit.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGreTunnelDestinationIp = types.StringNull()
- data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tlocExtensionGreTo.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tlocExtensionGreTo.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGreTunnelDestinationIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGreTunnelDestinationIp = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColorRestrict = types.BoolNull()
- data.TunnelInterfaceColorRestrictVariable = types.StringNull()
- if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.restrict.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorRestrictVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColorRestrict = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGroups = types.Int64Null()
- data.TunnelInterfaceGroupsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.group.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGroups = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBorder = types.BoolNull()
- data.TunnelInterfaceBorderVariable = types.StringNull()
- if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.border.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceMaxControlConnections = types.Int64Null()
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.maxControlConnections.value")
- if t.String() == "variable" {
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.natRefreshInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vBondAsStunServer.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vBondAsStunServer.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
- if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.excludeControllerGroupList.value")
- if t.String() == "variable" {
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
- }
- }
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vManageConnectionPreference.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vManageConnectionPreference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfacePortHop = types.BoolNull()
- data.TunnelInterfacePortHopVariable = types.StringNull()
- if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.portHop.value")
- if t.String() == "variable" {
- data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lowBandwidthLink.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tunnelTcpMss.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tunnelTcpMss.value")
- if t.String() == "variable" {
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceClearDontFragment = types.BoolNull()
- data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.clearDontFragment.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceCtsSgtPropagation = types.BoolNull()
- data.TunnelInterfaceCtsSgtPropagationVariable = types.StringNull()
- if t := res.Get(path + "tunnel.ctsSgtPropagation.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.ctsSgtPropagation.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCtsSgtPropagationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCtsSgtPropagation = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceNetworkBroadcast = types.BoolNull()
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringNull()
- if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.networkBroadcast.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNetworkBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNetworkBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowAll = types.BoolNull()
- data.TunnelInterfaceAllowAllVariable = types.StringNull()
- if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
- va := res.Get(path + "allowService.all.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBgp = types.BoolNull()
- data.TunnelInterfaceAllowBgpVariable = types.StringNull()
- if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bgp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDhcp = types.BoolNull()
- data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
- if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dhcp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNtp = types.BoolNull()
- data.TunnelInterfaceAllowNtpVariable = types.StringNull()
- if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ntp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSsh = types.BoolNull()
- data.TunnelInterfaceAllowSshVariable = types.StringNull()
- if t := res.Get(path + "allowService.ssh.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ssh.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDns = types.BoolNull()
- data.TunnelInterfaceAllowDnsVariable = types.StringNull()
- if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dns.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowIcmp = types.BoolNull()
- data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.icmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowHttps = types.BoolNull()
- data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
- if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
- va := res.Get(path + "allowService.https.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowOspf = types.BoolNull()
- data.TunnelInterfaceAllowOspfVariable = types.StringNull()
- if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ospf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowStun = types.BoolNull()
- data.TunnelInterfaceAllowStunVariable = types.StringNull()
- if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
- va := res.Get(path + "allowService.stun.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSnmp = types.BoolNull()
- data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.snmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNetconf = types.BoolNull()
- data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
- if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.netconf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBfd = types.BoolNull()
- data.TunnelInterfaceAllowBfdVariable = types.StringNull()
- if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bfd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
- }
- }
- for i := range data.TunnelInterfaceEncapsulations {
- keys := [...]string{"encap"}
- keyValues := [...]string{data.TunnelInterfaceEncapsulations[i].Encapsulation.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "encapsulation").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringNull()
-
- if t := r.Get("encap.optionType"); t.Exists() {
- va := r.Get("encap.value")
- if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Null()
- data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringNull()
- if t := r.Get("preference.optionType"); t.Exists() {
- va := r.Get("preference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Null()
- data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringNull()
- if t := r.Get("weight.optionType"); t.Exists() {
- va := r.Get("weight.value")
- if t.String() == "variable" {
- data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Value(va.Int())
- }
- }
- }
- data.NatIpv4 = types.BoolNull()
- data.NatIpv4Variable = types.StringNull()
- if t := res.Get(path + "nat.optionType"); t.Exists() {
- va := res.Get(path + "nat.value")
- if t.String() == "variable" {
- data.NatIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatIpv4 = types.BoolValue(va.Bool())
- }
- }
- data.NatType = types.StringNull()
- data.NatTypeVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natType.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natType.value")
- if t.String() == "variable" {
- data.NatTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatType = types.StringValue(va.String())
- }
- }
- data.NatRangeStart = types.StringNull()
- data.NatRangeStartVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeStart.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeStart.value")
- if t.String() == "variable" {
- data.NatRangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatRangeStart = types.StringValue(va.String())
- }
- }
- data.NatRangeEnd = types.StringNull()
- data.NatRangeEndVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.rangeEnd.value")
- if t.String() == "variable" {
- data.NatRangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatRangeEnd = types.StringValue(va.String())
- }
- }
- data.NatPrefixLength = types.Int64Null()
- data.NatPrefixLengthVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.prefixLength.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.prefixLength.value")
- if t.String() == "variable" {
- data.NatPrefixLengthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatPrefixLength = types.Int64Value(va.Int())
- }
- }
- data.NatOverload = types.BoolNull()
- data.NatOverloadVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natPool.overload.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natPool.overload.value")
- if t.String() == "variable" {
- data.NatOverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatOverload = types.BoolValue(va.Bool())
- }
- }
- data.NatLoopback = types.StringNull()
- data.NatLoopbackVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.natLookback.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.natLookback.value")
- if t.String() == "variable" {
- data.NatLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatLoopback = types.StringValue(va.String())
- }
- }
- data.NatUdpTimeout = types.Int64Null()
- data.NatUdpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.udpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.udpTimeout.value")
- if t.String() == "variable" {
- data.NatUdpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatUdpTimeout = types.Int64Value(va.Int())
- }
- }
- data.NatTcpTimeout = types.Int64Null()
- data.NatTcpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "natAttributesIpv4.tcpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv4.tcpTimeout.value")
- if t.String() == "variable" {
- data.NatTcpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatTcpTimeout = types.Int64Value(va.Int())
- }
- }
- for i := range data.NewStaticNats {
- keys := [...]string{"sourceIp", "translateIp"}
- keyValues := [...]string{data.NewStaticNats[i].SourceIp.ValueString(), data.NewStaticNats[i].TranslatedIp.ValueString()}
- keyValuesVariables := [...]string{data.NewStaticNats[i].SourceIpVariable.ValueString(), data.NewStaticNats[i].TranslatedIpVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "natAttributesIpv4.newStaticNat").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.NewStaticNats[i].SourceIp = types.StringNull()
- data.NewStaticNats[i].SourceIpVariable = types.StringNull()
- if t := r.Get("sourceIp.optionType"); t.Exists() {
- va := r.Get("sourceIp.value")
- if t.String() == "variable" {
- data.NewStaticNats[i].SourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NewStaticNats[i].SourceIp = types.StringValue(va.String())
- }
- }
- data.NewStaticNats[i].TranslatedIp = types.StringNull()
- data.NewStaticNats[i].TranslatedIpVariable = types.StringNull()
- if t := r.Get("translateIp.optionType"); t.Exists() {
- va := r.Get("translateIp.value")
- if t.String() == "variable" {
- data.NewStaticNats[i].TranslatedIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NewStaticNats[i].TranslatedIp = types.StringValue(va.String())
- }
- }
- data.NewStaticNats[i].Direction = types.StringNull()
-
- if t := r.Get("staticNatDirection.optionType"); t.Exists() {
- va := r.Get("staticNatDirection.value")
- if t.String() == "global" {
- data.NewStaticNats[i].Direction = types.StringValue(va.String())
- }
- }
- data.NewStaticNats[i].SourceVpn = types.Int64Null()
- data.NewStaticNats[i].SourceVpnVariable = types.StringNull()
- if t := r.Get("sourceVpn.optionType"); t.Exists() {
- va := r.Get("sourceVpn.value")
- if t.String() == "variable" {
- data.NewStaticNats[i].SourceVpnVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NewStaticNats[i].SourceVpn = types.Int64Value(va.Int())
- }
- }
- }
- data.NatIpv6 = types.BoolNull()
- data.NatIpv6Variable = types.StringNull()
- if t := res.Get(path + "natIpv6.optionType"); t.Exists() {
- va := res.Get(path + "natIpv6.value")
- if t.String() == "variable" {
- data.NatIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NatIpv6 = types.BoolValue(va.Bool())
- }
- }
- data.Nat64 = types.BoolNull()
-
- if t := res.Get(path + "natAttributesIpv6.nat64.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv6.nat64.value")
- if t.String() == "global" {
- data.Nat64 = types.BoolValue(va.Bool())
- }
- }
- data.Nat66 = types.BoolNull()
-
- if t := res.Get(path + "natAttributesIpv6.nat66.optionType"); t.Exists() {
- va := res.Get(path + "natAttributesIpv6.nat66.value")
- if t.String() == "global" {
- data.Nat66 = types.BoolValue(va.Bool())
- }
- }
- for i := range data.StaticNat66 {
- keys := [...]string{"sourcePrefix", "translatedSourcePrefix"}
- keyValues := [...]string{data.StaticNat66[i].SourcePrefix.ValueString(), data.StaticNat66[i].TranslatedSourcePrefix.ValueString()}
- keyValuesVariables := [...]string{data.StaticNat66[i].SourcePrefixVariable.ValueString(), data.StaticNat66[i].TranslatedSourcePrefixVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "natAttributesIpv6.staticNat66").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.StaticNat66[i].SourcePrefix = types.StringNull()
- data.StaticNat66[i].SourcePrefixVariable = types.StringNull()
- if t := r.Get("sourcePrefix.optionType"); t.Exists() {
- va := r.Get("sourcePrefix.value")
- if t.String() == "variable" {
- data.StaticNat66[i].SourcePrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNat66[i].SourcePrefix = types.StringValue(va.String())
- }
- }
- data.StaticNat66[i].TranslatedSourcePrefix = types.StringNull()
- data.StaticNat66[i].TranslatedSourcePrefixVariable = types.StringNull()
- if t := r.Get("translatedSourcePrefix.optionType"); t.Exists() {
- va := r.Get("translatedSourcePrefix.value")
- if t.String() == "variable" {
- data.StaticNat66[i].TranslatedSourcePrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNat66[i].TranslatedSourcePrefix = types.StringValue(va.String())
- }
- }
- data.StaticNat66[i].SourceVpnId = types.Int64Null()
- data.StaticNat66[i].SourceVpnIdVariable = types.StringNull()
- if t := r.Get("sourceVpnId.optionType"); t.Exists() {
- va := r.Get("sourceVpnId.value")
- if t.String() == "variable" {
- data.StaticNat66[i].SourceVpnIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.StaticNat66[i].SourceVpnId = types.Int64Value(va.Int())
- }
- }
- }
- data.QosAdaptive = types.BoolNull()
-
- if t := res.Get(path + "aclQos.adaptiveQoS.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptiveQoS.value")
- if t.String() == "global" {
- data.QosAdaptive = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptivePeriod = types.Int64Null()
- data.QosAdaptivePeriodVariable = types.StringNull()
- if t := res.Get(path + "aclQos.adaptPeriod.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.adaptPeriod.value")
- if t.String() == "variable" {
- data.QosAdaptivePeriodVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptivePeriod = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthUpstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthUpstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinUpstream = types.Int64Null()
- data.QosAdaptiveMinUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxUpstream = types.Int64Null()
- data.QosAdaptiveMaxUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultUpstream = types.Int64Null()
- data.QosAdaptiveDefaultUpstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultUpstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultUpstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveBandwidthDownstream = types.BoolNull()
-
- if t := res.Get(path + "aclQos.shapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstream.value")
- if t.String() == "global" {
- data.QosAdaptiveBandwidthDownstream = types.BoolValue(va.Bool())
- }
- }
- data.QosAdaptiveMinDownstream = types.Int64Null()
- data.QosAdaptiveMinDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMinDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMinDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveMaxDownstream = types.Int64Null()
- data.QosAdaptiveMaxDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveMaxDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveMaxDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosAdaptiveDefaultDownstream = types.Int64Null()
- data.QosAdaptiveDefaultDownstreamVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value")
- if t.String() == "variable" {
- data.QosAdaptiveDefaultDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosAdaptiveDefaultDownstream = types.Int64Value(va.Int())
- }
- }
- data.QosShapingRate = types.Int64Null()
- data.QosShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.QosShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosShapingRate = types.Int64Value(va.Int())
- }
- }
- for i := range data.Arps {
- keys := [...]string{"ipAddress", "macAddress"}
- keyValues := [...]string{data.Arps[i].IpAddress.ValueString(), data.Arps[i].MacAddress.ValueString()}
- keyValuesVariables := [...]string{data.Arps[i].IpAddressVariable.ValueString(), data.Arps[i].MacAddressVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "arp").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Arps[i].IpAddress = types.StringNull()
- data.Arps[i].IpAddressVariable = types.StringNull()
- if t := r.Get("ipAddress.optionType"); t.Exists() {
- va := r.Get("ipAddress.value")
- if t.String() == "variable" {
- data.Arps[i].IpAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].IpAddress = types.StringValue(va.String())
- }
- }
- data.Arps[i].MacAddress = types.StringNull()
- data.Arps[i].MacAddressVariable = types.StringNull()
- if t := r.Get("macAddress.optionType"); t.Exists() {
- va := r.Get("macAddress.value")
- if t.String() == "variable" {
- data.Arps[i].MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Arps[i].MacAddress = types.StringValue(va.String())
- }
- }
- }
- data.IcmpRedirectDisable = types.BoolNull()
- data.IcmpRedirectDisableVariable = types.StringNull()
- if t := res.Get(path + "advanced.icmpRedirectDisable.optionType"); t.Exists() {
- va := res.Get(path + "advanced.icmpRedirectDisable.value")
- if t.String() == "variable" {
- data.IcmpRedirectDisableVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IcmpRedirectDisable = types.BoolValue(va.Bool())
- }
- }
- data.Duplex = types.StringNull()
- data.DuplexVariable = types.StringNull()
- if t := res.Get(path + "advanced.duplex.optionType"); t.Exists() {
- va := res.Get(path + "advanced.duplex.value")
- if t.String() == "variable" {
- data.DuplexVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Duplex = types.StringValue(va.String())
- }
- }
- data.MacAddress = types.StringNull()
- data.MacAddressVariable = types.StringNull()
- if t := res.Get(path + "advanced.macAddress.optionType"); t.Exists() {
- va := res.Get(path + "advanced.macAddress.value")
- if t.String() == "variable" {
- data.MacAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MacAddress = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.InterfaceMtu = types.Int64Null()
- data.InterfaceMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.intrfMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.intrfMtu.value")
- if t.String() == "variable" {
- data.InterfaceMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMss.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMss.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Speed = types.StringNull()
- data.SpeedVariable = types.StringNull()
- if t := res.Get(path + "advanced.speed.optionType"); t.Exists() {
- va := res.Get(path + "advanced.speed.value")
- if t.String() == "variable" {
- data.SpeedVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Speed = types.StringValue(va.String())
- }
- }
- data.ArpTimeout = types.Int64Null()
- data.ArpTimeoutVariable = types.StringNull()
- if t := res.Get(path + "advanced.arpTimeout.optionType"); t.Exists() {
- va := res.Get(path + "advanced.arpTimeout.value")
- if t.String() == "variable" {
- data.ArpTimeoutVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ArpTimeout = types.Int64Value(va.Int())
- }
- }
- data.Autonegotiate = types.BoolNull()
- data.AutonegotiateVariable = types.StringNull()
- if t := res.Get(path + "advanced.autonegotiate.optionType"); t.Exists() {
- va := res.Get(path + "advanced.autonegotiate.value")
- if t.String() == "variable" {
- data.AutonegotiateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Autonegotiate = types.BoolValue(va.Bool())
- }
- }
- data.MediaType = types.StringNull()
- data.MediaTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.mediaType.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mediaType.value")
- if t.String() == "variable" {
- data.MediaTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.MediaType = types.StringValue(va.String())
- }
- }
- data.TlocExtension = types.StringNull()
- data.TlocExtensionVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtension.value")
- if t.String() == "variable" {
- data.TlocExtensionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlocExtension = types.StringValue(va.String())
- }
- }
- data.GreTunnelSourceIp = types.StringNull()
- data.GreTunnelSourceIpVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtensionGreFrom.sourceIp.value")
- if t.String() == "variable" {
- data.GreTunnelSourceIpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.GreTunnelSourceIp = types.StringValue(va.String())
- }
- }
- data.Xconnect = types.StringNull()
- data.XconnectVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtensionGreFrom.xconnect.value")
- if t.String() == "variable" {
- data.XconnectVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Xconnect = types.StringValue(va.String())
- }
- }
- data.LoadInterval = types.Int64Null()
- data.LoadIntervalVariable = types.StringNull()
- if t := res.Get(path + "advanced.loadInterval.optionType"); t.Exists() {
- va := res.Get(path + "advanced.loadInterval.value")
- if t.String() == "variable" {
- data.LoadIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.LoadInterval = types.Int64Value(va.Int())
- }
- }
- data.Tracker = types.StringNull()
- data.TrackerVariable = types.StringNull()
- if t := res.Get(path + "advanced.tracker.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tracker.value")
- if t.String() == "variable" {
- data.TrackerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Tracker = types.StringValue(va.String())
- }
- }
- data.IpDirectedBroadcast = types.BoolNull()
- data.IpDirectedBroadcastVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipDirectedBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipDirectedBroadcast.value")
- if t.String() == "variable" {
- data.IpDirectedBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpDirectedBroadcast = types.BoolValue(va.Bool())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportWANVPNInterfaceEthernet) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.TransportWanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4ConfigurationType.IsNull() {
- return false
- }
- if !data.Ipv4DhcpDistance.IsNull() {
- return false
- }
- if !data.Ipv4DhcpDistanceVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if len(data.Ipv4SecondaryAddresses) > 0 {
- return false
- }
- if !data.Ipv4DhcpHelper.IsNull() {
- return false
- }
- if !data.Ipv4DhcpHelperVariable.IsNull() {
- return false
- }
- if !data.Ipv6ConfigurationType.IsNull() {
- return false
- }
- if !data.EnableDhcpv6.IsNull() {
- return false
- }
- if len(data.Ipv6DhcpSecondaryAddress) > 0 {
- return false
- }
- if !data.Ipv6Address.IsNull() {
- return false
- }
- if !data.Ipv6AddressVariable.IsNull() {
- return false
- }
- if len(data.Ipv6SecondaryAddresses) > 0 {
- return false
- }
- if !data.IperfServer.IsNull() {
- return false
- }
- if !data.IperfServerVariable.IsNull() {
- return false
- }
- if !data.BlockNonSourceIp.IsNull() {
- return false
- }
- if !data.BlockNonSourceIpVariable.IsNull() {
- return false
- }
- if !data.ServiceProvider.IsNull() {
- return false
- }
- if !data.ServiceProviderVariable.IsNull() {
- return false
- }
- if !data.BandwidthUpstream.IsNull() {
- return false
- }
- if !data.BandwidthUpstreamVariable.IsNull() {
- return false
- }
- if !data.BandwidthDownstream.IsNull() {
- return false
- }
- if !data.BandwidthDownstreamVariable.IsNull() {
- return false
- }
- if !data.AutoDetectBandwidth.IsNull() {
- return false
- }
- if !data.AutoDetectBandwidthVariable.IsNull() {
- return false
- }
- if !data.TunnelInterface.IsNull() {
- return false
- }
- if !data.PerTunnelQos.IsNull() {
- return false
- }
- if !data.PerTunnelQosVariable.IsNull() {
- return false
- }
- if !data.TunnelQosMode.IsNull() {
- return false
- }
- if !data.TunnelQosModeVariable.IsNull() {
- return false
- }
- if !data.TunnelBandwidthPercent.IsNull() {
- return false
- }
- if !data.TunnelBandwidthPercentVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCarrier.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCarrierVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColor.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColorVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloInterval.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloTolerance.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLastResortCircuit.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGreTunnelDestinationIp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGreTunnelDestinationIpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColorRestrict.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColorRestrictVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGroups.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGroupsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBorder.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBorderVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceMaxControlConnections.IsNull() {
- return false
- }
- if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNatRefreshInterval.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVbondAsStunServer.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
- return false
- }
- if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfacePortHop.IsNull() {
- return false
- }
- if !data.TunnelInterfacePortHopVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLowBandwidthLink.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceTunnelTcpMss.IsNull() {
- return false
- }
- if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearDontFragment.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCtsSgtPropagation.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCtsSgtPropagationVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNetworkBroadcast.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowAll.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowAllVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBgp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDhcp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNtp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSsh.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSshVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDns.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowIcmp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowHttps.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowOspf.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowStun.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowStunVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSnmp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNetconf.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBfd.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
- return false
- }
- if len(data.TunnelInterfaceEncapsulations) > 0 {
- return false
- }
- if !data.NatIpv4.IsNull() {
- return false
- }
- if !data.NatIpv4Variable.IsNull() {
- return false
- }
- if !data.NatType.IsNull() {
- return false
- }
- if !data.NatTypeVariable.IsNull() {
- return false
- }
- if !data.NatRangeStart.IsNull() {
- return false
- }
- if !data.NatRangeStartVariable.IsNull() {
- return false
- }
- if !data.NatRangeEnd.IsNull() {
- return false
- }
- if !data.NatRangeEndVariable.IsNull() {
- return false
- }
- if !data.NatPrefixLength.IsNull() {
- return false
- }
- if !data.NatPrefixLengthVariable.IsNull() {
- return false
- }
- if !data.NatOverload.IsNull() {
- return false
- }
- if !data.NatOverloadVariable.IsNull() {
- return false
- }
- if !data.NatLoopback.IsNull() {
- return false
- }
- if !data.NatLoopbackVariable.IsNull() {
- return false
- }
- if !data.NatUdpTimeout.IsNull() {
- return false
- }
- if !data.NatUdpTimeoutVariable.IsNull() {
- return false
- }
- if !data.NatTcpTimeout.IsNull() {
- return false
- }
- if !data.NatTcpTimeoutVariable.IsNull() {
- return false
- }
- if len(data.NewStaticNats) > 0 {
- return false
- }
- if !data.NatIpv6.IsNull() {
- return false
- }
- if !data.NatIpv6Variable.IsNull() {
- return false
- }
- if !data.Nat64.IsNull() {
- return false
- }
- if !data.Nat66.IsNull() {
- return false
- }
- if len(data.StaticNat66) > 0 {
- return false
- }
- if !data.QosAdaptive.IsNull() {
- return false
- }
- if !data.QosAdaptivePeriod.IsNull() {
- return false
- }
- if !data.QosAdaptivePeriodVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveBandwidthUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinUpstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxUpstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultUpstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveBandwidthDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMinDownstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveMaxDownstreamVariable.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultDownstream.IsNull() {
- return false
- }
- if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() {
- return false
- }
- if !data.QosShapingRate.IsNull() {
- return false
- }
- if !data.QosShapingRateVariable.IsNull() {
- return false
- }
- if len(data.Arps) > 0 {
- return false
- }
- if !data.IcmpRedirectDisable.IsNull() {
- return false
- }
- if !data.IcmpRedirectDisableVariable.IsNull() {
- return false
- }
- if !data.Duplex.IsNull() {
- return false
- }
- if !data.DuplexVariable.IsNull() {
- return false
- }
- if !data.MacAddress.IsNull() {
- return false
- }
- if !data.MacAddressVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.InterfaceMtu.IsNull() {
- return false
- }
- if !data.InterfaceMtuVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.Speed.IsNull() {
- return false
- }
- if !data.SpeedVariable.IsNull() {
- return false
- }
- if !data.ArpTimeout.IsNull() {
- return false
- }
- if !data.ArpTimeoutVariable.IsNull() {
- return false
- }
- if !data.Autonegotiate.IsNull() {
- return false
- }
- if !data.AutonegotiateVariable.IsNull() {
- return false
- }
- if !data.MediaType.IsNull() {
- return false
- }
- if !data.MediaTypeVariable.IsNull() {
- return false
- }
- if !data.TlocExtension.IsNull() {
- return false
- }
- if !data.TlocExtensionVariable.IsNull() {
- return false
- }
- if !data.GreTunnelSourceIp.IsNull() {
- return false
- }
- if !data.GreTunnelSourceIpVariable.IsNull() {
- return false
- }
- if !data.Xconnect.IsNull() {
- return false
- }
- if !data.XconnectVariable.IsNull() {
- return false
- }
- if !data.LoadInterval.IsNull() {
- return false
- }
- if !data.LoadIntervalVariable.IsNull() {
- return false
- }
- if !data.Tracker.IsNull() {
- return false
- }
- if !data.TrackerVariable.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcast.IsNull() {
- return false
- }
- if !data.IpDirectedBroadcastVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_feature.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_feature.go
new file mode 100644
index 000000000..c722492b8
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_feature.go
@@ -0,0 +1,692 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportWANVPNInterfaceGRE 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"`
+ TransportWanVpnFeatureId types.String `tfsdk:"transport_wan_vpn_feature_id"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
+ TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
+ TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
+ TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
+ TunnelSourceInterfaceLoopback types.String `tfsdk:"tunnel_source_interface_loopback"`
+ TunnelSourceInterfaceLoopbackVariable types.String `tfsdk:"tunnel_source_interface_loopback_variable"`
+ TunnelRouteViaLoopback types.String `tfsdk:"tunnel_route_via_loopback"`
+ TunnelRouteViaLoopbackVariable types.String `tfsdk:"tunnel_route_via_loopback_variable"`
+ TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
+ TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
+ ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
+ ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
+ ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportWANVPNInterfaceGRE) getModel() string {
+ return "transport_wan_vpn_interface_gre"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportWANVPNInterfaceGRE) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/gre", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.description.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.shutdown.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelSourceIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
+ }
+ } else if !data.TunnelSourceInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString())
+ }
+ } else if !data.TunnelSourceInterfaceLoopback.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString())
+ }
+ }
+
+ if !data.TunnelRouteViaLoopbackVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString())
+ }
+ } else if !data.TunnelRouteViaLoopback.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString())
+ }
+ }
+
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelDestinationIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.mtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.ClearDontFragmentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable")
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
+ }
+ } else if data.ClearDontFragment.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default")
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global")
+ body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool())
+ }
+ }
+
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString())
+ }
+ } else if !data.ApplicationTunnelType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.application.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportWANVPNInterfaceGRE) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
+ va := res.Get(path + "basic.ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "basic.description.optionType"); t.Exists() {
+ va := res.Get(path + "basic.description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "basic.shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterfaceLoopback = types.StringNull()
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteViaLoopback = types.StringNull()
+ data.TunnelRouteViaLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteViaLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelDestination.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
+ va := res.Get(path + "basic.mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "basic.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportWANVPNInterfaceGRE) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
+ va := res.Get(path + "basic.ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "basic.description.optionType"); t.Exists() {
+ va := res.Get(path + "basic.description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "basic.address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "basic.shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterfaceLoopback = types.StringNull()
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteViaLoopback = types.StringNull()
+ data.TunnelRouteViaLoopbackVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteViaLoopback = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tunnelDestination.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
+ va := res.Get(path + "basic.mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "basic.tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "basic.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportWANVPNInterfaceGRE) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TransportWanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterface.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceLoopback.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteViaLoopback.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteViaLoopbackVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragment.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragmentVariable.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelType.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go
deleted file mode 100644
index c3b69c661..000000000
--- a/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go
+++ /dev/null
@@ -1,692 +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/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportWANVPNInterfaceGRE 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"`
- TransportWanVpnProfileParcelId types.String `tfsdk:"transport_wan_vpn_profile_parcel_id"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
- TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
- TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
- TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
- TunnelSourceInterfaceLoopback types.String `tfsdk:"tunnel_source_interface_loopback"`
- TunnelSourceInterfaceLoopbackVariable types.String `tfsdk:"tunnel_source_interface_loopback_variable"`
- TunnelRouteViaLoopback types.String `tfsdk:"tunnel_route_via_loopback"`
- TunnelRouteViaLoopbackVariable types.String `tfsdk:"tunnel_route_via_loopback_variable"`
- TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
- TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
- ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
- ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
- ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportWANVPNInterfaceGRE) getModel() string {
- return "transport_wan_vpn_interface_gre"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportWANVPNInterfaceGRE) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/gre", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.description.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.description.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"basic.shutdown.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelSourceIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString())
- }
- }
-
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
- }
- } else if !data.TunnelSourceInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
- }
- }
-
- if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString())
- }
- } else if !data.TunnelSourceInterfaceLoopback.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString())
- }
- }
-
- if !data.TunnelRouteViaLoopbackVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString())
- }
- } else if !data.TunnelRouteViaLoopback.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString())
- }
- }
-
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelDestinationIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default")
- body, _ = sjson.Set(body, path+"basic.mtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.ClearDontFragmentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable")
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
- }
- } else if data.ClearDontFragment.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default")
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global")
- body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool())
- }
- }
-
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString())
- }
- } else if !data.ApplicationTunnelType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.application.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportWANVPNInterfaceGRE) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
- va := res.Get(path + "basic.ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "basic.description.optionType"); t.Exists() {
- va := res.Get(path + "basic.description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
- va := res.Get(path + "basic.shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterfaceLoopback = types.StringNull()
- data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelRouteViaLoopback = types.StringNull()
- data.TunnelRouteViaLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteViaLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelDestination.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
- va := res.Get(path + "basic.mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "basic.tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "basic.clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
- va := res.Get(path + "advanced.application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportWANVPNInterfaceGRE) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "basic.ifName.optionType"); t.Exists() {
- va := res.Get(path + "basic.ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "basic.description.optionType"); t.Exists() {
- va := res.Get(path + "basic.description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.address.address.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "basic.address.mask.optionType"); t.Exists() {
- va := res.Get(path + "basic.address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "basic.shutdown.optionType"); t.Exists() {
- va := res.Get(path + "basic.shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceIp.tunnelSource.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterfaceLoopback = types.StringNull()
- data.TunnelSourceInterfaceLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterfaceLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelRouteViaLoopback = types.StringNull()
- data.TunnelRouteViaLoopbackVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaLoopbackVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteViaLoopback = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "basic.tunnelDestination.optionType"); t.Exists() {
- va := res.Get(path + "basic.tunnelDestination.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "basic.mtu.optionType"); t.Exists() {
- va := res.Get(path + "basic.mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "basic.tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "basic.tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "basic.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "basic.clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "advanced.application.optionType"); t.Exists() {
- va := res.Get(path + "advanced.application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportWANVPNInterfaceGRE) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.TransportWanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceInterface.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceLoopback.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() {
- return false
- }
- if !data.TunnelRouteViaLoopback.IsNull() {
- return false
- }
- if !data.TunnelRouteViaLoopbackVariable.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.ClearDontFragment.IsNull() {
- return false
- }
- if !data.ClearDontFragmentVariable.IsNull() {
- return false
- }
- if !data.ApplicationTunnelType.IsNull() {
- return false
- }
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_feature.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_feature.go
new file mode 100644
index 000000000..a3509e3d7
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_feature.go
@@ -0,0 +1,1393 @@
+// 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/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportWANVPNInterfaceIPSEC 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"`
+ TransportWanVpnFeatureId types.String `tfsdk:"transport_wan_vpn_feature_id"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceDescription types.String `tfsdk:"interface_description"`
+ InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
+ TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
+ TunnelSourceIpv4SubnetMask types.String `tfsdk:"tunnel_source_ipv4_subnet_mask"`
+ TunnelSourceIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_source_ipv4_subnet_mask_variable"`
+ TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
+ TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
+ TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
+ TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
+ TunnelDestinationIpv4SubnetMask types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask"`
+ TunnelDestinationIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask_variable"`
+ ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
+ ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
+ ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ DpdInterval types.Int64 `tfsdk:"dpd_interval"`
+ DpdIntervalVariable types.String `tfsdk:"dpd_interval_variable"`
+ DpdRetries types.Int64 `tfsdk:"dpd_retries"`
+ DpdRetriesVariable types.String `tfsdk:"dpd_retries_variable"`
+ IkePresharedKey types.String `tfsdk:"ike_preshared_key"`
+ IkePresharedKeyVariable types.String `tfsdk:"ike_preshared_key_variable"`
+ IkeVersion types.Int64 `tfsdk:"ike_version"`
+ IkeIntegrityProtocol types.String `tfsdk:"ike_integrity_protocol"`
+ IkeIntegrityProtocolVariable types.String `tfsdk:"ike_integrity_protocol_variable"`
+ IkeRekeyInterval types.Int64 `tfsdk:"ike_rekey_interval"`
+ IkeRekeyIntervalVariable types.String `tfsdk:"ike_rekey_interval_variable"`
+ IkeCiphersuite types.String `tfsdk:"ike_ciphersuite"`
+ IkeCiphersuiteVariable types.String `tfsdk:"ike_ciphersuite_variable"`
+ IkeDiffieHellmanGroup types.String `tfsdk:"ike_diffie_hellman_group"`
+ IkeDiffieHellmanGroupVariable types.String `tfsdk:"ike_diffie_hellman_group_variable"`
+ IkeIdLocalEndPoint types.String `tfsdk:"ike_id_local_end_point"`
+ IkeIdLocalEndPointVariable types.String `tfsdk:"ike_id_local_end_point_variable"`
+ IkeIdRemoteEndPoint types.String `tfsdk:"ike_id_remote_end_point"`
+ IkeIdRemoteEndPointVariable types.String `tfsdk:"ike_id_remote_end_point_variable"`
+ IpsecRekeyInterval types.Int64 `tfsdk:"ipsec_rekey_interval"`
+ IpsecRekeyIntervalVariable types.String `tfsdk:"ipsec_rekey_interval_variable"`
+ IpsecReplayWindow types.Int64 `tfsdk:"ipsec_replay_window"`
+ IpsecReplayWindowVariable types.String `tfsdk:"ipsec_replay_window_variable"`
+ IpsecCiphersuite types.String `tfsdk:"ipsec_ciphersuite"`
+ IpsecCiphersuiteVariable types.String `tfsdk:"ipsec_ciphersuite_variable"`
+ PerfectForwardSecrecy types.String `tfsdk:"perfect_forward_secrecy"`
+ PerfectForwardSecrecyVariable types.String `tfsdk:"perfect_forward_secrecy_variable"`
+ TrackerId types.String `tfsdk:"tracker_id"`
+ TrackerIdVariable types.String `tfsdk:"tracker_id_variable"`
+ TunnelRouteVia types.String `tfsdk:"tunnel_route_via"`
+ TunnelRouteViaVariable types.String `tfsdk:"tunnel_route_via_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportWANVPNInterfaceIPSEC) getModel() string {
+ return "transport_wan_vpn_interface_ipsec"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportWANVPNInterfaceIPSEC) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/ipsec", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ifName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ifName.optionType", "global")
+ body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "variable")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
+ }
+ } else if data.InterfaceDescription.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"description.optionType", "global")
+ body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if !data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"address.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelSourceIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.TunnelSourceIpv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
+ }
+ } else if !data.TunnelSourceInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
+ }
+ }
+
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
+ }
+ } else if !data.TunnelDestinationIpv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString())
+ }
+ }
+
+ if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"application.optionType", "variable")
+ body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString())
+ }
+ } else if !data.ApplicationTunnelType.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"application.optionType", "global")
+ body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global")
+ body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.ClearDontFragmentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable")
+ body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
+ }
+ } else if data.ClearDontFragment.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default")
+ body, _ = sjson.Set(body, path+"clearDontFragment.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global")
+ body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"mtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"mtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"mtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"mtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.DpdIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString())
+ }
+ } else if data.DpdInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"dpdInterval.value", 10)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64())
+ }
+ }
+
+ if !data.DpdRetriesVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable")
+ body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString())
+ }
+ } else if data.DpdRetries.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default")
+ body, _ = sjson.Set(body, path+"dpdRetries.value", 3)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global")
+ body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64())
+ }
+ }
+
+ if !data.IkePresharedKeyVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable")
+ body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString())
+ }
+ } else if !data.IkePresharedKey.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global")
+ body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString())
+ }
+ }
+ if data.IkeVersion.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeVersion.value", 1)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64())
+ }
+ }
+
+ if !data.IkeIntegrityProtocolVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString())
+ }
+ } else if data.IkeIntegrityProtocol.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeMode.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeMode.value", "main")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeMode.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString())
+ }
+ }
+
+ if !data.IkeRekeyIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString())
+ }
+ } else if data.IkeRekeyInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64())
+ }
+ }
+
+ if !data.IkeCiphersuiteVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString())
+ }
+ } else if data.IkeCiphersuite.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString())
+ }
+ }
+
+ if !data.IkeDiffieHellmanGroupVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString())
+ }
+ } else if data.IkeDiffieHellmanGroup.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default")
+ body, _ = sjson.Set(body, path+"ikeGroup.value", "16")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString())
+ }
+ }
+
+ if !data.IkeIdLocalEndPointVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString())
+ }
+ } else if data.IkeIdLocalEndPoint.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString())
+ }
+ }
+
+ if !data.IkeIdRemoteEndPointVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString())
+ }
+ } else if data.IkeIdRemoteEndPoint.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global")
+ body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString())
+ }
+ }
+
+ if !data.IpsecRekeyIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString())
+ }
+ } else if data.IpsecRekeyInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64())
+ }
+ }
+
+ if !data.IpsecReplayWindowVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString())
+ }
+ } else if data.IpsecReplayWindow.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64())
+ }
+ }
+
+ if !data.IpsecCiphersuiteVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable")
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString())
+ }
+ } else if data.IpsecCiphersuite.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default")
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global")
+ body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString())
+ }
+ }
+
+ if !data.PerfectForwardSecrecyVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable")
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString())
+ }
+ } else if data.PerfectForwardSecrecy.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default")
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global")
+ body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString())
+ }
+ }
+
+ if !data.TrackerIdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tracker.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString())
+ }
+ } else if data.TrackerId.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tracker.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tracker.optionType", "global")
+ body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString())
+ }
+ }
+
+ if !data.TunnelRouteViaVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString())
+ }
+ } else if data.TunnelRouteVia.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportWANVPNInterfaceIPSEC) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "ifName.optionType"); t.Exists() {
+ va := res.Get(path + "ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "address.address.optionType"); t.Exists() {
+ va := res.Get(path + "address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.address.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4SubnetMask = types.StringNull()
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.mask.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.address.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4SubnetMask = types.StringNull()
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.mask.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "application.optionType"); t.Exists() {
+ va := res.Get(path + "application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "mtu.optionType"); t.Exists() {
+ va := res.Get(path + "mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdInterval = types.Int64Null()
+ data.DpdIntervalVariable = types.StringNull()
+ if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
+ va := res.Get(path + "dpdInterval.value")
+ if t.String() == "variable" {
+ data.DpdIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdRetries = types.Int64Null()
+ data.DpdRetriesVariable = types.StringNull()
+ if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
+ va := res.Get(path + "dpdRetries.value")
+ if t.String() == "variable" {
+ data.DpdRetriesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdRetries = types.Int64Value(va.Int())
+ }
+ }
+ data.IkePresharedKey = types.StringNull()
+ data.IkePresharedKeyVariable = types.StringNull()
+ if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
+ va := res.Get(path + "preSharedSecret.value")
+ if t.String() == "variable" {
+ data.IkePresharedKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkePresharedKey = types.StringValue(va.String())
+ }
+ }
+ data.IkeVersion = types.Int64Null()
+
+ if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
+ va := res.Get(path + "ikeVersion.value")
+ if t.String() == "global" {
+ data.IkeVersion = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeIntegrityProtocol = types.StringNull()
+ data.IkeIntegrityProtocolVariable = types.StringNull()
+ if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
+ va := res.Get(path + "ikeMode.value")
+ if t.String() == "variable" {
+ data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIntegrityProtocol = types.StringValue(va.String())
+ }
+ }
+ data.IkeRekeyInterval = types.Int64Null()
+ data.IkeRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IkeRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeCiphersuite = types.StringNull()
+ data.IkeCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ikeCiphersuite.value")
+ if t.String() == "variable" {
+ data.IkeCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.IkeDiffieHellmanGroup = types.StringNull()
+ data.IkeDiffieHellmanGroupVariable = types.StringNull()
+ if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
+ va := res.Get(path + "ikeGroup.value")
+ if t.String() == "variable" {
+ data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeDiffieHellmanGroup = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdLocalEndPoint = types.StringNull()
+ data.IkeIdLocalEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeLocalId.value")
+ if t.String() == "variable" {
+ data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdLocalEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdRemoteEndPoint = types.StringNull()
+ data.IkeIdRemoteEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRemoteId.value")
+ if t.String() == "variable" {
+ data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdRemoteEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IpsecRekeyInterval = types.Int64Null()
+ data.IpsecRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecReplayWindow = types.Int64Null()
+ data.IpsecReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecReplayWindow.value")
+ if t.String() == "variable" {
+ data.IpsecReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecReplayWindow = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecCiphersuite = types.StringNull()
+ data.IpsecCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecCiphersuite.value")
+ if t.String() == "variable" {
+ data.IpsecCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.PerfectForwardSecrecy = types.StringNull()
+ data.PerfectForwardSecrecyVariable = types.StringNull()
+ if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
+ va := res.Get(path + "perfectForwardSecrecy.value")
+ if t.String() == "variable" {
+ data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerfectForwardSecrecy = types.StringValue(va.String())
+ }
+ }
+ data.TrackerId = types.StringNull()
+ data.TrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "tracker.optionType"); t.Exists() {
+ va := res.Get(path + "tracker.value")
+ if t.String() == "variable" {
+ data.TrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteVia = types.StringNull()
+ data.TunnelRouteViaVariable = types.StringNull()
+ if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteVia = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportWANVPNInterfaceIPSEC) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "ifName.optionType"); t.Exists() {
+ va := res.Get(path + "ifName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceDescription = types.StringNull()
+ data.InterfaceDescriptionVariable = types.StringNull()
+ if t := res.Get(path + "description.optionType"); t.Exists() {
+ va := res.Get(path + "description.value")
+ if t.String() == "variable" {
+ data.InterfaceDescriptionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceDescription = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "address.address.optionType"); t.Exists() {
+ va := res.Get(path + "address.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "address.mask.optionType"); t.Exists() {
+ va := res.Get(path + "address.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4Address = types.StringNull()
+ data.TunnelSourceIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.address.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceIpv4SubnetMask = types.StringNull()
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSource.mask.value")
+ if t.String() == "variable" {
+ data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.TunnelSourceInterface = types.StringNull()
+ data.TunnelSourceInterfaceVariable = types.StringNull()
+ if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelSourceInterface.value")
+ if t.String() == "variable" {
+ data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelSourceInterface = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4Address = types.StringNull()
+ data.TunnelDestinationIpv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.address.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4Address = types.StringValue(va.String())
+ }
+ }
+ data.TunnelDestinationIpv4SubnetMask = types.StringNull()
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelDestination.mask.value")
+ if t.String() == "variable" {
+ data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.ApplicationTunnelType = types.StringNull()
+ data.ApplicationTunnelTypeVariable = types.StringNull()
+ if t := res.Get(path + "application.optionType"); t.Exists() {
+ va := res.Get(path + "application.value")
+ if t.String() == "variable" {
+ data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ApplicationTunnelType = types.StringValue(va.String())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.ClearDontFragment = types.BoolNull()
+ data.ClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "clearDontFragment.value")
+ if t.String() == "variable" {
+ data.ClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "mtu.optionType"); t.Exists() {
+ va := res.Get(path + "mtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdInterval = types.Int64Null()
+ data.DpdIntervalVariable = types.StringNull()
+ if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
+ va := res.Get(path + "dpdInterval.value")
+ if t.String() == "variable" {
+ data.DpdIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.DpdRetries = types.Int64Null()
+ data.DpdRetriesVariable = types.StringNull()
+ if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
+ va := res.Get(path + "dpdRetries.value")
+ if t.String() == "variable" {
+ data.DpdRetriesVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.DpdRetries = types.Int64Value(va.Int())
+ }
+ }
+ data.IkePresharedKey = types.StringNull()
+ data.IkePresharedKeyVariable = types.StringNull()
+ if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
+ va := res.Get(path + "preSharedSecret.value")
+ if t.String() == "variable" {
+ data.IkePresharedKeyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkePresharedKey = types.StringValue(va.String())
+ }
+ }
+ data.IkeVersion = types.Int64Null()
+
+ if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
+ va := res.Get(path + "ikeVersion.value")
+ if t.String() == "global" {
+ data.IkeVersion = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeIntegrityProtocol = types.StringNull()
+ data.IkeIntegrityProtocolVariable = types.StringNull()
+ if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
+ va := res.Get(path + "ikeMode.value")
+ if t.String() == "variable" {
+ data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIntegrityProtocol = types.StringValue(va.String())
+ }
+ }
+ data.IkeRekeyInterval = types.Int64Null()
+ data.IkeRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IkeRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IkeCiphersuite = types.StringNull()
+ data.IkeCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ikeCiphersuite.value")
+ if t.String() == "variable" {
+ data.IkeCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.IkeDiffieHellmanGroup = types.StringNull()
+ data.IkeDiffieHellmanGroupVariable = types.StringNull()
+ if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
+ va := res.Get(path + "ikeGroup.value")
+ if t.String() == "variable" {
+ data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeDiffieHellmanGroup = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdLocalEndPoint = types.StringNull()
+ data.IkeIdLocalEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeLocalId.value")
+ if t.String() == "variable" {
+ data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdLocalEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IkeIdRemoteEndPoint = types.StringNull()
+ data.IkeIdRemoteEndPointVariable = types.StringNull()
+ if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
+ va := res.Get(path + "ikeRemoteId.value")
+ if t.String() == "variable" {
+ data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IkeIdRemoteEndPoint = types.StringValue(va.String())
+ }
+ }
+ data.IpsecRekeyInterval = types.Int64Null()
+ data.IpsecRekeyIntervalVariable = types.StringNull()
+ if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecRekeyInterval.value")
+ if t.String() == "variable" {
+ data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecRekeyInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecReplayWindow = types.Int64Null()
+ data.IpsecReplayWindowVariable = types.StringNull()
+ if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecReplayWindow.value")
+ if t.String() == "variable" {
+ data.IpsecReplayWindowVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecReplayWindow = types.Int64Value(va.Int())
+ }
+ }
+ data.IpsecCiphersuite = types.StringNull()
+ data.IpsecCiphersuiteVariable = types.StringNull()
+ if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
+ va := res.Get(path + "ipsecCiphersuite.value")
+ if t.String() == "variable" {
+ data.IpsecCiphersuiteVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpsecCiphersuite = types.StringValue(va.String())
+ }
+ }
+ data.PerfectForwardSecrecy = types.StringNull()
+ data.PerfectForwardSecrecyVariable = types.StringNull()
+ if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
+ va := res.Get(path + "perfectForwardSecrecy.value")
+ if t.String() == "variable" {
+ data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerfectForwardSecrecy = types.StringValue(va.String())
+ }
+ }
+ data.TrackerId = types.StringNull()
+ data.TrackerIdVariable = types.StringNull()
+ if t := res.Get(path + "tracker.optionType"); t.Exists() {
+ va := res.Get(path + "tracker.value")
+ if t.String() == "variable" {
+ data.TrackerIdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TrackerId = types.StringValue(va.String())
+ }
+ }
+ data.TunnelRouteVia = types.StringNull()
+ data.TunnelRouteViaVariable = types.StringNull()
+ if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelRouteVia.value")
+ if t.String() == "variable" {
+ data.TunnelRouteViaVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelRouteVia = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportWANVPNInterfaceIPSEC) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TransportWanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescription.IsNull() {
+ return false
+ }
+ if !data.InterfaceDescriptionVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterface.IsNull() {
+ return false
+ }
+ if !data.TunnelSourceInterfaceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4Address.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelType.IsNull() {
+ return false
+ }
+ if !data.ApplicationTunnelTypeVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragment.IsNull() {
+ return false
+ }
+ if !data.ClearDontFragmentVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.DpdInterval.IsNull() {
+ return false
+ }
+ if !data.DpdIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.DpdRetries.IsNull() {
+ return false
+ }
+ if !data.DpdRetriesVariable.IsNull() {
+ return false
+ }
+ if !data.IkePresharedKey.IsNull() {
+ return false
+ }
+ if !data.IkePresharedKeyVariable.IsNull() {
+ return false
+ }
+ if !data.IkeVersion.IsNull() {
+ return false
+ }
+ if !data.IkeIntegrityProtocol.IsNull() {
+ return false
+ }
+ if !data.IkeIntegrityProtocolVariable.IsNull() {
+ return false
+ }
+ if !data.IkeRekeyInterval.IsNull() {
+ return false
+ }
+ if !data.IkeRekeyIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.IkeCiphersuite.IsNull() {
+ return false
+ }
+ if !data.IkeCiphersuiteVariable.IsNull() {
+ return false
+ }
+ if !data.IkeDiffieHellmanGroup.IsNull() {
+ return false
+ }
+ if !data.IkeDiffieHellmanGroupVariable.IsNull() {
+ return false
+ }
+ if !data.IkeIdLocalEndPoint.IsNull() {
+ return false
+ }
+ if !data.IkeIdLocalEndPointVariable.IsNull() {
+ return false
+ }
+ if !data.IkeIdRemoteEndPoint.IsNull() {
+ return false
+ }
+ if !data.IkeIdRemoteEndPointVariable.IsNull() {
+ return false
+ }
+ if !data.IpsecRekeyInterval.IsNull() {
+ return false
+ }
+ if !data.IpsecRekeyIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.IpsecReplayWindow.IsNull() {
+ return false
+ }
+ if !data.IpsecReplayWindowVariable.IsNull() {
+ return false
+ }
+ if !data.IpsecCiphersuite.IsNull() {
+ return false
+ }
+ if !data.IpsecCiphersuiteVariable.IsNull() {
+ return false
+ }
+ if !data.PerfectForwardSecrecy.IsNull() {
+ return false
+ }
+ if !data.PerfectForwardSecrecyVariable.IsNull() {
+ return false
+ }
+ if !data.TrackerId.IsNull() {
+ return false
+ }
+ if !data.TrackerIdVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteVia.IsNull() {
+ return false
+ }
+ if !data.TunnelRouteViaVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go
deleted file mode 100644
index 09b05535a..000000000
--- a/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go
+++ /dev/null
@@ -1,1393 +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/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportWANVPNInterfaceIPSEC 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"`
- TransportWanVpnProfileParcelId types.String `tfsdk:"transport_wan_vpn_profile_parcel_id"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceDescription types.String `tfsdk:"interface_description"`
- InterfaceDescriptionVariable types.String `tfsdk:"interface_description_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- TunnelSourceIpv4Address types.String `tfsdk:"tunnel_source_ipv4_address"`
- TunnelSourceIpv4AddressVariable types.String `tfsdk:"tunnel_source_ipv4_address_variable"`
- TunnelSourceIpv4SubnetMask types.String `tfsdk:"tunnel_source_ipv4_subnet_mask"`
- TunnelSourceIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_source_ipv4_subnet_mask_variable"`
- TunnelSourceInterface types.String `tfsdk:"tunnel_source_interface"`
- TunnelSourceInterfaceVariable types.String `tfsdk:"tunnel_source_interface_variable"`
- TunnelDestinationIpv4Address types.String `tfsdk:"tunnel_destination_ipv4_address"`
- TunnelDestinationIpv4AddressVariable types.String `tfsdk:"tunnel_destination_ipv4_address_variable"`
- TunnelDestinationIpv4SubnetMask types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask"`
- TunnelDestinationIpv4SubnetMaskVariable types.String `tfsdk:"tunnel_destination_ipv4_subnet_mask_variable"`
- ApplicationTunnelType types.String `tfsdk:"application_tunnel_type"`
- ApplicationTunnelTypeVariable types.String `tfsdk:"application_tunnel_type_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- ClearDontFragment types.Bool `tfsdk:"clear_dont_fragment"`
- ClearDontFragmentVariable types.String `tfsdk:"clear_dont_fragment_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- DpdInterval types.Int64 `tfsdk:"dpd_interval"`
- DpdIntervalVariable types.String `tfsdk:"dpd_interval_variable"`
- DpdRetries types.Int64 `tfsdk:"dpd_retries"`
- DpdRetriesVariable types.String `tfsdk:"dpd_retries_variable"`
- IkePresharedKey types.String `tfsdk:"ike_preshared_key"`
- IkePresharedKeyVariable types.String `tfsdk:"ike_preshared_key_variable"`
- IkeVersion types.Int64 `tfsdk:"ike_version"`
- IkeIntegrityProtocol types.String `tfsdk:"ike_integrity_protocol"`
- IkeIntegrityProtocolVariable types.String `tfsdk:"ike_integrity_protocol_variable"`
- IkeRekeyInterval types.Int64 `tfsdk:"ike_rekey_interval"`
- IkeRekeyIntervalVariable types.String `tfsdk:"ike_rekey_interval_variable"`
- IkeCiphersuite types.String `tfsdk:"ike_ciphersuite"`
- IkeCiphersuiteVariable types.String `tfsdk:"ike_ciphersuite_variable"`
- IkeDiffieHellmanGroup types.String `tfsdk:"ike_diffie_hellman_group"`
- IkeDiffieHellmanGroupVariable types.String `tfsdk:"ike_diffie_hellman_group_variable"`
- IkeIdLocalEndPoint types.String `tfsdk:"ike_id_local_end_point"`
- IkeIdLocalEndPointVariable types.String `tfsdk:"ike_id_local_end_point_variable"`
- IkeIdRemoteEndPoint types.String `tfsdk:"ike_id_remote_end_point"`
- IkeIdRemoteEndPointVariable types.String `tfsdk:"ike_id_remote_end_point_variable"`
- IpsecRekeyInterval types.Int64 `tfsdk:"ipsec_rekey_interval"`
- IpsecRekeyIntervalVariable types.String `tfsdk:"ipsec_rekey_interval_variable"`
- IpsecReplayWindow types.Int64 `tfsdk:"ipsec_replay_window"`
- IpsecReplayWindowVariable types.String `tfsdk:"ipsec_replay_window_variable"`
- IpsecCiphersuite types.String `tfsdk:"ipsec_ciphersuite"`
- IpsecCiphersuiteVariable types.String `tfsdk:"ipsec_ciphersuite_variable"`
- PerfectForwardSecrecy types.String `tfsdk:"perfect_forward_secrecy"`
- PerfectForwardSecrecyVariable types.String `tfsdk:"perfect_forward_secrecy_variable"`
- TrackerId types.String `tfsdk:"tracker_id"`
- TrackerIdVariable types.String `tfsdk:"tracker_id_variable"`
- TunnelRouteVia types.String `tfsdk:"tunnel_route_via"`
- TunnelRouteViaVariable types.String `tfsdk:"tunnel_route_via_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportWANVPNInterfaceIPSEC) getModel() string {
- return "transport_wan_vpn_interface_ipsec"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportWANVPNInterfaceIPSEC) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/ipsec", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ifName.optionType", "variable")
- body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ifName.optionType", "global")
- body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceDescriptionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "variable")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString())
- }
- } else if data.InterfaceDescription.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"description.optionType", "global")
- body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if !data.Ipv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.address.optionType", "global")
- body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"address.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
-
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelSourceIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString())
- }
- }
-
- if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString())
- }
- } else if !data.TunnelSourceIpv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString())
- }
- }
-
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString())
- }
- } else if !data.TunnelSourceInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString())
- }
- }
-
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString())
- }
- } else if !data.TunnelDestinationIpv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString())
- }
- }
-
- if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString())
- }
- } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString())
- }
- }
-
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"application.optionType", "variable")
- body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString())
- }
- } else if !data.ApplicationTunnelType.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"application.optionType", "global")
- body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable")
- body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global")
- body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.ClearDontFragmentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable")
- body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString())
- }
- } else if data.ClearDontFragment.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default")
- body, _ = sjson.Set(body, path+"clearDontFragment.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global")
- body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"mtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"mtu.optionType", "default")
- body, _ = sjson.Set(body, path+"mtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"mtu.optionType", "global")
- body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.DpdIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString())
- }
- } else if data.DpdInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"dpdInterval.value", 10)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64())
- }
- }
-
- if !data.DpdRetriesVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable")
- body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString())
- }
- } else if data.DpdRetries.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default")
- body, _ = sjson.Set(body, path+"dpdRetries.value", 3)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global")
- body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64())
- }
- }
-
- if !data.IkePresharedKeyVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable")
- body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString())
- }
- } else if !data.IkePresharedKey.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global")
- body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString())
- }
- }
- if data.IkeVersion.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeVersion.value", 1)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64())
- }
- }
-
- if !data.IkeIntegrityProtocolVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString())
- }
- } else if data.IkeIntegrityProtocol.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeMode.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeMode.value", "main")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeMode.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString())
- }
- }
-
- if !data.IkeRekeyIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString())
- }
- } else if data.IkeRekeyInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64())
- }
- }
-
- if !data.IkeCiphersuiteVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString())
- }
- } else if data.IkeCiphersuite.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString())
- }
- }
-
- if !data.IkeDiffieHellmanGroupVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString())
- }
- } else if data.IkeDiffieHellmanGroup.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default")
- body, _ = sjson.Set(body, path+"ikeGroup.value", "16")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString())
- }
- }
-
- if !data.IkeIdLocalEndPointVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString())
- }
- } else if data.IkeIdLocalEndPoint.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString())
- }
- }
-
- if !data.IkeIdRemoteEndPointVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable")
- body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString())
- }
- } else if data.IkeIdRemoteEndPoint.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global")
- body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString())
- }
- }
-
- if !data.IpsecRekeyIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString())
- }
- } else if data.IpsecRekeyInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64())
- }
- }
-
- if !data.IpsecReplayWindowVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString())
- }
- } else if data.IpsecReplayWindow.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default")
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global")
- body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64())
- }
- }
-
- if !data.IpsecCiphersuiteVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable")
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString())
- }
- } else if data.IpsecCiphersuite.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default")
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global")
- body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString())
- }
- }
-
- if !data.PerfectForwardSecrecyVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable")
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString())
- }
- } else if data.PerfectForwardSecrecy.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default")
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global")
- body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString())
- }
- }
-
- if !data.TrackerIdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tracker.optionType", "variable")
- body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString())
- }
- } else if data.TrackerId.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tracker.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tracker.optionType", "global")
- body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString())
- }
- }
-
- if !data.TunnelRouteViaVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString())
- }
- } else if data.TunnelRouteVia.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportWANVPNInterfaceIPSEC) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "ifName.optionType"); t.Exists() {
- va := res.Get(path + "ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "address.address.optionType"); t.Exists() {
- va := res.Get(path + "address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "address.mask.optionType"); t.Exists() {
- va := res.Get(path + "address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.address.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4SubnetMask = types.StringNull()
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.mask.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.address.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4SubnetMask = types.StringNull()
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.mask.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "application.optionType"); t.Exists() {
- va := res.Get(path + "application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "mtu.optionType"); t.Exists() {
- va := res.Get(path + "mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.DpdInterval = types.Int64Null()
- data.DpdIntervalVariable = types.StringNull()
- if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
- va := res.Get(path + "dpdInterval.value")
- if t.String() == "variable" {
- data.DpdIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdInterval = types.Int64Value(va.Int())
- }
- }
- data.DpdRetries = types.Int64Null()
- data.DpdRetriesVariable = types.StringNull()
- if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
- va := res.Get(path + "dpdRetries.value")
- if t.String() == "variable" {
- data.DpdRetriesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdRetries = types.Int64Value(va.Int())
- }
- }
- data.IkePresharedKey = types.StringNull()
- data.IkePresharedKeyVariable = types.StringNull()
- if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
- va := res.Get(path + "preSharedSecret.value")
- if t.String() == "variable" {
- data.IkePresharedKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkePresharedKey = types.StringValue(va.String())
- }
- }
- data.IkeVersion = types.Int64Null()
-
- if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
- va := res.Get(path + "ikeVersion.value")
- if t.String() == "global" {
- data.IkeVersion = types.Int64Value(va.Int())
- }
- }
- data.IkeIntegrityProtocol = types.StringNull()
- data.IkeIntegrityProtocolVariable = types.StringNull()
- if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
- va := res.Get(path + "ikeMode.value")
- if t.String() == "variable" {
- data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIntegrityProtocol = types.StringValue(va.String())
- }
- }
- data.IkeRekeyInterval = types.Int64Null()
- data.IkeRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ikeRekeyInterval.value")
- if t.String() == "variable" {
- data.IkeRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IkeCiphersuite = types.StringNull()
- data.IkeCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ikeCiphersuite.value")
- if t.String() == "variable" {
- data.IkeCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeCiphersuite = types.StringValue(va.String())
- }
- }
- data.IkeDiffieHellmanGroup = types.StringNull()
- data.IkeDiffieHellmanGroupVariable = types.StringNull()
- if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
- va := res.Get(path + "ikeGroup.value")
- if t.String() == "variable" {
- data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeDiffieHellmanGroup = types.StringValue(va.String())
- }
- }
- data.IkeIdLocalEndPoint = types.StringNull()
- data.IkeIdLocalEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
- va := res.Get(path + "ikeLocalId.value")
- if t.String() == "variable" {
- data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdLocalEndPoint = types.StringValue(va.String())
- }
- }
- data.IkeIdRemoteEndPoint = types.StringNull()
- data.IkeIdRemoteEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
- va := res.Get(path + "ikeRemoteId.value")
- if t.String() == "variable" {
- data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdRemoteEndPoint = types.StringValue(va.String())
- }
- }
- data.IpsecRekeyInterval = types.Int64Null()
- data.IpsecRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ipsecRekeyInterval.value")
- if t.String() == "variable" {
- data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IpsecReplayWindow = types.Int64Null()
- data.IpsecReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
- va := res.Get(path + "ipsecReplayWindow.value")
- if t.String() == "variable" {
- data.IpsecReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecReplayWindow = types.Int64Value(va.Int())
- }
- }
- data.IpsecCiphersuite = types.StringNull()
- data.IpsecCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ipsecCiphersuite.value")
- if t.String() == "variable" {
- data.IpsecCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecCiphersuite = types.StringValue(va.String())
- }
- }
- data.PerfectForwardSecrecy = types.StringNull()
- data.PerfectForwardSecrecyVariable = types.StringNull()
- if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
- va := res.Get(path + "perfectForwardSecrecy.value")
- if t.String() == "variable" {
- data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerfectForwardSecrecy = types.StringValue(va.String())
- }
- }
- data.TrackerId = types.StringNull()
- data.TrackerIdVariable = types.StringNull()
- if t := res.Get(path + "tracker.optionType"); t.Exists() {
- va := res.Get(path + "tracker.value")
- if t.String() == "variable" {
- data.TrackerIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackerId = types.StringValue(va.String())
- }
- }
- data.TunnelRouteVia = types.StringNull()
- data.TunnelRouteViaVariable = types.StringNull()
- if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteVia = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportWANVPNInterfaceIPSEC) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "ifName.optionType"); t.Exists() {
- va := res.Get(path + "ifName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceDescription = types.StringNull()
- data.InterfaceDescriptionVariable = types.StringNull()
- if t := res.Get(path + "description.optionType"); t.Exists() {
- va := res.Get(path + "description.value")
- if t.String() == "variable" {
- data.InterfaceDescriptionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceDescription = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "address.address.optionType"); t.Exists() {
- va := res.Get(path + "address.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "address.mask.optionType"); t.Exists() {
- va := res.Get(path + "address.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4Address = types.StringNull()
- data.TunnelSourceIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.address.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelSourceIpv4SubnetMask = types.StringNull()
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelSource.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSource.mask.value")
- if t.String() == "variable" {
- data.TunnelSourceIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.TunnelSourceInterface = types.StringNull()
- data.TunnelSourceInterfaceVariable = types.StringNull()
- if t := res.Get(path + "tunnelSourceInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelSourceInterface.value")
- if t.String() == "variable" {
- data.TunnelSourceInterfaceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelSourceInterface = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4Address = types.StringNull()
- data.TunnelDestinationIpv4AddressVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.address.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.address.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4Address = types.StringValue(va.String())
- }
- }
- data.TunnelDestinationIpv4SubnetMask = types.StringNull()
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "tunnelDestination.mask.optionType"); t.Exists() {
- va := res.Get(path + "tunnelDestination.mask.value")
- if t.String() == "variable" {
- data.TunnelDestinationIpv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelDestinationIpv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.ApplicationTunnelType = types.StringNull()
- data.ApplicationTunnelTypeVariable = types.StringNull()
- if t := res.Get(path + "application.optionType"); t.Exists() {
- va := res.Get(path + "application.value")
- if t.String() == "variable" {
- data.ApplicationTunnelTypeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ApplicationTunnelType = types.StringValue(va.String())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.ClearDontFragment = types.BoolNull()
- data.ClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "clearDontFragment.value")
- if t.String() == "variable" {
- data.ClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "mtu.optionType"); t.Exists() {
- va := res.Get(path + "mtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.DpdInterval = types.Int64Null()
- data.DpdIntervalVariable = types.StringNull()
- if t := res.Get(path + "dpdInterval.optionType"); t.Exists() {
- va := res.Get(path + "dpdInterval.value")
- if t.String() == "variable" {
- data.DpdIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdInterval = types.Int64Value(va.Int())
- }
- }
- data.DpdRetries = types.Int64Null()
- data.DpdRetriesVariable = types.StringNull()
- if t := res.Get(path + "dpdRetries.optionType"); t.Exists() {
- va := res.Get(path + "dpdRetries.value")
- if t.String() == "variable" {
- data.DpdRetriesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.DpdRetries = types.Int64Value(va.Int())
- }
- }
- data.IkePresharedKey = types.StringNull()
- data.IkePresharedKeyVariable = types.StringNull()
- if t := res.Get(path + "preSharedSecret.optionType"); t.Exists() {
- va := res.Get(path + "preSharedSecret.value")
- if t.String() == "variable" {
- data.IkePresharedKeyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkePresharedKey = types.StringValue(va.String())
- }
- }
- data.IkeVersion = types.Int64Null()
-
- if t := res.Get(path + "ikeVersion.optionType"); t.Exists() {
- va := res.Get(path + "ikeVersion.value")
- if t.String() == "global" {
- data.IkeVersion = types.Int64Value(va.Int())
- }
- }
- data.IkeIntegrityProtocol = types.StringNull()
- data.IkeIntegrityProtocolVariable = types.StringNull()
- if t := res.Get(path + "ikeMode.optionType"); t.Exists() {
- va := res.Get(path + "ikeMode.value")
- if t.String() == "variable" {
- data.IkeIntegrityProtocolVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIntegrityProtocol = types.StringValue(va.String())
- }
- }
- data.IkeRekeyInterval = types.Int64Null()
- data.IkeRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ikeRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ikeRekeyInterval.value")
- if t.String() == "variable" {
- data.IkeRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IkeCiphersuite = types.StringNull()
- data.IkeCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ikeCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ikeCiphersuite.value")
- if t.String() == "variable" {
- data.IkeCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeCiphersuite = types.StringValue(va.String())
- }
- }
- data.IkeDiffieHellmanGroup = types.StringNull()
- data.IkeDiffieHellmanGroupVariable = types.StringNull()
- if t := res.Get(path + "ikeGroup.optionType"); t.Exists() {
- va := res.Get(path + "ikeGroup.value")
- if t.String() == "variable" {
- data.IkeDiffieHellmanGroupVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeDiffieHellmanGroup = types.StringValue(va.String())
- }
- }
- data.IkeIdLocalEndPoint = types.StringNull()
- data.IkeIdLocalEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeLocalId.optionType"); t.Exists() {
- va := res.Get(path + "ikeLocalId.value")
- if t.String() == "variable" {
- data.IkeIdLocalEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdLocalEndPoint = types.StringValue(va.String())
- }
- }
- data.IkeIdRemoteEndPoint = types.StringNull()
- data.IkeIdRemoteEndPointVariable = types.StringNull()
- if t := res.Get(path + "ikeRemoteId.optionType"); t.Exists() {
- va := res.Get(path + "ikeRemoteId.value")
- if t.String() == "variable" {
- data.IkeIdRemoteEndPointVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IkeIdRemoteEndPoint = types.StringValue(va.String())
- }
- }
- data.IpsecRekeyInterval = types.Int64Null()
- data.IpsecRekeyIntervalVariable = types.StringNull()
- if t := res.Get(path + "ipsecRekeyInterval.optionType"); t.Exists() {
- va := res.Get(path + "ipsecRekeyInterval.value")
- if t.String() == "variable" {
- data.IpsecRekeyIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecRekeyInterval = types.Int64Value(va.Int())
- }
- }
- data.IpsecReplayWindow = types.Int64Null()
- data.IpsecReplayWindowVariable = types.StringNull()
- if t := res.Get(path + "ipsecReplayWindow.optionType"); t.Exists() {
- va := res.Get(path + "ipsecReplayWindow.value")
- if t.String() == "variable" {
- data.IpsecReplayWindowVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecReplayWindow = types.Int64Value(va.Int())
- }
- }
- data.IpsecCiphersuite = types.StringNull()
- data.IpsecCiphersuiteVariable = types.StringNull()
- if t := res.Get(path + "ipsecCiphersuite.optionType"); t.Exists() {
- va := res.Get(path + "ipsecCiphersuite.value")
- if t.String() == "variable" {
- data.IpsecCiphersuiteVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpsecCiphersuite = types.StringValue(va.String())
- }
- }
- data.PerfectForwardSecrecy = types.StringNull()
- data.PerfectForwardSecrecyVariable = types.StringNull()
- if t := res.Get(path + "perfectForwardSecrecy.optionType"); t.Exists() {
- va := res.Get(path + "perfectForwardSecrecy.value")
- if t.String() == "variable" {
- data.PerfectForwardSecrecyVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerfectForwardSecrecy = types.StringValue(va.String())
- }
- }
- data.TrackerId = types.StringNull()
- data.TrackerIdVariable = types.StringNull()
- if t := res.Get(path + "tracker.optionType"); t.Exists() {
- va := res.Get(path + "tracker.value")
- if t.String() == "variable" {
- data.TrackerIdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TrackerId = types.StringValue(va.String())
- }
- }
- data.TunnelRouteVia = types.StringNull()
- data.TunnelRouteViaVariable = types.StringNull()
- if t := res.Get(path + "tunnelRouteVia.optionType"); t.Exists() {
- va := res.Get(path + "tunnelRouteVia.value")
- if t.String() == "variable" {
- data.TunnelRouteViaVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelRouteVia = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportWANVPNInterfaceIPSEC) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.TransportWanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceDescription.IsNull() {
- return false
- }
- if !data.InterfaceDescriptionVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4SubnetMask.IsNull() {
- return false
- }
- if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.TunnelSourceInterface.IsNull() {
- return false
- }
- if !data.TunnelSourceInterfaceVariable.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4Address.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4AddressVariable.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4SubnetMask.IsNull() {
- return false
- }
- if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.ApplicationTunnelType.IsNull() {
- return false
- }
- if !data.ApplicationTunnelTypeVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.ClearDontFragment.IsNull() {
- return false
- }
- if !data.ClearDontFragmentVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.DpdInterval.IsNull() {
- return false
- }
- if !data.DpdIntervalVariable.IsNull() {
- return false
- }
- if !data.DpdRetries.IsNull() {
- return false
- }
- if !data.DpdRetriesVariable.IsNull() {
- return false
- }
- if !data.IkePresharedKey.IsNull() {
- return false
- }
- if !data.IkePresharedKeyVariable.IsNull() {
- return false
- }
- if !data.IkeVersion.IsNull() {
- return false
- }
- if !data.IkeIntegrityProtocol.IsNull() {
- return false
- }
- if !data.IkeIntegrityProtocolVariable.IsNull() {
- return false
- }
- if !data.IkeRekeyInterval.IsNull() {
- return false
- }
- if !data.IkeRekeyIntervalVariable.IsNull() {
- return false
- }
- if !data.IkeCiphersuite.IsNull() {
- return false
- }
- if !data.IkeCiphersuiteVariable.IsNull() {
- return false
- }
- if !data.IkeDiffieHellmanGroup.IsNull() {
- return false
- }
- if !data.IkeDiffieHellmanGroupVariable.IsNull() {
- return false
- }
- if !data.IkeIdLocalEndPoint.IsNull() {
- return false
- }
- if !data.IkeIdLocalEndPointVariable.IsNull() {
- return false
- }
- if !data.IkeIdRemoteEndPoint.IsNull() {
- return false
- }
- if !data.IkeIdRemoteEndPointVariable.IsNull() {
- return false
- }
- if !data.IpsecRekeyInterval.IsNull() {
- return false
- }
- if !data.IpsecRekeyIntervalVariable.IsNull() {
- return false
- }
- if !data.IpsecReplayWindow.IsNull() {
- return false
- }
- if !data.IpsecReplayWindowVariable.IsNull() {
- return false
- }
- if !data.IpsecCiphersuite.IsNull() {
- return false
- }
- if !data.IpsecCiphersuiteVariable.IsNull() {
- return false
- }
- if !data.PerfectForwardSecrecy.IsNull() {
- return false
- }
- if !data.PerfectForwardSecrecyVariable.IsNull() {
- return false
- }
- if !data.TrackerId.IsNull() {
- return false
- }
- if !data.TrackerIdVariable.IsNull() {
- return false
- }
- if !data.TunnelRouteVia.IsNull() {
- return false
- }
- if !data.TunnelRouteViaVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go
new file mode 100644
index 000000000..510891381
--- /dev/null
+++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go
@@ -0,0 +1,2470 @@
+// 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"
+ "strconv"
+
+ "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type TransportWANVPNInterfaceT1E1Serial 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"`
+ TransportWanVpnFeatureId types.String `tfsdk:"transport_wan_vpn_feature_id"`
+ Shutdown types.Bool `tfsdk:"shutdown"`
+ ShutdownVariable types.String `tfsdk:"shutdown_variable"`
+ InterfaceName types.String `tfsdk:"interface_name"`
+ InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
+ Ipv4Address types.String `tfsdk:"ipv4_address"`
+ Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
+ Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
+ Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
+ Ipv6Address types.String `tfsdk:"ipv6_address"`
+ Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
+ Bandwidth types.Int64 `tfsdk:"bandwidth"`
+ BandwidthVariable types.String `tfsdk:"bandwidth_variable"`
+ BandwidthDownstream types.Int64 `tfsdk:"bandwidth_downstream"`
+ BandwidthDownstreamVariable types.String `tfsdk:"bandwidth_downstream_variable"`
+ ClockRate types.String `tfsdk:"clock_rate"`
+ ClockRateVariable types.String `tfsdk:"clock_rate_variable"`
+ Encapsulation types.String `tfsdk:"encapsulation"`
+ EncapsulationVariable types.String `tfsdk:"encapsulation_variable"`
+ TunnelInterface types.Bool `tfsdk:"tunnel_interface"`
+ PerTunnelQos types.Bool `tfsdk:"per_tunnel_qos"`
+ PerTunnelQosVariable types.String `tfsdk:"per_tunnel_qos_variable"`
+ PerTunnelQosAggregator types.Bool `tfsdk:"per_tunnel_qos_aggregator"`
+ PerTunnelQosAggregatorVariable types.String `tfsdk:"per_tunnel_qos_aggregator_variable"`
+ TunnelQosMode types.String `tfsdk:"tunnel_qos_mode"`
+ TunnelQosModeVariable types.String `tfsdk:"tunnel_qos_mode_variable"`
+ TunnelInterfaceColor types.String `tfsdk:"tunnel_interface_color"`
+ TunnelInterfaceColorVariable types.String `tfsdk:"tunnel_interface_color_variable"`
+ TunnelInterfaceRestrict types.Bool `tfsdk:"tunnel_interface_restrict"`
+ TunnelInterfaceRestrictVariable types.String `tfsdk:"tunnel_interface_restrict_variable"`
+ TunnelInterfaceGroups types.Int64 `tfsdk:"tunnel_interface_groups"`
+ TunnelInterfaceGroupsVariable types.String `tfsdk:"tunnel_interface_groups_variable"`
+ TunnelInterfaceBorder types.Bool `tfsdk:"tunnel_interface_border"`
+ TunnelInterfaceBorderVariable types.String `tfsdk:"tunnel_interface_border_variable"`
+ TunnelInterfaceMaxControlConnections types.Int64 `tfsdk:"tunnel_interface_max_control_connections"`
+ TunnelInterfaceMaxControlConnectionsVariable types.String `tfsdk:"tunnel_interface_max_control_connections_variable"`
+ TunnelInterfaceVbondAsStunServer types.Bool `tfsdk:"tunnel_interface_vbond_as_stun_server"`
+ TunnelInterfaceVbondAsStunServerVariable types.String `tfsdk:"tunnel_interface_vbond_as_stun_server_variable"`
+ TunnelInterfaceExcludeControllerGroupList types.Set `tfsdk:"tunnel_interface_exclude_controller_group_list"`
+ TunnelInterfaceExcludeControllerGroupListVariable types.String `tfsdk:"tunnel_interface_exclude_controller_group_list_variable"`
+ TunnelInterfaceVmanageConnectionPreference types.Int64 `tfsdk:"tunnel_interface_vmanage_connection_preference"`
+ TunnelInterfaceVmanageConnectionPreferenceVariable types.String `tfsdk:"tunnel_interface_vmanage_connection_preference_variable"`
+ TunnelInterfacePortHop types.Bool `tfsdk:"tunnel_interface_port_hop"`
+ TunnelInterfacePortHopVariable types.String `tfsdk:"tunnel_interface_port_hop_variable"`
+ TunnelInterfaceLowBandwidthLink types.Bool `tfsdk:"tunnel_interface_low_bandwidth_link"`
+ TunnelInterfaceLowBandwidthLinkVariable types.String `tfsdk:"tunnel_interface_low_bandwidth_link_variable"`
+ TunnelInterfaceTunnelTcpMss types.Int64 `tfsdk:"tunnel_interface_tunnel_tcp_mss"`
+ TunnelInterfaceTunnelTcpMssVariable types.String `tfsdk:"tunnel_interface_tunnel_tcp_mss_variable"`
+ TunnelInterfaceClearDontFragment types.Bool `tfsdk:"tunnel_interface_clear_dont_fragment"`
+ TunnelInterfaceClearDontFragmentVariable types.String `tfsdk:"tunnel_interface_clear_dont_fragment_variable"`
+ TunnelInterfaceClearNetworkBroadcast types.Bool `tfsdk:"tunnel_interface_clear_network_broadcast"`
+ TunnelInterfaceClearNetworkBroadcastVariable types.String `tfsdk:"tunnel_interface_clear_network_broadcast_variable"`
+ TunnelInterfaceCarrier types.String `tfsdk:"tunnel_interface_carrier"`
+ TunnelInterfaceCarrierVariable types.String `tfsdk:"tunnel_interface_carrier_variable"`
+ TunnelInterfaceBindLoopbackTunnel types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel"`
+ TunnelInterfaceBindLoopbackTunnelVariable types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel_variable"`
+ TunnelInterfaceLastResortCircuit types.Bool `tfsdk:"tunnel_interface_last_resort_circuit"`
+ TunnelInterfaceLastResortCircuitVariable types.String `tfsdk:"tunnel_interface_last_resort_circuit_variable"`
+ TunnelInterfaceNatRefreshInterval types.Int64 `tfsdk:"tunnel_interface_nat_refresh_interval"`
+ TunnelInterfaceNatRefreshIntervalVariable types.String `tfsdk:"tunnel_interface_nat_refresh_interval_variable"`
+ TunnelInterfaceHelloInterval types.Int64 `tfsdk:"tunnel_interface_hello_interval"`
+ TunnelInterfaceHelloIntervalVariable types.String `tfsdk:"tunnel_interface_hello_interval_variable"`
+ TunnelInterfaceHelloTolerance types.Int64 `tfsdk:"tunnel_interface_hello_tolerance"`
+ TunnelInterfaceHelloToleranceVariable types.String `tfsdk:"tunnel_interface_hello_tolerance_variable"`
+ TunnelInterfaceAllowAll types.Bool `tfsdk:"tunnel_interface_allow_all"`
+ TunnelInterfaceAllowAllVariable types.String `tfsdk:"tunnel_interface_allow_all_variable"`
+ TunnelInterfaceAllowBgp types.Bool `tfsdk:"tunnel_interface_allow_bgp"`
+ TunnelInterfaceAllowBgpVariable types.String `tfsdk:"tunnel_interface_allow_bgp_variable"`
+ TunnelInterfaceAllowDhcp types.Bool `tfsdk:"tunnel_interface_allow_dhcp"`
+ TunnelInterfaceAllowDhcpVariable types.String `tfsdk:"tunnel_interface_allow_dhcp_variable"`
+ TunnelInterfaceAllowDns types.Bool `tfsdk:"tunnel_interface_allow_dns"`
+ TunnelInterfaceAllowDnsVariable types.String `tfsdk:"tunnel_interface_allow_dns_variable"`
+ TunnelInterfaceAllowIcmp types.Bool `tfsdk:"tunnel_interface_allow_icmp"`
+ TunnelInterfaceAllowIcmpVariable types.String `tfsdk:"tunnel_interface_allow_icmp_variable"`
+ TunnelInterfaceAllowNetconf types.Bool `tfsdk:"tunnel_interface_allow_netconf"`
+ TunnelInterfaceAllowNetconfVariable types.String `tfsdk:"tunnel_interface_allow_netconf_variable"`
+ TunnelInterfaceAllowNtp types.Bool `tfsdk:"tunnel_interface_allow_ntp"`
+ TunnelInterfaceAllowNtpVariable types.String `tfsdk:"tunnel_interface_allow_ntp_variable"`
+ TunnelInterfaceAllowOspf types.Bool `tfsdk:"tunnel_interface_allow_ospf"`
+ TunnelInterfaceAllowOspfVariable types.String `tfsdk:"tunnel_interface_allow_ospf_variable"`
+ TunnelInterfaceAllowSsh types.Bool `tfsdk:"tunnel_interface_allow_ssh"`
+ TunnelInterfaceAllowSshVariable types.String `tfsdk:"tunnel_interface_allow_ssh_variable"`
+ TunnelInterfaceAllowStun types.Bool `tfsdk:"tunnel_interface_allow_stun"`
+ TunnelInterfaceAllowStunVariable types.String `tfsdk:"tunnel_interface_allow_stun_variable"`
+ TunnelInterfaceAllowHttps types.Bool `tfsdk:"tunnel_interface_allow_https"`
+ TunnelInterfaceAllowHttpsVariable types.String `tfsdk:"tunnel_interface_allow_https_variable"`
+ TunnelInterfaceAllowSnmp types.Bool `tfsdk:"tunnel_interface_allow_snmp"`
+ TunnelInterfaceAllowSnmpVariable types.String `tfsdk:"tunnel_interface_allow_snmp_variable"`
+ TunnelInterfaceAllowBfd types.Bool `tfsdk:"tunnel_interface_allow_bfd"`
+ TunnelInterfaceAllowBfdVariable types.String `tfsdk:"tunnel_interface_allow_bfd_variable"`
+ TunnelInterfaceEncapsulations []TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations `tfsdk:"tunnel_interface_encapsulations"`
+ QosShapingRate types.Int64 `tfsdk:"qos_shaping_rate"`
+ QosShapingRateVariable types.String `tfsdk:"qos_shaping_rate_variable"`
+ TcpMss types.Int64 `tfsdk:"tcp_mss"`
+ TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
+ Mtu types.Int64 `tfsdk:"mtu"`
+ MtuVariable types.String `tfsdk:"mtu_variable"`
+ IpMtu types.Int64 `tfsdk:"ip_mtu"`
+ IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
+ TlocExtension types.String `tfsdk:"tloc_extension"`
+ TlocExtensionVariable types.String `tfsdk:"tloc_extension_variable"`
+}
+
+type TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations struct {
+ Encapsulation types.String `tfsdk:"encapsulation"`
+ Preference types.Int64 `tfsdk:"preference"`
+ PreferenceVariable types.String `tfsdk:"preference_variable"`
+ Weight types.Int64 `tfsdk:"weight"`
+ WeightVariable types.String `tfsdk:"weight_variable"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getModel
+func (data TransportWANVPNInterfaceT1E1Serial) getModel() string {
+ return "transport_wan_vpn_interface_t1_e1_serial"
+}
+
+// End of section. //template:end getModel
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data TransportWANVPNInterfaceT1E1Serial) getPath() string {
+ return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/serial", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnFeatureId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) string {
+ body := ""
+ body, _ = sjson.Set(body, "name", data.Name.ValueString())
+ body, _ = sjson.Set(body, "description", data.Description.ValueString())
+ path := "data."
+
+ if !data.ShutdownVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
+ }
+ } else if data.Shutdown.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
+ body, _ = sjson.Set(body, path+"shutdown.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
+ body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
+ }
+ }
+
+ if !data.InterfaceNameVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
+ }
+ } else if !data.InterfaceName.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
+ body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
+ }
+ }
+
+ if !data.Ipv4AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV4.address.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4AddressVariable.ValueString())
+ }
+ } else if data.Ipv4Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV4.address.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV4.address.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4Address.ValueString())
+ }
+ }
+
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
+ }
+ } else if !data.Ipv4SubnetMask.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMask.ValueString())
+ }
+ }
+
+ if !data.Ipv6AddressVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV6.optionType", "variable")
+ body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6AddressVariable.ValueString())
+ }
+ } else if data.Ipv6Address.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV6.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"addressV6.optionType", "global")
+ body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6Address.ValueString())
+ }
+ }
+
+ if !data.BandwidthVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidth.optionType", "variable")
+ body, _ = sjson.Set(body, path+"bandwidth.value", data.BandwidthVariable.ValueString())
+ }
+ } else if data.Bandwidth.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidth.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidth.optionType", "global")
+ body, _ = sjson.Set(body, path+"bandwidth.value", data.Bandwidth.ValueInt64())
+ }
+ }
+
+ if !data.BandwidthDownstreamVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable")
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString())
+ }
+ } else if data.BandwidthDownstream.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global")
+ body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64())
+ }
+ }
+
+ if !data.ClockRateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clockRate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRateVariable.ValueString())
+ }
+ } else if data.ClockRate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"clockRate.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"clockRate.optionType", "global")
+ body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRate.ValueString())
+ }
+ }
+
+ if !data.EncapsulationVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "variable")
+ body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.EncapsulationVariable.ValueString())
+ }
+ } else if data.Encapsulation.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "global")
+ body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.Encapsulation.ValueString())
+ }
+ }
+ if data.TunnelInterface.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnelInterface.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool())
+ }
+ }
+
+ if !data.PerTunnelQosVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString())
+ }
+ } else if data.PerTunnelQos.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool())
+ }
+ }
+
+ if !data.PerTunnelQosAggregatorVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregatorVariable.ValueString())
+ }
+ } else if data.PerTunnelQosAggregator.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregator.ValueBool())
+ }
+ }
+
+ if !data.TunnelQosModeVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString())
+ }
+ } else if !data.TunnelQosMode.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceColorVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceColor.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", "default")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceRestrictVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrictVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceRestrict.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrict.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceGroupsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceGroups.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceBorderVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceBorder.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceMaxControlConnections.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceVbondAsStunServer.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global")
+ var values []int64
+ data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false)
+ body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values)
+ }
+ }
+
+ if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", 5)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfacePortHopVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString())
+ }
+ } else if data.TunnelInterfacePortHop.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceLowBandwidthLink.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceTunnelTcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceClearDontFragment.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceClearNetworkBroadcastVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcastVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceClearNetworkBroadcast.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcast.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceCarrierVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceCarrier.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default")
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString())
+ }
+ }
+
+ if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceLastResortCircuit.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceNatRefreshInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceHelloInterval.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceHelloTolerance.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global")
+ body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowAllVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowAll.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.all.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.all.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowBgp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowDhcp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowDns.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowIcmp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowNetconf.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString())
+ }
+ } else if !data.TunnelInterfaceAllowNtp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowOspf.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowSshVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSshVariable.ValueString())
+ }
+ } else if !data.TunnelInterfaceAllowSsh.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSsh.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowStunVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowStun.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowHttps.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.https.value", true)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.https.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowSnmp.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool())
+ }
+ }
+
+ if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString())
+ }
+ } else if data.TunnelInterfaceAllowBfd.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", false)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global")
+ body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool())
+ }
+ }
+ if true {
+ body, _ = sjson.Set(body, path+"encapsulation", []interface{}{})
+ for _, item := range data.TunnelInterfaceEncapsulations {
+ itemBody := ""
+ if !item.Encapsulation.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString())
+ }
+ }
+
+ if !item.PreferenceVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString())
+ }
+ } else if item.Preference.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default")
+
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64())
+ }
+ }
+
+ if !item.WeightVariable.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString())
+ }
+ } else if item.Weight.IsNull() {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", 1)
+ }
+ } else {
+ if true {
+ itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global")
+ itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64())
+ }
+ }
+ body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody)
+ }
+ }
+
+ if !data.QosShapingRateVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString())
+ }
+ } else if !data.QosShapingRate.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
+ body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64())
+ }
+ }
+
+ if !data.TcpMssVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMssVariable.ValueString())
+ }
+ } else if data.TcpMss.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMss.ValueInt64())
+ }
+ }
+
+ if !data.MtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.mtu.value", data.MtuVariable.ValueString())
+ }
+ } else if data.Mtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.mtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.mtu.value", data.Mtu.ValueInt64())
+ }
+ }
+
+ if !data.IpMtuVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
+ }
+ } else if data.IpMtu.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
+ }
+ }
+
+ if !data.TlocExtensionVariable.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString())
+ }
+ } else if data.TlocExtension.IsNull() {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default")
+
+ }
+ } else {
+ if true {
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global")
+ body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString())
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *TransportWANVPNInterfaceT1E1Serial) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "addressV4.address.optionType"); t.Exists() {
+ va := res.Get(path + "addressV4.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "addressV4.mask.optionType"); t.Exists() {
+ va := res.Get(path + "addressV4.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "addressV6.optionType"); t.Exists() {
+ va := res.Get(path + "addressV6.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ data.Bandwidth = types.Int64Null()
+ data.BandwidthVariable = types.StringNull()
+ if t := res.Get(path + "bandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidth.value")
+ if t.String() == "variable" {
+ data.BandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Bandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.BandwidthDownstream = types.Int64Null()
+ data.BandwidthDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthDownstream.value")
+ if t.String() == "variable" {
+ data.BandwidthDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.ClockRate = types.StringNull()
+ data.ClockRateVariable = types.StringNull()
+ if t := res.Get(path + "clockRate.optionType"); t.Exists() {
+ va := res.Get(path + "clockRate.value")
+ if t.String() == "variable" {
+ data.ClockRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClockRate = types.StringValue(va.String())
+ }
+ }
+ data.Encapsulation = types.StringNull()
+ data.EncapsulationVariable = types.StringNull()
+ if t := res.Get(path + "encapsulationSerial.optionType"); t.Exists() {
+ va := res.Get(path + "encapsulationSerial.value")
+ if t.String() == "variable" {
+ data.EncapsulationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Encapsulation = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterface = types.BoolNull()
+
+ if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelInterface.value")
+ if t.String() == "global" {
+ data.TunnelInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQos = types.BoolNull()
+ data.PerTunnelQosVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQos.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQos = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQosAggregator = types.BoolNull()
+ data.PerTunnelQosAggregatorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQosAggregator.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQosAggregator.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosAggregatorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQosAggregator = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelQosMode = types.StringNull()
+ data.TunnelQosModeVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.mode.value")
+ if t.String() == "variable" {
+ data.TunnelQosModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelQosMode = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColor = types.StringNull()
+ data.TunnelInterfaceColorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.color.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColor = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceRestrict = types.BoolNull()
+ data.TunnelInterfaceRestrictVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.restrict.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceRestrictVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceRestrict = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGroups = types.Int64Null()
+ data.TunnelInterfaceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.group.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGroups = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBorder = types.BoolNull()
+ data.TunnelInterfaceBorderVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.border.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceMaxControlConnections = types.Int64Null()
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.maxControlConnections.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vbondAsStunServer.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vbondAsStunServer.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.excludeControllerGroupList.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vmanageConnectionPreference.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vmanageConnectionPreference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfacePortHop = types.BoolNull()
+ data.TunnelInterfacePortHopVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.portHop.value")
+ if t.String() == "variable" {
+ data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lowBandwidthLink.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tunnelTcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tunnelTcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceClearDontFragment = types.BoolNull()
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceClearNetworkBroadcast = types.BoolNull()
+ data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.networkBroadcast.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearNetworkBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceCarrier = types.StringNull()
+ data.TunnelInterfaceCarrierVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.carrier.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCarrier = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bind.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceLastResortCircuit = types.BoolNull()
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lastResortCircuit.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.natRefreshInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloInterval = types.Int64Null()
+ data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloTolerance = types.Int64Null()
+ data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloTolerance.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceAllowAll = types.BoolNull()
+ data.TunnelInterfaceAllowAllVariable = types.StringNull()
+ if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.all.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBgp = types.BoolNull()
+ data.TunnelInterfaceAllowBgpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bgp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDhcp = types.BoolNull()
+ data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dhcp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDns = types.BoolNull()
+ data.TunnelInterfaceAllowDnsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dns.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowIcmp = types.BoolNull()
+ data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.icmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNetconf = types.BoolNull()
+ data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.netconf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNtp = types.BoolNull()
+ data.TunnelInterfaceAllowNtpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ntp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowOspf = types.BoolNull()
+ data.TunnelInterfaceAllowOspfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ospf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSsh = types.BoolNull()
+ data.TunnelInterfaceAllowSshVariable = types.StringNull()
+ if t := res.Get(path + "allowService.sshd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.sshd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowStun = types.BoolNull()
+ data.TunnelInterfaceAllowStunVariable = types.StringNull()
+ if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.stun.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowHttps = types.BoolNull()
+ data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.https.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSnmp = types.BoolNull()
+ data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.snmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBfd = types.BoolNull()
+ data.TunnelInterfaceAllowBfdVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bfd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
+ }
+ }
+ if value := res.Get(path + "encapsulation"); value.Exists() {
+ data.TunnelInterfaceEncapsulations = make([]TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations{}
+ item.Encapsulation = types.StringNull()
+
+ if t := v.Get("encap.optionType"); t.Exists() {
+ va := v.Get("encap.value")
+ if t.String() == "global" {
+ item.Encapsulation = types.StringValue(va.String())
+ }
+ }
+ item.Preference = types.Int64Null()
+ item.PreferenceVariable = types.StringNull()
+ if t := v.Get("preference.optionType"); t.Exists() {
+ va := v.Get("preference.value")
+ if t.String() == "variable" {
+ item.PreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Preference = types.Int64Value(va.Int())
+ }
+ }
+ item.Weight = types.Int64Null()
+ item.WeightVariable = types.StringNull()
+ if t := v.Get("weight.optionType"); t.Exists() {
+ va := v.Get("weight.value")
+ if t.String() == "variable" {
+ item.WeightVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ item.Weight = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceEncapsulations = append(data.TunnelInterfaceEncapsulations, item)
+ return true
+ })
+ }
+ data.QosShapingRate = types.Int64Null()
+ data.QosShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.QosShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Mtu = types.Int64Null()
+ data.MtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mtu.value")
+ if t.String() == "variable" {
+ data.MtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Mtu = types.Int64Value(va.Int())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TlocExtension = types.StringNull()
+ data.TlocExtensionVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtension.value")
+ if t.String() == "variable" {
+ data.TlocExtensionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlocExtension = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *TransportWANVPNInterfaceT1E1Serial) 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())
+ } else {
+ data.Description = types.StringNull()
+ }
+ path := "payload.data."
+ data.Shutdown = types.BoolNull()
+ data.ShutdownVariable = types.StringNull()
+ if t := res.Get(path + "shutdown.optionType"); t.Exists() {
+ va := res.Get(path + "shutdown.value")
+ if t.String() == "variable" {
+ data.ShutdownVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Shutdown = types.BoolValue(va.Bool())
+ }
+ }
+ data.InterfaceName = types.StringNull()
+ data.InterfaceNameVariable = types.StringNull()
+ if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
+ va := res.Get(path + "interfaceName.value")
+ if t.String() == "variable" {
+ data.InterfaceNameVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.InterfaceName = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4Address = types.StringNull()
+ data.Ipv4AddressVariable = types.StringNull()
+ if t := res.Get(path + "addressV4.address.optionType"); t.Exists() {
+ va := res.Get(path + "addressV4.address.value")
+ if t.String() == "variable" {
+ data.Ipv4AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4Address = types.StringValue(va.String())
+ }
+ }
+ data.Ipv4SubnetMask = types.StringNull()
+ data.Ipv4SubnetMaskVariable = types.StringNull()
+ if t := res.Get(path + "addressV4.mask.optionType"); t.Exists() {
+ va := res.Get(path + "addressV4.mask.value")
+ if t.String() == "variable" {
+ data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv4SubnetMask = types.StringValue(va.String())
+ }
+ }
+ data.Ipv6Address = types.StringNull()
+ data.Ipv6AddressVariable = types.StringNull()
+ if t := res.Get(path + "addressV6.optionType"); t.Exists() {
+ va := res.Get(path + "addressV6.value")
+ if t.String() == "variable" {
+ data.Ipv6AddressVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Ipv6Address = types.StringValue(va.String())
+ }
+ }
+ data.Bandwidth = types.Int64Null()
+ data.BandwidthVariable = types.StringNull()
+ if t := res.Get(path + "bandwidth.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidth.value")
+ if t.String() == "variable" {
+ data.BandwidthVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Bandwidth = types.Int64Value(va.Int())
+ }
+ }
+ data.BandwidthDownstream = types.Int64Null()
+ data.BandwidthDownstreamVariable = types.StringNull()
+ if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
+ va := res.Get(path + "bandwidthDownstream.value")
+ if t.String() == "variable" {
+ data.BandwidthDownstreamVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.BandwidthDownstream = types.Int64Value(va.Int())
+ }
+ }
+ data.ClockRate = types.StringNull()
+ data.ClockRateVariable = types.StringNull()
+ if t := res.Get(path + "clockRate.optionType"); t.Exists() {
+ va := res.Get(path + "clockRate.value")
+ if t.String() == "variable" {
+ data.ClockRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.ClockRate = types.StringValue(va.String())
+ }
+ }
+ data.Encapsulation = types.StringNull()
+ data.EncapsulationVariable = types.StringNull()
+ if t := res.Get(path + "encapsulationSerial.optionType"); t.Exists() {
+ va := res.Get(path + "encapsulationSerial.value")
+ if t.String() == "variable" {
+ data.EncapsulationVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Encapsulation = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterface = types.BoolNull()
+
+ if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
+ va := res.Get(path + "tunnelInterface.value")
+ if t.String() == "global" {
+ data.TunnelInterface = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQos = types.BoolNull()
+ data.PerTunnelQosVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQos.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQos = types.BoolValue(va.Bool())
+ }
+ }
+ data.PerTunnelQosAggregator = types.BoolNull()
+ data.PerTunnelQosAggregatorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.perTunnelQosAggregator.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.perTunnelQosAggregator.value")
+ if t.String() == "variable" {
+ data.PerTunnelQosAggregatorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.PerTunnelQosAggregator = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelQosMode = types.StringNull()
+ data.TunnelQosModeVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.mode.value")
+ if t.String() == "variable" {
+ data.TunnelQosModeVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelQosMode = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceColor = types.StringNull()
+ data.TunnelInterfaceColorVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.color.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceColorVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceColor = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceRestrict = types.BoolNull()
+ data.TunnelInterfaceRestrictVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.restrict.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceRestrictVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceRestrict = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceGroups = types.Int64Null()
+ data.TunnelInterfaceGroupsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.group.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceGroups = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceBorder = types.BoolNull()
+ data.TunnelInterfaceBorderVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.border.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceMaxControlConnections = types.Int64Null()
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.maxControlConnections.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vbondAsStunServer.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vbondAsStunServer.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.excludeControllerGroupList.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
+ }
+ }
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.vmanageConnectionPreference.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.vmanageConnectionPreference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfacePortHop = types.BoolNull()
+ data.TunnelInterfacePortHopVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.portHop.value")
+ if t.String() == "variable" {
+ data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lowBandwidthLink.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.tunnelTcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.tunnelTcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceClearDontFragment = types.BoolNull()
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.clearDontFragment.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceClearNetworkBroadcast = types.BoolNull()
+ data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.networkBroadcast.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceClearNetworkBroadcast = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceCarrier = types.StringNull()
+ data.TunnelInterfaceCarrierVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.carrier.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceCarrier = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.bind.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceLastResortCircuit = types.BoolNull()
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.lastResortCircuit.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.natRefreshInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloInterval = types.Int64Null()
+ data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloInterval.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceHelloTolerance = types.Int64Null()
+ data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
+ if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
+ va := res.Get(path + "tunnel.helloTolerance.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceAllowAll = types.BoolNull()
+ data.TunnelInterfaceAllowAllVariable = types.StringNull()
+ if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.all.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBgp = types.BoolNull()
+ data.TunnelInterfaceAllowBgpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bgp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDhcp = types.BoolNull()
+ data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dhcp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowDns = types.BoolNull()
+ data.TunnelInterfaceAllowDnsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.dns.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowIcmp = types.BoolNull()
+ data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.icmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNetconf = types.BoolNull()
+ data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.netconf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowNtp = types.BoolNull()
+ data.TunnelInterfaceAllowNtpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ntp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowOspf = types.BoolNull()
+ data.TunnelInterfaceAllowOspfVariable = types.StringNull()
+ if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.ospf.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSsh = types.BoolNull()
+ data.TunnelInterfaceAllowSshVariable = types.StringNull()
+ if t := res.Get(path + "allowService.sshd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.sshd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowStun = types.BoolNull()
+ data.TunnelInterfaceAllowStunVariable = types.StringNull()
+ if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.stun.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowHttps = types.BoolNull()
+ data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
+ if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.https.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowSnmp = types.BoolNull()
+ data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
+ if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.snmp.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
+ }
+ }
+ data.TunnelInterfaceAllowBfd = types.BoolNull()
+ data.TunnelInterfaceAllowBfdVariable = types.StringNull()
+ if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
+ va := res.Get(path + "allowService.bfd.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
+ }
+ }
+ for i := range data.TunnelInterfaceEncapsulations {
+ keys := [...]string{"encap", "preference"}
+ keyValues := [...]string{data.TunnelInterfaceEncapsulations[i].Encapsulation.ValueString(), strconv.FormatInt(data.TunnelInterfaceEncapsulations[i].Preference.ValueInt64(), 10)}
+ keyValuesVariables := [...]string{"", data.TunnelInterfaceEncapsulations[i].PreferenceVariable.ValueString()}
+
+ var r gjson.Result
+ res.Get(path + "encapsulation").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ tt := v.Get(keys[ik] + ".optionType")
+ vv := v.Get(keys[ik] + ".value")
+ if tt.Exists() && vv.Exists() {
+ if (tt.String() == "variable" && vv.String() == keyValuesVariables[ik]) || (tt.String() == "global" && vv.String() == keyValues[ik]) {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ continue
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringNull()
+
+ if t := r.Get("encap.optionType"); t.Exists() {
+ va := r.Get("encap.value")
+ if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringValue(va.String())
+ }
+ }
+ data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Null()
+ data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringNull()
+ if t := r.Get("preference.optionType"); t.Exists() {
+ va := r.Get("preference.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Value(va.Int())
+ }
+ }
+ data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Null()
+ data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringNull()
+ if t := r.Get("weight.optionType"); t.Exists() {
+ va := r.Get("weight.value")
+ if t.String() == "variable" {
+ data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Value(va.Int())
+ }
+ }
+ }
+ data.QosShapingRate = types.Int64Null()
+ data.QosShapingRateVariable = types.StringNull()
+ if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
+ va := res.Get(path + "aclQos.shapingRate.value")
+ if t.String() == "variable" {
+ data.QosShapingRateVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.QosShapingRate = types.Int64Value(va.Int())
+ }
+ }
+ data.TcpMss = types.Int64Null()
+ data.TcpMssVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tcpMssAdjust.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tcpMssAdjust.value")
+ if t.String() == "variable" {
+ data.TcpMssVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TcpMss = types.Int64Value(va.Int())
+ }
+ }
+ data.Mtu = types.Int64Null()
+ data.MtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.mtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.mtu.value")
+ if t.String() == "variable" {
+ data.MtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.Mtu = types.Int64Value(va.Int())
+ }
+ }
+ data.IpMtu = types.Int64Null()
+ data.IpMtuVariable = types.StringNull()
+ if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.ipMtu.value")
+ if t.String() == "variable" {
+ data.IpMtuVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.IpMtu = types.Int64Value(va.Int())
+ }
+ }
+ data.TlocExtension = types.StringNull()
+ data.TlocExtensionVariable = types.StringNull()
+ if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
+ va := res.Get(path + "advanced.tlocExtension.value")
+ if t.String() == "variable" {
+ data.TlocExtensionVariable = types.StringValue(va.String())
+ } else if t.String() == "global" {
+ data.TlocExtension = types.StringValue(va.String())
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *TransportWANVPNInterfaceT1E1Serial) isNull(ctx context.Context, res gjson.Result) bool {
+ if !data.FeatureProfileId.IsNull() {
+ return false
+ }
+ if !data.TransportWanVpnFeatureId.IsNull() {
+ return false
+ }
+ if !data.Shutdown.IsNull() {
+ return false
+ }
+ if !data.ShutdownVariable.IsNull() {
+ return false
+ }
+ if !data.InterfaceName.IsNull() {
+ return false
+ }
+ if !data.InterfaceNameVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4Address.IsNull() {
+ return false
+ }
+ if !data.Ipv4AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMask.IsNull() {
+ return false
+ }
+ if !data.Ipv4SubnetMaskVariable.IsNull() {
+ return false
+ }
+ if !data.Ipv6Address.IsNull() {
+ return false
+ }
+ if !data.Ipv6AddressVariable.IsNull() {
+ return false
+ }
+ if !data.Bandwidth.IsNull() {
+ return false
+ }
+ if !data.BandwidthVariable.IsNull() {
+ return false
+ }
+ if !data.BandwidthDownstream.IsNull() {
+ return false
+ }
+ if !data.BandwidthDownstreamVariable.IsNull() {
+ return false
+ }
+ if !data.ClockRate.IsNull() {
+ return false
+ }
+ if !data.ClockRateVariable.IsNull() {
+ return false
+ }
+ if !data.Encapsulation.IsNull() {
+ return false
+ }
+ if !data.EncapsulationVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterface.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQos.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQosVariable.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQosAggregator.IsNull() {
+ return false
+ }
+ if !data.PerTunnelQosAggregatorVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelQosMode.IsNull() {
+ return false
+ }
+ if !data.TunnelQosModeVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColor.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceColorVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceRestrict.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceRestrictVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGroups.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceGroupsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBorder.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBorderVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceMaxControlConnections.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVbondAsStunServer.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfacePortHop.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfacePortHopVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLowBandwidthLink.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceTunnelTcpMss.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearDontFragment.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearNetworkBroadcast.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceClearNetworkBroadcastVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCarrier.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceCarrierVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLastResortCircuit.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNatRefreshInterval.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloInterval.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloTolerance.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowAll.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowAllVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBgp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDhcp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDns.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowIcmp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNetconf.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNtp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowOspf.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSsh.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSshVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowStun.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowStunVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowHttps.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSnmp.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBfd.IsNull() {
+ return false
+ }
+ if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
+ return false
+ }
+ if len(data.TunnelInterfaceEncapsulations) > 0 {
+ return false
+ }
+ if !data.QosShapingRate.IsNull() {
+ return false
+ }
+ if !data.QosShapingRateVariable.IsNull() {
+ return false
+ }
+ if !data.TcpMss.IsNull() {
+ return false
+ }
+ if !data.TcpMssVariable.IsNull() {
+ return false
+ }
+ if !data.Mtu.IsNull() {
+ return false
+ }
+ if !data.MtuVariable.IsNull() {
+ return false
+ }
+ if !data.IpMtu.IsNull() {
+ return false
+ }
+ if !data.IpMtuVariable.IsNull() {
+ return false
+ }
+ if !data.TlocExtension.IsNull() {
+ return false
+ }
+ if !data.TlocExtensionVariable.IsNull() {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go
deleted file mode 100644
index 18a65630d..000000000
--- a/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go
+++ /dev/null
@@ -1,2467 +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"
- "strconv"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportWANVPNInterfaceT1E1Serial 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"`
- TransportWanVpnProfileParcelId types.String `tfsdk:"transport_wan_vpn_profile_parcel_id"`
- Shutdown types.Bool `tfsdk:"shutdown"`
- ShutdownVariable types.String `tfsdk:"shutdown_variable"`
- InterfaceName types.String `tfsdk:"interface_name"`
- InterfaceNameVariable types.String `tfsdk:"interface_name_variable"`
- Ipv4Address types.String `tfsdk:"ipv4_address"`
- Ipv4AddressVariable types.String `tfsdk:"ipv4_address_variable"`
- Ipv4SubnetMask types.String `tfsdk:"ipv4_subnet_mask"`
- Ipv4SubnetMaskVariable types.String `tfsdk:"ipv4_subnet_mask_variable"`
- Ipv6Address types.String `tfsdk:"ipv6_address"`
- Ipv6AddressVariable types.String `tfsdk:"ipv6_address_variable"`
- Bandwidth types.Int64 `tfsdk:"bandwidth"`
- BandwidthVariable types.String `tfsdk:"bandwidth_variable"`
- BandwidthDownstream types.Int64 `tfsdk:"bandwidth_downstream"`
- BandwidthDownstreamVariable types.String `tfsdk:"bandwidth_downstream_variable"`
- ClockRate types.String `tfsdk:"clock_rate"`
- ClockRateVariable types.String `tfsdk:"clock_rate_variable"`
- Encapsulation types.String `tfsdk:"encapsulation"`
- EncapsulationVariable types.String `tfsdk:"encapsulation_variable"`
- TunnelInterface types.Bool `tfsdk:"tunnel_interface"`
- PerTunnelQos types.Bool `tfsdk:"per_tunnel_qos"`
- PerTunnelQosVariable types.String `tfsdk:"per_tunnel_qos_variable"`
- PerTunnelQosAggregator types.Bool `tfsdk:"per_tunnel_qos_aggregator"`
- PerTunnelQosAggregatorVariable types.String `tfsdk:"per_tunnel_qos_aggregator_variable"`
- TunnelQosMode types.String `tfsdk:"tunnel_qos_mode"`
- TunnelQosModeVariable types.String `tfsdk:"tunnel_qos_mode_variable"`
- TunnelInterfaceColor types.String `tfsdk:"tunnel_interface_color"`
- TunnelInterfaceColorVariable types.String `tfsdk:"tunnel_interface_color_variable"`
- TunnelInterfaceRestrict types.Bool `tfsdk:"tunnel_interface_restrict"`
- TunnelInterfaceRestrictVariable types.String `tfsdk:"tunnel_interface_restrict_variable"`
- TunnelInterfaceGroups types.Int64 `tfsdk:"tunnel_interface_groups"`
- TunnelInterfaceGroupsVariable types.String `tfsdk:"tunnel_interface_groups_variable"`
- TunnelInterfaceBorder types.Bool `tfsdk:"tunnel_interface_border"`
- TunnelInterfaceBorderVariable types.String `tfsdk:"tunnel_interface_border_variable"`
- TunnelInterfaceMaxControlConnections types.Int64 `tfsdk:"tunnel_interface_max_control_connections"`
- TunnelInterfaceMaxControlConnectionsVariable types.String `tfsdk:"tunnel_interface_max_control_connections_variable"`
- TunnelInterfaceVbondAsStunServer types.Bool `tfsdk:"tunnel_interface_vbond_as_stun_server"`
- TunnelInterfaceVbondAsStunServerVariable types.String `tfsdk:"tunnel_interface_vbond_as_stun_server_variable"`
- TunnelInterfaceExcludeControllerGroupList types.Set `tfsdk:"tunnel_interface_exclude_controller_group_list"`
- TunnelInterfaceExcludeControllerGroupListVariable types.String `tfsdk:"tunnel_interface_exclude_controller_group_list_variable"`
- TunnelInterfaceVmanageConnectionPreference types.Int64 `tfsdk:"tunnel_interface_vmanage_connection_preference"`
- TunnelInterfaceVmanageConnectionPreferenceVariable types.String `tfsdk:"tunnel_interface_vmanage_connection_preference_variable"`
- TunnelInterfacePortHop types.Bool `tfsdk:"tunnel_interface_port_hop"`
- TunnelInterfacePortHopVariable types.String `tfsdk:"tunnel_interface_port_hop_variable"`
- TunnelInterfaceLowBandwidthLink types.Bool `tfsdk:"tunnel_interface_low_bandwidth_link"`
- TunnelInterfaceLowBandwidthLinkVariable types.String `tfsdk:"tunnel_interface_low_bandwidth_link_variable"`
- TunnelInterfaceTunnelTcpMss types.Int64 `tfsdk:"tunnel_interface_tunnel_tcp_mss"`
- TunnelInterfaceTunnelTcpMssVariable types.String `tfsdk:"tunnel_interface_tunnel_tcp_mss_variable"`
- TunnelInterfaceClearDontFragment types.Bool `tfsdk:"tunnel_interface_clear_dont_fragment"`
- TunnelInterfaceClearDontFragmentVariable types.String `tfsdk:"tunnel_interface_clear_dont_fragment_variable"`
- TunnelInterfaceClearNetworkBroadcast types.Bool `tfsdk:"tunnel_interface_clear_network_broadcast"`
- TunnelInterfaceClearNetworkBroadcastVariable types.String `tfsdk:"tunnel_interface_clear_network_broadcast_variable"`
- TunnelInterfaceCarrier types.String `tfsdk:"tunnel_interface_carrier"`
- TunnelInterfaceCarrierVariable types.String `tfsdk:"tunnel_interface_carrier_variable"`
- TunnelInterfaceBindLoopbackTunnel types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel"`
- TunnelInterfaceBindLoopbackTunnelVariable types.String `tfsdk:"tunnel_interface_bind_loopback_tunnel_variable"`
- TunnelInterfaceLastResortCircuit types.Bool `tfsdk:"tunnel_interface_last_resort_circuit"`
- TunnelInterfaceLastResortCircuitVariable types.String `tfsdk:"tunnel_interface_last_resort_circuit_variable"`
- TunnelInterfaceNatRefreshInterval types.Int64 `tfsdk:"tunnel_interface_nat_refresh_interval"`
- TunnelInterfaceNatRefreshIntervalVariable types.String `tfsdk:"tunnel_interface_nat_refresh_interval_variable"`
- TunnelInterfaceHelloInterval types.Int64 `tfsdk:"tunnel_interface_hello_interval"`
- TunnelInterfaceHelloIntervalVariable types.String `tfsdk:"tunnel_interface_hello_interval_variable"`
- TunnelInterfaceHelloTolerance types.Int64 `tfsdk:"tunnel_interface_hello_tolerance"`
- TunnelInterfaceHelloToleranceVariable types.String `tfsdk:"tunnel_interface_hello_tolerance_variable"`
- TunnelInterfaceAllowAll types.Bool `tfsdk:"tunnel_interface_allow_all"`
- TunnelInterfaceAllowAllVariable types.String `tfsdk:"tunnel_interface_allow_all_variable"`
- TunnelInterfaceAllowBgp types.Bool `tfsdk:"tunnel_interface_allow_bgp"`
- TunnelInterfaceAllowBgpVariable types.String `tfsdk:"tunnel_interface_allow_bgp_variable"`
- TunnelInterfaceAllowDhcp types.Bool `tfsdk:"tunnel_interface_allow_dhcp"`
- TunnelInterfaceAllowDhcpVariable types.String `tfsdk:"tunnel_interface_allow_dhcp_variable"`
- TunnelInterfaceAllowDns types.Bool `tfsdk:"tunnel_interface_allow_dns"`
- TunnelInterfaceAllowDnsVariable types.String `tfsdk:"tunnel_interface_allow_dns_variable"`
- TunnelInterfaceAllowIcmp types.Bool `tfsdk:"tunnel_interface_allow_icmp"`
- TunnelInterfaceAllowIcmpVariable types.String `tfsdk:"tunnel_interface_allow_icmp_variable"`
- TunnelInterfaceAllowNetconf types.Bool `tfsdk:"tunnel_interface_allow_netconf"`
- TunnelInterfaceAllowNetconfVariable types.String `tfsdk:"tunnel_interface_allow_netconf_variable"`
- TunnelInterfaceAllowNtp types.Bool `tfsdk:"tunnel_interface_allow_ntp"`
- TunnelInterfaceAllowNtpVariable types.String `tfsdk:"tunnel_interface_allow_ntp_variable"`
- TunnelInterfaceAllowOspf types.Bool `tfsdk:"tunnel_interface_allow_ospf"`
- TunnelInterfaceAllowOspfVariable types.String `tfsdk:"tunnel_interface_allow_ospf_variable"`
- TunnelInterfaceAllowSsh types.Bool `tfsdk:"tunnel_interface_allow_ssh"`
- TunnelInterfaceAllowSshVariable types.String `tfsdk:"tunnel_interface_allow_ssh_variable"`
- TunnelInterfaceAllowStun types.Bool `tfsdk:"tunnel_interface_allow_stun"`
- TunnelInterfaceAllowStunVariable types.String `tfsdk:"tunnel_interface_allow_stun_variable"`
- TunnelInterfaceAllowHttps types.Bool `tfsdk:"tunnel_interface_allow_https"`
- TunnelInterfaceAllowHttpsVariable types.String `tfsdk:"tunnel_interface_allow_https_variable"`
- TunnelInterfaceAllowSnmp types.Bool `tfsdk:"tunnel_interface_allow_snmp"`
- TunnelInterfaceAllowSnmpVariable types.String `tfsdk:"tunnel_interface_allow_snmp_variable"`
- TunnelInterfaceAllowBfd types.Bool `tfsdk:"tunnel_interface_allow_bfd"`
- TunnelInterfaceAllowBfdVariable types.String `tfsdk:"tunnel_interface_allow_bfd_variable"`
- TunnelInterfaceEncapsulations []TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations `tfsdk:"tunnel_interface_encapsulations"`
- QosShapingRate types.Int64 `tfsdk:"qos_shaping_rate"`
- QosShapingRateVariable types.String `tfsdk:"qos_shaping_rate_variable"`
- TcpMss types.Int64 `tfsdk:"tcp_mss"`
- TcpMssVariable types.String `tfsdk:"tcp_mss_variable"`
- Mtu types.Int64 `tfsdk:"mtu"`
- MtuVariable types.String `tfsdk:"mtu_variable"`
- IpMtu types.Int64 `tfsdk:"ip_mtu"`
- IpMtuVariable types.String `tfsdk:"ip_mtu_variable"`
- TlocExtension types.String `tfsdk:"tloc_extension"`
- TlocExtensionVariable types.String `tfsdk:"tloc_extension_variable"`
-}
-
-type TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations struct {
- Encapsulation types.String `tfsdk:"encapsulation"`
- Preference types.Int64 `tfsdk:"preference"`
- PreferenceVariable types.String `tfsdk:"preference_variable"`
- Weight types.Int64 `tfsdk:"weight"`
- WeightVariable types.String `tfsdk:"weight_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportWANVPNInterfaceT1E1Serial) getModel() string {
- return "transport_wan_vpn_interface_t1_e1_serial"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportWANVPNInterfaceT1E1Serial) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/serial", url.QueryEscape(data.FeatureProfileId.ValueString()), url.QueryEscape(data.TransportWanVpnProfileParcelId.ValueString()))
-}
-
-// End of section. //template:end getPath
-
-// Section below is generated&owned by "gen/generator.go". //template:begin toBody
-func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
-
- if !data.ShutdownVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "variable")
- body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString())
- }
- } else if data.Shutdown.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "default")
- body, _ = sjson.Set(body, path+"shutdown.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"shutdown.optionType", "global")
- body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool())
- }
- }
-
- if !data.InterfaceNameVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString())
- }
- } else if !data.InterfaceName.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"interfaceName.optionType", "global")
- body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString())
- }
- }
-
- if !data.Ipv4AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressV4.address.optionType", "variable")
- body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4AddressVariable.ValueString())
- }
- } else if data.Ipv4Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressV4.address.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"addressV4.address.optionType", "global")
- body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4Address.ValueString())
- }
- }
-
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "variable")
- body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMaskVariable.ValueString())
- }
- } else if !data.Ipv4SubnetMask.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "global")
- body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMask.ValueString())
- }
- }
-
- if !data.Ipv6AddressVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressV6.optionType", "variable")
- body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6AddressVariable.ValueString())
- }
- } else if data.Ipv6Address.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"addressV6.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"addressV6.optionType", "global")
- body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6Address.ValueString())
- }
- }
-
- if !data.BandwidthVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidth.optionType", "variable")
- body, _ = sjson.Set(body, path+"bandwidth.value", data.BandwidthVariable.ValueString())
- }
- } else if data.Bandwidth.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidth.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"bandwidth.optionType", "global")
- body, _ = sjson.Set(body, path+"bandwidth.value", data.Bandwidth.ValueInt64())
- }
- }
-
- if !data.BandwidthDownstreamVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable")
- body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString())
- }
- } else if data.BandwidthDownstream.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global")
- body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64())
- }
- }
-
- if !data.ClockRateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clockRate.optionType", "variable")
- body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRateVariable.ValueString())
- }
- } else if data.ClockRate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"clockRate.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"clockRate.optionType", "global")
- body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRate.ValueString())
- }
- }
-
- if !data.EncapsulationVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "variable")
- body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.EncapsulationVariable.ValueString())
- }
- } else if data.Encapsulation.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "global")
- body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.Encapsulation.ValueString())
- }
- }
- if data.TunnelInterface.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnelInterface.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool())
- }
- }
-
- if !data.PerTunnelQosVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString())
- }
- } else if data.PerTunnelQos.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool())
- }
- }
-
- if !data.PerTunnelQosAggregatorVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregatorVariable.ValueString())
- }
- } else if data.PerTunnelQosAggregator.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregator.ValueBool())
- }
- }
-
- if !data.TunnelQosModeVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString())
- }
- } else if !data.TunnelQosMode.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString())
- }
- }
-
- if !data.TunnelInterfaceColorVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString())
- }
- } else if data.TunnelInterfaceColor.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.color.value", "default")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString())
- }
- }
-
- if !data.TunnelInterfaceRestrictVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrictVariable.ValueString())
- }
- } else if data.TunnelInterfaceRestrict.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrict.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceGroupsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString())
- }
- } else if data.TunnelInterfaceGroups.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceBorderVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString())
- }
- } else if data.TunnelInterfaceBorder.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.border.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString())
- }
- } else if data.TunnelInterfaceMaxControlConnections.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString())
- }
- } else if data.TunnelInterfaceVbondAsStunServer.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString())
- }
- } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global")
- var values []int64
- data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false)
- body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values)
- }
- }
-
- if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString())
- }
- } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", 5)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64())
- }
- }
-
- if !data.TunnelInterfacePortHopVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString())
- }
- } else if data.TunnelInterfacePortHop.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString())
- }
- } else if data.TunnelInterfaceLowBandwidthLink.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString())
- }
- } else if data.TunnelInterfaceTunnelTcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString())
- }
- } else if data.TunnelInterfaceClearDontFragment.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceClearNetworkBroadcastVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcastVariable.ValueString())
- }
- } else if data.TunnelInterfaceClearNetworkBroadcast.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcast.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceCarrierVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString())
- }
- } else if data.TunnelInterfaceCarrier.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default")
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString())
- }
- }
-
- if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString())
- }
- } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString())
- }
- }
-
- if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString())
- }
- } else if data.TunnelInterfaceLastResortCircuit.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString())
- }
- } else if data.TunnelInterfaceNatRefreshInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString())
- }
- } else if data.TunnelInterfaceHelloInterval.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString())
- }
- } else if data.TunnelInterfaceHelloTolerance.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global")
- body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64())
- }
- }
-
- if !data.TunnelInterfaceAllowAllVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowAll.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.all.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.all.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowBgp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowDhcp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowDns.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.dns.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowIcmp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowNetconf.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString())
- }
- } else if !data.TunnelInterfaceAllowNtp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowOspf.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowSshVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSshVariable.ValueString())
- }
- } else if !data.TunnelInterfaceAllowSsh.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSsh.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowStunVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowStun.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.stun.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowHttps.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.https.value", true)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.https.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowSnmp.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool())
- }
- }
-
- if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString())
- }
- } else if data.TunnelInterfaceAllowBfd.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global")
- body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"encapsulation", []interface{}{})
- for _, item := range data.TunnelInterfaceEncapsulations {
- itemBody := ""
- if !item.Encapsulation.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString())
- }
- }
-
- if !item.PreferenceVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString())
- }
- } else if item.Preference.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default")
-
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64())
- }
- }
-
- if !item.WeightVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString())
- }
- } else if item.Weight.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "weight.value", 1)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody)
- }
- }
-
- if !data.QosShapingRateVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString())
- }
- } else if !data.QosShapingRate.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global")
- body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64())
- }
- }
-
- if !data.TcpMssVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMssVariable.ValueString())
- }
- } else if data.TcpMss.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMss.ValueInt64())
- }
- }
-
- if !data.MtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.mtu.value", data.MtuVariable.ValueString())
- }
- } else if data.Mtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.mtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.mtu.value", data.Mtu.ValueInt64())
- }
- }
-
- if !data.IpMtuVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString())
- }
- } else if data.IpMtu.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64())
- }
- }
-
- if !data.TlocExtensionVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable")
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString())
- }
- } else if data.TlocExtension.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default")
-
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global")
- body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString())
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportWANVPNInterfaceT1E1Serial) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "addressV4.address.optionType"); t.Exists() {
- va := res.Get(path + "addressV4.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "addressV4.mask.optionType"); t.Exists() {
- va := res.Get(path + "addressV4.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "addressV6.optionType"); t.Exists() {
- va := res.Get(path + "addressV6.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- data.Bandwidth = types.Int64Null()
- data.BandwidthVariable = types.StringNull()
- if t := res.Get(path + "bandwidth.optionType"); t.Exists() {
- va := res.Get(path + "bandwidth.value")
- if t.String() == "variable" {
- data.BandwidthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Bandwidth = types.Int64Value(va.Int())
- }
- }
- data.BandwidthDownstream = types.Int64Null()
- data.BandwidthDownstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthDownstream.value")
- if t.String() == "variable" {
- data.BandwidthDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthDownstream = types.Int64Value(va.Int())
- }
- }
- data.ClockRate = types.StringNull()
- data.ClockRateVariable = types.StringNull()
- if t := res.Get(path + "clockRate.optionType"); t.Exists() {
- va := res.Get(path + "clockRate.value")
- if t.String() == "variable" {
- data.ClockRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClockRate = types.StringValue(va.String())
- }
- }
- data.Encapsulation = types.StringNull()
- data.EncapsulationVariable = types.StringNull()
- if t := res.Get(path + "encapsulationSerial.optionType"); t.Exists() {
- va := res.Get(path + "encapsulationSerial.value")
- if t.String() == "variable" {
- data.EncapsulationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Encapsulation = types.StringValue(va.String())
- }
- }
- data.TunnelInterface = types.BoolNull()
-
- if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelInterface.value")
- if t.String() == "global" {
- data.TunnelInterface = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQos = types.BoolNull()
- data.PerTunnelQosVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQos.value")
- if t.String() == "variable" {
- data.PerTunnelQosVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQos = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQosAggregator = types.BoolNull()
- data.PerTunnelQosAggregatorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQosAggregator.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQosAggregator.value")
- if t.String() == "variable" {
- data.PerTunnelQosAggregatorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQosAggregator = types.BoolValue(va.Bool())
- }
- }
- data.TunnelQosMode = types.StringNull()
- data.TunnelQosModeVariable = types.StringNull()
- if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.mode.value")
- if t.String() == "variable" {
- data.TunnelQosModeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelQosMode = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColor = types.StringNull()
- data.TunnelInterfaceColorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.color.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColor = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceRestrict = types.BoolNull()
- data.TunnelInterfaceRestrictVariable = types.StringNull()
- if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.restrict.value")
- if t.String() == "variable" {
- data.TunnelInterfaceRestrictVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceRestrict = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGroups = types.Int64Null()
- data.TunnelInterfaceGroupsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.group.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGroups = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBorder = types.BoolNull()
- data.TunnelInterfaceBorderVariable = types.StringNull()
- if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.border.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceMaxControlConnections = types.Int64Null()
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.maxControlConnections.value")
- if t.String() == "variable" {
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vbondAsStunServer.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vbondAsStunServer.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
- if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.excludeControllerGroupList.value")
- if t.String() == "variable" {
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
- }
- }
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vmanageConnectionPreference.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vmanageConnectionPreference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfacePortHop = types.BoolNull()
- data.TunnelInterfacePortHopVariable = types.StringNull()
- if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.portHop.value")
- if t.String() == "variable" {
- data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lowBandwidthLink.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tunnelTcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tunnelTcpMssAdjust.value")
- if t.String() == "variable" {
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceClearDontFragment = types.BoolNull()
- data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.clearDontFragment.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceClearNetworkBroadcast = types.BoolNull()
- data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringNull()
- if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.networkBroadcast.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearNetworkBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceCarrier = types.StringNull()
- data.TunnelInterfaceCarrierVariable = types.StringNull()
- if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.carrier.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCarrier = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bind.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceLastResortCircuit = types.BoolNull()
- data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lastResortCircuit.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.natRefreshInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloInterval = types.Int64Null()
- data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloTolerance = types.Int64Null()
- data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloTolerance.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceAllowAll = types.BoolNull()
- data.TunnelInterfaceAllowAllVariable = types.StringNull()
- if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
- va := res.Get(path + "allowService.all.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBgp = types.BoolNull()
- data.TunnelInterfaceAllowBgpVariable = types.StringNull()
- if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bgp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDhcp = types.BoolNull()
- data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
- if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dhcp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDns = types.BoolNull()
- data.TunnelInterfaceAllowDnsVariable = types.StringNull()
- if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dns.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowIcmp = types.BoolNull()
- data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.icmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNetconf = types.BoolNull()
- data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
- if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.netconf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNtp = types.BoolNull()
- data.TunnelInterfaceAllowNtpVariable = types.StringNull()
- if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ntp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowOspf = types.BoolNull()
- data.TunnelInterfaceAllowOspfVariable = types.StringNull()
- if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ospf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSsh = types.BoolNull()
- data.TunnelInterfaceAllowSshVariable = types.StringNull()
- if t := res.Get(path + "allowService.sshd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.sshd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowStun = types.BoolNull()
- data.TunnelInterfaceAllowStunVariable = types.StringNull()
- if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
- va := res.Get(path + "allowService.stun.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowHttps = types.BoolNull()
- data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
- if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
- va := res.Get(path + "allowService.https.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSnmp = types.BoolNull()
- data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.snmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBfd = types.BoolNull()
- data.TunnelInterfaceAllowBfdVariable = types.StringNull()
- if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bfd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
- }
- }
- if value := res.Get(path + "encapsulation"); value.Exists() {
- data.TunnelInterfaceEncapsulations = make([]TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNInterfaceT1E1SerialTunnelInterfaceEncapsulations{}
- item.Encapsulation = types.StringNull()
-
- if t := v.Get("encap.optionType"); t.Exists() {
- va := v.Get("encap.value")
- if t.String() == "global" {
- item.Encapsulation = types.StringValue(va.String())
- }
- }
- item.Preference = types.Int64Null()
- item.PreferenceVariable = types.StringNull()
- if t := v.Get("preference.optionType"); t.Exists() {
- va := v.Get("preference.value")
- if t.String() == "variable" {
- item.PreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Preference = types.Int64Value(va.Int())
- }
- }
- item.Weight = types.Int64Null()
- item.WeightVariable = types.StringNull()
- if t := v.Get("weight.optionType"); t.Exists() {
- va := v.Get("weight.value")
- if t.String() == "variable" {
- item.WeightVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Weight = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceEncapsulations = append(data.TunnelInterfaceEncapsulations, item)
- return true
- })
- }
- data.QosShapingRate = types.Int64Null()
- data.QosShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.QosShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosShapingRate = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Mtu = types.Int64Null()
- data.MtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.mtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mtu.value")
- if t.String() == "variable" {
- data.MtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Mtu = types.Int64Value(va.Int())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.TlocExtension = types.StringNull()
- data.TlocExtensionVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtension.value")
- if t.String() == "variable" {
- data.TlocExtensionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlocExtension = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportWANVPNInterfaceT1E1Serial) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Shutdown = types.BoolNull()
- data.ShutdownVariable = types.StringNull()
- if t := res.Get(path + "shutdown.optionType"); t.Exists() {
- va := res.Get(path + "shutdown.value")
- if t.String() == "variable" {
- data.ShutdownVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Shutdown = types.BoolValue(va.Bool())
- }
- }
- data.InterfaceName = types.StringNull()
- data.InterfaceNameVariable = types.StringNull()
- if t := res.Get(path + "interfaceName.optionType"); t.Exists() {
- va := res.Get(path + "interfaceName.value")
- if t.String() == "variable" {
- data.InterfaceNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.InterfaceName = types.StringValue(va.String())
- }
- }
- data.Ipv4Address = types.StringNull()
- data.Ipv4AddressVariable = types.StringNull()
- if t := res.Get(path + "addressV4.address.optionType"); t.Exists() {
- va := res.Get(path + "addressV4.address.value")
- if t.String() == "variable" {
- data.Ipv4AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4Address = types.StringValue(va.String())
- }
- }
- data.Ipv4SubnetMask = types.StringNull()
- data.Ipv4SubnetMaskVariable = types.StringNull()
- if t := res.Get(path + "addressV4.mask.optionType"); t.Exists() {
- va := res.Get(path + "addressV4.mask.value")
- if t.String() == "variable" {
- data.Ipv4SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv6Address = types.StringNull()
- data.Ipv6AddressVariable = types.StringNull()
- if t := res.Get(path + "addressV6.optionType"); t.Exists() {
- va := res.Get(path + "addressV6.value")
- if t.String() == "variable" {
- data.Ipv6AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6Address = types.StringValue(va.String())
- }
- }
- data.Bandwidth = types.Int64Null()
- data.BandwidthVariable = types.StringNull()
- if t := res.Get(path + "bandwidth.optionType"); t.Exists() {
- va := res.Get(path + "bandwidth.value")
- if t.String() == "variable" {
- data.BandwidthVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Bandwidth = types.Int64Value(va.Int())
- }
- }
- data.BandwidthDownstream = types.Int64Null()
- data.BandwidthDownstreamVariable = types.StringNull()
- if t := res.Get(path + "bandwidthDownstream.optionType"); t.Exists() {
- va := res.Get(path + "bandwidthDownstream.value")
- if t.String() == "variable" {
- data.BandwidthDownstreamVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.BandwidthDownstream = types.Int64Value(va.Int())
- }
- }
- data.ClockRate = types.StringNull()
- data.ClockRateVariable = types.StringNull()
- if t := res.Get(path + "clockRate.optionType"); t.Exists() {
- va := res.Get(path + "clockRate.value")
- if t.String() == "variable" {
- data.ClockRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.ClockRate = types.StringValue(va.String())
- }
- }
- data.Encapsulation = types.StringNull()
- data.EncapsulationVariable = types.StringNull()
- if t := res.Get(path + "encapsulationSerial.optionType"); t.Exists() {
- va := res.Get(path + "encapsulationSerial.value")
- if t.String() == "variable" {
- data.EncapsulationVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Encapsulation = types.StringValue(va.String())
- }
- }
- data.TunnelInterface = types.BoolNull()
-
- if t := res.Get(path + "tunnelInterface.optionType"); t.Exists() {
- va := res.Get(path + "tunnelInterface.value")
- if t.String() == "global" {
- data.TunnelInterface = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQos = types.BoolNull()
- data.PerTunnelQosVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQos.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQos.value")
- if t.String() == "variable" {
- data.PerTunnelQosVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQos = types.BoolValue(va.Bool())
- }
- }
- data.PerTunnelQosAggregator = types.BoolNull()
- data.PerTunnelQosAggregatorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.perTunnelQosAggregator.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.perTunnelQosAggregator.value")
- if t.String() == "variable" {
- data.PerTunnelQosAggregatorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PerTunnelQosAggregator = types.BoolValue(va.Bool())
- }
- }
- data.TunnelQosMode = types.StringNull()
- data.TunnelQosModeVariable = types.StringNull()
- if t := res.Get(path + "tunnel.mode.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.mode.value")
- if t.String() == "variable" {
- data.TunnelQosModeVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelQosMode = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceColor = types.StringNull()
- data.TunnelInterfaceColorVariable = types.StringNull()
- if t := res.Get(path + "tunnel.color.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.color.value")
- if t.String() == "variable" {
- data.TunnelInterfaceColorVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceColor = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceRestrict = types.BoolNull()
- data.TunnelInterfaceRestrictVariable = types.StringNull()
- if t := res.Get(path + "tunnel.restrict.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.restrict.value")
- if t.String() == "variable" {
- data.TunnelInterfaceRestrictVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceRestrict = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceGroups = types.Int64Null()
- data.TunnelInterfaceGroupsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.group.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.group.value")
- if t.String() == "variable" {
- data.TunnelInterfaceGroupsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceGroups = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceBorder = types.BoolNull()
- data.TunnelInterfaceBorderVariable = types.StringNull()
- if t := res.Get(path + "tunnel.border.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.border.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBorderVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBorder = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceMaxControlConnections = types.Int64Null()
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringNull()
- if t := res.Get(path + "tunnel.maxControlConnections.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.maxControlConnections.value")
- if t.String() == "variable" {
- data.TunnelInterfaceMaxControlConnectionsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceMaxControlConnections = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceVbondAsStunServer = types.BoolNull()
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vbondAsStunServer.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vbondAsStunServer.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVbondAsStunServerVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVbondAsStunServer = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceExcludeControllerGroupList = types.SetNull(types.Int64Type)
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringNull()
- if t := res.Get(path + "tunnel.excludeControllerGroupList.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.excludeControllerGroupList.value")
- if t.String() == "variable" {
- data.TunnelInterfaceExcludeControllerGroupListVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceExcludeControllerGroupList = helpers.GetInt64Set(va.Array())
- }
- }
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Null()
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.vmanageConnectionPreference.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.vmanageConnectionPreference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceVmanageConnectionPreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceVmanageConnectionPreference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfacePortHop = types.BoolNull()
- data.TunnelInterfacePortHopVariable = types.StringNull()
- if t := res.Get(path + "tunnel.portHop.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.portHop.value")
- if t.String() == "variable" {
- data.TunnelInterfacePortHopVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfacePortHop = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceLowBandwidthLink = types.BoolNull()
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lowBandwidthLink.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lowBandwidthLink.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLowBandwidthLinkVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLowBandwidthLink = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceTunnelTcpMss = types.Int64Null()
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringNull()
- if t := res.Get(path + "tunnel.tunnelTcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.tunnelTcpMssAdjust.value")
- if t.String() == "variable" {
- data.TunnelInterfaceTunnelTcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceTunnelTcpMss = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceClearDontFragment = types.BoolNull()
- data.TunnelInterfaceClearDontFragmentVariable = types.StringNull()
- if t := res.Get(path + "tunnel.clearDontFragment.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.clearDontFragment.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearDontFragmentVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearDontFragment = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceClearNetworkBroadcast = types.BoolNull()
- data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringNull()
- if t := res.Get(path + "tunnel.networkBroadcast.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.networkBroadcast.value")
- if t.String() == "variable" {
- data.TunnelInterfaceClearNetworkBroadcastVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceClearNetworkBroadcast = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceCarrier = types.StringNull()
- data.TunnelInterfaceCarrierVariable = types.StringNull()
- if t := res.Get(path + "tunnel.carrier.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.carrier.value")
- if t.String() == "variable" {
- data.TunnelInterfaceCarrierVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceCarrier = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceBindLoopbackTunnel = types.StringNull()
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringNull()
- if t := res.Get(path + "tunnel.bind.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.bind.value")
- if t.String() == "variable" {
- data.TunnelInterfaceBindLoopbackTunnelVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceBindLoopbackTunnel = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceLastResortCircuit = types.BoolNull()
- data.TunnelInterfaceLastResortCircuitVariable = types.StringNull()
- if t := res.Get(path + "tunnel.lastResortCircuit.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.lastResortCircuit.value")
- if t.String() == "variable" {
- data.TunnelInterfaceLastResortCircuitVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceLastResortCircuit = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceNatRefreshInterval = types.Int64Null()
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.natRefreshInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.natRefreshInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceNatRefreshIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceNatRefreshInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloInterval = types.Int64Null()
- data.TunnelInterfaceHelloIntervalVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloInterval.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloInterval.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloIntervalVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloInterval = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceHelloTolerance = types.Int64Null()
- data.TunnelInterfaceHelloToleranceVariable = types.StringNull()
- if t := res.Get(path + "tunnel.helloTolerance.optionType"); t.Exists() {
- va := res.Get(path + "tunnel.helloTolerance.value")
- if t.String() == "variable" {
- data.TunnelInterfaceHelloToleranceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceHelloTolerance = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceAllowAll = types.BoolNull()
- data.TunnelInterfaceAllowAllVariable = types.StringNull()
- if t := res.Get(path + "allowService.all.optionType"); t.Exists() {
- va := res.Get(path + "allowService.all.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowAllVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowAll = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBgp = types.BoolNull()
- data.TunnelInterfaceAllowBgpVariable = types.StringNull()
- if t := res.Get(path + "allowService.bgp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bgp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBgpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBgp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDhcp = types.BoolNull()
- data.TunnelInterfaceAllowDhcpVariable = types.StringNull()
- if t := res.Get(path + "allowService.dhcp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dhcp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDhcpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDhcp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowDns = types.BoolNull()
- data.TunnelInterfaceAllowDnsVariable = types.StringNull()
- if t := res.Get(path + "allowService.dns.optionType"); t.Exists() {
- va := res.Get(path + "allowService.dns.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowDnsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowDns = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowIcmp = types.BoolNull()
- data.TunnelInterfaceAllowIcmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.icmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.icmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowIcmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowIcmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNetconf = types.BoolNull()
- data.TunnelInterfaceAllowNetconfVariable = types.StringNull()
- if t := res.Get(path + "allowService.netconf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.netconf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNetconfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNetconf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowNtp = types.BoolNull()
- data.TunnelInterfaceAllowNtpVariable = types.StringNull()
- if t := res.Get(path + "allowService.ntp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ntp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowNtpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowNtp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowOspf = types.BoolNull()
- data.TunnelInterfaceAllowOspfVariable = types.StringNull()
- if t := res.Get(path + "allowService.ospf.optionType"); t.Exists() {
- va := res.Get(path + "allowService.ospf.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowOspfVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowOspf = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSsh = types.BoolNull()
- data.TunnelInterfaceAllowSshVariable = types.StringNull()
- if t := res.Get(path + "allowService.sshd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.sshd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSshVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSsh = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowStun = types.BoolNull()
- data.TunnelInterfaceAllowStunVariable = types.StringNull()
- if t := res.Get(path + "allowService.stun.optionType"); t.Exists() {
- va := res.Get(path + "allowService.stun.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowStunVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowStun = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowHttps = types.BoolNull()
- data.TunnelInterfaceAllowHttpsVariable = types.StringNull()
- if t := res.Get(path + "allowService.https.optionType"); t.Exists() {
- va := res.Get(path + "allowService.https.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowHttpsVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowHttps = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowSnmp = types.BoolNull()
- data.TunnelInterfaceAllowSnmpVariable = types.StringNull()
- if t := res.Get(path + "allowService.snmp.optionType"); t.Exists() {
- va := res.Get(path + "allowService.snmp.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowSnmpVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowSnmp = types.BoolValue(va.Bool())
- }
- }
- data.TunnelInterfaceAllowBfd = types.BoolNull()
- data.TunnelInterfaceAllowBfdVariable = types.StringNull()
- if t := res.Get(path + "allowService.bfd.optionType"); t.Exists() {
- va := res.Get(path + "allowService.bfd.value")
- if t.String() == "variable" {
- data.TunnelInterfaceAllowBfdVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceAllowBfd = types.BoolValue(va.Bool())
- }
- }
- for i := range data.TunnelInterfaceEncapsulations {
- keys := [...]string{"encap", "preference"}
- keyValues := [...]string{data.TunnelInterfaceEncapsulations[i].Encapsulation.ValueString(), strconv.FormatInt(data.TunnelInterfaceEncapsulations[i].Preference.ValueInt64(), 10)}
- keyValuesVariables := [...]string{"", data.TunnelInterfaceEncapsulations[i].PreferenceVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "encapsulation").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringNull()
-
- if t := r.Get("encap.optionType"); t.Exists() {
- va := r.Get("encap.value")
- if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Encapsulation = types.StringValue(va.String())
- }
- }
- data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Null()
- data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringNull()
- if t := r.Get("preference.optionType"); t.Exists() {
- va := r.Get("preference.value")
- if t.String() == "variable" {
- data.TunnelInterfaceEncapsulations[i].PreferenceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Preference = types.Int64Value(va.Int())
- }
- }
- data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Null()
- data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringNull()
- if t := r.Get("weight.optionType"); t.Exists() {
- va := r.Get("weight.value")
- if t.String() == "variable" {
- data.TunnelInterfaceEncapsulations[i].WeightVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TunnelInterfaceEncapsulations[i].Weight = types.Int64Value(va.Int())
- }
- }
- }
- data.QosShapingRate = types.Int64Null()
- data.QosShapingRateVariable = types.StringNull()
- if t := res.Get(path + "aclQos.shapingRate.optionType"); t.Exists() {
- va := res.Get(path + "aclQos.shapingRate.value")
- if t.String() == "variable" {
- data.QosShapingRateVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.QosShapingRate = types.Int64Value(va.Int())
- }
- }
- data.TcpMss = types.Int64Null()
- data.TcpMssVariable = types.StringNull()
- if t := res.Get(path + "advanced.tcpMssAdjust.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tcpMssAdjust.value")
- if t.String() == "variable" {
- data.TcpMssVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TcpMss = types.Int64Value(va.Int())
- }
- }
- data.Mtu = types.Int64Null()
- data.MtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.mtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.mtu.value")
- if t.String() == "variable" {
- data.MtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Mtu = types.Int64Value(va.Int())
- }
- }
- data.IpMtu = types.Int64Null()
- data.IpMtuVariable = types.StringNull()
- if t := res.Get(path + "advanced.ipMtu.optionType"); t.Exists() {
- va := res.Get(path + "advanced.ipMtu.value")
- if t.String() == "variable" {
- data.IpMtuVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.IpMtu = types.Int64Value(va.Int())
- }
- }
- data.TlocExtension = types.StringNull()
- data.TlocExtensionVariable = types.StringNull()
- if t := res.Get(path + "advanced.tlocExtension.optionType"); t.Exists() {
- va := res.Get(path + "advanced.tlocExtension.value")
- if t.String() == "variable" {
- data.TlocExtensionVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.TlocExtension = types.StringValue(va.String())
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportWANVPNInterfaceT1E1Serial) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.TransportWanVpnProfileParcelId.IsNull() {
- return false
- }
- if !data.Shutdown.IsNull() {
- return false
- }
- if !data.ShutdownVariable.IsNull() {
- return false
- }
- if !data.InterfaceName.IsNull() {
- return false
- }
- if !data.InterfaceNameVariable.IsNull() {
- return false
- }
- if !data.Ipv4Address.IsNull() {
- return false
- }
- if !data.Ipv4AddressVariable.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMask.IsNull() {
- return false
- }
- if !data.Ipv4SubnetMaskVariable.IsNull() {
- return false
- }
- if !data.Ipv6Address.IsNull() {
- return false
- }
- if !data.Ipv6AddressVariable.IsNull() {
- return false
- }
- if !data.Bandwidth.IsNull() {
- return false
- }
- if !data.BandwidthVariable.IsNull() {
- return false
- }
- if !data.BandwidthDownstream.IsNull() {
- return false
- }
- if !data.BandwidthDownstreamVariable.IsNull() {
- return false
- }
- if !data.ClockRate.IsNull() {
- return false
- }
- if !data.ClockRateVariable.IsNull() {
- return false
- }
- if !data.Encapsulation.IsNull() {
- return false
- }
- if !data.EncapsulationVariable.IsNull() {
- return false
- }
- if !data.TunnelInterface.IsNull() {
- return false
- }
- if !data.PerTunnelQos.IsNull() {
- return false
- }
- if !data.PerTunnelQosVariable.IsNull() {
- return false
- }
- if !data.PerTunnelQosAggregator.IsNull() {
- return false
- }
- if !data.PerTunnelQosAggregatorVariable.IsNull() {
- return false
- }
- if !data.TunnelQosMode.IsNull() {
- return false
- }
- if !data.TunnelQosModeVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColor.IsNull() {
- return false
- }
- if !data.TunnelInterfaceColorVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceRestrict.IsNull() {
- return false
- }
- if !data.TunnelInterfaceRestrictVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGroups.IsNull() {
- return false
- }
- if !data.TunnelInterfaceGroupsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBorder.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBorderVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceMaxControlConnections.IsNull() {
- return false
- }
- if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVbondAsStunServer.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceExcludeControllerGroupList.IsNull() {
- return false
- }
- if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVmanageConnectionPreference.IsNull() {
- return false
- }
- if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfacePortHop.IsNull() {
- return false
- }
- if !data.TunnelInterfacePortHopVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLowBandwidthLink.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceTunnelTcpMss.IsNull() {
- return false
- }
- if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearDontFragment.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearNetworkBroadcast.IsNull() {
- return false
- }
- if !data.TunnelInterfaceClearNetworkBroadcastVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCarrier.IsNull() {
- return false
- }
- if !data.TunnelInterfaceCarrierVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBindLoopbackTunnel.IsNull() {
- return false
- }
- if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLastResortCircuit.IsNull() {
- return false
- }
- if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNatRefreshInterval.IsNull() {
- return false
- }
- if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloInterval.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloIntervalVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloTolerance.IsNull() {
- return false
- }
- if !data.TunnelInterfaceHelloToleranceVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowAll.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowAllVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBgp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBgpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDhcp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDhcpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDns.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowDnsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowIcmp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowIcmpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNetconf.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNetconfVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNtp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowNtpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowOspf.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowOspfVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSsh.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSshVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowStun.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowStunVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowHttps.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowHttpsVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSnmp.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowSnmpVariable.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBfd.IsNull() {
- return false
- }
- if !data.TunnelInterfaceAllowBfdVariable.IsNull() {
- return false
- }
- if len(data.TunnelInterfaceEncapsulations) > 0 {
- return false
- }
- if !data.QosShapingRate.IsNull() {
- return false
- }
- if !data.QosShapingRateVariable.IsNull() {
- return false
- }
- if !data.TcpMss.IsNull() {
- return false
- }
- if !data.TcpMssVariable.IsNull() {
- return false
- }
- if !data.Mtu.IsNull() {
- return false
- }
- if !data.MtuVariable.IsNull() {
- return false
- }
- if !data.IpMtu.IsNull() {
- return false
- }
- if !data.IpMtuVariable.IsNull() {
- return false
- }
- if !data.TlocExtension.IsNull() {
- return false
- }
- if !data.TlocExtensionVariable.IsNull() {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go
deleted file mode 100644
index 5d2bec62a..000000000
--- a/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go
+++ /dev/null
@@ -1,1278 +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/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework/types"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-)
-
-// End of section. //template:end imports
-
-// Section below is generated&owned by "gen/generator.go". //template:begin types
-type TransportWANVPN 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"`
- Vpn types.Int64 `tfsdk:"vpn"`
- EnhanceEcmpKeying types.Bool `tfsdk:"enhance_ecmp_keying"`
- EnhanceEcmpKeyingVariable types.String `tfsdk:"enhance_ecmp_keying_variable"`
- PrimaryDnsAddressIpv4 types.String `tfsdk:"primary_dns_address_ipv4"`
- PrimaryDnsAddressIpv4Variable types.String `tfsdk:"primary_dns_address_ipv4_variable"`
- SecondaryDnsAddressIpv4 types.String `tfsdk:"secondary_dns_address_ipv4"`
- SecondaryDnsAddressIpv4Variable types.String `tfsdk:"secondary_dns_address_ipv4_variable"`
- PrimaryDnsAddressIpv6 types.String `tfsdk:"primary_dns_address_ipv6"`
- PrimaryDnsAddressIpv6Variable types.String `tfsdk:"primary_dns_address_ipv6_variable"`
- SecondaryDnsAddressIpv6 types.String `tfsdk:"secondary_dns_address_ipv6"`
- SecondaryDnsAddressIpv6Variable types.String `tfsdk:"secondary_dns_address_ipv6_variable"`
- NewHostMappings []TransportWANVPNNewHostMappings `tfsdk:"new_host_mappings"`
- Ipv4StaticRoutes []TransportWANVPNIpv4StaticRoutes `tfsdk:"ipv4_static_routes"`
- Ipv6StaticRoutes []TransportWANVPNIpv6StaticRoutes `tfsdk:"ipv6_static_routes"`
- Services []TransportWANVPNServices `tfsdk:"services"`
- Nat64V4Pools []TransportWANVPNNat64V4Pools `tfsdk:"nat_64_v4_pools"`
-}
-
-type TransportWANVPNNewHostMappings struct {
- HostName types.String `tfsdk:"host_name"`
- HostNameVariable types.String `tfsdk:"host_name_variable"`
- ListOfIpAddresses types.Set `tfsdk:"list_of_ip_addresses"`
- ListOfIpAddressesVariable types.String `tfsdk:"list_of_ip_addresses_variable"`
-}
-
-type TransportWANVPNIpv4StaticRoutes struct {
- NetworkAddress types.String `tfsdk:"network_address"`
- NetworkAddressVariable types.String `tfsdk:"network_address_variable"`
- SubnetMask types.String `tfsdk:"subnet_mask"`
- SubnetMaskVariable types.String `tfsdk:"subnet_mask_variable"`
- Gateway types.String `tfsdk:"gateway"`
- NextHops []TransportWANVPNIpv4StaticRoutesNextHops `tfsdk:"next_hops"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-
-type TransportWANVPNIpv6StaticRoutes struct {
- Prefix types.String `tfsdk:"prefix"`
- PrefixVariable types.String `tfsdk:"prefix_variable"`
- NextHops []TransportWANVPNIpv6StaticRoutesNextHops `tfsdk:"next_hops"`
- Null0 types.Bool `tfsdk:"null0"`
- Nat types.String `tfsdk:"nat"`
- NatVariable types.String `tfsdk:"nat_variable"`
-}
-
-type TransportWANVPNServices struct {
- ServiceType types.String `tfsdk:"service_type"`
-}
-
-type TransportWANVPNNat64V4Pools struct {
- Nat64V4PoolName types.String `tfsdk:"nat64_v4_pool_name"`
- Nat64V4PoolNameVariable types.String `tfsdk:"nat64_v4_pool_name_variable"`
- Nat64V4PoolRangeStart types.String `tfsdk:"nat64_v4_pool_range_start"`
- Nat64V4PoolRangeStartVariable types.String `tfsdk:"nat64_v4_pool_range_start_variable"`
- Nat64V4PoolRangeEnd types.String `tfsdk:"nat64_v4_pool_range_end"`
- Nat64V4PoolRangeEndVariable types.String `tfsdk:"nat64_v4_pool_range_end_variable"`
- Nat64V4PoolOverload types.Bool `tfsdk:"nat64_v4_pool_overload"`
- Nat64V4PoolOverloadVariable types.String `tfsdk:"nat64_v4_pool_overload_variable"`
-}
-
-type TransportWANVPNIpv4StaticRoutesNextHops struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-
-type TransportWANVPNIpv6StaticRoutesNextHops struct {
- Address types.String `tfsdk:"address"`
- AddressVariable types.String `tfsdk:"address_variable"`
- AdministrativeDistance types.Int64 `tfsdk:"administrative_distance"`
- AdministrativeDistanceVariable types.String `tfsdk:"administrative_distance_variable"`
-}
-
-// End of section. //template:end types
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getModel
-func (data TransportWANVPN) getModel() string {
- return "transport_wan_vpn"
-}
-
-// End of section. //template:end getModel
-
-// Section below is generated&owned by "gen/generator.go". //template:begin getPath
-func (data TransportWANVPN) getPath() string {
- return fmt.Sprintf("/v1/feature-profile/sdwan/transport/%v/wan/vpn", 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 TransportWANVPN) toBody(ctx context.Context) string {
- body := ""
- body, _ = sjson.Set(body, "name", data.Name.ValueString())
- body, _ = sjson.Set(body, "description", data.Description.ValueString())
- path := "data."
- if data.Vpn.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"vpnId.optionType", "default")
- body, _ = sjson.Set(body, path+"vpnId.value", 0)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"vpnId.optionType", "global")
- body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64())
- }
- }
-
- if !data.EnhanceEcmpKeyingVariable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "variable")
- body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeyingVariable.ValueString())
- }
- } else if data.EnhanceEcmpKeying.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "default")
- body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", false)
- }
- } else {
- if true {
- body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "global")
- body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeying.ValueBool())
- }
- }
-
- if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString())
- }
- } else if !data.PrimaryDnsAddressIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString())
- }
- }
-
- if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString())
- }
- } else if !data.SecondaryDnsAddressIpv4.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString())
- }
- }
-
- if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString())
- }
- } else if !data.PrimaryDnsAddressIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString())
- }
- }
-
- if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable")
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString())
- }
- } else if !data.SecondaryDnsAddressIpv6.IsNull() {
- if true {
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global")
- body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString())
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{})
- for _, item := range data.NewHostMappings {
- itemBody := ""
-
- if !item.HostNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString())
- }
- } else if !item.HostName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString())
- }
- }
-
- if !item.ListOfIpAddressesVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString())
- }
- } else if !item.ListOfIpAddresses.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global")
- var values []string
- item.ListOfIpAddresses.ElementsAs(ctx, &values, false)
- itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values)
- }
- }
- body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{})
- for _, item := range data.Ipv4StaticRoutes {
- itemBody := ""
-
- if !item.NetworkAddressVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString())
- }
- } else if !item.NetworkAddress.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString())
- }
- }
-
- if !item.SubnetMaskVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString())
- }
- } else if !item.SubnetMask.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString())
- }
- }
- if item.Gateway.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop")
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString())
- }
- }
- if true && item.Gateway.ValueString() == "nextHop" {
- itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{})
- for _, childItem := range item.NextHops {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AdministrativeDistanceVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
- }
- } else if childItem.AdministrativeDistance.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1)
- }
- } else {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody)
- }
- }
-
- if !item.AdministrativeDistanceVariable.IsNull() {
- if true && item.Gateway.ValueString() == "null0" {
- itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString())
- }
- } else if item.AdministrativeDistance.IsNull() {
- if true && item.Gateway.ValueString() == "null0" {
- itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "distance.value", 1)
- }
- } else {
- if true && item.Gateway.ValueString() == "null0" {
- itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{})
- for _, item := range data.Ipv6StaticRoutes {
- itemBody := ""
-
- if !item.PrefixVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString())
- }
- } else if !item.Prefix.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString())
- }
- }
- if true {
-
- for _, childItem := range item.NextHops {
- itemChildBody := ""
-
- if !childItem.AddressVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString())
- }
- } else if !childItem.Address.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString())
- }
- }
-
- if !childItem.AdministrativeDistanceVariable.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString())
- }
- } else if !childItem.AdministrativeDistance.IsNull() {
- if true {
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global")
- itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64())
- }
- }
- itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody)
- }
- }
- if !item.Null0.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool())
- }
- }
-
- if !item.NatVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString())
- }
- } else if !item.Nat.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"service", []interface{}{})
- for _, item := range data.Services {
- itemBody := ""
- if !item.ServiceType.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString())
- }
- }
- body, _ = sjson.SetRaw(body, path+"service.-1", itemBody)
- }
- }
- if true {
- body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{})
- for _, item := range data.Nat64V4Pools {
- itemBody := ""
-
- if !item.Nat64V4PoolNameVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolNameVariable.ValueString())
- }
- } else if !item.Nat64V4PoolName.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolName.ValueString())
- }
- }
-
- if !item.Nat64V4PoolRangeStartVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStartVariable.ValueString())
- }
- } else if !item.Nat64V4PoolRangeStart.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStart.ValueString())
- }
- }
-
- if !item.Nat64V4PoolRangeEndVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEndVariable.ValueString())
- }
- } else if !item.Nat64V4PoolRangeEnd.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEnd.ValueString())
- }
- }
-
- if !item.Nat64V4PoolOverloadVariable.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverloadVariable.ValueString())
- }
- } else if item.Nat64V4PoolOverload.IsNull() {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false)
- }
- } else {
- if true {
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global")
- itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverload.ValueBool())
- }
- }
- body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody)
- }
- }
- return body
-}
-
-// End of section. //template:end toBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
-func (data *TransportWANVPN) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Vpn = types.Int64Null()
-
- if t := res.Get(path + "vpnId.optionType"); t.Exists() {
- va := res.Get(path + "vpnId.value")
- if t.String() == "global" {
- data.Vpn = types.Int64Value(va.Int())
- }
- }
- data.EnhanceEcmpKeying = types.BoolNull()
- data.EnhanceEcmpKeyingVariable = types.StringNull()
- if t := res.Get(path + "enhanceEcmpKeying.optionType"); t.Exists() {
- va := res.Get(path + "enhanceEcmpKeying.value")
- if t.String() == "variable" {
- data.EnhanceEcmpKeyingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.EnhanceEcmpKeying = types.BoolValue(va.Bool())
- }
- }
- data.PrimaryDnsAddressIpv4 = types.StringNull()
- data.PrimaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv4 = types.StringNull()
- data.SecondaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv6 = types.StringNull()
- data.PrimaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv6 = types.StringNull()
- data.SecondaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- if value := res.Get(path + "newHostMapping"); value.Exists() {
- data.NewHostMappings = make([]TransportWANVPNNewHostMappings, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNNewHostMappings{}
- item.HostName = types.StringNull()
- item.HostNameVariable = types.StringNull()
- if t := v.Get("hostName.optionType"); t.Exists() {
- va := v.Get("hostName.value")
- if t.String() == "variable" {
- item.HostNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.HostName = types.StringValue(va.String())
- }
- }
- item.ListOfIpAddresses = types.SetNull(types.StringType)
- item.ListOfIpAddressesVariable = types.StringNull()
- if t := v.Get("listOfIp.optionType"); t.Exists() {
- va := v.Get("listOfIp.value")
- if t.String() == "variable" {
- item.ListOfIpAddressesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.ListOfIpAddresses = helpers.GetStringSet(va.Array())
- }
- }
- data.NewHostMappings = append(data.NewHostMappings, item)
- return true
- })
- }
- if value := res.Get(path + "ipv4Route"); value.Exists() {
- data.Ipv4StaticRoutes = make([]TransportWANVPNIpv4StaticRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNIpv4StaticRoutes{}
- item.NetworkAddress = types.StringNull()
- item.NetworkAddressVariable = types.StringNull()
- if t := v.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := v.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- item.NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.NetworkAddress = types.StringValue(va.String())
- }
- }
- item.SubnetMask = types.StringNull()
- item.SubnetMaskVariable = types.StringNull()
- if t := v.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := v.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- item.SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.SubnetMask = types.StringValue(va.String())
- }
- }
- item.Gateway = types.StringNull()
-
- if t := v.Get("gateway.optionType"); t.Exists() {
- va := v.Get("gateway.value")
- if t.String() == "global" {
- item.Gateway = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("nextHop"); cValue.Exists() {
- item.NextHops = make([]TransportWANVPNIpv4StaticRoutesNextHops, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := TransportWANVPNIpv4StaticRoutesNextHops{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AdministrativeDistance = types.Int64Null()
- cItem.AdministrativeDistanceVariable = types.StringNull()
- if t := cv.Get("distance.optionType"); t.Exists() {
- va := cv.Get("distance.value")
- if t.String() == "variable" {
- cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- item.NextHops = append(item.NextHops, cItem)
- return true
- })
- }
- item.AdministrativeDistance = types.Int64Null()
- item.AdministrativeDistanceVariable = types.StringNull()
- if t := v.Get("distance.optionType"); t.Exists() {
- va := v.Get("distance.value")
- if t.String() == "variable" {
- item.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- data.Ipv4StaticRoutes = append(data.Ipv4StaticRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "ipv6Route"); value.Exists() {
- data.Ipv6StaticRoutes = make([]TransportWANVPNIpv6StaticRoutes, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNIpv6StaticRoutes{}
- item.Prefix = types.StringNull()
- item.PrefixVariable = types.StringNull()
- if t := v.Get("prefix.optionType"); t.Exists() {
- va := v.Get("prefix.value")
- if t.String() == "variable" {
- item.PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Prefix = types.StringValue(va.String())
- }
- }
- if cValue := v.Get("oneOfIpRoute.nextHopContainer.nextHop"); cValue.Exists() {
- item.NextHops = make([]TransportWANVPNIpv6StaticRoutesNextHops, 0)
- cValue.ForEach(func(ck, cv gjson.Result) bool {
- cItem := TransportWANVPNIpv6StaticRoutesNextHops{}
- cItem.Address = types.StringNull()
- cItem.AddressVariable = types.StringNull()
- if t := cv.Get("address.optionType"); t.Exists() {
- va := cv.Get("address.value")
- if t.String() == "variable" {
- cItem.AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.Address = types.StringValue(va.String())
- }
- }
- cItem.AdministrativeDistance = types.Int64Null()
- cItem.AdministrativeDistanceVariable = types.StringNull()
- if t := cv.Get("distance.optionType"); t.Exists() {
- va := cv.Get("distance.value")
- if t.String() == "variable" {
- cItem.AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- cItem.AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- item.NextHops = append(item.NextHops, cItem)
- return true
- })
- }
- item.Null0 = types.BoolNull()
-
- if t := v.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- item.Null0 = types.BoolValue(va.Bool())
- }
- }
- item.Nat = types.StringNull()
- item.NatVariable = types.StringNull()
- if t := v.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
- va := v.Get("oneOfIpRoute.nat.value")
- if t.String() == "variable" {
- item.NatVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Nat = types.StringValue(va.String())
- }
- }
- data.Ipv6StaticRoutes = append(data.Ipv6StaticRoutes, item)
- return true
- })
- }
- if value := res.Get(path + "service"); value.Exists() {
- data.Services = make([]TransportWANVPNServices, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNServices{}
- item.ServiceType = types.StringNull()
-
- if t := v.Get("serviceType.optionType"); t.Exists() {
- va := v.Get("serviceType.value")
- if t.String() == "global" {
- item.ServiceType = types.StringValue(va.String())
- }
- }
- data.Services = append(data.Services, item)
- return true
- })
- }
- if value := res.Get(path + "nat64V4Pool"); value.Exists() {
- data.Nat64V4Pools = make([]TransportWANVPNNat64V4Pools, 0)
- value.ForEach(func(k, v gjson.Result) bool {
- item := TransportWANVPNNat64V4Pools{}
- item.Nat64V4PoolName = types.StringNull()
- item.Nat64V4PoolNameVariable = types.StringNull()
- if t := v.Get("nat64V4PoolName.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolName.value")
- if t.String() == "variable" {
- item.Nat64V4PoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Nat64V4PoolName = types.StringValue(va.String())
- }
- }
- item.Nat64V4PoolRangeStart = types.StringNull()
- item.Nat64V4PoolRangeStartVariable = types.StringNull()
- if t := v.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolRangeStart.value")
- if t.String() == "variable" {
- item.Nat64V4PoolRangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Nat64V4PoolRangeStart = types.StringValue(va.String())
- }
- }
- item.Nat64V4PoolRangeEnd = types.StringNull()
- item.Nat64V4PoolRangeEndVariable = types.StringNull()
- if t := v.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolRangeEnd.value")
- if t.String() == "variable" {
- item.Nat64V4PoolRangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Nat64V4PoolRangeEnd = types.StringValue(va.String())
- }
- }
- item.Nat64V4PoolOverload = types.BoolNull()
- item.Nat64V4PoolOverloadVariable = types.StringNull()
- if t := v.Get("nat64V4PoolOverload.optionType"); t.Exists() {
- va := v.Get("nat64V4PoolOverload.value")
- if t.String() == "variable" {
- item.Nat64V4PoolOverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- item.Nat64V4PoolOverload = types.BoolValue(va.Bool())
- }
- }
- data.Nat64V4Pools = append(data.Nat64V4Pools, item)
- return true
- })
- }
-}
-
-// End of section. //template:end fromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
-func (data *TransportWANVPN) 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())
- } else {
- data.Description = types.StringNull()
- }
- path := "payload.data."
- data.Vpn = types.Int64Null()
-
- if t := res.Get(path + "vpnId.optionType"); t.Exists() {
- va := res.Get(path + "vpnId.value")
- if t.String() == "global" {
- data.Vpn = types.Int64Value(va.Int())
- }
- }
- data.EnhanceEcmpKeying = types.BoolNull()
- data.EnhanceEcmpKeyingVariable = types.StringNull()
- if t := res.Get(path + "enhanceEcmpKeying.optionType"); t.Exists() {
- va := res.Get(path + "enhanceEcmpKeying.value")
- if t.String() == "variable" {
- data.EnhanceEcmpKeyingVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.EnhanceEcmpKeying = types.BoolValue(va.Bool())
- }
- }
- data.PrimaryDnsAddressIpv4 = types.StringNull()
- data.PrimaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.primaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv4 = types.StringNull()
- data.SecondaryDnsAddressIpv4Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv4.secondaryDnsAddressIpv4.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv4Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv4 = types.StringValue(va.String())
- }
- }
- data.PrimaryDnsAddressIpv6 = types.StringNull()
- data.PrimaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.primaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.PrimaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.PrimaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- data.SecondaryDnsAddressIpv6 = types.StringNull()
- data.SecondaryDnsAddressIpv6Variable = types.StringNull()
- if t := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.optionType"); t.Exists() {
- va := res.Get(path + "dnsIpv6.secondaryDnsAddressIpv6.value")
- if t.String() == "variable" {
- data.SecondaryDnsAddressIpv6Variable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.SecondaryDnsAddressIpv6 = types.StringValue(va.String())
- }
- }
- for i := range data.NewHostMappings {
- keys := [...]string{"hostName"}
- keyValues := [...]string{data.NewHostMappings[i].HostName.ValueString()}
- keyValuesVariables := [...]string{data.NewHostMappings[i].HostNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "newHostMapping").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.NewHostMappings[i].HostName = types.StringNull()
- data.NewHostMappings[i].HostNameVariable = types.StringNull()
- if t := r.Get("hostName.optionType"); t.Exists() {
- va := r.Get("hostName.value")
- if t.String() == "variable" {
- data.NewHostMappings[i].HostNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NewHostMappings[i].HostName = types.StringValue(va.String())
- }
- }
- data.NewHostMappings[i].ListOfIpAddresses = types.SetNull(types.StringType)
- data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringNull()
- if t := r.Get("listOfIp.optionType"); t.Exists() {
- va := r.Get("listOfIp.value")
- if t.String() == "variable" {
- data.NewHostMappings[i].ListOfIpAddressesVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.NewHostMappings[i].ListOfIpAddresses = helpers.GetStringSet(va.Array())
- }
- }
- }
- for i := range data.Ipv4StaticRoutes {
- keys := [...]string{"prefix.ipAddress", "prefix.subnetMask", "gateway"}
- keyValues := [...]string{data.Ipv4StaticRoutes[i].NetworkAddress.ValueString(), data.Ipv4StaticRoutes[i].SubnetMask.ValueString(), data.Ipv4StaticRoutes[i].Gateway.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NetworkAddressVariable.ValueString(), data.Ipv4StaticRoutes[i].SubnetMaskVariable.ValueString(), ""}
-
- var r gjson.Result
- res.Get(path + "ipv4Route").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv4StaticRoutes[i].NetworkAddress = types.StringNull()
- data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringNull()
- if t := r.Get("prefix.ipAddress.optionType"); t.Exists() {
- va := r.Get("prefix.ipAddress.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NetworkAddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NetworkAddress = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].SubnetMask = types.StringNull()
- data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringNull()
- if t := r.Get("prefix.subnetMask.optionType"); t.Exists() {
- va := r.Get("prefix.subnetMask.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].SubnetMaskVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].SubnetMask = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].Gateway = types.StringNull()
-
- if t := r.Get("gateway.optionType"); t.Exists() {
- va := r.Get("gateway.value")
- if t.String() == "global" {
- data.Ipv4StaticRoutes[i].Gateway = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv4StaticRoutes[i].NextHops {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("nextHop").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringNull()
- data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
- if t := cr.Get("distance.optionType"); t.Exists() {
- va := cr.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Null()
- data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringNull()
- if t := r.Get("distance.optionType"); t.Exists() {
- va := r.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv4StaticRoutes[i].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv4StaticRoutes[i].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- for i := range data.Ipv6StaticRoutes {
- keys := [...]string{"prefix"}
- keyValues := [...]string{data.Ipv6StaticRoutes[i].Prefix.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].PrefixVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "ipv6Route").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Ipv6StaticRoutes[i].Prefix = types.StringNull()
- data.Ipv6StaticRoutes[i].PrefixVariable = types.StringNull()
- if t := r.Get("prefix.optionType"); t.Exists() {
- va := r.Get("prefix.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].PrefixVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Prefix = types.StringValue(va.String())
- }
- }
- for ci := range data.Ipv6StaticRoutes[i].NextHops {
- keys := [...]string{"address"}
- keyValues := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].Address.ValueString()}
- keyValuesVariables := [...]string{data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable.ValueString()}
-
- var cr gjson.Result
- r.Get("oneOfIpRoute.nextHopContainer.nextHop").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- cr = v
- return false
- }
- return true
- },
- )
- data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringNull()
- data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringNull()
- if t := cr.Get("address.optionType"); t.Exists() {
- va := cr.Get("address.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AddressVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].NextHops[ci].Address = types.StringValue(va.String())
- }
- }
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Null()
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringNull()
- if t := cr.Get("distance.optionType"); t.Exists() {
- va := cr.Get("distance.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistanceVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].NextHops[ci].AdministrativeDistance = types.Int64Value(va.Int())
- }
- }
- }
- data.Ipv6StaticRoutes[i].Null0 = types.BoolNull()
-
- if t := r.Get("oneOfIpRoute.null0.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.null0.value")
- if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Null0 = types.BoolValue(va.Bool())
- }
- }
- data.Ipv6StaticRoutes[i].Nat = types.StringNull()
- data.Ipv6StaticRoutes[i].NatVariable = types.StringNull()
- if t := r.Get("oneOfIpRoute.nat.optionType"); t.Exists() {
- va := r.Get("oneOfIpRoute.nat.value")
- if t.String() == "variable" {
- data.Ipv6StaticRoutes[i].NatVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Ipv6StaticRoutes[i].Nat = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Services {
- keys := [...]string{"serviceType"}
- keyValues := [...]string{data.Services[i].ServiceType.ValueString()}
- keyValuesVariables := [...]string{""}
-
- var r gjson.Result
- res.Get(path + "service").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Services[i].ServiceType = types.StringNull()
-
- if t := r.Get("serviceType.optionType"); t.Exists() {
- va := r.Get("serviceType.value")
- if t.String() == "global" {
- data.Services[i].ServiceType = types.StringValue(va.String())
- }
- }
- }
- for i := range data.Nat64V4Pools {
- keys := [...]string{"nat64V4PoolName"}
- keyValues := [...]string{data.Nat64V4Pools[i].Nat64V4PoolName.ValueString()}
- keyValuesVariables := [...]string{data.Nat64V4Pools[i].Nat64V4PoolNameVariable.ValueString()}
-
- var r gjson.Result
- res.Get(path + "nat64V4Pool").ForEach(
- func(_, v gjson.Result) bool {
- found := false
- for ik := range keys {
- tt := v.Get(keys[ik] + ".optionType").String()
- vv := v.Get(keys[ik] + ".value").String()
- if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) {
- found = true
- continue
- }
- found = false
- break
- }
- if found {
- r = v
- return false
- }
- return true
- },
- )
- data.Nat64V4Pools[i].Nat64V4PoolName = types.StringNull()
- data.Nat64V4Pools[i].Nat64V4PoolNameVariable = types.StringNull()
- if t := r.Get("nat64V4PoolName.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolName.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].Nat64V4PoolNameVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].Nat64V4PoolName = types.StringValue(va.String())
- }
- }
- data.Nat64V4Pools[i].Nat64V4PoolRangeStart = types.StringNull()
- data.Nat64V4Pools[i].Nat64V4PoolRangeStartVariable = types.StringNull()
- if t := r.Get("nat64V4PoolRangeStart.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolRangeStart.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].Nat64V4PoolRangeStartVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].Nat64V4PoolRangeStart = types.StringValue(va.String())
- }
- }
- data.Nat64V4Pools[i].Nat64V4PoolRangeEnd = types.StringNull()
- data.Nat64V4Pools[i].Nat64V4PoolRangeEndVariable = types.StringNull()
- if t := r.Get("nat64V4PoolRangeEnd.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolRangeEnd.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].Nat64V4PoolRangeEndVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].Nat64V4PoolRangeEnd = types.StringValue(va.String())
- }
- }
- data.Nat64V4Pools[i].Nat64V4PoolOverload = types.BoolNull()
- data.Nat64V4Pools[i].Nat64V4PoolOverloadVariable = types.StringNull()
- if t := r.Get("nat64V4PoolOverload.optionType"); t.Exists() {
- va := r.Get("nat64V4PoolOverload.value")
- if t.String() == "variable" {
- data.Nat64V4Pools[i].Nat64V4PoolOverloadVariable = types.StringValue(va.String())
- } else if t.String() == "global" {
- data.Nat64V4Pools[i].Nat64V4PoolOverload = types.BoolValue(va.Bool())
- }
- }
- }
-}
-
-// End of section. //template:end updateFromBody
-
-// Section below is generated&owned by "gen/generator.go". //template:begin isNull
-func (data *TransportWANVPN) isNull(ctx context.Context, res gjson.Result) bool {
- if !data.FeatureProfileId.IsNull() {
- return false
- }
- if !data.Vpn.IsNull() {
- return false
- }
- if !data.EnhanceEcmpKeying.IsNull() {
- return false
- }
- if !data.EnhanceEcmpKeyingVariable.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv4.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv4Variable.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv4.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv4Variable.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv6.IsNull() {
- return false
- }
- if !data.PrimaryDnsAddressIpv6Variable.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv6.IsNull() {
- return false
- }
- if !data.SecondaryDnsAddressIpv6Variable.IsNull() {
- return false
- }
- if len(data.NewHostMappings) > 0 {
- return false
- }
- if len(data.Ipv4StaticRoutes) > 0 {
- return false
- }
- if len(data.Ipv6StaticRoutes) > 0 {
- return false
- }
- if len(data.Services) > 0 {
- return false
- }
- if len(data.Nat64V4Pools) > 0 {
- return false
- }
- return true
-}
-
-// End of section. //template:end isNull
diff --git a/internal/provider/provider.go b/internal/provider/provider.go
index c9ea78d27..2f0e988bf 100644
--- a/internal/provider/provider.go
+++ b/internal/provider/provider.go
@@ -282,13 +282,52 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc
NewVPNInterfaceDSLPPPoEFeatureTemplateResource,
NewVPNInterfaceSVIFeatureTemplateResource,
NewVPNInterfaceT1E1SerialFeatureTemplateResource,
- NewApplicationPriorityQoSPolicyProfileParcelResource,
+ NewApplicationPriorityQoSProfileParcelResource,
+ NewOtherThousandEyesProfileParcelResource,
+ NewOtherUCSEProfileParcelResource,
+ NewPolicyObjectAppProbeClassProfileParcelResource,
+ NewPolicyObjectApplicationListProfileParcelResource,
+ NewPolicyObjectASPathListProfileParcelResource,
+ NewPolicyObjectClassMapProfileParcelResource,
+ NewPolicyObjectColorListProfileParcelResource,
+ NewPolicyObjectDataIPv4PrefixListProfileParcelResource,
+ NewPolicyObjectDataIPv6PrefixListProfileParcelResource,
+ NewPolicyObjectExpandedCommunityListProfileParcelResource,
+ NewPolicyObjectExtendedCommunityListProfileParcelResource,
+ NewPolicyObjectIPv4PrefixListProfileParcelResource,
+ NewPolicyObjectIPv6PrefixListProfileParcelResource,
+ NewPolicyObjectMirrorProfileParcelResource,
+ NewPolicyObjectPolicerProfileParcelResource,
+ NewPolicyObjectPreferredColorGroupProfileParcelResource,
+ NewPolicyObjectSecurityDataIPv4PrefixListProfileParcelResource,
+ NewPolicyObjectSecurityFQDNListProfileParcelResource,
+ NewPolicyObjectSecurityGeolocationListProfileParcelResource,
+ NewPolicyObjectSecurityIdentityListProfileParcelResource,
+ NewPolicyObjectSecurityIPSSignatureProfileParcelResource,
+ NewPolicyObjectSecurityLocalApplicationListProfileParcelResource,
+ NewPolicyObjectSecurityLocalDomainListProfileParcelResource,
+ NewPolicyObjectSecurityPortListProfileParcelResource,
+ NewPolicyObjectSecurityScalableGroupTagListProfileParcelResource,
+ NewPolicyObjectSecurityURLListProfileParcelResource,
+ NewPolicyObjectSLAClassListProfileParcelResource,
+ NewPolicyObjectStandardCommunityListProfileParcelResource,
+ NewPolicyObjectTLOCListProfileParcelResource,
+ NewPolicyObjectVPNGroupProfileParcelResource,
NewServiceLANVPNProfileParcelResource,
NewServiceLANVPNInterfaceEthernetProfileParcelResource,
NewServiceLANVPNInterfaceGREProfileParcelResource,
NewServiceLANVPNInterfaceIPSecProfileParcelResource,
NewServiceLANVPNInterfaceSVIProfileParcelResource,
+ NewServiceObjectTrackerProfileParcelResource,
+ NewServiceObjectTrackerGroupProfileParcelResource,
+ NewServiceRoutePolicyProfileParcelResource,
+ NewServiceRoutingBGPProfileParcelResource,
+ NewServiceRoutingOSPFProfileParcelResource,
+ NewServiceRoutingOSPFv3IPv4ProfileParcelResource,
+ NewServiceRoutingOSPFv3IPv6ProfileParcelResource,
+ NewServiceSwitchportProfileParcelResource,
NewServiceTrackerProfileParcelResource,
+ NewServiceTrackerGroupProfileParcelResource,
NewSystemAAAProfileParcelResource,
NewSystemBannerProfileParcelResource,
NewSystemBasicProfileParcelResource,
@@ -305,10 +344,18 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc
NewSystemRemoteAccessProfileParcelResource,
NewSystemSecurityProfileParcelResource,
NewSystemSNMPProfileParcelResource,
+ NewTransportGPSProfileParcelResource,
NewTransportIPv6TrackerProfileParcelResource,
+ NewTransportIPv6TrackerGroupProfileParcelResource,
NewTransportManagementVPNProfileParcelResource,
NewTransportManagementVPNInterfaceEthernetProfileParcelResource,
+ NewTransportRoutePolicyProfileParcelResource,
NewTransportRoutingBGPProfileParcelResource,
+ NewTransportRoutingOSPFProfileParcelResource,
+ NewTransportRoutingOSPFv3IPv4ProfileParcelResource,
+ NewTransportRoutingOSPFv3IPv6ProfileParcelResource,
+ NewTransportTrackerProfileParcelResource,
+ NewTransportTrackerGroupProfileParcelResource,
NewTransportWANVPNProfileParcelResource,
NewTransportWANVPNInterfaceCellularProfileParcelResource,
NewTransportWANVPNInterfaceEthernetProfileParcelResource,
@@ -327,7 +374,7 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc
NewCentralizedPolicyResource,
NewCflowdPolicyDefinitionResource,
NewClassMapPolicyObjectResource,
- NewCLIConfigProfileParcelResource,
+ NewCLIConfigFeatureResource,
NewCLIDeviceTemplateResource,
NewCLIFeatureProfileResource,
NewColorListPolicyObjectResource,
@@ -336,8 +383,10 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc
NewDataFQDNPrefixListPolicyObjectResource,
NewDataIPv4PrefixListPolicyObjectResource,
NewDataIPv6PrefixListPolicyObjectResource,
+ NewDNSSecurityFeatureProfileResource,
NewDNSSecurityPolicyDefinitionResource,
NewDomainListPolicyObjectResource,
+ NewEmbeddedSecurityFeatureProfileResource,
NewExpandedCommunityListPolicyObjectResource,
NewExtendedCommunityListPolicyObjectResource,
NewFeatureDeviceTemplateResource,
@@ -356,7 +405,9 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc
NewMeshTopologyPolicyDefinitionResource,
NewMirrorPolicyObjectResource,
NewObjectGroupPolicyDefinitionResource,
+ NewOtherFeatureProfileResource,
NewPolicerPolicyObjectResource,
+ NewPolicyObjectFeatureProfileResource,
NewPortListPolicyObjectResource,
NewPreferredColorGroupPolicyObjectResource,
NewProtocolListPolicyObjectResource,
@@ -367,6 +418,7 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc
NewRuleSetPolicyDefinitionResource,
NewSecurityPolicyResource,
NewServiceFeatureProfileResource,
+ NewSIGSecurityFeatureProfileResource,
NewSiteListPolicyObjectResource,
NewSLAClassPolicyObjectResource,
NewStandardCommunityListPolicyObjectResource,
@@ -430,13 +482,52 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat
NewVPNInterfaceDSLPPPoEFeatureTemplateDataSource,
NewVPNInterfaceSVIFeatureTemplateDataSource,
NewVPNInterfaceT1E1SerialFeatureTemplateDataSource,
- NewApplicationPriorityQoSPolicyProfileParcelDataSource,
+ NewApplicationPriorityQoSProfileParcelDataSource,
+ NewOtherThousandEyesProfileParcelDataSource,
+ NewOtherUCSEProfileParcelDataSource,
+ NewPolicyObjectAppProbeClassProfileParcelDataSource,
+ NewPolicyObjectApplicationListProfileParcelDataSource,
+ NewPolicyObjectASPathListProfileParcelDataSource,
+ NewPolicyObjectClassMapProfileParcelDataSource,
+ NewPolicyObjectColorListProfileParcelDataSource,
+ NewPolicyObjectDataIPv4PrefixListProfileParcelDataSource,
+ NewPolicyObjectDataIPv6PrefixListProfileParcelDataSource,
+ NewPolicyObjectExpandedCommunityListProfileParcelDataSource,
+ NewPolicyObjectExtendedCommunityListProfileParcelDataSource,
+ NewPolicyObjectIPv4PrefixListProfileParcelDataSource,
+ NewPolicyObjectIPv6PrefixListProfileParcelDataSource,
+ NewPolicyObjectMirrorProfileParcelDataSource,
+ NewPolicyObjectPolicerProfileParcelDataSource,
+ NewPolicyObjectPreferredColorGroupProfileParcelDataSource,
+ NewPolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource,
+ NewPolicyObjectSecurityFQDNListProfileParcelDataSource,
+ NewPolicyObjectSecurityGeolocationListProfileParcelDataSource,
+ NewPolicyObjectSecurityIdentityListProfileParcelDataSource,
+ NewPolicyObjectSecurityIPSSignatureProfileParcelDataSource,
+ NewPolicyObjectSecurityLocalApplicationListProfileParcelDataSource,
+ NewPolicyObjectSecurityLocalDomainListProfileParcelDataSource,
+ NewPolicyObjectSecurityPortListProfileParcelDataSource,
+ NewPolicyObjectSecurityScalableGroupTagListProfileParcelDataSource,
+ NewPolicyObjectSecurityURLListProfileParcelDataSource,
+ NewPolicyObjectSLAClassListProfileParcelDataSource,
+ NewPolicyObjectStandardCommunityListProfileParcelDataSource,
+ NewPolicyObjectTLOCListProfileParcelDataSource,
+ NewPolicyObjectVPNGroupProfileParcelDataSource,
NewServiceLANVPNProfileParcelDataSource,
NewServiceLANVPNInterfaceEthernetProfileParcelDataSource,
NewServiceLANVPNInterfaceGREProfileParcelDataSource,
NewServiceLANVPNInterfaceIPSecProfileParcelDataSource,
NewServiceLANVPNInterfaceSVIProfileParcelDataSource,
+ NewServiceObjectTrackerProfileParcelDataSource,
+ NewServiceObjectTrackerGroupProfileParcelDataSource,
+ NewServiceRoutePolicyProfileParcelDataSource,
+ NewServiceRoutingBGPProfileParcelDataSource,
+ NewServiceRoutingOSPFProfileParcelDataSource,
+ NewServiceRoutingOSPFv3IPv4ProfileParcelDataSource,
+ NewServiceRoutingOSPFv3IPv6ProfileParcelDataSource,
+ NewServiceSwitchportProfileParcelDataSource,
NewServiceTrackerProfileParcelDataSource,
+ NewServiceTrackerGroupProfileParcelDataSource,
NewSystemAAAProfileParcelDataSource,
NewSystemBannerProfileParcelDataSource,
NewSystemBasicProfileParcelDataSource,
@@ -453,10 +544,18 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat
NewSystemRemoteAccessProfileParcelDataSource,
NewSystemSecurityProfileParcelDataSource,
NewSystemSNMPProfileParcelDataSource,
+ NewTransportGPSProfileParcelDataSource,
NewTransportIPv6TrackerProfileParcelDataSource,
+ NewTransportIPv6TrackerGroupProfileParcelDataSource,
NewTransportManagementVPNProfileParcelDataSource,
NewTransportManagementVPNInterfaceEthernetProfileParcelDataSource,
+ NewTransportRoutePolicyProfileParcelDataSource,
NewTransportRoutingBGPProfileParcelDataSource,
+ NewTransportRoutingOSPFProfileParcelDataSource,
+ NewTransportRoutingOSPFv3IPv4ProfileParcelDataSource,
+ NewTransportRoutingOSPFv3IPv6ProfileParcelDataSource,
+ NewTransportTrackerProfileParcelDataSource,
+ NewTransportTrackerGroupProfileParcelDataSource,
NewTransportWANVPNProfileParcelDataSource,
NewTransportWANVPNInterfaceCellularProfileParcelDataSource,
NewTransportWANVPNInterfaceEthernetProfileParcelDataSource,
@@ -475,7 +574,7 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat
NewCentralizedPolicyDataSource,
NewCflowdPolicyDefinitionDataSource,
NewClassMapPolicyObjectDataSource,
- NewCLIConfigProfileParcelDataSource,
+ NewCLIConfigFeatureDataSource,
NewCLIDeviceTemplateDataSource,
NewCLIFeatureProfileDataSource,
NewColorListPolicyObjectDataSource,
@@ -485,8 +584,10 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat
NewDataIPv4PrefixListPolicyObjectDataSource,
NewDataIPv6PrefixListPolicyObjectDataSource,
NewDeviceDataSource,
+ NewDNSSecurityFeatureProfileDataSource,
NewDNSSecurityPolicyDefinitionDataSource,
NewDomainListPolicyObjectDataSource,
+ NewEmbeddedSecurityFeatureProfileDataSource,
NewExpandedCommunityListPolicyObjectDataSource,
NewExtendedCommunityListPolicyObjectDataSource,
NewFeatureDeviceTemplateDataSource,
@@ -505,7 +606,9 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat
NewMeshTopologyPolicyDefinitionDataSource,
NewMirrorPolicyObjectDataSource,
NewObjectGroupPolicyDefinitionDataSource,
+ NewOtherFeatureProfileDataSource,
NewPolicerPolicyObjectDataSource,
+ NewPolicyObjectFeatureProfileDataSource,
NewPortListPolicyObjectDataSource,
NewPreferredColorGroupPolicyObjectDataSource,
NewProtocolListPolicyObjectDataSource,
@@ -516,6 +619,7 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat
NewRuleSetPolicyDefinitionDataSource,
NewSecurityPolicyDataSource,
NewServiceFeatureProfileDataSource,
+ NewSIGSecurityFeatureProfileDataSource,
NewSiteListPolicyObjectDataSource,
NewSLAClassPolicyObjectDataSource,
NewStandardCommunityListPolicyObjectDataSource,
diff --git a/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go b/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go
index 8d82f7498..0622d8d73 100644
--- a/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go
+++ b/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go
@@ -184,7 +184,7 @@ func (r *AdvancedInspectionProfilePolicyDefinitionResource) Read(ctx context.Con
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go b/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go
index 40f937513..88f0c6a5f 100644
--- a/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go
+++ b/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go
@@ -208,7 +208,7 @@ func (r *AdvancedMalwareProtectionPolicyDefinitionResource) Read(ctx context.Con
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_allow_url_list_policy_object.go b/internal/provider/resource_sdwan_allow_url_list_policy_object.go
index fbbd4a9fc..df15e6071 100644
--- a/internal/provider/resource_sdwan_allow_url_list_policy_object.go
+++ b/internal/provider/resource_sdwan_allow_url_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *AllowURLListPolicyObjectResource) Read(ctx context.Context, req resourc
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_app_probe_class_policy_object.go b/internal/provider/resource_sdwan_app_probe_class_policy_object.go
index 317df1f5a..9b24b9000 100644
--- a/internal/provider/resource_sdwan_app_probe_class_policy_object.go
+++ b/internal/provider/resource_sdwan_app_probe_class_policy_object.go
@@ -168,7 +168,7 @@ func (r *AppProbeClassPolicyObjectResource) Read(ctx context.Context, req resour
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go b/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go
index ed5032e3b..cb1358a34 100644
--- a/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go
+++ b/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go
@@ -118,10 +118,10 @@ func (r *ApplicationAwareRoutingPolicyDefinitionResource) Schema(ctx context.Con
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Type of match entry").AddStringEnumDescription("appList", "dnsAppList", "dns", "dscp", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "trafficTo").String,
+ MarkdownDescription: helpers.NewAttributeDescription("Type of match entry").AddStringEnumDescription("appList", "dnsAppList", "dns", "dscp", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "trafficTo", "icmpMessage").String,
Required: true,
Validators: []validator.String{
- stringvalidator.OneOf("appList", "dnsAppList", "dns", "dscp", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "trafficTo"),
+ stringvalidator.OneOf("appList", "dnsAppList", "dns", "dscp", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "trafficTo", "icmpMessage"),
},
},
"application_list_id": schema.StringAttribute{
@@ -140,6 +140,10 @@ func (r *ApplicationAwareRoutingPolicyDefinitionResource) Schema(ctx context.Con
MarkdownDescription: helpers.NewAttributeDescription("DNS Application list version").String,
Optional: true,
},
+ "icmp_message": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ICMP Message").String,
+ Optional: true,
+ },
"dns": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("DNS request or response").AddStringEnumDescription("request", "response").String,
Optional: true,
@@ -345,7 +349,7 @@ func (r *ApplicationAwareRoutingPolicyDefinitionResource) Read(ctx context.Conte
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_application_aware_routing_policy_definition_test.go b/internal/provider/resource_sdwan_application_aware_routing_policy_definition_test.go
index 0b881e9da..5b496abd8 100644
--- a/internal/provider/resource_sdwan_application_aware_routing_policy_definition_test.go
+++ b/internal/provider/resource_sdwan_application_aware_routing_policy_definition_test.go
@@ -61,6 +61,7 @@ resource "sdwan_application_list_policy_object" "test" {
}
]
}
+
`
// End of section. //template:end testPrerequisites
diff --git a/internal/provider/resource_sdwan_application_list_policy_object.go b/internal/provider/resource_sdwan_application_list_policy_object.go
index 2cae596f1..2ad598dfb 100644
--- a/internal/provider/resource_sdwan_application_list_policy_object.go
+++ b/internal/provider/resource_sdwan_application_list_policy_object.go
@@ -160,7 +160,7 @@ func (r *ApplicationListPolicyObjectResource) Read(ctx context.Context, req reso
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_application_priority_feature_profile.go b/internal/provider/resource_sdwan_application_priority_feature_profile.go
index cc7a2dd1d..eeac81400 100644
--- a/internal/provider/resource_sdwan_application_priority_feature_profile.go
+++ b/internal/provider/resource_sdwan_application_priority_feature_profile.go
@@ -60,7 +60,7 @@ func (r *ApplicationPriorityFeatureProfileResource) Metadata(ctx context.Context
func (r *ApplicationPriorityFeatureProfileResource) 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 Application Priority Feature Profile .").String,
+ MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Application Priority Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
@@ -138,7 +138,7 @@ func (r *ApplicationPriorityFeatureProfileResource) Read(ctx context.Context, re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_application_priority_qos_policy.go b/internal/provider/resource_sdwan_application_priority_qos_policy.go
new file mode 100644
index 000000000..55b35aae2
--- /dev/null
+++ b/internal/provider/resource_sdwan_application_priority_qos_policy.go
@@ -0,0 +1,283 @@
+// 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 = &ApplicationPriorityQoSProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ApplicationPriorityQoSProfileParcelResource{}
+
+func NewApplicationPriorityQoSProfileParcelResource() resource.Resource {
+ return &ApplicationPriorityQoSProfileParcelResource{}
+}
+
+type ApplicationPriorityQoSProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ApplicationPriorityQoSProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_application_priority_qos_policy"
+}
+
+func (r *ApplicationPriorityQoSProfileParcelResource) 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 Application Priority QoS Policy.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "target_interface": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("interfaces").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "target_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_schedulers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("qosSchedulers").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "forwarding_class_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "drops": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("drops").String,
+ Optional: true,
+ },
+ "queue": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("queue").String,
+ Optional: true,
+ },
+ "bandwidth": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("bandwidthPercent").String,
+ Optional: true,
+ },
+ "scheduling_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("scheduling").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ApplicationPriorityQoSProfileParcelResource) 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 *ApplicationPriorityQoSProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ApplicationPriorityQoS
+
+ // 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("id").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 *ApplicationPriorityQoSProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ApplicationPriorityQoS
+
+ // 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 *ApplicationPriorityQoSProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ApplicationPriorityQoS
+
+ // 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 *ApplicationPriorityQoSProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ApplicationPriorityQoS
+
+ // 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 *ApplicationPriorityQoSProfileParcelResource) 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_application_priority_qos_policy_profile_parcel.go b/internal/provider/resource_sdwan_application_priority_qos_policy_profile_parcel.go
deleted file mode 100644
index 741ff866e..000000000
--- a/internal/provider/resource_sdwan_application_priority_qos_policy_profile_parcel.go
+++ /dev/null
@@ -1,283 +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"
- "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 = &ApplicationPriorityQoSPolicyProfileParcelResource{}
-var _ resource.ResourceWithImportState = &ApplicationPriorityQoSPolicyProfileParcelResource{}
-
-func NewApplicationPriorityQoSPolicyProfileParcelResource() resource.Resource {
- return &ApplicationPriorityQoSPolicyProfileParcelResource{}
-}
-
-type ApplicationPriorityQoSPolicyProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *ApplicationPriorityQoSPolicyProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_application_priority_qos_policy_profile_parcel"
-}
-
-func (r *ApplicationPriorityQoSPolicyProfileParcelResource) 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 Application Priority QoS Policy 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,
- },
- "target_interface": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("interfaces").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "target_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_schedulers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("qosSchedulers").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "forwarding_class_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "drops": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("drops").String,
- Optional: true,
- },
- "queue": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("queue").String,
- Optional: true,
- },
- "bandwidth": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("bandwidthPercent").String,
- Optional: true,
- },
- "scheduling_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("scheduling").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *ApplicationPriorityQoSPolicyProfileParcelResource) 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 *ApplicationPriorityQoSPolicyProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan ApplicationPriorityQoSPolicy
-
- // 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("id").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 *ApplicationPriorityQoSPolicyProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state ApplicationPriorityQoSPolicy
-
- // 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 *ApplicationPriorityQoSPolicyProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state ApplicationPriorityQoSPolicy
-
- // 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 *ApplicationPriorityQoSPolicyProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state ApplicationPriorityQoSPolicy
-
- // 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 *ApplicationPriorityQoSPolicyProfileParcelResource) 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_application_priority_qos_policy_profile_parcel_test.go b/internal/provider/resource_sdwan_application_priority_qos_policy_profile_parcel_test.go
deleted file mode 100644
index b70300f49..000000000
--- a/internal/provider/resource_sdwan_application_priority_qos_policy_profile_parcel_test.go
+++ /dev/null
@@ -1,96 +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 TestAccSdwanApplicationPriorityQoSPolicyProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.drops", "tail-drop"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.queue", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.bandwidth", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy_profile_parcel.test", "qos_schedulers.0.scheduling_type", "llq"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanApplicationPriorityQoSPolicyPrerequisitesProfileParcelConfig + testAccSdwanApplicationPriorityQoSPolicyProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanApplicationPriorityQoSPolicyPrerequisitesProfileParcelConfig + testAccSdwanApplicationPriorityQoSPolicyProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanApplicationPriorityQoSPolicyPrerequisitesProfileParcelConfig = `
-resource "sdwan_application_priority_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanApplicationPriorityQoSPolicyProfileParcelConfig_minimum() string {
- config := `resource "sdwan_application_priority_qos_policy_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_application_priority_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanApplicationPriorityQoSPolicyProfileParcelConfig_all() string {
- config := `resource "sdwan_application_priority_qos_policy_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_application_priority_feature_profile.test.id` + "\n"
- config += ` target_interface = ["{{interface_var_1}}"]` + "\n"
- config += ` qos_schedulers = [{` + "\n"
- config += ` drops = "tail-drop"` + "\n"
- config += ` queue = "0"` + "\n"
- config += ` bandwidth = "10"` + "\n"
- config += ` scheduling_type = "llq"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_application_priority_qos_policy_test.go b/internal/provider/resource_sdwan_application_priority_qos_policy_test.go
new file mode 100644
index 000000000..0b4f52586
--- /dev/null
+++ b/internal/provider/resource_sdwan_application_priority_qos_policy_test.go
@@ -0,0 +1,96 @@
+// 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 TestAccSdwanApplicationPriorityQoSProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy.test", "qos_schedulers.0.drops", "tail-drop"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy.test", "qos_schedulers.0.queue", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy.test", "qos_schedulers.0.bandwidth", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_application_priority_qos_policy.test", "qos_schedulers.0.scheduling_type", "llq"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanApplicationPriorityQoSPrerequisitesProfileParcelConfig + testAccSdwanApplicationPriorityQoSProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanApplicationPriorityQoSPrerequisitesProfileParcelConfig + testAccSdwanApplicationPriorityQoSProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanApplicationPriorityQoSPrerequisitesProfileParcelConfig = `
+resource "sdwan_application_priority_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanApplicationPriorityQoSProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_application_priority_qos_policy" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_application_priority_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanApplicationPriorityQoSProfileParcelConfig_all() string {
+ config := `resource "sdwan_application_priority_qos_policy" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_application_priority_feature_profile.test.id` + "\n"
+ config += ` target_interface = ["{{interface_var_1}}"]` + "\n"
+ config += ` qos_schedulers = [{` + "\n"
+ config += ` drops = "tail-drop"` + "\n"
+ config += ` queue = "0"` + "\n"
+ config += ` bandwidth = "10"` + "\n"
+ config += ` scheduling_type = "llq"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_as_path_list_policy_object.go b/internal/provider/resource_sdwan_as_path_list_policy_object.go
index d02cf493d..558733f8a 100644
--- a/internal/provider/resource_sdwan_as_path_list_policy_object.go
+++ b/internal/provider/resource_sdwan_as_path_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *ASPathListPolicyObjectResource) Read(ctx context.Context, req resource.
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_block_url_list_policy_object.go b/internal/provider/resource_sdwan_block_url_list_policy_object.go
index bb47a4a46..e2311c267 100644
--- a/internal/provider/resource_sdwan_block_url_list_policy_object.go
+++ b/internal/provider/resource_sdwan_block_url_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *BlockURLListPolicyObjectResource) Read(ctx context.Context, req resourc
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_centralized_policy.go b/internal/provider/resource_sdwan_centralized_policy.go
index 0009a4388..ab800ecbe 100644
--- a/internal/provider/resource_sdwan_centralized_policy.go
+++ b/internal/provider/resource_sdwan_centralized_policy.go
@@ -218,7 +218,7 @@ func (r *CentralizedPolicyResource) Read(ctx context.Context, req resource.ReadR
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get("/template/policy/vsmart/definition/" + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_cflowd_policy_definition.go b/internal/provider/resource_sdwan_cflowd_policy_definition.go
index 0f47d0b87..50f308a05 100644
--- a/internal/provider/resource_sdwan_cflowd_policy_definition.go
+++ b/internal/provider/resource_sdwan_cflowd_policy_definition.go
@@ -249,7 +249,7 @@ func (r *CflowdPolicyDefinitionResource) Read(ctx context.Context, req resource.
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_class_map_policy_object.go b/internal/provider/resource_sdwan_class_map_policy_object.go
index 56d34ea28..3eccda6ee 100644
--- a/internal/provider/resource_sdwan_class_map_policy_object.go
+++ b/internal/provider/resource_sdwan_class_map_policy_object.go
@@ -148,7 +148,7 @@ func (r *ClassMapPolicyObjectResource) Read(ctx context.Context, req resource.Re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_cli_config_feature.go b/internal/provider/resource_sdwan_cli_config_feature.go
new file mode 100644
index 000000000..19155f897
--- /dev/null
+++ b/internal/provider/resource_sdwan_cli_config_feature.go
@@ -0,0 +1,255 @@
+// 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"
+ "strings"
+ "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 = &CLIConfigFeatureResource{}
+var _ resource.ResourceWithImportState = &CLIConfigFeatureResource{}
+
+func NewCLIConfigFeatureResource() resource.Resource {
+ return &CLIConfigFeatureResource{}
+}
+
+type CLIConfigFeatureResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *CLIConfigFeatureResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_cli_config_feature"
+}
+
+func (r *CLIConfigFeatureResource) 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 CLI Config Feature .").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the object",
+ Computed: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The name of the Feature").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The description of the Feature").String,
+ Required: true,
+ },
+ "cli_configuration": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("CLI configuration").String,
+ Required: true,
+ },
+ },
+ }
+}
+
+func (r *CLIConfigFeatureResource) 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 *CLIConfigFeatureResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan CLIConfigFeature
+
+ // 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 *CLIConfigFeatureResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state CLIConfigFeature
+
+ // 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 strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
+ 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
+ }
+
+ state.fromBody(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 *CLIConfigFeatureResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state CLIConfigFeature
+
+ // 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()))
+
+ if plan.hasChanges(ctx, &state) {
+ body := plan.toBody(ctx)
+ r.updateMutex.Lock()
+ res, err := r.client.Put(plan.getPath()+url.QueryEscape(plan.Id.ValueString()), body)
+ r.updateMutex.Unlock()
+ if err != nil {
+ if strings.Contains(res.Get("error.message").String(), "Failed to acquire lock") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify policy due to policy being locked by another change. Policy changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else if strings.Contains(res.Get("error.message").String(), "Template locked in edit mode") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify template due to template being locked by another change. Template changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String()))
+ return
+ }
+ }
+ } else {
+ tflog.Debug(ctx, fmt.Sprintf("%s: No changes detected", plan.Name.ValueString()))
+ }
+ 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 *CLIConfigFeatureResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state CLIConfigFeature
+
+ // 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 {
+ 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 *CLIConfigFeatureResource) 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_cli_config_feature_test.go b/internal/provider/resource_sdwan_cli_config_feature_test.go
new file mode 100644
index 000000000..09f20e144
--- /dev/null
+++ b/internal/provider/resource_sdwan_cli_config_feature_test.go
@@ -0,0 +1,74 @@
+// 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 TestAccSdwanCLIConfigFeature(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_cli_config_feature.test", "name", "Example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_cli_config_feature.test", "description", "My Example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_cli_config_feature.test", "cli_configuration", "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanCLIConfigFeaturePrerequisitesConfig + testAccSdwanCLIConfigFeatureConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanCLIConfigFeaturePrerequisitesConfig = `
+resource "sdwan_cli_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanCLIConfigFeatureConfig_all() string {
+ config := `resource "sdwan_cli_config_feature" "test" {` + "\n"
+ config += ` feature_profile_id = sdwan_cli_feature_profile.test.id` + "\n"
+ config += ` name = "Example"` + "\n"
+ config += ` description = "My Example"` + "\n"
+ config += ` cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_cli_config_profile_parcel.go b/internal/provider/resource_sdwan_cli_config_profile_parcel.go
deleted file mode 100644
index c2ac4473f..000000000
--- a/internal/provider/resource_sdwan_cli_config_profile_parcel.go
+++ /dev/null
@@ -1,255 +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"
- "strings"
- "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 = &CLIConfigProfileParcelResource{}
-var _ resource.ResourceWithImportState = &CLIConfigProfileParcelResource{}
-
-func NewCLIConfigProfileParcelResource() resource.Resource {
- return &CLIConfigProfileParcelResource{}
-}
-
-type CLIConfigProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *CLIConfigProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_cli_config_profile_parcel"
-}
-
-func (r *CLIConfigProfileParcelResource) 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 CLI Config Profile Parcel .").AddMinimumVersionDescription("20.12.0").String,
-
- Attributes: map[string]schema.Attribute{
- "id": schema.StringAttribute{
- MarkdownDescription: "The id of the object",
- Computed: true,
- PlanModifiers: []planmodifier.String{
- stringplanmodifier.UseStateForUnknown(),
- },
- },
- "version": schema.Int64Attribute{
- MarkdownDescription: "The version of the object",
- Computed: true,
- },
- "feature_profile_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
- Required: true,
- },
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("The name of the profile parcel").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("The description of the profile parcel").String,
- Required: true,
- },
- "cli_configuration": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("CLI configuration").String,
- Required: true,
- },
- },
- }
-}
-
-func (r *CLIConfigProfileParcelResource) 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 *CLIConfigProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan CLIConfigProfileParcel
-
- // 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 *CLIConfigProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state CLIConfigProfileParcel
-
- // 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 strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(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
- }
-
- state.fromBody(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 *CLIConfigProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state CLIConfigProfileParcel
-
- // 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()))
-
- if plan.hasChanges(ctx, &state) {
- body := plan.toBody(ctx)
- r.updateMutex.Lock()
- res, err := r.client.Put(plan.getPath()+url.QueryEscape(plan.Id.ValueString()), body)
- r.updateMutex.Unlock()
- if err != nil {
- if strings.Contains(res.Get("error.message").String(), "Failed to acquire lock") {
- resp.Diagnostics.AddWarning("Client Warning", "Failed to modify policy due to policy being locked by another change. Policy changes will not be applied. Re-run 'terraform apply' to try again.")
- } else if strings.Contains(res.Get("error.message").String(), "Template locked in edit mode") {
- resp.Diagnostics.AddWarning("Client Warning", "Failed to modify template due to template being locked by another change. Template changes will not be applied. Re-run 'terraform apply' to try again.")
- } else {
- resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String()))
- return
- }
- }
- } else {
- tflog.Debug(ctx, fmt.Sprintf("%s: No changes detected", plan.Name.ValueString()))
- }
- 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 *CLIConfigProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state CLIConfigProfileParcel
-
- // 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 {
- 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 *CLIConfigProfileParcelResource) 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_cli_config_profile_parcel_test.go b/internal/provider/resource_sdwan_cli_config_profile_parcel_test.go
deleted file mode 100644
index 988de3374..000000000
--- a/internal/provider/resource_sdwan_cli_config_profile_parcel_test.go
+++ /dev/null
@@ -1,74 +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 TestAccSdwanCLIConfigProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_cli_config_profile_parcel.test", "name", "Example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_cli_config_profile_parcel.test", "description", "My Example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_cli_config_profile_parcel.test", "cli_configuration", "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanCLIConfigProfileParcelPrerequisitesConfig + testAccSdwanCLIConfigProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanCLIConfigProfileParcelPrerequisitesConfig = `
-resource "sdwan_cli_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanCLIConfigProfileParcelConfig_all() string {
- config := `resource "sdwan_cli_config_profile_parcel" "test" {` + "\n"
- config += ` feature_profile_id = sdwan_cli_feature_profile.test.id` + "\n"
- config += ` name = "Example"` + "\n"
- config += ` description = "My Example"` + "\n"
- config += ` cli_configuration = "bfd default-dscp 48\nbfd app-route multiplier 6\nbfd app-route poll-interval 600000"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_cli_device_template.go b/internal/provider/resource_sdwan_cli_device_template.go
index dd6b501b4..a22c662db 100644
--- a/internal/provider/resource_sdwan_cli_device_template.go
+++ b/internal/provider/resource_sdwan_cli_device_template.go
@@ -160,7 +160,7 @@ func (r *CLIDeviceTemplateResource) Read(ctx context.Context, req resource.ReadR
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get("/template/device/object/" + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_cli_feature_profile.go b/internal/provider/resource_sdwan_cli_feature_profile.go
index 0efdfee11..7bddbfb9a 100644
--- a/internal/provider/resource_sdwan_cli_feature_profile.go
+++ b/internal/provider/resource_sdwan_cli_feature_profile.go
@@ -60,7 +60,7 @@ func (r *CLIFeatureProfileResource) Metadata(ctx context.Context, req resource.M
func (r *CLIFeatureProfileResource) 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 CLI Feature Profile .").String,
+ MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a CLI Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
@@ -138,7 +138,7 @@ func (r *CLIFeatureProfileResource) Read(ctx context.Context, req resource.ReadR
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_color_list_policy_object.go b/internal/provider/resource_sdwan_color_list_policy_object.go
index a137034a7..e6c5b4f13 100644
--- a/internal/provider/resource_sdwan_color_list_policy_object.go
+++ b/internal/provider/resource_sdwan_color_list_policy_object.go
@@ -160,7 +160,7 @@ func (r *ColorListPolicyObjectResource) Read(ctx context.Context, req resource.R
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_configuration_group.go b/internal/provider/resource_sdwan_configuration_group.go
index e71307e06..0872904a9 100644
--- a/internal/provider/resource_sdwan_configuration_group.go
+++ b/internal/provider/resource_sdwan_configuration_group.go
@@ -205,7 +205,7 @@ func (r *ConfigurationGroupResource) Read(ctx context.Context, req resource.Read
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go b/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go
index 18b7a90a1..a52fa95c2 100644
--- a/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go
+++ b/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go
@@ -101,7 +101,7 @@ func (r *CustomControlTopologyPolicyDefinitionResource) Schema(ctx context.Conte
},
"sequences": schema.ListNestedAttribute{
MarkdownDescription: helpers.NewAttributeDescription("List of sequences").String,
- Required: true,
+ Optional: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"id": schema.Int64Attribute{
@@ -478,7 +478,7 @@ func (r *CustomControlTopologyPolicyDefinitionResource) Read(ctx context.Context
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go
index 978cd1cf7..f3c83167c 100644
--- a/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go
+++ b/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *DataFQDNPrefixListPolicyObjectResource) Read(ctx context.Context, req r
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go
index 938fda69d..d465c6ebe 100644
--- a/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go
+++ b/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *DataIPv4PrefixListPolicyObjectResource) Read(ctx context.Context, req r
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go
index d7b3dbf68..87aaac709 100644
--- a/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go
+++ b/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *DataIPv6PrefixListPolicyObjectResource) Read(ctx context.Context, req r
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_dns_security_feature_profile.go b/internal/provider/resource_sdwan_dns_security_feature_profile.go
new file mode 100644
index 000000000..97425ff49
--- /dev/null
+++ b/internal/provider/resource_sdwan_dns_security_feature_profile.go
@@ -0,0 +1,236 @@
+// 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"
+ "strings"
+ "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 = &DNSSecurityFeatureProfileResource{}
+var _ resource.ResourceWithImportState = &DNSSecurityFeatureProfileResource{}
+
+func NewDNSSecurityFeatureProfileResource() resource.Resource {
+ return &DNSSecurityFeatureProfileResource{}
+}
+
+type DNSSecurityFeatureProfileResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *DNSSecurityFeatureProfileResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_dns_security_feature_profile"
+}
+
+func (r *DNSSecurityFeatureProfileResource) 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 DNS Security Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The name of the dns security feature profile").String,
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Description").String,
+ Required: true,
+ },
+ },
+ }
+}
+
+func (r *DNSSecurityFeatureProfileResource) 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 *DNSSecurityFeatureProfileResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan DNSSecurityFeatureProfile
+
+ // 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("id").String())
+
+ 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 *DNSSecurityFeatureProfileResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state DNSSecurityFeatureProfile
+
+ // 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 strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
+ 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
+ }
+
+ state.fromBody(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 *DNSSecurityFeatureProfileResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state DNSSecurityFeatureProfile
+
+ // 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()))
+
+ if plan.hasChanges(ctx, &state) {
+ body := plan.toBody(ctx)
+ r.updateMutex.Lock()
+ res, err := r.client.Put(plan.getPath()+url.QueryEscape(plan.Id.ValueString()), body)
+ r.updateMutex.Unlock()
+ if err != nil {
+ if strings.Contains(res.Get("error.message").String(), "Failed to acquire lock") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify policy due to policy being locked by another change. Policy changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else if strings.Contains(res.Get("error.message").String(), "Template locked in edit mode") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify template due to template being locked by another change. Template changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String()))
+ return
+ }
+ }
+ } else {
+ tflog.Debug(ctx, fmt.Sprintf("%s: No changes detected", plan.Name.ValueString()))
+ }
+
+ 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 *DNSSecurityFeatureProfileResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state DNSSecurityFeatureProfile
+
+ // 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 {
+ 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 *DNSSecurityFeatureProfileResource) 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_dns_security_feature_profile_test.go b/internal/provider/resource_sdwan_dns_security_feature_profile_test.go
new file mode 100644
index 000000000..8512d924a
--- /dev/null
+++ b/internal/provider/resource_sdwan_dns_security_feature_profile_test.go
@@ -0,0 +1,64 @@
+// 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 TestAccSdwanDNSSecurityFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_dns_security_feature_profile.test", "name", "DNS_SECURITY_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_dns_security_feature_profile.test", "description", "My dns security feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanDNSSecurityFeatureProfileConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanDNSSecurityFeatureProfileConfig_all() string {
+ config := `resource "sdwan_dns_security_feature_profile" "test" {` + "\n"
+ config += ` name = "DNS_SECURITY_FP_1"` + "\n"
+ config += ` description = "My dns security feature profile 1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_dns_security_policy_definition.go b/internal/provider/resource_sdwan_dns_security_policy_definition.go
index 8badd786d..892500be3 100644
--- a/internal/provider/resource_sdwan_dns_security_policy_definition.go
+++ b/internal/provider/resource_sdwan_dns_security_policy_definition.go
@@ -204,7 +204,7 @@ func (r *DNSSecurityPolicyDefinitionResource) Read(ctx context.Context, req reso
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_domain_list_policy_object.go b/internal/provider/resource_sdwan_domain_list_policy_object.go
index acba08d7b..efbf9291d 100644
--- a/internal/provider/resource_sdwan_domain_list_policy_object.go
+++ b/internal/provider/resource_sdwan_domain_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *DomainListPolicyObjectResource) Read(ctx context.Context, req resource.
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_embedded_security_feature_profile.go b/internal/provider/resource_sdwan_embedded_security_feature_profile.go
new file mode 100644
index 000000000..d9544cff0
--- /dev/null
+++ b/internal/provider/resource_sdwan_embedded_security_feature_profile.go
@@ -0,0 +1,236 @@
+// 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"
+ "strings"
+ "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 = &EmbeddedSecurityFeatureProfileResource{}
+var _ resource.ResourceWithImportState = &EmbeddedSecurityFeatureProfileResource{}
+
+func NewEmbeddedSecurityFeatureProfileResource() resource.Resource {
+ return &EmbeddedSecurityFeatureProfileResource{}
+}
+
+type EmbeddedSecurityFeatureProfileResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *EmbeddedSecurityFeatureProfileResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_embedded_security_feature_profile"
+}
+
+func (r *EmbeddedSecurityFeatureProfileResource) 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 Embedded Security Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The name of the embedded security feature profile").String,
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Description").String,
+ Required: true,
+ },
+ },
+ }
+}
+
+func (r *EmbeddedSecurityFeatureProfileResource) 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 *EmbeddedSecurityFeatureProfileResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan EmbeddedSecurityFeatureProfile
+
+ // 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("id").String())
+
+ 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 *EmbeddedSecurityFeatureProfileResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state EmbeddedSecurityFeatureProfile
+
+ // 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 strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
+ 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
+ }
+
+ state.fromBody(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 *EmbeddedSecurityFeatureProfileResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state EmbeddedSecurityFeatureProfile
+
+ // 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()))
+
+ if plan.hasChanges(ctx, &state) {
+ body := plan.toBody(ctx)
+ r.updateMutex.Lock()
+ res, err := r.client.Put(plan.getPath()+url.QueryEscape(plan.Id.ValueString()), body)
+ r.updateMutex.Unlock()
+ if err != nil {
+ if strings.Contains(res.Get("error.message").String(), "Failed to acquire lock") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify policy due to policy being locked by another change. Policy changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else if strings.Contains(res.Get("error.message").String(), "Template locked in edit mode") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify template due to template being locked by another change. Template changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String()))
+ return
+ }
+ }
+ } else {
+ tflog.Debug(ctx, fmt.Sprintf("%s: No changes detected", plan.Name.ValueString()))
+ }
+
+ 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 *EmbeddedSecurityFeatureProfileResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state EmbeddedSecurityFeatureProfile
+
+ // 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 {
+ 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 *EmbeddedSecurityFeatureProfileResource) 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_embedded_security_feature_profile_test.go b/internal/provider/resource_sdwan_embedded_security_feature_profile_test.go
new file mode 100644
index 000000000..f5f5fd690
--- /dev/null
+++ b/internal/provider/resource_sdwan_embedded_security_feature_profile_test.go
@@ -0,0 +1,64 @@
+// 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 TestAccSdwanEmbeddedSecurityFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_embedded_security_feature_profile.test", "name", "EMBEDDED_SECURITY_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_embedded_security_feature_profile.test", "description", "My embedded security feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanEmbeddedSecurityFeatureProfileConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanEmbeddedSecurityFeatureProfileConfig_all() string {
+ config := `resource "sdwan_embedded_security_feature_profile" "test" {` + "\n"
+ config += ` name = "EMBEDDED_SECURITY_FP_1"` + "\n"
+ config += ` description = "My embedded security feature profile 1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_expanded_community_list_policy_object.go b/internal/provider/resource_sdwan_expanded_community_list_policy_object.go
index c0ebeecda..a0f6b7843 100644
--- a/internal/provider/resource_sdwan_expanded_community_list_policy_object.go
+++ b/internal/provider/resource_sdwan_expanded_community_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *ExpandedCommunityListPolicyObjectResource) Read(ctx context.Context, re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_extended_community_list_policy_object.go b/internal/provider/resource_sdwan_extended_community_list_policy_object.go
index 3419b6158..8b4b65605 100644
--- a/internal/provider/resource_sdwan_extended_community_list_policy_object.go
+++ b/internal/provider/resource_sdwan_extended_community_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *ExtendedCommunityListPolicyObjectResource) Read(ctx context.Context, re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_feature_device_template.go b/internal/provider/resource_sdwan_feature_device_template.go
index baa233c39..94317501e 100644
--- a/internal/provider/resource_sdwan_feature_device_template.go
+++ b/internal/provider/resource_sdwan_feature_device_template.go
@@ -125,7 +125,7 @@ func (r *FeatureDeviceTemplateResource) Schema(ctx context.Context, req resource
Optional: true,
},
"type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Feature template type").AddStringEnumDescription("cisco_system", "cisco_logging", "cedge_aaa", "cisco_bfd", "cisco_omp", "cisco_security", "cisco_banner", "cisco_snmp", "cedge_global", "cli-template", "cisco_sig_credentials", "switchport", "cisco_thousandeyes", "cisco_vpn").String,
+ MarkdownDescription: helpers.NewAttributeDescription("Feature template type").AddStringEnumDescription("cisco_system", "cisco_logging", "cedge_aaa", "cisco_bfd", "cisco_omp", "cisco_security", "cisco_banner", "cisco_snmp", "cedge_global", "cli-template", "cisco_sig_credentials", "switchport", "cisco_thousandeyes", "cisco_vpn", "virtual-application-utd").String,
Required: true,
},
"sub_templates": schema.SetNestedAttribute{
@@ -232,7 +232,7 @@ func (r *FeatureDeviceTemplateResource) Read(ctx context.Context, req resource.R
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get("/template/device/object/" + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_geo_location_list_policy_object.go b/internal/provider/resource_sdwan_geo_location_list_policy_object.go
index b1fce60b2..38fbba398 100644
--- a/internal/provider/resource_sdwan_geo_location_list_policy_object.go
+++ b/internal/provider/resource_sdwan_geo_location_list_policy_object.go
@@ -164,7 +164,7 @@ func (r *GeoLocationListPolicyObjectResource) Read(ctx context.Context, req reso
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go b/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go
index 9f1af9403..573dc440a 100644
--- a/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go
+++ b/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go
@@ -229,7 +229,7 @@ func (r *HubAndSpokeTopologyPolicyDefinitionResource) Read(ctx context.Context,
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go b/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go
index 9a6dcd9b3..3aa44f3a3 100644
--- a/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go
+++ b/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go
@@ -186,7 +186,7 @@ func (r *IntrusionPreventionPolicyDefinitionResource) Read(ctx context.Context,
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_ips_signature_list_policy_object.go b/internal/provider/resource_sdwan_ips_signature_list_policy_object.go
index 29f9fe7e3..3fbc6c38f 100644
--- a/internal/provider/resource_sdwan_ips_signature_list_policy_object.go
+++ b/internal/provider/resource_sdwan_ips_signature_list_policy_object.go
@@ -167,7 +167,7 @@ func (r *IPSSignatureListPolicyObjectResource) Read(ctx context.Context, req res
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go
index ae1728c64..8e81572b6 100644
--- a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go
+++ b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go
@@ -128,10 +128,10 @@ func (r *IPv4ACLPolicyDefinitionResource) Schema(ctx context.Context, req resour
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Type of match entry").AddStringEnumDescription("dscp", "sourceIp", "destinationIp", "class", "packetLength", "plp", "sourcePort", "destinationPort", "sourceDataPrefixList", "destinationDataPrefixList", "protocol", "tcp").String,
+ MarkdownDescription: helpers.NewAttributeDescription("Type of match entry").AddStringEnumDescription("dscp", "sourceIp", "destinationIp", "class", "packetLength", "plp", "sourcePort", "destinationPort", "sourceDataPrefixList", "destinationDataPrefixList", "protocol", "tcp", "icmpMessage").String,
Required: true,
Validators: []validator.String{
- stringvalidator.OneOf("dscp", "sourceIp", "destinationIp", "class", "packetLength", "plp", "sourcePort", "destinationPort", "sourceDataPrefixList", "destinationDataPrefixList", "protocol", "tcp"),
+ stringvalidator.OneOf("dscp", "sourceIp", "destinationIp", "class", "packetLength", "plp", "sourcePort", "destinationPort", "sourceDataPrefixList", "destinationDataPrefixList", "protocol", "tcp", "icmpMessage"),
},
},
"dscp": schema.Int64Attribute{
@@ -145,6 +145,10 @@ func (r *IPv4ACLPolicyDefinitionResource) Schema(ctx context.Context, req resour
MarkdownDescription: helpers.NewAttributeDescription("Source IP prefix").String,
Optional: true,
},
+ "icmp_message": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ICMP Message").String,
+ Optional: true,
+ },
"destination_ip": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Destination IP prefix").String,
Optional: true,
@@ -347,7 +351,7 @@ func (r *IPv4ACLPolicyDefinitionResource) Read(ctx context.Context, req resource
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go
index c091e2ff4..078a8ca88 100644
--- a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go
+++ b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go
@@ -256,7 +256,7 @@ func (r *IPv4DeviceACLPolicyDefinitionResource) Read(ctx context.Context, req re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go b/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go
index 9824add23..a43f902ec 100644
--- a/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go
+++ b/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go
@@ -164,7 +164,7 @@ func (r *IPv4PrefixListPolicyObjectResource) Read(ctx context.Context, req resou
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go
index 504f794b1..dc70ebeb3 100644
--- a/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go
+++ b/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go
@@ -350,7 +350,7 @@ func (r *IPv6ACLPolicyDefinitionResource) Read(ctx context.Context, req resource
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go
index 07d9b203e..d04b8630a 100644
--- a/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go
+++ b/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go
@@ -256,7 +256,7 @@ func (r *IPv6DeviceACLPolicyDefinitionResource) Read(ctx context.Context, req re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go b/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go
index 9b4381bf2..5641f0758 100644
--- a/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go
+++ b/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go
@@ -164,7 +164,7 @@ func (r *IPv6PrefixListPolicyObjectResource) Read(ctx context.Context, req resou
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_local_application_list_policy_object.go b/internal/provider/resource_sdwan_local_application_list_policy_object.go
index c7cacb6c4..cd289fa22 100644
--- a/internal/provider/resource_sdwan_local_application_list_policy_object.go
+++ b/internal/provider/resource_sdwan_local_application_list_policy_object.go
@@ -160,7 +160,7 @@ func (r *LocalApplicationListPolicyObjectResource) Read(ctx context.Context, req
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_localized_policy.go b/internal/provider/resource_sdwan_localized_policy.go
index 9b8f83b19..081c18aa6 100644
--- a/internal/provider/resource_sdwan_localized_policy.go
+++ b/internal/provider/resource_sdwan_localized_policy.go
@@ -233,7 +233,7 @@ func (r *LocalizedPolicyResource) Read(ctx context.Context, req resource.ReadReq
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get("/template/policy/vedge/definition/" + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_mesh_topology_policy_definition.go b/internal/provider/resource_sdwan_mesh_topology_policy_definition.go
index 0cfc1eb36..ea4804626 100644
--- a/internal/provider/resource_sdwan_mesh_topology_policy_definition.go
+++ b/internal/provider/resource_sdwan_mesh_topology_policy_definition.go
@@ -181,7 +181,7 @@ func (r *MeshTopologyPolicyDefinitionResource) Read(ctx context.Context, req res
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_mirror_policy_object.go b/internal/provider/resource_sdwan_mirror_policy_object.go
index e082d4fa6..0cf76a5cd 100644
--- a/internal/provider/resource_sdwan_mirror_policy_object.go
+++ b/internal/provider/resource_sdwan_mirror_policy_object.go
@@ -147,7 +147,7 @@ func (r *MirrorPolicyObjectResource) Read(ctx context.Context, req resource.Read
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_object_group_policy_definition.go b/internal/provider/resource_sdwan_object_group_policy_definition.go
index 8b0b3c72e..7f65181eb 100644
--- a/internal/provider/resource_sdwan_object_group_policy_definition.go
+++ b/internal/provider/resource_sdwan_object_group_policy_definition.go
@@ -195,7 +195,7 @@ func (r *ObjectGroupPolicyDefinitionResource) Read(ctx context.Context, req reso
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_other_feature_profile.go b/internal/provider/resource_sdwan_other_feature_profile.go
new file mode 100644
index 000000000..a13a8da69
--- /dev/null
+++ b/internal/provider/resource_sdwan_other_feature_profile.go
@@ -0,0 +1,236 @@
+// 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"
+ "strings"
+ "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 = &OtherFeatureProfileResource{}
+var _ resource.ResourceWithImportState = &OtherFeatureProfileResource{}
+
+func NewOtherFeatureProfileResource() resource.Resource {
+ return &OtherFeatureProfileResource{}
+}
+
+type OtherFeatureProfileResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *OtherFeatureProfileResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_other_feature_profile"
+}
+
+func (r *OtherFeatureProfileResource) 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 Other Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The name of the transport feature profile").String,
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Description").String,
+ Required: true,
+ },
+ },
+ }
+}
+
+func (r *OtherFeatureProfileResource) 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 *OtherFeatureProfileResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan OtherFeatureProfile
+
+ // 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("id").String())
+
+ 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 *OtherFeatureProfileResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state OtherFeatureProfile
+
+ // 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 strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
+ 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
+ }
+
+ state.fromBody(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 *OtherFeatureProfileResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state OtherFeatureProfile
+
+ // 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()))
+
+ if plan.hasChanges(ctx, &state) {
+ body := plan.toBody(ctx)
+ r.updateMutex.Lock()
+ res, err := r.client.Put(plan.getPath()+url.QueryEscape(plan.Id.ValueString()), body)
+ r.updateMutex.Unlock()
+ if err != nil {
+ if strings.Contains(res.Get("error.message").String(), "Failed to acquire lock") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify policy due to policy being locked by another change. Policy changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else if strings.Contains(res.Get("error.message").String(), "Template locked in edit mode") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify template due to template being locked by another change. Template changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String()))
+ return
+ }
+ }
+ } else {
+ tflog.Debug(ctx, fmt.Sprintf("%s: No changes detected", plan.Name.ValueString()))
+ }
+
+ 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 *OtherFeatureProfileResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state OtherFeatureProfile
+
+ // 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 {
+ 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 *OtherFeatureProfileResource) 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_other_feature_profile_test.go b/internal/provider/resource_sdwan_other_feature_profile_test.go
new file mode 100644
index 000000000..a2edfd0bf
--- /dev/null
+++ b/internal/provider/resource_sdwan_other_feature_profile_test.go
@@ -0,0 +1,64 @@
+// 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 TestAccSdwanOtherFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_feature_profile.test", "name", "OTHER_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_feature_profile.test", "description", "My Other feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanOtherFeatureProfileConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanOtherFeatureProfileConfig_all() string {
+ config := `resource "sdwan_other_feature_profile" "test" {` + "\n"
+ config += ` name = "OTHER_FP_1"` + "\n"
+ config += ` description = "My Other feature profile 1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_other_thousandeyes_feature.go b/internal/provider/resource_sdwan_other_thousandeyes_feature.go
new file mode 100644
index 000000000..14ebf0171
--- /dev/null
+++ b/internal/provider/resource_sdwan_other_thousandeyes_feature.go
@@ -0,0 +1,356 @@
+// 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-validators/int64validator"
+ "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 = &OtherThousandEyesProfileParcelResource{}
+var _ resource.ResourceWithImportState = &OtherThousandEyesProfileParcelResource{}
+
+func NewOtherThousandEyesProfileParcelResource() resource.Resource {
+ return &OtherThousandEyesProfileParcelResource{}
+}
+
+type OtherThousandEyesProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *OtherThousandEyesProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_other_thousandeyes_feature"
+}
+
+func (r *OtherThousandEyesProfileParcelResource) 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 Other ThousandEyes Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "virtual_application": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Virtual application Instance").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "account_group_token": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the Account Group Token").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 210),
+ },
+ },
+ "account_group_token_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VPN number").AddIntegerRangeDescription(0, 65530).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "management_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the Agent IP Address").String,
+ Optional: true,
+ },
+ "management_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "management_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the Agent SubnetMask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "management_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "agent_default_gateway": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the Agent default gateway").String,
+ Optional: true,
+ },
+ "agent_default_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "name_server_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the name server").String,
+ Optional: true,
+ },
+ "name_server_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hostname": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the host name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 235),
+ },
+ },
+ "hostname_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "proxy_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select Web Proxy Type").String,
+ Optional: true,
+ },
+ "proxy_host": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the Proxy Host").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 174),
+ },
+ },
+ "proxy_host_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "proxy_port": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the Proxy Port").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "proxy_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "pac_url": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the proxy PAC url").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 183),
+ },
+ },
+ "pac_url_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *OtherThousandEyesProfileParcelResource) 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 *OtherThousandEyesProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan OtherThousandEyes
+
+ // 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 *OtherThousandEyesProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state OtherThousandEyes
+
+ // 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 *OtherThousandEyesProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state OtherThousandEyes
+
+ // 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 *OtherThousandEyesProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state OtherThousandEyes
+
+ // 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 *OtherThousandEyesProfileParcelResource) 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_other_thousandeyes_feature_test.go b/internal/provider/resource_sdwan_other_thousandeyes_feature_test.go
new file mode 100644
index 000000000..7237c5a4a
--- /dev/null
+++ b/internal/provider/resource_sdwan_other_thousandeyes_feature_test.go
@@ -0,0 +1,97 @@
+// 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 TestAccSdwanOtherThousandEyesProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.account_group_token", "qwer"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.management_ip", "10.0.0.2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.management_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.agent_default_gateway", "10.0.0.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.name_server_ip", "77.77.77.71"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.hostname", "thousandeyesHost"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.proxy_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.proxy_host", "proxy.thousandeyes.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_thousandeyes_feature.test", "virtual_application.0.proxy_port", "3128"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanOtherThousandEyesPrerequisitesProfileParcelConfig + testAccSdwanOtherThousandEyesProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanOtherThousandEyesPrerequisitesProfileParcelConfig = `
+resource "sdwan_other_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// 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 testAccSdwanOtherThousandEyesProfileParcelConfig_all() string {
+ config := `resource "sdwan_other_thousandeyes_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_other_feature_profile.test.id` + "\n"
+ config += ` virtual_application = [{` + "\n"
+ config += ` account_group_token = "qwer"` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` management_ip = "10.0.0.2"` + "\n"
+ config += ` management_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` agent_default_gateway = "10.0.0.1"` + "\n"
+ config += ` name_server_ip = "77.77.77.71"` + "\n"
+ config += ` hostname = "thousandeyesHost"` + "\n"
+ config += ` proxy_type = "static"` + "\n"
+ config += ` proxy_host = "proxy.thousandeyes.com"` + "\n"
+ config += ` proxy_port = 3128` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_other_ucse_feature.go b/internal/provider/resource_sdwan_other_ucse_feature.go
new file mode 100644
index 000000000..831774f99
--- /dev/null
+++ b/internal/provider/resource_sdwan_other_ucse_feature.go
@@ -0,0 +1,350 @@
+// 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/int64validator"
+ "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 = &OtherUCSEProfileParcelResource{}
+var _ resource.ResourceWithImportState = &OtherUCSEProfileParcelResource{}
+
+func NewOtherUCSEProfileParcelResource() resource.Resource {
+ return &OtherUCSEProfileParcelResource{}
+}
+
+type OtherUCSEProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *OtherUCSEProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_other_ucse_feature"
+}
+
+func (r *OtherUCSEProfileParcelResource) 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 Other UCSE Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "bay": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Bay").AddIntegerRangeDescription(0, 2).String,
+ Required: true,
+ },
+ "slot": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Slot").AddIntegerRangeDescription(0, 3).String,
+ Required: true,
+ },
+ "access_port_dedicated": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Dedicated").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "access_port_shared_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("ge1", "ge2", "ge3", "te2", "te3", "console", "failover").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("ge1", "ge2", "ge3", "te2", "te3", "console", "failover"),
+ },
+ },
+ "access_port_shared_failover_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("ge2", "te2").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("ge2", "te2"),
+ },
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign IPv4 address").String,
+ Required: 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])`), ""),
+ },
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_gateway": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign default gateway").String,
+ Required: true,
+ },
+ "default_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vlan_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign Vlan Id").AddIntegerRangeDescription(2, 4095).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(2, 4095),
+ },
+ },
+ "vlan_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "assign_priority": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign priority").AddIntegerRangeDescription(0, 7).String,
+ Optional: true,
+ },
+ "assign_priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name: GigabitEthernet0/<>/<> when present").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Inteface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ucse)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ucse_interface_vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("UCSE Interface VPN").AddIntegerRangeDescription(1, 65527).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65527),
+ },
+ },
+ "ucse_interface_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign IPv4 address").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])`), ""),
+ },
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *OtherUCSEProfileParcelResource) 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 *OtherUCSEProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan OtherUCSE
+
+ // 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 *OtherUCSEProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state OtherUCSE
+
+ // 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 *OtherUCSEProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state OtherUCSE
+
+ // 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 *OtherUCSEProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state OtherUCSE
+
+ // 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 *OtherUCSEProfileParcelResource) 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_other_ucse_feature_test.go b/internal/provider/resource_sdwan_other_ucse_feature_test.go
new file mode 100644
index 000000000..f4a335531
--- /dev/null
+++ b/internal/provider/resource_sdwan_other_ucse_feature_test.go
@@ -0,0 +1,117 @@
+// 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 TestAccSdwanOtherUCSEProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "bay", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "slot", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "access_port_dedicated", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "access_port_shared_type", "ge1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "access_port_shared_failover_type", "ge2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "ipv4_address", "2.2.2.2/24"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "default_gateway", "2.2.2.2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "vlan_id", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "assign_priority", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "interfaces.0.interface_name", "ucse2/0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "interfaces.0.ucse_interface_vpn", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_other_ucse_feature.test", "interfaces.0.ipv4_address", "10.1.15.15/24"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanOtherUCSEPrerequisitesProfileParcelConfig + testAccSdwanOtherUCSEProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanOtherUCSEPrerequisitesProfileParcelConfig + testAccSdwanOtherUCSEProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanOtherUCSEPrerequisitesProfileParcelConfig = `
+resource "sdwan_other_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanOtherUCSEProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_other_ucse_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_other_feature_profile.test.id` + "\n"
+ config += ` bay = 2` + "\n"
+ config += ` slot = 0` + "\n"
+ config += ` access_port_shared_type = "ge1"` + "\n"
+ config += ` access_port_shared_failover_type = "ge2"` + "\n"
+ config += ` ipv4_address = "2.2.2.2/24"` + "\n"
+ config += ` default_gateway = "2.2.2.2"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanOtherUCSEProfileParcelConfig_all() string {
+ config := `resource "sdwan_other_ucse_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_other_feature_profile.test.id` + "\n"
+ config += ` bay = 2` + "\n"
+ config += ` slot = 0` + "\n"
+ config += ` access_port_dedicated = false` + "\n"
+ config += ` access_port_shared_type = "ge1"` + "\n"
+ config += ` access_port_shared_failover_type = "ge2"` + "\n"
+ config += ` ipv4_address = "2.2.2.2/24"` + "\n"
+ config += ` default_gateway = "2.2.2.2"` + "\n"
+ config += ` vlan_id = 3` + "\n"
+ config += ` assign_priority = 3` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` interface_name = "ucse2/0"` + "\n"
+ config += ` ucse_interface_vpn = 2` + "\n"
+ config += ` ipv4_address = "10.1.15.15/24"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policer_policy_object.go b/internal/provider/resource_sdwan_policer_policy_object.go
index a4e047b36..911025dea 100644
--- a/internal/provider/resource_sdwan_policer_policy_object.go
+++ b/internal/provider/resource_sdwan_policer_policy_object.go
@@ -163,7 +163,7 @@ func (r *PolicerPolicyObjectResource) Read(ctx context.Context, req resource.Rea
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_policy_object_app_probe_class.go b/internal/provider/resource_sdwan_policy_object_app_probe_class.go
new file mode 100644
index 000000000..25a402d26
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_app_probe_class.go
@@ -0,0 +1,277 @@
+// 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-validators/int64validator"
+ "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 = &PolicyObjectAppProbeClassProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectAppProbeClassProfileParcelResource{}
+
+func NewPolicyObjectAppProbeClassProfileParcelResource() resource.Resource {
+ return &PolicyObjectAppProbeClassProfileParcelResource{}
+}
+
+type PolicyObjectAppProbeClassProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectAppProbeClassProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_app_probe_class"
+}
+
+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 Class Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("App Probe List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "map": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Map").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "color": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Color").AddStringEnumDescription("3g", "biz-internet", "blue", "bronze", "custom1", "custom2", "custom3", "default", "gold", "green", "lte", "metro-ethernet", "mpls", "private1", "private2", "private3", "private4", "private5", "private6", "public-internet", "red", "silver").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("3g", "biz-internet", "blue", "bronze", "custom1", "custom2", "custom3", "default", "gold", "green", "lte", "metro-ethernet", "mpls", "private1", "private2", "private3", "private4", "private5", "private6", "public-internet", "red", "silver"),
+ },
+ },
+ "dscp": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DSCP number").AddIntegerRangeDescription(0, 63).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(63),
+ },
+ },
+ },
+ },
+ },
+ "forwarding_class": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Forwarding Class Name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectAppProbeClassProfileParcelResource) 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 *PolicyObjectAppProbeClassProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectAppProbeClass
+
+ // 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 *PolicyObjectAppProbeClassProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectAppProbeClass
+
+ // 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 *PolicyObjectAppProbeClassProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectAppProbeClass
+
+ // 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 *PolicyObjectAppProbeClassProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectAppProbeClass
+
+ // 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 *PolicyObjectAppProbeClassProfileParcelResource) 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_app_probe_class_test.go b/internal/provider/resource_sdwan_policy_object_app_probe_class_test.go
new file mode 100644
index 000000000..cd28fc88f
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_app_probe_class_test.go
@@ -0,0 +1,85 @@
+// 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 TestAccSdwanPolicyObjectAppProbeClassProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_class.test", "entries.0.map.0.color", "3g"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_class.test", "entries.0.map.0.dscp", "45"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_class.test", "entries.0.forwarding_class", "classlist1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectAppProbeClassProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectAppProbeClassProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_app_probe_class" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` map = [{` + "\n"
+ config += ` color = "3g"` + "\n"
+ config += ` dscp = 45` + "\n"
+ config += ` }]` + "\n"
+ config += ` forwarding_class = "classlist1"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_application_list.go b/internal/provider/resource_sdwan_policy_object_application_list.go
new file mode 100644
index 000000000..3377dac82
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_application_list.go
@@ -0,0 +1,256 @@
+// 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 = &PolicyObjectApplicationListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectApplicationListProfileParcelResource{}
+
+func NewPolicyObjectApplicationListProfileParcelResource() resource.Resource {
+ return &PolicyObjectApplicationListProfileParcelResource{}
+}
+
+type PolicyObjectApplicationListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectApplicationListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_application_list"
+}
+
+func (r *PolicyObjectApplicationListProfileParcelResource) 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 Application List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Centralized Policy App List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "application": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "application_family": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectApplicationListProfileParcelResource) 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 *PolicyObjectApplicationListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectApplicationList
+
+ // 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 *PolicyObjectApplicationListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectApplicationList
+
+ // 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 *PolicyObjectApplicationListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectApplicationList
+
+ // 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 *PolicyObjectApplicationListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectApplicationList
+
+ // 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 *PolicyObjectApplicationListProfileParcelResource) 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_application_list_test.go b/internal/provider/resource_sdwan_policy_object_application_list_test.go
new file mode 100644
index 000000000..1c09bdf70
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_application_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectApplicationListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_application_list.test", "entries.0.application", "3com-amp3"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectApplicationListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectApplicationListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectApplicationListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectApplicationListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_application_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` application = "3com-amp3"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_as_path_list.go b/internal/provider/resource_sdwan_policy_object_as_path_list.go
new file mode 100644
index 000000000..d37ba1003
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_as_path_list.go
@@ -0,0 +1,266 @@
+// 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/int64validator"
+ "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 = &PolicyObjectASPathListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectASPathListProfileParcelResource{}
+
+func NewPolicyObjectASPathListProfileParcelResource() resource.Resource {
+ return &PolicyObjectASPathListProfileParcelResource{}
+}
+
+type PolicyObjectASPathListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectASPathListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_as_path_list"
+}
+
+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 List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "as_path_list_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("As path List Number").AddIntegerRangeDescription(1, 500).String,
+ Required: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 500),
+ },
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("AS Path List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_list": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[^<>]*`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectASPathListProfileParcelResource) 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 *PolicyObjectASPathListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectASPathList
+
+ // 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 *PolicyObjectASPathListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectASPathList
+
+ // 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 *PolicyObjectASPathListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectASPathList
+
+ // 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 *PolicyObjectASPathListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectASPathList
+
+ // 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 *PolicyObjectASPathListProfileParcelResource) 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_as_path_list_test.go b/internal/provider/resource_sdwan_policy_object_as_path_list_test.go
new file mode 100644
index 000000000..27888d543
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_as_path_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccSdwanPolicyObjectASPathListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_as_path_list.test", "as_path_list_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_as_path_list.test", "entries.0.as_path_list", "110"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectASPathListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectASPathListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_as_path_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` as_path_list_id = 1` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` as_path_list = "110"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_class_map.go b/internal/provider/resource_sdwan_policy_object_class_map.go
new file mode 100644
index 000000000..8254adab0
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_class_map.go
@@ -0,0 +1,257 @@
+// 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-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 = &PolicyObjectClassMapProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectClassMapProfileParcelResource{}
+
+func NewPolicyObjectClassMapProfileParcelResource() resource.Resource {
+ return &PolicyObjectClassMapProfileParcelResource{}
+}
+
+type PolicyObjectClassMapProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectClassMapProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_class_map"
+}
+
+func (r *PolicyObjectClassMapProfileParcelResource) 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 Class Map Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("class map List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "queue": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("select a queue").AddStringEnumDescription("0", "1", "2", "3", "4", "5", "6", "7").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("0", "1", "2", "3", "4", "5", "6", "7"),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectClassMapProfileParcelResource) 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 *PolicyObjectClassMapProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectClassMap
+
+ // 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 *PolicyObjectClassMapProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectClassMap
+
+ // 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 *PolicyObjectClassMapProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectClassMap
+
+ // 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 *PolicyObjectClassMapProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectClassMap
+
+ // 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 *PolicyObjectClassMapProfileParcelResource) 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_class_map_test.go b/internal/provider/resource_sdwan_policy_object_class_map_test.go
new file mode 100644
index 000000000..ecef193b0
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_class_map_test.go
@@ -0,0 +1,80 @@
+// 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 TestAccSdwanPolicyObjectClassMapProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_class_map.test", "entries.0.queue", "0"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectClassMapPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectClassMapProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectClassMapPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectClassMapProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_class_map" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` queue = "0"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_color_list.go b/internal/provider/resource_sdwan_policy_object_color_list.go
new file mode 100644
index 000000000..30eba03aa
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_color_list.go
@@ -0,0 +1,257 @@
+// 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-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 = &PolicyObjectColorListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectColorListProfileParcelResource{}
+
+func NewPolicyObjectColorListProfileParcelResource() resource.Resource {
+ return &PolicyObjectColorListProfileParcelResource{}
+}
+
+type PolicyObjectColorListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectColorListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_color_list"
+}
+
+func (r *PolicyObjectColorListProfileParcelResource) 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 Color List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Color List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "color": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("3g", "biz-internet", "blue", "bronze", "custom1", "custom2", "custom3", "default", "gold", "green", "lte", "metro-ethernet", "mpls", "private1", "private2", "private3", "private4", "private5", "private6", "public-internet", "red", "silver").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("3g", "biz-internet", "blue", "bronze", "custom1", "custom2", "custom3", "default", "gold", "green", "lte", "metro-ethernet", "mpls", "private1", "private2", "private3", "private4", "private5", "private6", "public-internet", "red", "silver"),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectColorListProfileParcelResource) 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 *PolicyObjectColorListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectColorList
+
+ // 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 *PolicyObjectColorListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectColorList
+
+ // 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 *PolicyObjectColorListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectColorList
+
+ // 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 *PolicyObjectColorListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectColorList
+
+ // 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 *PolicyObjectColorListProfileParcelResource) 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_color_list_test.go b/internal/provider/resource_sdwan_policy_object_color_list_test.go
new file mode 100644
index 000000000..d4ffc1507
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_color_list_test.go
@@ -0,0 +1,80 @@
+// 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 TestAccSdwanPolicyObjectColorListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_color_list.test", "entries.0.color", "blue"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectColorListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectColorListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectColorListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectColorListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_color_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` color = "blue"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list.go b/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list.go
new file mode 100644
index 000000000..30eca46ca
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list.go
@@ -0,0 +1,261 @@
+// 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-validators/int64validator"
+ "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 = &PolicyObjectDataIPv4PrefixListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectDataIPv4PrefixListProfileParcelResource{}
+
+func NewPolicyObjectDataIPv4PrefixListProfileParcelResource() resource.Resource {
+ return &PolicyObjectDataIPv4PrefixListProfileParcelResource{}
+}
+
+type PolicyObjectDataIPv4PrefixListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectDataIPv4PrefixListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_data_ipv4_prefix_list"
+}
+
+func (r *PolicyObjectDataIPv4PrefixListProfileParcelResource) 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 Data IPv4 Prefix List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Data Prefix List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 address").String,
+ Optional: true,
+ },
+ "ipv4_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 prefix Length").AddIntegerRangeDescription(0, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(32),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectDataIPv4PrefixListProfileParcelResource) 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 *PolicyObjectDataIPv4PrefixListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectDataIPv4PrefixList
+
+ // 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 *PolicyObjectDataIPv4PrefixListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectDataIPv4PrefixList
+
+ // 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 *PolicyObjectDataIPv4PrefixListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectDataIPv4PrefixList
+
+ // 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 *PolicyObjectDataIPv4PrefixListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectDataIPv4PrefixList
+
+ // 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 *PolicyObjectDataIPv4PrefixListProfileParcelResource) 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_data_ipv4_prefix_list_test.go b/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list_test.go
new file mode 100644
index 000000000..dfa592276
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list_test.go
@@ -0,0 +1,82 @@
+// 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 TestAccSdwanPolicyObjectDataIPv4PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_data_ipv4_prefix_list.test", "entries.0.ipv4_address", "10.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_data_ipv4_prefix_list.test", "entries.0.ipv4_prefix_length", "8"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectDataIPv4PrefixListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectDataIPv4PrefixListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectDataIPv4PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectDataIPv4PrefixListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_data_ipv4_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv4_address = "10.0.0.0"` + "\n"
+ config += ` ipv4_prefix_length = 8` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list.go b/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list.go
new file mode 100644
index 000000000..4ca2974fa
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list.go
@@ -0,0 +1,261 @@
+// 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-validators/int64validator"
+ "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 = &PolicyObjectDataIPv6PrefixListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectDataIPv6PrefixListProfileParcelResource{}
+
+func NewPolicyObjectDataIPv6PrefixListProfileParcelResource() resource.Resource {
+ return &PolicyObjectDataIPv6PrefixListProfileParcelResource{}
+}
+
+type PolicyObjectDataIPv6PrefixListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectDataIPv6PrefixListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_data_ipv6_prefix_list"
+}
+
+func (r *PolicyObjectDataIPv6PrefixListProfileParcelResource) 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 Data IPv6 Prefix List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Prefix List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 address").String,
+ Optional: true,
+ },
+ "ipv6_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 prefix").AddIntegerRangeDescription(0, 128).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(128),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectDataIPv6PrefixListProfileParcelResource) 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 *PolicyObjectDataIPv6PrefixListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectDataIPv6PrefixList
+
+ // 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 *PolicyObjectDataIPv6PrefixListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectDataIPv6PrefixList
+
+ // 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 *PolicyObjectDataIPv6PrefixListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectDataIPv6PrefixList
+
+ // 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 *PolicyObjectDataIPv6PrefixListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectDataIPv6PrefixList
+
+ // 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 *PolicyObjectDataIPv6PrefixListProfileParcelResource) 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_data_ipv6_prefix_list_test.go b/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list_test.go
new file mode 100644
index 000000000..c3c2df45c
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list_test.go
@@ -0,0 +1,82 @@
+// 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 TestAccSdwanPolicyObjectDataIPv6PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_data_ipv6_prefix_list.test", "entries.0.ipv6_address", "2001:db8:85a3::8a2e:370:7334"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_data_ipv6_prefix_list.test", "entries.0.ipv6_prefix_length", "64"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectDataIPv6PrefixListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectDataIPv6PrefixListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectDataIPv6PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectDataIPv6PrefixListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_data_ipv6_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv6_address = "2001:db8:85a3::8a2e:370:7334"` + "\n"
+ config += ` ipv6_prefix_length = 64` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_expanded_community_list.go b/internal/provider/resource_sdwan_policy_object_expanded_community_list.go
new file mode 100644
index 000000000..ae01c1e3e
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_expanded_community_list.go
@@ -0,0 +1,249 @@
+// 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 = &PolicyObjectExpandedCommunityListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectExpandedCommunityListProfileParcelResource{}
+
+func NewPolicyObjectExpandedCommunityListProfileParcelResource() resource.Resource {
+ return &PolicyObjectExpandedCommunityListProfileParcelResource{}
+}
+
+type PolicyObjectExpandedCommunityListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectExpandedCommunityListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_expanded_community_list"
+}
+
+func (r *PolicyObjectExpandedCommunityListProfileParcelResource) 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 Expanded Community List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "expanded_community_lists": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Expanded Community List").String,
+ ElementType: types.StringType,
+ Required: true,
+ },
+ "expanded_community_lists_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectExpandedCommunityListProfileParcelResource) 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 *PolicyObjectExpandedCommunityListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectExpandedCommunityList
+
+ // 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 *PolicyObjectExpandedCommunityListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectExpandedCommunityList
+
+ // 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 *PolicyObjectExpandedCommunityListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectExpandedCommunityList
+
+ // 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 *PolicyObjectExpandedCommunityListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectExpandedCommunityList
+
+ // 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 *PolicyObjectExpandedCommunityListProfileParcelResource) 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_expanded_community_list_test.go b/internal/provider/resource_sdwan_policy_object_expanded_community_list_test.go
new file mode 100644
index 000000000..855544c87
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_expanded_community_list_test.go
@@ -0,0 +1,77 @@
+// 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 TestAccSdwanPolicyObjectExpandedCommunityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectExpandedCommunityListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectExpandedCommunityListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectExpandedCommunityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectExpandedCommunityListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_expanded_community_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` expanded_community_lists = ["abcd"]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_extended_community_list.go b/internal/provider/resource_sdwan_policy_object_extended_community_list.go
new file mode 100644
index 000000000..24d564f01
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_extended_community_list.go
@@ -0,0 +1,258 @@
+// 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 = &PolicyObjectExtendedCommunityListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectExtendedCommunityListProfileParcelResource{}
+
+func NewPolicyObjectExtendedCommunityListProfileParcelResource() resource.Resource {
+ return &PolicyObjectExtendedCommunityListProfileParcelResource{}
+}
+
+type PolicyObjectExtendedCommunityListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectExtendedCommunityListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_extended_community_list"
+}
+
+func (r *PolicyObjectExtendedCommunityListProfileParcelResource) 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 Extended Community List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Extended Community List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "extended_community": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("can be soo 10.0.0.1:30 or rt 500:50 etc.").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(rt|soo) ([\d\.]+):(\d+)$`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectExtendedCommunityListProfileParcelResource) 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 *PolicyObjectExtendedCommunityListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectExtendedCommunityList
+
+ // 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 *PolicyObjectExtendedCommunityListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectExtendedCommunityList
+
+ // 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 *PolicyObjectExtendedCommunityListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectExtendedCommunityList
+
+ // 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 *PolicyObjectExtendedCommunityListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectExtendedCommunityList
+
+ // 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 *PolicyObjectExtendedCommunityListProfileParcelResource) 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_extended_community_list_test.go b/internal/provider/resource_sdwan_policy_object_extended_community_list_test.go
new file mode 100644
index 000000000..c0f6e7ace
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_extended_community_list_test.go
@@ -0,0 +1,80 @@
+// 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 TestAccSdwanPolicyObjectExtendedCommunityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_extended_community_list.test", "entries.0.extended_community", "soo 10.0.0.1:30"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectExtendedCommunityListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectExtendedCommunityListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectExtendedCommunityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectExtendedCommunityListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_extended_community_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` extended_community = "soo 10.0.0.1:30"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_feature_profile.go b/internal/provider/resource_sdwan_policy_object_feature_profile.go
new file mode 100644
index 000000000..e213c55d4
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_feature_profile.go
@@ -0,0 +1,238 @@
+// 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"
+ "strings"
+ "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 = &PolicyObjectFeatureProfileResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectFeatureProfileResource{}
+
+func NewPolicyObjectFeatureProfileResource() resource.Resource {
+ return &PolicyObjectFeatureProfileResource{}
+}
+
+type PolicyObjectFeatureProfileResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectFeatureProfileResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_feature_profile"
+}
+
+func (r *PolicyObjectFeatureProfileResource) 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("SD-WAN manager supports only a single policy object feature profile to be configured. This resource will therefore either create a new one if none exists or update the existing one.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The name of the policy object feature profile").String,
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Description").String,
+ Required: true,
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectFeatureProfileResource) 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
+
+func (r *PolicyObjectFeatureProfileResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectFeatureProfile
+
+ // 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.Get(plan.getPath())
+ if err != nil {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object (GET), got error: %s, %s", err, res.String()))
+ return
+ }
+ if len(res.Array()) > 0 {
+ plan.Id = types.StringValue(res.Array()[0].Get("profileId").String())
+ 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
+ }
+ } else {
+ 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("id").String())
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Create finished successfully", plan.Name.ValueString()))
+
+ diags = resp.State.Set(ctx, &plan)
+ resp.Diagnostics.Append(diags...)
+}
+
+// Section below is generated&owned by "gen/generator.go". //template:begin read
+func (r *PolicyObjectFeatureProfileResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectFeatureProfile
+
+ // 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 strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
+ 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
+ }
+
+ state.fromBody(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 *PolicyObjectFeatureProfileResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectFeatureProfile
+
+ // 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()))
+
+ if plan.hasChanges(ctx, &state) {
+ body := plan.toBody(ctx)
+ r.updateMutex.Lock()
+ res, err := r.client.Put(plan.getPath()+url.QueryEscape(plan.Id.ValueString()), body)
+ r.updateMutex.Unlock()
+ if err != nil {
+ if strings.Contains(res.Get("error.message").String(), "Failed to acquire lock") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify policy due to policy being locked by another change. Policy changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else if strings.Contains(res.Get("error.message").String(), "Template locked in edit mode") {
+ resp.Diagnostics.AddWarning("Client Warning", "Failed to modify template due to template being locked by another change. Template changes will not be applied. Re-run 'terraform apply' to try again.")
+ } else {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String()))
+ return
+ }
+ }
+ } else {
+ tflog.Debug(ctx, fmt.Sprintf("%s: No changes detected", plan.Name.ValueString()))
+ }
+
+ 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
+
+func (r *PolicyObjectFeatureProfileResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectFeatureProfile
+
+ // 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()))
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Delete finished successfully", state.Name.ValueString()))
+
+ resp.State.RemoveResource(ctx)
+}
+
+// Section below is generated&owned by "gen/generator.go". //template:begin import
+func (r *PolicyObjectFeatureProfileResource) 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_feature_profile_test.go b/internal/provider/resource_sdwan_policy_object_feature_profile_test.go
new file mode 100644
index 000000000..70ad8ac12
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_feature_profile_test.go
@@ -0,0 +1,64 @@
+// 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 TestAccSdwanPolicyObjectFeatureProfile(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_feature_profile.test", "name", "POLICY_OBJECT_FP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_feature_profile.test", "description", "My policy object feature profile 1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanPolicyObjectFeatureProfileConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanPolicyObjectFeatureProfileConfig_all() string {
+ config := `resource "sdwan_policy_object_feature_profile" "test" {` + "\n"
+ config += ` name = "POLICY_OBJECT_FP_1"` + "\n"
+ config += ` description = "My policy object feature profile 1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list.go b/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list.go
new file mode 100644
index 000000000..206065599
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list.go
@@ -0,0 +1,275 @@
+// 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-validators/int64validator"
+ "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 = &PolicyObjectIPv4PrefixListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectIPv4PrefixListProfileParcelResource{}
+
+func NewPolicyObjectIPv4PrefixListProfileParcelResource() resource.Resource {
+ return &PolicyObjectIPv4PrefixListProfileParcelResource{}
+}
+
+type PolicyObjectIPv4PrefixListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectIPv4PrefixListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_ipv4_prefix_list"
+}
+
+func (r *PolicyObjectIPv4PrefixListProfileParcelResource) 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 IPv4 Prefix List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Prefix List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 address").String,
+ Optional: true,
+ },
+ "ipv4_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 prefix length").AddIntegerRangeDescription(0, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(32),
+ },
+ },
+ "le": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 prefix length with le range operator").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "ge": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 prefix length with ge range operator").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectIPv4PrefixListProfileParcelResource) 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 *PolicyObjectIPv4PrefixListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectIPv4PrefixList
+
+ // 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 *PolicyObjectIPv4PrefixListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectIPv4PrefixList
+
+ // 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 *PolicyObjectIPv4PrefixListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectIPv4PrefixList
+
+ // 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 *PolicyObjectIPv4PrefixListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectIPv4PrefixList
+
+ // 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 *PolicyObjectIPv4PrefixListProfileParcelResource) 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_ipv4_prefix_list_test.go b/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list_test.go
new file mode 100644
index 000000000..135e91c68
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list_test.go
@@ -0,0 +1,102 @@
+// 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 TestAccSdwanPolicyObjectIPv4PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv4_prefix_list.test", "entries.0.ipv4_address", "10.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv4_prefix_list.test", "entries.0.ipv4_prefix_length", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv4_prefix_list.test", "entries.0.le", "24"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv4_prefix_list.test", "entries.0.ge", "16"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanPolicyObjectIPv4PrefixListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectIPv4PrefixListProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanPolicyObjectIPv4PrefixListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectIPv4PrefixListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectIPv4PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanPolicyObjectIPv4PrefixListProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_policy_object_ipv4_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv4_address = "10.0.0.0"` + "\n"
+ config += ` ipv4_prefix_length = 8` + "\n"
+ config += ` le = 24` + "\n"
+ config += ` ge = 16` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanPolicyObjectIPv4PrefixListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_ipv4_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv4_address = "10.0.0.0"` + "\n"
+ config += ` ipv4_prefix_length = 8` + "\n"
+ config += ` le = 24` + "\n"
+ config += ` ge = 16` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list.go b/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list.go
new file mode 100644
index 000000000..831ee7ed3
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list.go
@@ -0,0 +1,275 @@
+// 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-validators/int64validator"
+ "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 = &PolicyObjectIPv6PrefixListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectIPv6PrefixListProfileParcelResource{}
+
+func NewPolicyObjectIPv6PrefixListProfileParcelResource() resource.Resource {
+ return &PolicyObjectIPv6PrefixListProfileParcelResource{}
+}
+
+type PolicyObjectIPv6PrefixListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectIPv6PrefixListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_ipv6_prefix_list"
+}
+
+func (r *PolicyObjectIPv6PrefixListProfileParcelResource) 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 IPv6 Prefix List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Prefix List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 address").String,
+ Optional: true,
+ },
+ "ipv6_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 prefix length").AddIntegerRangeDescription(0, 128).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(128),
+ },
+ },
+ "le": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 prefix length with le range operator").AddIntegerRangeDescription(1, 128).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 128),
+ },
+ },
+ "ge": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 prefix length with ge range operator").AddIntegerRangeDescription(1, 128).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 128),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectIPv6PrefixListProfileParcelResource) 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 *PolicyObjectIPv6PrefixListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectIPv6PrefixList
+
+ // 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 *PolicyObjectIPv6PrefixListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectIPv6PrefixList
+
+ // 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 *PolicyObjectIPv6PrefixListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectIPv6PrefixList
+
+ // 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 *PolicyObjectIPv6PrefixListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectIPv6PrefixList
+
+ // 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 *PolicyObjectIPv6PrefixListProfileParcelResource) 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_ipv6_prefix_list_test.go b/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list_test.go
new file mode 100644
index 000000000..b3c5c5178
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list_test.go
@@ -0,0 +1,102 @@
+// 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 TestAccSdwanPolicyObjectIPv6PrefixListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv6_prefix_list.test", "entries.0.ipv6_address", "2001:db8:85a3::8a2e:370:7334"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv6_prefix_list.test", "entries.0.ipv6_prefix_length", "64"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv6_prefix_list.test", "entries.0.le", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_ipv6_prefix_list.test", "entries.0.ge", "70"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanPolicyObjectIPv6PrefixListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectIPv6PrefixListProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanPolicyObjectIPv6PrefixListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectIPv6PrefixListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectIPv6PrefixListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanPolicyObjectIPv6PrefixListProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_policy_object_ipv6_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv6_address = "2001:db8:85a3::8a2e:370:7334"` + "\n"
+ config += ` ipv6_prefix_length = 64` + "\n"
+ config += ` le = 100` + "\n"
+ config += ` ge = 70` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanPolicyObjectIPv6PrefixListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_ipv6_prefix_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` ipv6_address = "2001:db8:85a3::8a2e:370:7334"` + "\n"
+ config += ` ipv6_prefix_length = 64` + "\n"
+ config += ` le = 100` + "\n"
+ config += ` ge = 70` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_mirror.go b/internal/provider/resource_sdwan_policy_object_mirror.go
new file mode 100644
index 000000000..a8d964c1d
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_mirror.go
@@ -0,0 +1,256 @@
+// 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 = &PolicyObjectMirrorProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectMirrorProfileParcelResource{}
+
+func NewPolicyObjectMirrorProfileParcelResource() resource.Resource {
+ return &PolicyObjectMirrorProfileParcelResource{}
+}
+
+type PolicyObjectMirrorProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectMirrorProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_mirror"
+}
+
+func (r *PolicyObjectMirrorProfileParcelResource) 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 Mirror Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Mirror List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "remote_destination_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("remote destination ip address").String,
+ Optional: true,
+ },
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("source ip address").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectMirrorProfileParcelResource) 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 *PolicyObjectMirrorProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectMirror
+
+ // 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 *PolicyObjectMirrorProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectMirror
+
+ // 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 *PolicyObjectMirrorProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectMirror
+
+ // 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 *PolicyObjectMirrorProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectMirror
+
+ // 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 *PolicyObjectMirrorProfileParcelResource) 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_mirror_test.go b/internal/provider/resource_sdwan_policy_object_mirror_test.go
new file mode 100644
index 000000000..b6a91f728
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_mirror_test.go
@@ -0,0 +1,82 @@
+// 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 TestAccSdwanPolicyObjectMirrorProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_mirror.test", "entries.0.remote_destination_ip", "10.0.0.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_mirror.test", "entries.0.source_ip", "10.0.0.2"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectMirrorPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectMirrorProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectMirrorPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectMirrorProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_mirror" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` remote_destination_ip = "10.0.0.1"` + "\n"
+ config += ` source_ip = "10.0.0.2"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_policer.go b/internal/provider/resource_sdwan_policy_object_policer.go
new file mode 100644
index 000000000..a820e3658
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_policer.go
@@ -0,0 +1,272 @@
+// 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-validators/int64validator"
+ "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 = &PolicyObjectPolicerProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectPolicerProfileParcelResource{}
+
+func NewPolicyObjectPolicerProfileParcelResource() resource.Resource {
+ return &PolicyObjectPolicerProfileParcelResource{}
+}
+
+type PolicyObjectPolicerProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectPolicerProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_policer"
+}
+
+func (r *PolicyObjectPolicerProfileParcelResource) 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 Policer Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Policer Entries").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "burst_bytes": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Burst (Bytes)").AddIntegerRangeDescription(15000, 10000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(15000, 10000000),
+ },
+ },
+ "exceed_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Exceed options such as Drop or Remark").AddStringEnumDescription("drop", "remark").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("drop", "remark"),
+ },
+ },
+ "rate_bps": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Rate (bps)").AddIntegerRangeDescription(8, 100000000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000000),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectPolicerProfileParcelResource) 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 *PolicyObjectPolicerProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectPolicer
+
+ // 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 *PolicyObjectPolicerProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectPolicer
+
+ // 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 *PolicyObjectPolicerProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectPolicer
+
+ // 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 *PolicyObjectPolicerProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectPolicer
+
+ // 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 *PolicyObjectPolicerProfileParcelResource) 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_policer_test.go b/internal/provider/resource_sdwan_policy_object_policer_test.go
new file mode 100644
index 000000000..481090025
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_policer_test.go
@@ -0,0 +1,84 @@
+// 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 TestAccSdwanPolicyObjectPolicerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_policer.test", "entries.0.burst_bytes", "56500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_policer.test", "entries.0.exceed_action", "remark"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_policer.test", "entries.0.rate_bps", "60000"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectPolicerPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectPolicerProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectPolicerPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectPolicerProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_policer" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` burst_bytes = 56500` + "\n"
+ config += ` exceed_action = "remark"` + "\n"
+ config += ` rate_bps = 60000` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_preferred_color_group.go b/internal/provider/resource_sdwan_policy_object_preferred_color_group.go
new file mode 100644
index 000000000..43be0a927
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_preferred_color_group.go
@@ -0,0 +1,286 @@
+// 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-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 = &PolicyObjectPreferredColorGroupProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectPreferredColorGroupProfileParcelResource{}
+
+func NewPolicyObjectPreferredColorGroupProfileParcelResource() resource.Resource {
+ return &PolicyObjectPreferredColorGroupProfileParcelResource{}
+}
+
+type PolicyObjectPreferredColorGroupProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectPreferredColorGroupProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_preferred_color_group"
+}
+
+func (r *PolicyObjectPreferredColorGroupProfileParcelResource) 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 Preferred Color Group Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Preferred Color Group List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "primary_color_preference": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "primary_path_preference": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("all-paths", "direct-path", "multi-hop-path").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("all-paths", "direct-path", "multi-hop-path"),
+ },
+ },
+ "secondary_color_preference": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "secondary_path_preference": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("all-paths", "direct-path", "multi-hop-path").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("all-paths", "direct-path", "multi-hop-path"),
+ },
+ },
+ "tertiary_color_preference": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "tertiary_path_preference": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("all-paths", "direct-path", "multi-hop-path").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("all-paths", "direct-path", "multi-hop-path"),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectPreferredColorGroupProfileParcelResource) 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 *PolicyObjectPreferredColorGroupProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectPreferredColorGroup
+
+ // 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 *PolicyObjectPreferredColorGroupProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectPreferredColorGroup
+
+ // 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 *PolicyObjectPreferredColorGroupProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectPreferredColorGroup
+
+ // 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 *PolicyObjectPreferredColorGroupProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectPreferredColorGroup
+
+ // 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 *PolicyObjectPreferredColorGroupProfileParcelResource) 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_preferred_color_group_test.go b/internal/provider/resource_sdwan_policy_object_preferred_color_group_test.go
new file mode 100644
index 000000000..5890e0ad6
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_preferred_color_group_test.go
@@ -0,0 +1,86 @@
+// 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 TestAccSdwanPolicyObjectPreferredColorGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_preferred_color_group.test", "entries.0.primary_path_preference", "direct-path"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_preferred_color_group.test", "entries.0.secondary_path_preference", "all-paths"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_preferred_color_group.test", "entries.0.tertiary_path_preference", "all-paths"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectPreferredColorGroupPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectPreferredColorGroupProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectPreferredColorGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectPreferredColorGroupProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_preferred_color_group" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` primary_color_preference = ["default"]` + "\n"
+ config += ` primary_path_preference = "direct-path"` + "\n"
+ config += ` secondary_color_preference = ["bronze"]` + "\n"
+ config += ` secondary_path_preference = "all-paths"` + "\n"
+ config += ` tertiary_color_preference = ["blue"]` + "\n"
+ config += ` tertiary_path_preference = "all-paths"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list.go b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list.go
new file mode 100644
index 000000000..95aa64a96
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list.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"
+}
+
+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 Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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_test.go b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_test.go
new file mode 100644
index 000000000..90a590128
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_test.go
@@ -0,0 +1,79 @@
+// 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") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_data_ipv4_prefix_list.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 = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.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_fqdn_list.go b/internal/provider/resource_sdwan_policy_object_security_fqdn_list.go
new file mode 100644
index 000000000..7a80296d0
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_fqdn_list.go
@@ -0,0 +1,259 @@
+// 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 = &PolicyObjectSecurityFQDNListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityFQDNListProfileParcelResource{}
+
+func NewPolicyObjectSecurityFQDNListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityFQDNListProfileParcelResource{}
+}
+
+type PolicyObjectSecurityFQDNListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_fqdn_list"
+}
+
+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 FQDN List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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{
+ "pattern": 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-])+$`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityFQDNListProfileParcelResource) 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 *PolicyObjectSecurityFQDNListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityFQDNList
+
+ // 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 *PolicyObjectSecurityFQDNListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityFQDNList
+
+ // 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 *PolicyObjectSecurityFQDNListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityFQDNList
+
+ // 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 *PolicyObjectSecurityFQDNListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityFQDNList
+
+ // 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 *PolicyObjectSecurityFQDNListProfileParcelResource) 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_fqdn_list_test.go b/internal/provider/resource_sdwan_policy_object_security_fqdn_list_test.go
new file mode 100644
index 000000000..2b68cd2b9
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_fqdn_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectSecurityFQDNListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_fqdn_list.test", "entries.0.pattern", "cisco.com"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityFQDNListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityFQDNListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_fqdn_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` pattern = "cisco.com"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_security_geolocation_list.go b/internal/provider/resource_sdwan_policy_object_security_geolocation_list.go
new file mode 100644
index 000000000..a3e1f7986
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_geolocation_list.go
@@ -0,0 +1,264 @@
+// 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-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 = &PolicyObjectSecurityGeolocationListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityGeolocationListProfileParcelResource{}
+
+func NewPolicyObjectSecurityGeolocationListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityGeolocationListProfileParcelResource{}
+}
+
+type PolicyObjectSecurityGeolocationListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_geolocation_list"
+}
+
+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 List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Geolocation List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "country": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("country names").AddStringEnumDescription("AFG", "ALB", "ATA", "DZA", "ASM", "AND", "AGO", "ATG", "AZE", "ARG", "AUS", "AUT", "BHS", "BHR", "BGD", "ARM", "BRB", "BEL", "BMU", "BTN", "BOL", "BIH", "BWA", "BVT", "BRA", "BLZ", "IOT", "SLB", "VGB", "BRN", "BGR", "MMR", "BDI", "BLR", "KHM", "CMR", "CAN", "CPV", "CYM", "CAF", "LKA", "TCD", "CHL", "CHN", "TWN", "CXR", "CCK", "COL", "COM", "MYT", "COG", "COD", "COK", "CRI", "HRV", "CUB", "CYP", "CZE", "BEN", "DNK", "DMA", "DOM", "ECU", "SLV", "GNQ", "ETH", "ERI", "EST", "FRO", "FLK", "SGS", "FJI", "FIN", "ALA", "FRA", "GUF", "PYF", "ATF", "DJI", "GAB", "GEO", "GMB", "PSE", "DEU", "GHA", "GIB", "KIR", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GIN", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "ISR", "ITA", "CIV", "JAM", "JPN", "KAZ", "JOR", "KEN", "PRK", "KOR", "KWT", "KGZ", "LAO", "LBN", "LSO", "LVA", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MTQ", "MRT", "MUS", "MEX", "MCO", "MNG", "MDA", "MNE", "MSR", "MAR", "MOZ", "OMN", "NAM", "NRU", "NPL", "NLD", "ANT", "CUW", "ABW", "SXM", "BES", "NCL", "VUT", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "NOR", "MNP", "UMI", "FSM", "MHL", "PLW", "PAK", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "GNB", "TLS", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "AIA", "LCA", "MAF", "SPM", "VCT", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SLE", "SGP", "SVK", "VNM", "SVN", "SOM", "ZAF", "ZWE", "ESP", "SSD", "ESH", "SDN", "SUR", "SJM", "SWZ", "SWE", "CHE", "SYR", "TJK", "THA", "TGO", "TKL", "TON", "TTO", "ARE", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "MKD", "EGY", "GBR", "GGY", "JEY", "IMN", "TZA", "USA", "VIR", "BFA", "URY", "UZB", "VEN", "WLF", "WSM", "YEM", "ZMB").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("AFG", "ALB", "ATA", "DZA", "ASM", "AND", "AGO", "ATG", "AZE", "ARG", "AUS", "AUT", "BHS", "BHR", "BGD", "ARM", "BRB", "BEL", "BMU", "BTN", "BOL", "BIH", "BWA", "BVT", "BRA", "BLZ", "IOT", "SLB", "VGB", "BRN", "BGR", "MMR", "BDI", "BLR", "KHM", "CMR", "CAN", "CPV", "CYM", "CAF", "LKA", "TCD", "CHL", "CHN", "TWN", "CXR", "CCK", "COL", "COM", "MYT", "COG", "COD", "COK", "CRI", "HRV", "CUB", "CYP", "CZE", "BEN", "DNK", "DMA", "DOM", "ECU", "SLV", "GNQ", "ETH", "ERI", "EST", "FRO", "FLK", "SGS", "FJI", "FIN", "ALA", "FRA", "GUF", "PYF", "ATF", "DJI", "GAB", "GEO", "GMB", "PSE", "DEU", "GHA", "GIB", "KIR", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GIN", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "ISR", "ITA", "CIV", "JAM", "JPN", "KAZ", "JOR", "KEN", "PRK", "KOR", "KWT", "KGZ", "LAO", "LBN", "LSO", "LVA", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MTQ", "MRT", "MUS", "MEX", "MCO", "MNG", "MDA", "MNE", "MSR", "MAR", "MOZ", "OMN", "NAM", "NRU", "NPL", "NLD", "ANT", "CUW", "ABW", "SXM", "BES", "NCL", "VUT", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "NOR", "MNP", "UMI", "FSM", "MHL", "PLW", "PAK", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "GNB", "TLS", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "AIA", "LCA", "MAF", "SPM", "VCT", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SLE", "SGP", "SVK", "VNM", "SVN", "SOM", "ZAF", "ZWE", "ESP", "SSD", "ESH", "SDN", "SUR", "SJM", "SWZ", "SWE", "CHE", "SYR", "TJK", "THA", "TGO", "TKL", "TON", "TTO", "ARE", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "MKD", "EGY", "GBR", "GGY", "JEY", "IMN", "TZA", "USA", "VIR", "BFA", "URY", "UZB", "VEN", "WLF", "WSM", "YEM", "ZMB"),
+ },
+ },
+ "continent": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("continent name").AddStringEnumDescription("AF", "AN", "AS", "EU", "NA", "OC", "SA").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("AF", "AN", "AS", "EU", "NA", "OC", "SA"),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) 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 *PolicyObjectSecurityGeolocationListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityGeolocationList
+
+ // 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 *PolicyObjectSecurityGeolocationListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityGeolocationList
+
+ // 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 *PolicyObjectSecurityGeolocationListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityGeolocationList
+
+ // 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 *PolicyObjectSecurityGeolocationListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityGeolocationList
+
+ // 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 *PolicyObjectSecurityGeolocationListProfileParcelResource) 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_geolocation_list_test.go b/internal/provider/resource_sdwan_policy_object_security_geolocation_list_test.go
new file mode 100644
index 000000000..b4097a9c6
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_geolocation_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectSecurityGeolocationListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_geolocation_list.test", "entries.0.country", "DZA"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_geolocation_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` country = "DZA"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_security_identity_list.go b/internal/provider/resource_sdwan_policy_object_security_identity_list.go
new file mode 100644
index 000000000..cc21ec482
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_identity_list.go
@@ -0,0 +1,267 @@
+// 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 = &PolicyObjectSecurityIdentityListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityIdentityListProfileParcelResource{}
+
+func NewPolicyObjectSecurityIdentityListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityIdentityListProfileParcelResource{}
+}
+
+type PolicyObjectSecurityIdentityListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_identity_list"
+}
+
+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 Identity List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Array of Users and User Groups").String,
+ Optional: 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{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 96),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^.*[a-zA-Z0-9]+.*$`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityIdentityListProfileParcelResource) 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 *PolicyObjectSecurityIdentityListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityIdentityList
+
+ // 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 *PolicyObjectSecurityIdentityListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityIdentityList
+
+ // 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 *PolicyObjectSecurityIdentityListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityIdentityList
+
+ // 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 *PolicyObjectSecurityIdentityListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityIdentityList
+
+ // 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 *PolicyObjectSecurityIdentityListProfileParcelResource) 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_identity_list_test.go b/internal/provider/resource_sdwan_policy_object_security_identity_list_test.go
new file mode 100644
index 000000000..b64414b7b
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_identity_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectSecurityIdentityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_identity_list.test", "entries.0.user", "administrator"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityIdentityListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityIdentityListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_identity_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` user = "administrator"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_security_ips_signature.go b/internal/provider/resource_sdwan_policy_object_security_ips_signature.go
new file mode 100644
index 000000000..9ad7a8e11
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_ips_signature.go
@@ -0,0 +1,265 @@
+// 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 = &PolicyObjectSecurityIPSSignatureProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityIPSSignatureProfileParcelResource{}
+
+func NewPolicyObjectSecurityIPSSignatureProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityIPSSignatureProfileParcelResource{}
+}
+
+type PolicyObjectSecurityIPSSignatureProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_ips_signature"
+}
+
+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 Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Ips Signature").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "generator_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(429496729[0-5]|42949672[0-8]\d|4294967[01]\d{2}|429496[0-6]\d{3}|42949[0-5]\d{4}|4294[0-8]\d{5}|429[0-3]\d{6}|42[0-8]\d{7}|4[01]\d{8}|[1-3]\d{9}|[1-9]\d{8}|[1-9]\d{7}|[1-9]\d{6}|[1-9]\d{5}|[1-9]\d{4}|[1-9]\d{3}|[1-9]\d{2}|[1-9]\d|\d)$`), ""),
+ },
+ },
+ "signature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(429496729[0-5]|42949672[0-8]\d|4294967[01]\d{2}|429496[0-6]\d{3}|42949[0-5]\d{4}|4294[0-8]\d{5}|429[0-3]\d{6}|42[0-8]\d{7}|4[01]\d{8}|[1-3]\d{9}|[1-9]\d{8}|[1-9]\d{7}|[1-9]\d{6}|[1-9]\d{5}|[1-9]\d{4}|[1-9]\d{3}|[1-9]\d{2}|[1-9]\d|\d)$`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) 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 *PolicyObjectSecurityIPSSignatureProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityIPSSignature
+
+ // 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 *PolicyObjectSecurityIPSSignatureProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityIPSSignature
+
+ // 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 *PolicyObjectSecurityIPSSignatureProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityIPSSignature
+
+ // 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 *PolicyObjectSecurityIPSSignatureProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityIPSSignature
+
+ // 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 *PolicyObjectSecurityIPSSignatureProfileParcelResource) 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_ips_signature_test.go b/internal/provider/resource_sdwan_policy_object_security_ips_signature_test.go
new file mode 100644
index 000000000..596fc1a47
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_ips_signature_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccSdwanPolicyObjectSecurityIPSSignatureProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_ips_signature.test", "entries.0.generator_id", "1234"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_ips_signature.test", "entries.0.signature_id", "5678"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_ips_signature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` generator_id = "1234"` + "\n"
+ config += ` signature_id = "5678"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_security_local_application_list.go b/internal/provider/resource_sdwan_policy_object_security_local_application_list.go
new file mode 100644
index 000000000..67e54c2bc
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_local_application_list.go
@@ -0,0 +1,256 @@
+// 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 = &PolicyObjectSecurityLocalApplicationListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityLocalApplicationListProfileParcelResource{}
+
+func NewPolicyObjectSecurityLocalApplicationListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityLocalApplicationListProfileParcelResource{}
+}
+
+type PolicyObjectSecurityLocalApplicationListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_local_application_list"
+}
+
+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 Local Application List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Localapp list").String,
+ Optional: 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,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) 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 *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityLocalApplicationList
+
+ // 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 *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityLocalApplicationList
+
+ // 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 *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityLocalApplicationList
+
+ // 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 *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityLocalApplicationList
+
+ // 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 *PolicyObjectSecurityLocalApplicationListProfileParcelResource) 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_local_application_list_test.go b/internal/provider/resource_sdwan_policy_object_security_local_application_list_test.go
new file mode 100644
index 000000000..ecea7a89d
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_local_application_list_test.go
@@ -0,0 +1,79 @@
+// 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") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_local_application_list.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 = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.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_local_domain_list.go b/internal/provider/resource_sdwan_policy_object_security_local_domain_list.go
new file mode 100644
index 000000000..5977b34aa
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_local_domain_list.go
@@ -0,0 +1,259 @@
+// 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 = &PolicyObjectSecurityLocalDomainListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityLocalDomainListProfileParcelResource{}
+
+func NewPolicyObjectSecurityLocalDomainListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityLocalDomainListProfileParcelResource{}
+}
+
+type PolicyObjectSecurityLocalDomainListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_local_domain_list"
+}
+
+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 Local Domain List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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{
+ "local_domain": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 240),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[^*+].*`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) 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 *PolicyObjectSecurityLocalDomainListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityLocalDomainList
+
+ // 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 *PolicyObjectSecurityLocalDomainListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityLocalDomainList
+
+ // 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 *PolicyObjectSecurityLocalDomainListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityLocalDomainList
+
+ // 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 *PolicyObjectSecurityLocalDomainListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityLocalDomainList
+
+ // 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 *PolicyObjectSecurityLocalDomainListProfileParcelResource) 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_local_domain_list_test.go b/internal/provider/resource_sdwan_policy_object_security_local_domain_list_test.go
new file mode 100644
index 000000000..53c372dfa
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_local_domain_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectSecurityLocalDomainListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_local_domain_list.test", "entries.0.local_domain", "hello.com"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_local_domain_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` local_domain = "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_port_list.go b/internal/provider/resource_sdwan_policy_object_security_port_list.go
new file mode 100644
index 000000000..81dc7594f
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_port_list.go
@@ -0,0 +1,252 @@
+// 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 = &PolicyObjectSecurityPortListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityPortListProfileParcelResource{}
+
+func NewPolicyObjectSecurityPortListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityPortListProfileParcelResource{}
+}
+
+type PolicyObjectSecurityPortListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityPortListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_port_list"
+}
+
+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 Port List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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 *PolicyObjectSecurityPortListProfileParcelResource) 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 *PolicyObjectSecurityPortListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityPortList
+
+ // 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 *PolicyObjectSecurityPortListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityPortList
+
+ // 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 *PolicyObjectSecurityPortListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityPortList
+
+ // 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 *PolicyObjectSecurityPortListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityPortList
+
+ // 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 *PolicyObjectSecurityPortListProfileParcelResource) 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_list_test.go b/internal/provider/resource_sdwan_policy_object_security_port_list_test.go
new file mode 100644
index 000000000..a4c370a88
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_port_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectSecurityPortListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_port_list.test", "entries.0.port", "100"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityPortListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityPortListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_port_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.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_list.go b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list.go
new file mode 100644
index 000000000..25e499a65
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list.go
@@ -0,0 +1,264 @@
+// 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-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 = &PolicyObjectSecurityScalableGroupTagListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityScalableGroupTagListProfileParcelResource{}
+
+func NewPolicyObjectSecurityScalableGroupTagListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityScalableGroupTagListProfileParcelResource{}
+}
+
+type PolicyObjectSecurityScalableGroupTagListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_security_scalable_group_tag_list"
+}
+
+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 List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ 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{
+ "sgt_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "tag": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) 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 *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityScalableGroupTagList
+
+ // 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 *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityScalableGroupTagList
+
+ // 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 *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityScalableGroupTagList
+
+ // 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 *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityScalableGroupTagList
+
+ // 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 *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) 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_scalable_group_tag_list_test.go b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_test.go
new file mode 100644
index 000000000..d89dcd525
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_test.go
@@ -0,0 +1,81 @@
+// 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 TestAccSdwanPolicyObjectSecurityScalableGroupTagListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_scalable_group_tag_list.test", "entries.0.sgt_name", "ANY"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_scalable_group_tag_list.test", "entries.0.tag", "65535"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_scalable_group_tag_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` sgt_name = "ANY"` + "\n"
+ config += ` tag = "65535"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_security_url_list.go b/internal/provider/resource_sdwan_policy_object_security_url_list.go
new file mode 100644
index 000000000..bebe8cd20
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_url_list.go
@@ -0,0 +1,259 @@
+// 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 = &PolicyObjectSecurityURLListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSecurityURLListProfileParcelResource{}
+
+func NewPolicyObjectSecurityURLListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSecurityURLListProfileParcelResource{}
+}
+
+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_url_list"
+}
+
+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 URL List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("URL List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "pattern": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("valid url pattern").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 240),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[^*+].*`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSecurityURLListProfileParcelResource) 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 *PolicyObjectSecurityURLListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSecurityURLList
+
+ // 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 *PolicyObjectSecurityURLListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSecurityURLList
+
+ // 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 *PolicyObjectSecurityURLListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSecurityURLList
+
+ // 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 *PolicyObjectSecurityURLListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSecurityURLList
+
+ // 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 *PolicyObjectSecurityURLListProfileParcelResource) 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_url_list_test.go b/internal/provider/resource_sdwan_policy_object_security_url_list_test.go
new file mode 100644
index 000000000..e27fdccd1
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_security_url_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectSecurityURLListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_url_list.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(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSecurityURLListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectSecurityURLListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_security_url_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` pattern = "www.cisco.com"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_sla_class_list.go b/internal/provider/resource_sdwan_policy_object_sla_class_list.go
new file mode 100644
index 000000000..f88fc488b
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_sla_class_list.go
@@ -0,0 +1,308 @@
+// 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/int64validator"
+ "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 = &PolicyObjectSLAClassListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectSLAClassListProfileParcelResource{}
+
+func NewPolicyObjectSLAClassListProfileParcelResource() resource.Resource {
+ return &PolicyObjectSLAClassListProfileParcelResource{}
+}
+
+type PolicyObjectSLAClassListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectSLAClassListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_sla_class_list"
+}
+
+func (r *PolicyObjectSLAClassListProfileParcelResource) 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 SLA Class List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sla class List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "latency": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 1000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 1000),
+ },
+ },
+ "loss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(0, 100).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(100),
+ },
+ },
+ "jitter": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 1000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 1000),
+ },
+ },
+ "app_probe_class_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "fallback_best_tunnel_criteria": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("jitter", "latency", "loss", "loss-latency", "loss-jitter", "latency-loss", "latency-jitter", "jitter-latency", "jitter-loss", "loss-latency-jitter", "loss-jitter-latency", "latency-loss-jitter", "latency-jitter-loss", "jitter-latency-loss", "jitter-loss-latency").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("jitter", "latency", "loss", "loss-latency", "loss-jitter", "latency-loss", "latency-jitter", "jitter-latency", "jitter-loss", "loss-latency-jitter", "loss-jitter-latency", "latency-loss-jitter", "latency-jitter-loss", "jitter-latency-loss", "jitter-loss-latency"),
+ },
+ },
+ "fallback_best_tunnel_loss_variance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(0, 100).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(100),
+ },
+ },
+ "fallback_best_tunnel_latency_variance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 1000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 1000),
+ },
+ },
+ "fallback_best_tunnel_jitter_variance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 1000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 1000),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectSLAClassListProfileParcelResource) 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 *PolicyObjectSLAClassListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectSLAClassList
+
+ // 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 *PolicyObjectSLAClassListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectSLAClassList
+
+ // 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 *PolicyObjectSLAClassListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectSLAClassList
+
+ // 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 *PolicyObjectSLAClassListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectSLAClassList
+
+ // 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 *PolicyObjectSLAClassListProfileParcelResource) 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_sla_class_list_test.go b/internal/provider/resource_sdwan_policy_object_sla_class_list_test.go
new file mode 100644
index 000000000..4aba79aca
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_sla_class_list_test.go
@@ -0,0 +1,88 @@
+// 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 TestAccSdwanPolicyObjectSLAClassListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_sla_class_list.test", "entries.0.latency", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_sla_class_list.test", "entries.0.loss", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_sla_class_list.test", "entries.0.jitter", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_sla_class_list.test", "entries.0.fallback_best_tunnel_criteria", "loss"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_sla_class_list.test", "entries.0.fallback_best_tunnel_loss_variance", "5"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectSLAClassListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSLAClassListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectSLAClassListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectSLAClassListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_sla_class_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` latency = 2` + "\n"
+ config += ` loss = 1` + "\n"
+ config += ` jitter = 1` + "\n"
+ config += ` fallback_best_tunnel_criteria = "loss"` + "\n"
+ config += ` fallback_best_tunnel_loss_variance = 5` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_standard_community_list.go b/internal/provider/resource_sdwan_policy_object_standard_community_list.go
new file mode 100644
index 000000000..943a4fab3
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_standard_community_list.go
@@ -0,0 +1,252 @@
+// 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 = &PolicyObjectStandardCommunityListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectStandardCommunityListProfileParcelResource{}
+
+func NewPolicyObjectStandardCommunityListProfileParcelResource() resource.Resource {
+ return &PolicyObjectStandardCommunityListProfileParcelResource{}
+}
+
+type PolicyObjectStandardCommunityListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectStandardCommunityListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_standard_community_list"
+}
+
+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 List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Standard Community List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "standard_community": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Standard Community").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectStandardCommunityListProfileParcelResource) 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 *PolicyObjectStandardCommunityListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectStandardCommunityList
+
+ // 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 *PolicyObjectStandardCommunityListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectStandardCommunityList
+
+ // 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 *PolicyObjectStandardCommunityListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectStandardCommunityList
+
+ // 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 *PolicyObjectStandardCommunityListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectStandardCommunityList
+
+ // 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 *PolicyObjectStandardCommunityListProfileParcelResource) 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_standard_community_list_test.go b/internal/provider/resource_sdwan_policy_object_standard_community_list_test.go
new file mode 100644
index 000000000..61593f9d3
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_standard_community_list_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectStandardCommunityListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_standard_community_list.test", "entries.0.standard_community", "1000:10000"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectStandardCommunityListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectStandardCommunityListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_standard_community_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` standard_community = "1000:10000"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_tloc_list.go b/internal/provider/resource_sdwan_policy_object_tloc_list.go
new file mode 100644
index 000000000..2d0ec0a94
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_tloc_list.go
@@ -0,0 +1,272 @@
+// 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-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 = &PolicyObjectTLOCListProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectTLOCListProfileParcelResource{}
+
+func NewPolicyObjectTLOCListProfileParcelResource() resource.Resource {
+ return &PolicyObjectTLOCListProfileParcelResource{}
+}
+
+type PolicyObjectTLOCListProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectTLOCListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_tloc_list"
+}
+
+func (r *PolicyObjectTLOCListProfileParcelResource) 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 TLOC List Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TLOC List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "tloc_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("tloc").String,
+ Optional: true,
+ },
+ "color": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("color").AddStringEnumDescription("3g", "biz-internet", "blue", "bronze", "custom1", "custom2", "custom3", "default", "gold", "green", "lte", "metro-ethernet", "mpls", "private1", "private2", "private3", "private4", "private5", "private6", "public-internet", "red", "silver").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("3g", "biz-internet", "blue", "bronze", "custom1", "custom2", "custom3", "default", "gold", "green", "lte", "metro-ethernet", "mpls", "private1", "private2", "private3", "private4", "private5", "private6", "public-internet", "red", "silver"),
+ },
+ },
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("encapsulation").AddStringEnumDescription("ipsec", "gre").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("ipsec", "gre"),
+ },
+ },
+ "preference": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Preference").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectTLOCListProfileParcelResource) 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 *PolicyObjectTLOCListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectTLOCList
+
+ // 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 *PolicyObjectTLOCListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectTLOCList
+
+ // 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 *PolicyObjectTLOCListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectTLOCList
+
+ // 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 *PolicyObjectTLOCListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectTLOCList
+
+ // 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 *PolicyObjectTLOCListProfileParcelResource) 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_tloc_list_test.go b/internal/provider/resource_sdwan_policy_object_tloc_list_test.go
new file mode 100644
index 000000000..1f3f01a49
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_tloc_list_test.go
@@ -0,0 +1,86 @@
+// 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 TestAccSdwanPolicyObjectTLOCListProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_tloc_list.test", "entries.0.tloc_ip", "10.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_tloc_list.test", "entries.0.color", "3g"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_tloc_list.test", "entries.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_tloc_list.test", "entries.0.preference", "33"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectTLOCListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectTLOCListProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectTLOCListPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+
+`
+
+// 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 testAccSdwanPolicyObjectTLOCListProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_tloc_list" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` tloc_ip = "10.0.0.0"` + "\n"
+ config += ` color = "3g"` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = "33"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_policy_object_vpn_group.go b/internal/provider/resource_sdwan_policy_object_vpn_group.go
new file mode 100644
index 000000000..52a9bf3ea
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_vpn_group.go
@@ -0,0 +1,252 @@
+// 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 = &PolicyObjectVPNGroupProfileParcelResource{}
+var _ resource.ResourceWithImportState = &PolicyObjectVPNGroupProfileParcelResource{}
+
+func NewPolicyObjectVPNGroupProfileParcelResource() resource.Resource {
+ return &PolicyObjectVPNGroupProfileParcelResource{}
+}
+
+type PolicyObjectVPNGroupProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *PolicyObjectVPNGroupProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_policy_object_vpn_group"
+}
+
+func (r *PolicyObjectVPNGroupProfileParcelResource) 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 VPN Group Policy_object.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Policy_object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Policy_object",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Policy_object",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Policy_object",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VPN List").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("can be single vpn id or vpn id range").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *PolicyObjectVPNGroupProfileParcelResource) 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 *PolicyObjectVPNGroupProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan PolicyObjectVPNGroup
+
+ // 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 *PolicyObjectVPNGroupProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state PolicyObjectVPNGroup
+
+ // 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 *PolicyObjectVPNGroupProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state PolicyObjectVPNGroup
+
+ // 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 *PolicyObjectVPNGroupProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state PolicyObjectVPNGroup
+
+ // 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 *PolicyObjectVPNGroupProfileParcelResource) 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_vpn_group_test.go b/internal/provider/resource_sdwan_policy_object_vpn_group_test.go
new file mode 100644
index 000000000..48944c5c7
--- /dev/null
+++ b/internal/provider/resource_sdwan_policy_object_vpn_group_test.go
@@ -0,0 +1,79 @@
+// 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 TestAccSdwanPolicyObjectVPNGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_vpn_group.test", "entries.0.vpn", "100"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanPolicyObjectVPNGroupPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectVPNGroupProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanPolicyObjectVPNGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_policy_object_feature_profile" "test" {
+ name = "POLICY_OBJECT_FP_1"
+ description = "My policy object feature profile 1"
+}
+`
+
+// 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 testAccSdwanPolicyObjectVPNGroupProfileParcelConfig_all() string {
+ config := `resource "sdwan_policy_object_vpn_group" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n"
+ config += ` entries = [{` + "\n"
+ config += ` vpn = 100` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_port_list_policy_object.go b/internal/provider/resource_sdwan_port_list_policy_object.go
index daa3d29bf..62ea41b0d 100644
--- a/internal/provider/resource_sdwan_port_list_policy_object.go
+++ b/internal/provider/resource_sdwan_port_list_policy_object.go
@@ -160,7 +160,7 @@ func (r *PortListPolicyObjectResource) Read(ctx context.Context, req resource.Re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_preferred_color_group_policy_object.go b/internal/provider/resource_sdwan_preferred_color_group_policy_object.go
index ad2ed79c3..9db8615c3 100644
--- a/internal/provider/resource_sdwan_preferred_color_group_policy_object.go
+++ b/internal/provider/resource_sdwan_preferred_color_group_policy_object.go
@@ -174,7 +174,7 @@ func (r *PreferredColorGroupPolicyObjectResource) Read(ctx context.Context, req
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_protocol_list_policy_object.go b/internal/provider/resource_sdwan_protocol_list_policy_object.go
index 2aac6066a..1b926c32a 100644
--- a/internal/provider/resource_sdwan_protocol_list_policy_object.go
+++ b/internal/provider/resource_sdwan_protocol_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *ProtocolListPolicyObjectResource) Read(ctx context.Context, req resourc
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_qos_map_policy_definition.go b/internal/provider/resource_sdwan_qos_map_policy_definition.go
index d4ff1b07d..8b4dc68ab 100644
--- a/internal/provider/resource_sdwan_qos_map_policy_definition.go
+++ b/internal/provider/resource_sdwan_qos_map_policy_definition.go
@@ -212,7 +212,7 @@ func (r *QoSMapPolicyDefinitionResource) Read(ctx context.Context, req resource.
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_region_list_policy_object.go b/internal/provider/resource_sdwan_region_list_policy_object.go
index 223331a54..9281522e7 100644
--- a/internal/provider/resource_sdwan_region_list_policy_object.go
+++ b/internal/provider/resource_sdwan_region_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *RegionListPolicyObjectResource) Read(ctx context.Context, req resource.
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go b/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go
index 7f360757e..7652321be 100644
--- a/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go
+++ b/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go
@@ -191,7 +191,7 @@ func (r *RewriteRulePolicyDefinitionResource) Read(ctx context.Context, req reso
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_route_policy_definition.go b/internal/provider/resource_sdwan_route_policy_definition.go
index 07330d10e..b98306d08 100644
--- a/internal/provider/resource_sdwan_route_policy_definition.go
+++ b/internal/provider/resource_sdwan_route_policy_definition.go
@@ -408,7 +408,7 @@ func (r *RoutePolicyDefinitionResource) Read(ctx context.Context, req resource.R
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_rule_set_policy_definition.go b/internal/provider/resource_sdwan_rule_set_policy_definition.go
index 445e62574..eebcf4965 100644
--- a/internal/provider/resource_sdwan_rule_set_policy_definition.go
+++ b/internal/provider/resource_sdwan_rule_set_policy_definition.go
@@ -300,7 +300,7 @@ func (r *RuleSetPolicyDefinitionResource) Read(ctx context.Context, req resource
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_security_policy.go b/internal/provider/resource_sdwan_security_policy.go
index 3f2bb4bb8..10fcae029 100644
--- a/internal/provider/resource_sdwan_security_policy.go
+++ b/internal/provider/resource_sdwan_security_policy.go
@@ -252,7 +252,7 @@ func (r *SecurityPolicyResource) Read(ctx context.Context, req resource.ReadRequ
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get("/template/policy/security/definition/" + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_service_feature_profile.go b/internal/provider/resource_sdwan_service_feature_profile.go
index da5788b92..420f28383 100644
--- a/internal/provider/resource_sdwan_service_feature_profile.go
+++ b/internal/provider/resource_sdwan_service_feature_profile.go
@@ -60,7 +60,7 @@ func (r *ServiceFeatureProfileResource) Metadata(ctx context.Context, req resour
func (r *ServiceFeatureProfileResource) 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 Service Feature Profile .").String,
+ MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Service Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
@@ -138,7 +138,7 @@ func (r *ServiceFeatureProfileResource) Read(ctx context.Context, req resource.R
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature.go
new file mode 100644
index 000000000..82190715f
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_feature.go
@@ -0,0 +1,1268 @@
+// 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/int64validator"
+ "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 = &ServiceLANVPNProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceLANVPNProfileParcelResource{}
+
+func NewServiceLANVPNProfileParcelResource() resource.Resource {
+ return &ServiceLANVPNProfileParcelResource{}
+}
+
+type ServiceLANVPNProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceLANVPNProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_feature"
+}
+
+func (r *ServiceLANVPNProfileParcelResource) 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 Service LAN VPN Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VPN").AddIntegerRangeDescription(1, 65527).AddDefaultValueDescription("0").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65527),
+ },
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "config_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtMost(244),
+ },
+ },
+ "config_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "omp_admin_distance_ipv4": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv4").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "omp_admin_distance_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "omp_admin_distance_ipv6": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv6").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "omp_admin_distance_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "enable_sdwan_remote_access": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable SDWAN Remote Access").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv4)").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv4)").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv6)").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv6)").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "host_mappings": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "host_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Hostname").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "host_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "list_of_ips": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of IP").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "list_of_ips_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "advertise_omp_ipv4s": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OMP Advertise IPv4").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Protocol").AddStringEnumDescription("bgp", "ospf", "ospfv3", "connected", "static", "network", "aggregate", "eigrp", "lisp", "isis").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("bgp", "ospf", "ospfv3", "connected", "static", "network", "aggregate", "eigrp", "lisp", "isis"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "prefixes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Prefix List").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "aggregate_only": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Aggregate Only").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "region": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Applied to Region").AddStringEnumDescription("core-and-access", "core", "access").AddDefaultValueDescription("core-and-access").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("core-and-access", "core", "access"),
+ },
+ },
+ "region_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "advertise_omp_ipv6s": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OMP Advertise IPv6").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Protocol").AddStringEnumDescription("BGP", "OSPF", "Connected", "Static", "Network", "Aggregate").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("BGP", "OSPF", "Connected", "Static", "Network", "Aggregate"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "protocol_sub_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Protocol Sub Type").AddStringEnumDescription("External").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("External"),
+ },
+ },
+ "protocol_sub_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "prefixes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Prefix List").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Prefix").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "aggregate_only": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Aggregate Only").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static Route").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "next_hop_with_trackers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop with Tracker").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "null0": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop").String,
+ Optional: true,
+ },
+ "gateway_dhcp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway DHCP").String,
+ Optional: true,
+ },
+ "vpn": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway VPN").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Static Route").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Prefix").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 254).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "null0": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String,
+ Optional: true,
+ },
+ "nat": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Nat").AddStringEnumDescription("NAT64", "NAT66").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("NAT64", "NAT66"),
+ },
+ },
+ "nat_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "services": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "service_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service Type").AddStringEnumDescription("FW", "IDS", "IDP", "netsvc1", "netsvc2", "netsvc3", "netsvc4", "TE", "appqoe").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("FW", "IDS", "IDP", "netsvc1", "netsvc2", "netsvc3", "netsvc4", "TE", "appqoe"),
+ },
+ },
+ "service_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_addresses": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Addresses (Maximum: 4)").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "ipv4_addresses_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracking": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tracking").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tracking_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "service_routes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "service": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service").AddStringEnumDescription("SIG").AddDefaultValueDescription("SIG").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("SIG"),
+ },
+ },
+ "service_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "gre_routes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static GRE Route").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipsec_routes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static IPSEC Route").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "nat_pools": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "nat_pool_name": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Name").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "nat_pool_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "prefix_length": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Prefix Length").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "prefix_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "range_start": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range Start").String,
+ Optional: true,
+ },
+ "range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "range_end": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range End").String,
+ Optional: true,
+ },
+ "range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "overload": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Overload").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "direction": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Direction").AddStringEnumDescription("inside", "outside").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("inside", "outside"),
+ },
+ },
+ "direction_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_object_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "nat_port_forwards": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Port Forward").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "nat_pool_name": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Name").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "nat_pool_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_port": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source Port").String,
+ Optional: true,
+ },
+ "source_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "translate_port": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Translate Port").String,
+ Optional: true,
+ },
+ "translate_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source IP Address").String,
+ Optional: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "translated_source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Translated Source IP Address").String,
+ Optional: true,
+ },
+ "translated_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Protocol").AddStringEnumDescription("TCP", "UDP").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("TCP", "UDP"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "static_nats": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Static NAT Rules").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "nat_pool_name": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Name").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "nat_pool_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source IP Address").String,
+ Optional: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "translated_source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Translated Source IP Address").String,
+ Optional: true,
+ },
+ "translated_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "static_nat_direction": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Static NAT Direction").AddStringEnumDescription("inside", "outside").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("inside", "outside"),
+ },
+ },
+ "static_nat_direction_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_object_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "nat_64_v4_pools": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT64 V4 Pool").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT64 v4 Pool Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "range_start": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT64 Pool Range Start").String,
+ Optional: true,
+ },
+ "range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "range_end": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT64 Pool Range End").String,
+ Optional: true,
+ },
+ "range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "overload": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT64 Overload").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "route_leak_from_global_vpns": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable route leaking from Global to Service VPN").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Leak Routes of particular protocol from Global to Service VPN").AddStringEnumDescription("static", "connected", "bgp", "ospf").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "bgp", "ospf"),
+ },
+ },
+ "route_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "redistributions": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute Routes to specific Protocol on Service VPN").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Protocol to restributed leaked routes").AddStringEnumDescription("bgp", "ospf").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("bgp", "ospf"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistribution_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "route_leak_to_global_vpns": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable route leaking from Service to Global VPN").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Leak Routes of particular protocol from Service to Global VPN").AddStringEnumDescription("static", "connected", "bgp", "ospf").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "bgp", "ospf"),
+ },
+ },
+ "route_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "redistributions": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute Routes to specific Protocol on Global VPN").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Protocol to restributed leaked routes").AddStringEnumDescription("bgp", "ospf").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("bgp", "ospf"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistribution_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "route_leak_from_other_services": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable route leak from another Service VPN to current Service VPN").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source Service VPN from where route are to be leaked").AddIntegerRangeDescription(1, 65530).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65530),
+ },
+ },
+ "source_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Leak Route of particular protocol from Source Service VPN").AddStringEnumDescription("static", "connected", "bgp", "ospf").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "bgp", "ospf"),
+ },
+ },
+ "route_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "redistributions": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute Route to specific Protocol on Current Service VPN").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Protocol to restributed leaked routes").AddStringEnumDescription("bgp", "ospf").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("bgp", "ospf"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistribution_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_import_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
+ },
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_export_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
+ },
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_import_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
+ },
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_export_route_targets": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "route_target": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
+ },
+ },
+ "route_target_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ServiceLANVPNProfileParcelResource) 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 *ServiceLANVPNProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceLANVPN
+
+ // 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 *ServiceLANVPNProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceLANVPN
+
+ // 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 *ServiceLANVPNProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceLANVPN
+
+ // 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 *ServiceLANVPNProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceLANVPN
+
+ // 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 *ServiceLANVPNProfileParcelResource) 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_service_lan_vpn_feature_test.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_test.go
new file mode 100644
index 000000000..e3844dc79
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_test.go
@@ -0,0 +1,227 @@
+// 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 TestAccSdwanServiceLANVPNProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "config_description", "VPN1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "omp_admin_distance_ipv4", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "omp_admin_distance_ipv6", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "enable_sdwan_remote_access", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "primary_dns_address_ipv4", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "secondary_dns_address_ipv4", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "host_mappings.0.host_name", "HOSTMAPPING1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv6_static_routes.0.prefix", "2001:0:0:1::0/12"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "services.0.service_type", "FW"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "services.0.tracking", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "service_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "service_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "service_routes.0.service", "SIG"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "service_routes.0.vpn", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "gre_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "gre_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "gre_routes.0.vpn", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipsec_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipsec_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_pools.0.nat_pool_name", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_pools.0.prefix_length", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_pools.0.range_start", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_pools.0.range_end", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_pools.0.overload", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_pools.0.direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.nat_pool_name", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.source_port", "122"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.translate_port", "330"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.translated_source_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_port_forwards.0.protocol", "TCP"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "static_nats.0.nat_pool_name", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "static_nats.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "static_nats.0.translated_source_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "static_nats.0.static_nat_direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.name", "NATPOOL1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.range_start", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.range_end", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "nat_64_v4_pools.0.overload", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv4_import_route_targets.0.route_target", "1.1.1.3:200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv4_export_route_targets.0.route_target", "1.1.1.3:200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv6_import_route_targets.0.route_target", "1.1.1.3:200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_feature.test", "ipv6_export_route_targets.0.route_target", "1.1.1.3:200"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceLANVPNPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceLANVPNPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceLANVPNPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceLANVPNProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_lan_vpn_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceLANVPNProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_lan_vpn_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` config_description = "VPN1"` + "\n"
+ config += ` omp_admin_distance_ipv4 = 1` + "\n"
+ config += ` omp_admin_distance_ipv6 = 1` + "\n"
+ config += ` enable_sdwan_remote_access = false` + "\n"
+ config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
+ config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
+ config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
+ config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
+ config += ` host_mappings = [{` + "\n"
+ config += ` host_name = "HOSTMAPPING1"` + "\n"
+ config += ` list_of_ips = ["1.2.3.4"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_static_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_static_routes = [{` + "\n"
+ config += ` prefix = "2001:0:0:1::0/12"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "2001:0:0:1::0"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` services = [{` + "\n"
+ config += ` service_type = "FW"` + "\n"
+ config += ` ipv4_addresses = ["1.2.3.4"]` + "\n"
+ config += ` tracking = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` service_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` service = "SIG"` + "\n"
+ config += ` vpn = 0` + "\n"
+ config += ` }]` + "\n"
+ config += ` gre_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` interface = ["gre01"]` + "\n"
+ config += ` vpn = 0` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipsec_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` interface = ["ipsec01"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_pools = [{` + "\n"
+ config += ` nat_pool_name = 1` + "\n"
+ config += ` prefix_length = 3` + "\n"
+ config += ` range_start = "1.2.3.4"` + "\n"
+ config += ` range_end = "2.3.4.5"` + "\n"
+ config += ` overload = true` + "\n"
+ config += ` direction = "inside"` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_port_forwards = [{` + "\n"
+ config += ` nat_pool_name = 2` + "\n"
+ config += ` source_port = 122` + "\n"
+ config += ` translate_port = 330` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translated_source_ip = "2.3.4.5"` + "\n"
+ config += ` protocol = "TCP"` + "\n"
+ config += ` }]` + "\n"
+ config += ` static_nats = [{` + "\n"
+ config += ` nat_pool_name = 3` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translated_source_ip = "2.3.4.5"` + "\n"
+ config += ` static_nat_direction = "inside"` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_64_v4_pools = [{` + "\n"
+ config += ` name = "NATPOOL1"` + "\n"
+ config += ` range_start = "1.2.3.4"` + "\n"
+ config += ` range_end = "2.3.4.5"` + "\n"
+ config += ` overload = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_import_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_export_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_import_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_export_route_targets = [{` + "\n"
+ config += ` route_target = "1.1.1.3:200"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..2e854420d
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature.go
@@ -0,0 +1,951 @@
+// 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/int64validator"
+ "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 = &ServiceLANVPNInterfaceEthernetProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceEthernetProfileParcelResource{}
+
+func NewServiceLANVPNInterfaceEthernetProfileParcelResource() resource.Resource {
+ return &ServiceLANVPNInterfaceEthernetProfileParcelResource{}
+}
+
+type ServiceLANVPNInterfaceEthernetProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceLANVPNInterfaceEthernetProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ethernet_feature"
+}
+
+func (r *ServiceLANVPNInterfaceEthernetProfileParcelResource) 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 Service LAN VPN Interface Ethernet Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 200),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_dhcp_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance").AddIntegerRangeDescription(1, 65536).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "ipv4_dhcp_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helper": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of DHCP IPv4 helper addresses (min 1, max 8)").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "ipv4_dhcp_helper_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6").String,
+ Optional: true,
+ },
+ "ipv6_dhcp_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("secondary IPv6 addresses").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Static secondary IPv6 addresses").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_dhcp_helpers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dhcpv6_helper_vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper VPN").AddIntegerRangeDescription(1, 65536).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "dhcpv6_helper_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_nat": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv4_nat_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Type").AddStringEnumDescription("pool", "loopback").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("pool", "loopback"),
+ },
+ },
+ "ipv4_nat_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_nat_range_start": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range Start").String,
+ Optional: true,
+ },
+ "ipv4_nat_range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_nat_range_end": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range End").String,
+ Optional: true,
+ },
+ "ipv4_nat_range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_nat_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Prefix Length").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "ipv4_nat_prefix_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_nat_overload": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Overload").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "ipv4_nat_overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_nat_loopback": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Inside Source Loopback Interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "ipv4_nat_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_nat_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT UDP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 8947),
+ },
+ },
+ "ipv4_nat_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_nat_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT TCP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 8947),
+ },
+ },
+ "ipv4_nat_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "static_nats": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("static NAT").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source IP address to be translated").String,
+ Optional: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "translate_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Statically translated source IP address").String,
+ Optional: true,
+ },
+ "translate_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "direction": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Direction of static NAT translation").AddStringEnumDescription("inside", "outside").AddDefaultValueDescription("inside").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("inside", "outside"),
+ },
+ },
+ "source_vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source VPN ID").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "source_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_nat": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation ipv6 on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "nat64": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT64 on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "acl_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate (Kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "acl_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "acl_ipv4_egress_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "acl_ipv4_ingress_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "acl_ipv6_egress_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "acl_ipv6_ingress_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv6_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable VRRP Ipv6").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 40950),
+ },
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv6_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 VRRP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "link_local_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Use link-local IPv6 Address").String,
+ Optional: true,
+ },
+ "link_local_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "global_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign Global IPv6 Prefix").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "global_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable VRRP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 40950),
+ },
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VRRP Ip Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VRRP Secondary Ip Addresses").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Ip Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "tloc_prefix_change": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tloc_pref_change_value": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 4294967295),
+ },
+ },
+ },
+ },
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPV4 Address").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "trustsec_enable_sgt_propogation": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Indicates that the interface is trustworthy for CTS").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "trustsec_propogate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enables the interface for CTS SGT authorization and forwarding").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "trustsec_security_group_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("SGT value between 2 and 65519").AddIntegerRangeDescription(2, 65519).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(2, 65519),
+ },
+ },
+ "trustsec_security_group_tag_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "trustsec_enable_enforced_propogation": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable/Disable SGT Enforcement on an interface").String,
+ Optional: true,
+ },
+ "trustsec_enforced_security_group_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("SGT value between 2 and 65519").AddIntegerRangeDescription(2, 65519).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(2, 65519),
+ },
+ },
+ "trustsec_enforced_security_group_tag_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Duplex mode").AddStringEnumDescription("full", "half", "auto").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("full", "half", "auto"),
+ },
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1500, 9216),
+ },
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface speed").AddStringEnumDescription("10", "100", "1000", "2500", "10000").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("10", "100", "1000", "2500", "10000"),
+ },
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2147483).AddDefaultValueDescription("1200").String,
+ Optional: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "autonegotiate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Link autonegotiation").String,
+ Optional: true,
+ },
+ "autonegotiate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "media_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Media type").AddStringEnumDescription("auto-select", "rj45", "sfp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("auto-select", "rj45", "sfp"),
+ },
+ },
+ "media_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "load_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval for interface load calculation").AddIntegerRangeDescription(30, 600).AddDefaultValueDescription("30").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(30, 600),
+ },
+ },
+ "load_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
+ Optional: true,
+ },
+ "tracker_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "xconnect": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Extend remote TLOC over a GRE tunnel to a local LAN interface").String,
+ Optional: true,
+ },
+ "xconnect_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *ServiceLANVPNInterfaceEthernetProfileParcelResource) 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceLANVPNInterfaceEthernet
+
+ // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceLANVPNInterfaceEthernet
+
+ // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceLANVPNInterfaceEthernet
+
+ // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceLANVPNInterfaceEthernet
+
+ // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) 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_service_lan_vpn_interface_ethernet_feature_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_test.go
new file mode 100644
index 000000000..9ef4457dd
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_test.go
@@ -0,0 +1,235 @@
+// 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 TestAccSdwanServiceLANVPNInterfaceEthernetProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "interface_description", "LAN"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_dhcp_helpers.0.dhcpv6_helper_vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_type", "pool"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_range_start", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_range_end", "4.5.6.7"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_prefix_length", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_overload", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_loopback", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_udp_timeout", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_nat_tcp_timeout", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.translate_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "static_nats.0.source_vpn", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_nat", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "nat64", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "acl_shaping_rate", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.ipv6_addresses.0.link_local_address", "1::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv6_vrrps.0.ipv6_addresses.0.global_address", "1::1/24"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ipv4_vrrps.0.tloc_pref_change_value", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_enable_sgt_propogation", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_propogate", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_security_group_tag", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_enable_enforced_propogation", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "trustsec_enforced_security_group_tag", "1234"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "tcp_mss", "500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "speed", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "autonegotiate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "media_type", "auto-select"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "load_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "tracker", "TRACKER1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "icmp_redirect_disable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "xconnect", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_lan_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "GigabitEthernet3"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_nat_type = "pool"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_lan_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` interface_name = "GigabitEthernet3"` + "\n"
+ config += ` interface_description = "LAN"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "1.2.3.5"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` ipv6_dhcp_helpers = [{` + "\n"
+ config += ` address = "2001:0:0:1::0"` + "\n"
+ config += ` dhcpv6_helper_vpn = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_nat = false` + "\n"
+ config += ` ipv4_nat_type = "pool"` + "\n"
+ config += ` ipv4_nat_range_start = "1.2.3.4"` + "\n"
+ config += ` ipv4_nat_range_end = "4.5.6.7"` + "\n"
+ config += ` ipv4_nat_prefix_length = 1` + "\n"
+ config += ` ipv4_nat_overload = true` + "\n"
+ config += ` ipv4_nat_loopback = "123"` + "\n"
+ config += ` ipv4_nat_udp_timeout = 123` + "\n"
+ config += ` ipv4_nat_tcp_timeout = 123` + "\n"
+ config += ` static_nats = [{` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translate_ip = "2.3.4.5"` + "\n"
+ config += ` direction = "inside"` + "\n"
+ config += ` source_vpn = 0` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_nat = true` + "\n"
+ config += ` nat64 = false` + "\n"
+ config += ` acl_shaping_rate = 12` + "\n"
+ config += ` ipv6_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` ipv6_addresses = [{` + "\n"
+ config += ` link_local_address = "1::1"` + "\n"
+ config += ` global_address = "1::1/24"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` secondary_addresses = [{` + "\n"
+ config += ` address = "2.3.4.5"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` tloc_prefix_change = true` + "\n"
+ config += ` tloc_pref_change_value = 100` + "\n"
+ config += ` }]` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` trustsec_enable_sgt_propogation = false` + "\n"
+ config += ` trustsec_propogate = true` + "\n"
+ config += ` trustsec_security_group_tag = 123` + "\n"
+ config += ` trustsec_enable_enforced_propogation = false` + "\n"
+ config += ` trustsec_enforced_security_group_tag = 1234` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 500` + "\n"
+ config += ` speed = "1000"` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` autonegotiate = false` + "\n"
+ config += ` media_type = "auto-select"` + "\n"
+ config += ` load_interval = 30` + "\n"
+ config += ` tracker = "TRACKER1"` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += ` xconnect = "1"` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index 4a280f0c3..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,951 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &ServiceLANVPNInterfaceEthernetProfileParcelResource{}
-var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceEthernetProfileParcelResource{}
-
-func NewServiceLANVPNInterfaceEthernetProfileParcelResource() resource.Resource {
- return &ServiceLANVPNInterfaceEthernetProfileParcelResource{}
-}
-
-type ServiceLANVPNInterfaceEthernetProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *ServiceLANVPNInterfaceEthernetProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ethernet_profile_parcel"
-}
-
-func (r *ServiceLANVPNInterfaceEthernetProfileParcelResource) 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 Service LAN VPN Interface Ethernet 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Profile Profile ID").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 200),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_dhcp_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance").AddIntegerRangeDescription(1, 65536).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65536),
- },
- },
- "ipv4_dhcp_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of DHCP IPv4 helper addresses (min 1, max 8)").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6").String,
- Optional: true,
- },
- "ipv6_dhcp_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("secondary IPv6 addresses").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Static secondary IPv6 addresses").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_dhcp_helpers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "dhcpv6_helper_vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper VPN").AddIntegerRangeDescription(1, 65536).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65536),
- },
- },
- "dhcpv6_helper_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_nat": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipv4_nat_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Type").AddStringEnumDescription("pool", "loopback").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("pool", "loopback"),
- },
- },
- "ipv4_nat_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_nat_range_start": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range Start").String,
- Optional: true,
- },
- "ipv4_nat_range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_nat_range_end": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range End").String,
- Optional: true,
- },
- "ipv4_nat_range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_nat_prefix_length": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Prefix Length").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "ipv4_nat_prefix_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_nat_overload": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Overload").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "ipv4_nat_overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_nat_loopback": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Inside Source Loopback Interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "ipv4_nat_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_nat_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT UDP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 8947),
- },
- },
- "ipv4_nat_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_nat_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT TCP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("60").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 8947),
- },
- },
- "ipv4_nat_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "static_nats": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("static NAT").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source IP address to be translated").String,
- Optional: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "translate_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Statically translated source IP address").String,
- Optional: true,
- },
- "translate_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "direction": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Direction of static NAT translation").AddStringEnumDescription("inside", "outside").AddDefaultValueDescription("inside").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("inside", "outside"),
- },
- },
- "source_vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source VPN ID").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65530),
- },
- },
- "source_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_nat": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation ipv6 on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "nat64": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "acl_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate (Kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "acl_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "acl_ipv4_egress_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "acl_ipv4_ingress_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "acl_ipv6_egress_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "acl_ipv6_ingress_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "ipv6_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable VRRP Ipv6").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 254),
- },
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 40950),
- },
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipv6_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 VRRP").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "link_local_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Use link-local IPv6 Address").String,
- Optional: true,
- },
- "link_local_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "global_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Assign Global IPv6 Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "global_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- },
- },
- "ipv4_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable VRRP").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 254),
- },
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 40950),
- },
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("VRRP Ip Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("VRRP Secondary Ip Addresses").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Ip Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "tloc_prefix_change": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tloc_pref_change_value": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 4294967295),
- },
- },
- },
- },
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPV4 Address").String,
- Optional: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "trustsec_enable_sgt_propogation": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Indicates that the interface is trustworthy for CTS").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "trustsec_propogate": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enables the interface for CTS SGT authorization and forwarding").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "trustsec_security_group_tag": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("SGT value between 2 and 65519").AddIntegerRangeDescription(2, 65519).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(2, 65519),
- },
- },
- "trustsec_security_group_tag_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "trustsec_enable_enforced_propogation": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable/Disable SGT Enforcement on an interface").String,
- Optional: true,
- },
- "trustsec_enforced_security_group_tag": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("SGT value between 2 and 65519").AddIntegerRangeDescription(2, 65519).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(2, 65519),
- },
- },
- "trustsec_enforced_security_group_tag_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "duplex": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Duplex mode").AddStringEnumDescription("full", "half", "auto").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("full", "half", "auto"),
- },
- },
- "duplex_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1500, 9216),
- },
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "speed": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface speed").AddStringEnumDescription("10", "100", "1000", "2500", "10000").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("10", "100", "1000", "2500", "10000"),
- },
- },
- "speed_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2147483).AddDefaultValueDescription("1200").String,
- Optional: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "autonegotiate": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Link autonegotiation").String,
- Optional: true,
- },
- "autonegotiate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "media_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Media type").AddStringEnumDescription("auto-select", "rj45", "sfp").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("auto-select", "rj45", "sfp"),
- },
- },
- "media_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "load_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval for interface load calculation").AddIntegerRangeDescription(30, 600).AddDefaultValueDescription("30").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(30, 600),
- },
- },
- "load_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
- Optional: true,
- },
- "tracker_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "xconnect": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Extend remote TLOC over a GRE tunnel to a local LAN interface").String,
- Optional: true,
- },
- "xconnect_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *ServiceLANVPNInterfaceEthernetProfileParcelResource) 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan ServiceLANVPNInterfaceEthernet
-
- // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state ServiceLANVPNInterfaceEthernet
-
- // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state ServiceLANVPNInterfaceEthernet
-
- // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state ServiceLANVPNInterfaceEthernet
-
- // 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 *ServiceLANVPNInterfaceEthernetProfileParcelResource) 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_service_lan_vpn_interface_ethernet_profile_parcel_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_profile_parcel_test.go
deleted file mode 100644
index 140e90880..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_profile_parcel_test.go
+++ /dev/null
@@ -1,235 +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 TestAccSdwanServiceLANVPNInterfaceEthernetProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "interface_name", "GigabitEthernet3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "interface_description", "LAN"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.address", "1.2.3.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_dhcp_helpers.0.dhcpv6_helper_vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_type", "pool"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_range_start", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_range_end", "4.5.6.7"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_prefix_length", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_overload", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_loopback", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_udp_timeout", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_nat_tcp_timeout", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.translate_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "static_nats.0.source_vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_nat", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "nat64", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "acl_shaping_rate", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.ipv6_addresses.0.link_local_address", "1::1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv6_vrrps.0.ipv6_addresses.0.global_address", "1::1/24"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ipv4_vrrps.0.tloc_pref_change_value", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_enable_sgt_propogation", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_propogate", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_security_group_tag", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_enable_enforced_propogation", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "trustsec_enforced_security_group_tag", "1234"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "duplex", "full"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "tcp_mss", "500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "speed", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "autonegotiate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "media_type", "auto-select"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "load_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "tracker", "TRACKER1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "icmp_redirect_disable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "xconnect", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ethernet_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanServiceLANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_minimum() string {
- config := `resource "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "GigabitEthernet3"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_nat_type = "pool"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanServiceLANVPNInterfaceEthernetProfileParcelConfig_all() string {
- config := `resource "sdwan_service_lan_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` interface_name = "GigabitEthernet3"` + "\n"
- config += ` interface_description = "LAN"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "1.2.3.5"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` ipv6_dhcp_helpers = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` dhcpv6_helper_vpn = 1` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_nat = false` + "\n"
- config += ` ipv4_nat_type = "pool"` + "\n"
- config += ` ipv4_nat_range_start = "1.2.3.4"` + "\n"
- config += ` ipv4_nat_range_end = "4.5.6.7"` + "\n"
- config += ` ipv4_nat_prefix_length = 1` + "\n"
- config += ` ipv4_nat_overload = true` + "\n"
- config += ` ipv4_nat_loopback = "123"` + "\n"
- config += ` ipv4_nat_udp_timeout = 123` + "\n"
- config += ` ipv4_nat_tcp_timeout = 123` + "\n"
- config += ` static_nats = [{` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translate_ip = "2.3.4.5"` + "\n"
- config += ` direction = "inside"` + "\n"
- config += ` source_vpn = 0` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_nat = true` + "\n"
- config += ` nat64 = false` + "\n"
- config += ` acl_shaping_rate = 12` + "\n"
- config += ` ipv6_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` ipv6_addresses = [{` + "\n"
- config += ` link_local_address = "1::1"` + "\n"
- config += ` global_address = "1::1/24"` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` secondary_addresses = [{` + "\n"
- config += ` address = "2.3.4.5"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` tloc_prefix_change = true` + "\n"
- config += ` tloc_pref_change_value = 100` + "\n"
- config += ` }]` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` trustsec_enable_sgt_propogation = false` + "\n"
- config += ` trustsec_propogate = true` + "\n"
- config += ` trustsec_security_group_tag = 123` + "\n"
- config += ` trustsec_enable_enforced_propogation = false` + "\n"
- config += ` trustsec_enforced_security_group_tag = 1234` + "\n"
- config += ` duplex = "full"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 500` + "\n"
- config += ` speed = "1000"` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` autonegotiate = false` + "\n"
- config += ` media_type = "auto-select"` + "\n"
- config += ` load_interval = 30` + "\n"
- config += ` tracker = "TRACKER1"` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += ` xconnect = "1"` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_feature.go
new file mode 100644
index 000000000..0b96fcdff
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_feature.go
@@ -0,0 +1,388 @@
+// 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/int64validator"
+ "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 = &ServiceLANVPNInterfaceGREProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceGREProfileParcelResource{}
+
+func NewServiceLANVPNInterfaceGREProfileParcelResource() resource.Resource {
+ return &ServiceLANVPNInterfaceGREProfileParcelResource{}
+}
+
+type ServiceLANVPNInterfaceGREProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceLANVPNInterfaceGREProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_gre_feature"
+}
+
+func (r *ServiceLANVPNInterfaceGREProfileParcelResource) 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 Service LAN VPN Interface GRE Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name (1..255)").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(4, 6),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^gre([1-9]|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Required: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel source IP Address").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_interface_loopback": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_source_interface_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_route_via_loopback": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name, can't be Loopback interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_route_via_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel destination IP Address").String,
+ Required: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <576..9976>, in bytes").AddIntegerRangeDescription(576, 9976).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9976),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("none", "sig"),
+ },
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *ServiceLANVPNInterfaceGREProfileParcelResource) 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceLANVPNInterfaceGRE
+
+ // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceLANVPNInterfaceGRE
+
+ // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceLANVPNInterfaceGRE
+
+ // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceLANVPNInterfaceGRE
+
+ // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) 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_service_lan_vpn_interface_gre_feature_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_feature_test.go
new file mode 100644
index 000000000..a6252d10f
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_feature_test.go
@@ -0,0 +1,118 @@
+// 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 TestAccSdwanServiceLANVPNInterfaceGREProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "interface_name", "gre1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "interface_description", "gre1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "ipv4_address", "70.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "tunnel_source_ipv4_address", "78.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "tunnel_destination_ipv4_address", "79.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_feature.test", "application_tunnel_type", "none"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_lan_vpn_interface_gre_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "gre1"` + "\n"
+ config += ` ipv4_address = "70.1.1.1"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_lan_vpn_interface_gre_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "gre1"` + "\n"
+ config += ` interface_description = "gre1"` + "\n"
+ config += ` ipv4_address = "70.1.1.1"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_profile_parcel.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_profile_parcel.go
deleted file mode 100644
index a1568fdb6..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_profile_parcel.go
+++ /dev/null
@@ -1,388 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &ServiceLANVPNInterfaceGREProfileParcelResource{}
-var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceGREProfileParcelResource{}
-
-func NewServiceLANVPNInterfaceGREProfileParcelResource() resource.Resource {
- return &ServiceLANVPNInterfaceGREProfileParcelResource{}
-}
-
-type ServiceLANVPNInterfaceGREProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *ServiceLANVPNInterfaceGREProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_gre_profile_parcel"
-}
-
-func (r *ServiceLANVPNInterfaceGREProfileParcelResource) 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 Service LAN VPN Interface GRE 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Profile Parcel ID").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface name (1..255)").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(4, 6),
- stringvalidator.RegexMatches(regexp.MustCompile(`^gre([1-9]|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel source IP Address").String,
- Optional: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_interface_loopback": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_source_interface_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_route_via_loopback": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name, can't be Loopback interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_route_via_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel destination IP Address").String,
- Required: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <576..9976>, in bytes").AddIntegerRangeDescription(576, 9976).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9976),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("none", "sig"),
- },
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *ServiceLANVPNInterfaceGREProfileParcelResource) 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan ServiceLANVPNInterfaceGRE
-
- // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state ServiceLANVPNInterfaceGRE
-
- // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state ServiceLANVPNInterfaceGRE
-
- // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state ServiceLANVPNInterfaceGRE
-
- // 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 *ServiceLANVPNInterfaceGREProfileParcelResource) 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_service_lan_vpn_interface_gre_profile_parcel_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_profile_parcel_test.go
deleted file mode 100644
index 8a0bf189d..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_gre_profile_parcel_test.go
+++ /dev/null
@@ -1,118 +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 TestAccSdwanServiceLANVPNInterfaceGREProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "interface_name", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "interface_description", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "ipv4_address", "70.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "tunnel_source_ipv4_address", "78.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "tunnel_destination_ipv4_address", "79.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_gre_profile_parcel.test", "application_tunnel_type", "none"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanServiceLANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_minimum() string {
- config := `resource "sdwan_service_lan_vpn_interface_gre_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "gre1"` + "\n"
- config += ` ipv4_address = "70.1.1.1"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanServiceLANVPNInterfaceGREProfileParcelConfig_all() string {
- config := `resource "sdwan_service_lan_vpn_interface_gre_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "gre1"` + "\n"
- config += ` interface_description = "gre1"` + "\n"
- config += ` ipv4_address = "70.1.1.1"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
- config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature.go
new file mode 100644
index 000000000..9f5aa9ed4
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature.go
@@ -0,0 +1,558 @@
+// 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/int64validator"
+ "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 = &ServiceLANVPNInterfaceIPSecProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceIPSecProfileParcelResource{}
+
+func NewServiceLANVPNInterfaceIPSecProfileParcelResource() resource.Resource {
+ return &ServiceLANVPNInterfaceIPSecProfileParcelResource{}
+}
+
+type ServiceLANVPNInterfaceIPSecProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceLANVPNInterfaceIPSecProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ipsec_feature"
+}
+
+func (r *ServiceLANVPNInterfaceIPSecProfileParcelResource) 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 Service LAN VPN Interface IPSec Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name: IPsec when present").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(6, 8),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^ipsec\d{1,3}$`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtMost(240),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Required: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Required: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Required: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("none", "sig"),
+ },
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <68..9216>, in bytes").AddIntegerRangeDescription(68, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(68, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dpd_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive interval (seconds)").AddIntegerRangeDescription(10, 3600).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(10, 3600),
+ },
+ },
+ "dpd_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dpd_retries": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive retries").AddIntegerRangeDescription(2, 60).AddDefaultValueDescription("3").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(2, 60),
+ },
+ },
+ "dpd_retries_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_preshared_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Use preshared key to authenticate IKE peer").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 127),
+ },
+ },
+ "ike_preshared_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_version": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE Version <1..2>").AddIntegerRangeDescription(1, 2).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 2),
+ },
+ },
+ "ike_integrity_protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE integrity protocol").AddStringEnumDescription("main", "aggressive").AddDefaultValueDescription("main").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("main", "aggressive"),
+ },
+ },
+ "ike_integrity_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE rekey interval <60..86400> seconds").AddIntegerRangeDescription(60, 86400).AddDefaultValueDescription("14400").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(60, 86400),
+ },
+ },
+ "ike_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE identity the IKE preshared secret belongs to").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2").AddDefaultValueDescription("aes256-cbc-sha1").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2"),
+ },
+ },
+ "ike_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_diffie_hellman_group": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE Diffie Hellman Groups").AddStringEnumDescription("2", "14", "15", "16", "19", "20", "21", "24").AddDefaultValueDescription("16").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("2", "14", "15", "16", "19", "20", "21", "24"),
+ },
+ },
+ "ike_diffie_hellman_group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_id_local_end_point": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the local endpoint. Input IPv4 address, domain name, or email address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 63),
+ },
+ },
+ "ike_id_local_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_id_remote_end_point": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 63),
+ },
+ },
+ "ike_id_remote_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPsec rekey interval <300..1209600> seconds").AddIntegerRangeDescription(120, 2592000).AddDefaultValueDescription("3600").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(120, 2592000),
+ },
+ },
+ "ipsec_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_replay_window": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Replay window size 32..8192 (must be a power of 2)").AddIntegerRangeDescription(64, 4096).AddDefaultValueDescription("512").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(64, 4096),
+ },
+ },
+ "ipsec_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPsec(ESP) encryption and integrity protocol").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512").AddDefaultValueDescription("aes256-gcm").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512"),
+ },
+ },
+ "ipsec_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "perfect_forward_secrecy": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPsec perfect forward secrecy settings").AddStringEnumDescription("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none").AddDefaultValueDescription("group-16").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none"),
+ },
+ },
+ "perfect_forward_secrecy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
+ Optional: true,
+ },
+ "tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_route_via": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_route_via_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *ServiceLANVPNInterfaceIPSecProfileParcelResource) 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceLANVPNInterfaceIPSec
+
+ // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceLANVPNInterfaceIPSec
+
+ // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceLANVPNInterfaceIPSec
+
+ // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceLANVPNInterfaceIPSec
+
+ // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) 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_service_lan_vpn_interface_ipsec_feature_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_test.go
new file mode 100644
index 000000000..65ec8e049
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_test.go
@@ -0,0 +1,160 @@
+// 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 TestAccSdwanServiceLANVPNInterfaceIPSecProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "interface_name", "ipsec987"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "interface_description", "ipsec987"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipv4_address", "9.7.5.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_source_ipv4_address", "1.3.5.88"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_source_ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_source_interface", "GigabitEthernet8"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_destination_ipv4_address", "2.55.67.99"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_destination_ipv4_subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "application_tunnel_type", "none"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "dpd_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "dpd_retries", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_preshared_key", "123"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_version", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_integrity_protocol", "main"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_rekey_interval", "14400"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_ciphersuite", "aes256-cbc-sha1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_diffie_hellman_group", "16"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_id_local_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ike_id_remote_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipsec_rekey_interval", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipsec_replay_window", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "ipsec_ciphersuite", "aes256-gcm"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "perfect_forward_secrecy", "group-16"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_feature.test", "tunnel_route_via", "2222"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_lan_vpn_interface_ipsec_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "ipsec987"` + "\n"
+ config += ` ipv4_address = "9.7.5.4"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
+ config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
+ config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += ` ike_preshared_key = "123"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_lan_vpn_interface_ipsec_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "ipsec987"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_description = "ipsec987"` + "\n"
+ config += ` ipv4_address = "9.7.5.4"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
+ config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
+ config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` dpd_interval = 10` + "\n"
+ config += ` dpd_retries = 3` + "\n"
+ config += ` ike_preshared_key = "123"` + "\n"
+ config += ` ike_version = 1` + "\n"
+ config += ` ike_integrity_protocol = "main"` + "\n"
+ config += ` ike_rekey_interval = 14400` + "\n"
+ config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
+ config += ` ike_diffie_hellman_group = "16"` + "\n"
+ config += ` ike_id_local_end_point = "xxx"` + "\n"
+ config += ` ike_id_remote_end_point = "xxx"` + "\n"
+ config += ` ipsec_rekey_interval = 3600` + "\n"
+ config += ` ipsec_replay_window = 512` + "\n"
+ config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
+ config += ` perfect_forward_secrecy = "group-16"` + "\n"
+ config += ` tunnel_route_via = "2222"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go
deleted file mode 100644
index 1f2c2ca54..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go
+++ /dev/null
@@ -1,558 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &ServiceLANVPNInterfaceIPSecProfileParcelResource{}
-var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceIPSecProfileParcelResource{}
-
-func NewServiceLANVPNInterfaceIPSecProfileParcelResource() resource.Resource {
- return &ServiceLANVPNInterfaceIPSecProfileParcelResource{}
-}
-
-type ServiceLANVPNInterfaceIPSecProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *ServiceLANVPNInterfaceIPSecProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_ipsec_profile_parcel"
-}
-
-func (r *ServiceLANVPNInterfaceIPSecProfileParcelResource) 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 Service LAN VPN Interface IPSec 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Profile Parcel ID").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface name: IPsec when present").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(6, 8),
- stringvalidator.RegexMatches(regexp.MustCompile(`^ipsec\d{1,3}$`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtMost(240),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("none", "sig"),
- },
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <68..9216>, in bytes").AddIntegerRangeDescription(68, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(68, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "dpd_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive interval (seconds)").AddIntegerRangeDescription(10, 3600).AddDefaultValueDescription("10").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(10, 3600),
- },
- },
- "dpd_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "dpd_retries": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive retries").AddIntegerRangeDescription(2, 60).AddDefaultValueDescription("3").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(2, 60),
- },
- },
- "dpd_retries_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_preshared_key": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Use preshared key to authenticate IKE peer").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 127),
- },
- },
- "ike_preshared_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_version": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE Version <1..2>").AddIntegerRangeDescription(1, 2).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2),
- },
- },
- "ike_integrity_protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE integrity protocol").AddStringEnumDescription("main", "aggressive").AddDefaultValueDescription("main").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("main", "aggressive"),
- },
- },
- "ike_integrity_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE rekey interval <60..86400> seconds").AddIntegerRangeDescription(60, 86400).AddDefaultValueDescription("14400").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(60, 86400),
- },
- },
- "ike_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_ciphersuite": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE identity the IKE preshared secret belongs to").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2").AddDefaultValueDescription("aes256-cbc-sha1").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2"),
- },
- },
- "ike_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_diffie_hellman_group": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE Diffie Hellman Groups").AddStringEnumDescription("2", "14", "15", "16", "19", "20", "21", "24").AddDefaultValueDescription("16").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("2", "14", "15", "16", "19", "20", "21", "24"),
- },
- },
- "ike_diffie_hellman_group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_id_local_end_point": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the local endpoint. Input IPv4 address, domain name, or email address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 63),
- },
- },
- "ike_id_local_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_id_remote_end_point": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 63),
- },
- },
- "ike_id_remote_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPsec rekey interval <300..1209600> seconds").AddIntegerRangeDescription(120, 2592000).AddDefaultValueDescription("3600").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(120, 2592000),
- },
- },
- "ipsec_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_replay_window": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Replay window size 32..8192 (must be a power of 2)").AddIntegerRangeDescription(64, 4096).AddDefaultValueDescription("512").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(64, 4096),
- },
- },
- "ipsec_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_ciphersuite": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPsec(ESP) encryption and integrity protocol").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512").AddDefaultValueDescription("aes256-gcm").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512"),
- },
- },
- "ipsec_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "perfect_forward_secrecy": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPsec perfect forward secrecy settings").AddStringEnumDescription("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none").AddDefaultValueDescription("group-16").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none"),
- },
- },
- "perfect_forward_secrecy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
- Optional: true,
- },
- "tracker_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_route_via": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_route_via_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *ServiceLANVPNInterfaceIPSecProfileParcelResource) 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan ServiceLANVPNInterfaceIPSec
-
- // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state ServiceLANVPNInterfaceIPSec
-
- // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state ServiceLANVPNInterfaceIPSec
-
- // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state ServiceLANVPNInterfaceIPSec
-
- // 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 *ServiceLANVPNInterfaceIPSecProfileParcelResource) 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_service_lan_vpn_interface_ipsec_profile_parcel_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_profile_parcel_test.go
deleted file mode 100644
index 57f27a0f1..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_profile_parcel_test.go
+++ /dev/null
@@ -1,160 +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 TestAccSdwanServiceLANVPNInterfaceIPSecProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "interface_name", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "interface_description", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipv4_address", "9.7.5.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_address", "1.3.5.88"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_interface", "GigabitEthernet8"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_address", "2.55.67.99"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "application_tunnel_type", "none"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "dpd_interval", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "dpd_retries", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_preshared_key", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_version", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_integrity_protocol", "main"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_rekey_interval", "14400"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_ciphersuite", "aes256-cbc-sha1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_diffie_hellman_group", "16"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_id_local_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ike_id_remote_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipsec_rekey_interval", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipsec_replay_window", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "ipsec_ciphersuite", "aes256-gcm"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "perfect_forward_secrecy", "group-16"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_ipsec_profile_parcel.test", "tunnel_route_via", "2222"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanServiceLANVPNInterfaceIPSecPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_minimum() string {
- config := `resource "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "ipsec987"` + "\n"
- config += ` ipv4_address = "9.7.5.4"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
- config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
- config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
- config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += ` ike_preshared_key = "123"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanServiceLANVPNInterfaceIPSecProfileParcelConfig_all() string {
- config := `resource "sdwan_service_lan_vpn_interface_ipsec_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "ipsec987"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_description = "ipsec987"` + "\n"
- config += ` ipv4_address = "9.7.5.4"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
- config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
- config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
- config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` dpd_interval = 10` + "\n"
- config += ` dpd_retries = 3` + "\n"
- config += ` ike_preshared_key = "123"` + "\n"
- config += ` ike_version = 1` + "\n"
- config += ` ike_integrity_protocol = "main"` + "\n"
- config += ` ike_rekey_interval = 14400` + "\n"
- config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
- config += ` ike_diffie_hellman_group = "16"` + "\n"
- config += ` ike_id_local_end_point = "xxx"` + "\n"
- config += ` ike_id_remote_end_point = "xxx"` + "\n"
- config += ` ipsec_rekey_interval = 3600` + "\n"
- config += ` ipsec_replay_window = 512` + "\n"
- config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
- config += ` perfect_forward_secrecy = "group-16"` + "\n"
- config += ` tunnel_route_via = "2222"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature.go
new file mode 100644
index 000000000..e59b27cf4
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature.go
@@ -0,0 +1,687 @@
+// 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/int64validator"
+ "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 = &ServiceLANVPNInterfaceSVIProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceSVIProfileParcelResource{}
+
+func NewServiceLANVPNInterfaceSVIProfileParcelResource() resource.Resource {
+ return &ServiceLANVPNInterfaceSVIProfileParcelResource{}
+}
+
+type ServiceLANVPNInterfaceSVIProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceLANVPNInterfaceSVIProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_svi_feature"
+}
+
+func (r *ServiceLANVPNInterfaceSVIProfileParcelResource) 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 Service LAN VPN Interface SVI Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "service_lan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name: VLAN 1 - VLAN 4094 when present").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(5, 8),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^Vlan([1-9]|[1-9]\d{1,2}|[1-3]\d{3}|40[0-8]\d|409[0-4])$`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <1500..9216> in bytes").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1500, 9216),
+ },
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP MTU <576..Interface MTU>, in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Required: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign secondary IP addresses").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helpers": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of DHCP helper addresses").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "ipv4_dhcp_helpers_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign IPv6 address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign secondary IPv6 addresses").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_dhcp_helpers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper VPN").AddIntegerRangeDescription(1, 65536).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure static ARP entries").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable ipv4 VRRP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 40950),
+ },
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "track_omp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "prefix_list": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Track Prefix List").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[a-zA-Z0-9-_]+$`), ""),
+ },
+ },
+ "prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign IPV4 Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VRRP Secondary IPV4 address").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VRRP Secondary IPV4 address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "tloc_prefix_change": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("change TLOC preference").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tloc_prefix_change_value": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set tloc preference change value").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "tloc_prefix_change_value_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_vrrps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable ipv6 VRRP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "group_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "group_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "priority": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "timer": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 40950),
+ },
+ },
+ "timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "track_omp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "track_omp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "track_prefix_list": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Track Prefix List").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[a-zA-Z0-9-_]+$`), ""),
+ },
+ },
+ "track_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 VRRP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "link_local_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Use link-local IPv6 Address").String,
+ Optional: true,
+ },
+ "link_local_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "global_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign Global IPv6 Prefix").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "global_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Secondary IP address").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Secondary IP address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "enable_dhcpv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(552, 1960).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(552, 1960),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2678400).AddDefaultValueDescription("1200").String,
+ Optional: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *ServiceLANVPNInterfaceSVIProfileParcelResource) 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceLANVPNInterfaceSVI
+
+ // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceLANVPNInterfaceSVI
+
+ // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceLANVPNInterfaceSVI
+
+ // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceLANVPNInterfaceSVI
+
+ // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) 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_service_lan_vpn_interface_svi_feature_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_test.go
new file mode 100644
index 000000000..757dc9484
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_test.go
@@ -0,0 +1,188 @@
+// 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 TestAccSdwanServiceLANVPNInterfaceSVIProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "interface_name", "Vlan1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "interface_description", "SVI"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_secondary_addresses.0.address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_secondary_addresses.0.ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_address", "2001:0:0:1::0/32"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_secondary_addresses.0.address", "::2/32"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_dhcp_helpers.0.vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.prefix_list", "prefix"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv4_vrrps.0.tloc_prefix_change_value", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.group_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.priority", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.timer", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.track_omp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.track_prefix_list", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.addresses.0.link_local_address", "1::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.addresses.0.global_address", "1::1/24"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ipv6_vrrps.0.secondary_addresses.0.prefix", "::20/32"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "enable_dhcpv6", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "tcp_mss", "1024"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "ip_directed_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_feature.test", "icmp_redirect_disable", "true"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_lan_vpn_feature" "test" {
+ name = "TF_TEST_SLAN"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_lan_vpn_interface_svi_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "Vlan1"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_lan_vpn_interface_svi_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` service_lan_vpn_feature_id = sdwan_service_lan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` interface_name = "Vlan1"` + "\n"
+ config += ` interface_description = "SVI"` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "2.3.4.5"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helpers = ["4.5.6.7"]` + "\n"
+ config += ` ipv6_address = "2001:0:0:1::0/32"` + "\n"
+ config += ` ipv6_secondary_addresses = [{` + "\n"
+ config += ` address = "::2/32"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_dhcp_helpers = [{` + "\n"
+ config += ` address = "2001:0:0:1::0"` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` prefix_list = "prefix"` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` secondary_addresses = [{` + "\n"
+ config += ` address = "2.3.4.5"` + "\n"
+ config += ` }]` + "\n"
+ config += ` tloc_prefix_change = true` + "\n"
+ config += ` tloc_prefix_change_value = 100` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_vrrps = [{` + "\n"
+ config += ` group_id = 1` + "\n"
+ config += ` priority = 100` + "\n"
+ config += ` timer = 1000` + "\n"
+ config += ` track_omp = false` + "\n"
+ config += ` track_prefix_list = "1"` + "\n"
+ config += ` addresses = [{` + "\n"
+ config += ` link_local_address = "1::1"` + "\n"
+ config += ` global_address = "1::1/24"` + "\n"
+ config += ` }]` + "\n"
+ config += ` secondary_addresses = [{` + "\n"
+ config += ` prefix = "::20/32"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` enable_dhcpv6 = false` + "\n"
+ config += ` tcp_mss = 1024` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_profile_parcel.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_profile_parcel.go
deleted file mode 100644
index 7e719c103..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_profile_parcel.go
+++ /dev/null
@@ -1,687 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &ServiceLANVPNInterfaceSVIProfileParcelResource{}
-var _ resource.ResourceWithImportState = &ServiceLANVPNInterfaceSVIProfileParcelResource{}
-
-func NewServiceLANVPNInterfaceSVIProfileParcelResource() resource.Resource {
- return &ServiceLANVPNInterfaceSVIProfileParcelResource{}
-}
-
-type ServiceLANVPNInterfaceSVIProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *ServiceLANVPNInterfaceSVIProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_interface_svi_profile_parcel"
-}
-
-func (r *ServiceLANVPNInterfaceSVIProfileParcelResource) 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 Service LAN VPN Interface SVI 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,
- },
- "service_lan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service LAN VPN Profile Profile ID").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface name: VLAN 1 - VLAN 4094 when present").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(5, 8),
- stringvalidator.RegexMatches(regexp.MustCompile(`^Vlan([1-9]|[1-9]\d{1,2}|[1-3]\d{3}|40[0-8]\d|409[0-4])$`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <1500..9216> in bytes").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1500, 9216),
- },
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP MTU <576..Interface MTU>, in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Required: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Assign secondary IP addresses").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_dhcp_helpers": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of DHCP helper addresses").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "ipv4_dhcp_helpers_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Assign IPv6 address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Assign secondary IPv6 addresses").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_dhcp_helpers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCPv6 Helper VPN").AddIntegerRangeDescription(1, 65536).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65536),
- },
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure static ARP entries").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable ipv4 VRRP").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 254),
- },
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 40950),
- },
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "track_omp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "prefix_list": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Track Prefix List").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`^[a-zA-Z0-9-_]+$`), ""),
- },
- },
- "prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Assign IPV4 Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("VRRP Secondary IPV4 address").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("VRRP Secondary IPV4 address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "tloc_prefix_change": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("change TLOC preference").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tloc_prefix_change_value": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set tloc preference change value").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "tloc_prefix_change_value_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_vrrps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable ipv6 VRRP").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "group_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Group ID").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "group_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "priority": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set priority").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("100").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 254),
- },
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "timer": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timer interval for successive advertisements, in milliseconds").AddIntegerRangeDescription(100, 40950).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 40950),
- },
- },
- "timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_omp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Track OMP status").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "track_omp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_prefix_list": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Track Prefix List").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`^[a-zA-Z0-9-_]+$`), ""),
- },
- },
- "track_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 VRRP").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "link_local_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Use link-local IPv6 Address").String,
- Optional: true,
- },
- "link_local_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "global_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Assign Global IPv6 Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "global_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Secondary IP address").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Secondary IP address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- },
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "enable_dhcpv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(552, 1960).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(552, 1960),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2678400).AddDefaultValueDescription("1200").String,
- Optional: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *ServiceLANVPNInterfaceSVIProfileParcelResource) 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan ServiceLANVPNInterfaceSVI
-
- // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state ServiceLANVPNInterfaceSVI
-
- // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state ServiceLANVPNInterfaceSVI
-
- // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state ServiceLANVPNInterfaceSVI
-
- // 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 *ServiceLANVPNInterfaceSVIProfileParcelResource) 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_service_lan_vpn_interface_svi_profile_parcel_test.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_profile_parcel_test.go
deleted file mode 100644
index 2d2fdc15c..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_profile_parcel_test.go
+++ /dev/null
@@ -1,188 +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 TestAccSdwanServiceLANVPNInterfaceSVIProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "interface_name", "Vlan1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "interface_description", "SVI"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_secondary_addresses.0.address", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_secondary_addresses.0.ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_address", "2001:0:0:1::0/32"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_secondary_addresses.0.address", "::2/32"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_dhcp_helpers.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_dhcp_helpers.0.vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.prefix_list", "prefix"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.secondary_addresses.0.address", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.tloc_prefix_change", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv4_vrrps.0.tloc_prefix_change_value", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.group_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.priority", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.timer", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.track_omp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.track_prefix_list", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.addresses.0.link_local_address", "1::1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.addresses.0.global_address", "1::1/24"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ipv6_vrrps.0.secondary_addresses.0.prefix", "::20/32"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "enable_dhcpv6", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "tcp_mss", "1024"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "ip_directed_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_interface_svi_profile_parcel.test", "icmp_redirect_disable", "true"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanServiceLANVPNInterfaceSVIPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_service_lan_vpn_profile_parcel" "test" {
- name = "TF_TEST_SLAN"
- feature_profile_id = sdwan_service_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_minimum() string {
- config := `resource "sdwan_service_lan_vpn_interface_svi_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "Vlan1"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanServiceLANVPNInterfaceSVIProfileParcelConfig_all() string {
- config := `resource "sdwan_service_lan_vpn_interface_svi_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` service_lan_vpn_profile_parcel_id = sdwan_service_lan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` interface_name = "Vlan1"` + "\n"
- config += ` interface_description = "SVI"` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "2.3.4.5"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helpers = ["4.5.6.7"]` + "\n"
- config += ` ipv6_address = "2001:0:0:1::0/32"` + "\n"
- config += ` ipv6_secondary_addresses = [{` + "\n"
- config += ` address = "::2/32"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_dhcp_helpers = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` vpn = 1` + "\n"
- config += ` }]` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` prefix_list = "prefix"` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` secondary_addresses = [{` + "\n"
- config += ` address = "2.3.4.5"` + "\n"
- config += ` }]` + "\n"
- config += ` tloc_prefix_change = true` + "\n"
- config += ` tloc_prefix_change_value = 100` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_vrrps = [{` + "\n"
- config += ` group_id = 1` + "\n"
- config += ` priority = 100` + "\n"
- config += ` timer = 1000` + "\n"
- config += ` track_omp = false` + "\n"
- config += ` track_prefix_list = "1"` + "\n"
- config += ` addresses = [{` + "\n"
- config += ` link_local_address = "1::1"` + "\n"
- config += ` global_address = "1::1/24"` + "\n"
- config += ` }]` + "\n"
- config += ` secondary_addresses = [{` + "\n"
- config += ` prefix = "::20/32"` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` enable_dhcpv6 = false` + "\n"
- config += ` tcp_mss = 1024` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_lan_vpn_profile_parcel.go b/internal/provider/resource_sdwan_service_lan_vpn_profile_parcel.go
deleted file mode 100644
index 6b7755c49..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_profile_parcel.go
+++ /dev/null
@@ -1,1268 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &ServiceLANVPNProfileParcelResource{}
-var _ resource.ResourceWithImportState = &ServiceLANVPNProfileParcelResource{}
-
-func NewServiceLANVPNProfileParcelResource() resource.Resource {
- return &ServiceLANVPNProfileParcelResource{}
-}
-
-type ServiceLANVPNProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *ServiceLANVPNProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_service_lan_vpn_profile_parcel"
-}
-
-func (r *ServiceLANVPNProfileParcelResource) 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 Service LAN VPN 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,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("VPN").AddIntegerRangeDescription(1, 65527).AddDefaultValueDescription("0").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65527),
- },
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "config_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtMost(244),
- },
- },
- "config_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "omp_admin_distance_ipv4": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv4").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "omp_admin_distance_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "omp_admin_distance_ipv6": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv6").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "omp_admin_distance_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "enable_sdwan_remote_access": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable SDWAN Remote Access").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "primary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv4)").String,
- Optional: true,
- },
- "primary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv4)").String,
- Optional: true,
- },
- "secondary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "primary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv6)").String,
- Optional: true,
- },
- "primary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv6)").String,
- Optional: true,
- },
- "secondary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "host_mappings": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "host_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Hostname").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "host_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "list_of_ips": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of IP").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "list_of_ips_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "advertise_omp_ipv4s": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("OMP Advertise IPv4").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Protocol").AddStringEnumDescription("bgp", "ospf", "ospfv3", "connected", "static", "network", "aggregate", "eigrp", "lisp", "isis").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("bgp", "ospf", "ospfv3", "connected", "static", "network", "aggregate", "eigrp", "lisp", "isis"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "prefixes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Prefix List").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "aggregate_only": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Aggregate Only").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "region": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Applied to Region").AddStringEnumDescription("core-and-access", "core", "access").AddDefaultValueDescription("core-and-access").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("core-and-access", "core", "access"),
- },
- },
- "region_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- },
- },
- "advertise_omp_ipv6s": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("OMP Advertise IPv6").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Protocol").AddStringEnumDescription("BGP", "OSPF", "Connected", "Static", "Network", "Aggregate").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("BGP", "OSPF", "Connected", "Static", "Network", "Aggregate"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "protocol_sub_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Protocol Sub Type").AddStringEnumDescription("External").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("External"),
- },
- },
- "protocol_sub_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "prefixes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Prefix List").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "aggregate_only": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Aggregate Only").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- },
- },
- },
- },
- },
- },
- "ipv4_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "next_hop_with_trackers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop with Tracker").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop").String,
- Optional: true,
- },
- "gateway_dhcp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway DHCP").String,
- Optional: true,
- },
- "vpn": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway VPN").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Static Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 254).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 254),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String,
- Optional: true,
- },
- "nat": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Nat").AddStringEnumDescription("NAT64", "NAT66").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("NAT64", "NAT66"),
- },
- },
- "nat_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "services": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "service_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service Type").AddStringEnumDescription("FW", "IDS", "IDP", "netsvc1", "netsvc2", "netsvc3", "netsvc4", "TE", "appqoe").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("FW", "IDS", "IDP", "netsvc1", "netsvc2", "netsvc3", "netsvc4", "TE", "appqoe"),
- },
- },
- "service_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_addresses": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Addresses (Maximum: 4)").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "ipv4_addresses_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracking": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tracking").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tracking_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "service_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "service": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service").AddStringEnumDescription("SIG").AddDefaultValueDescription("SIG").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("SIG"),
- },
- },
- "service_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service").String,
- Optional: true,
- },
- },
- },
- },
- "gre_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static GRE Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service").String,
- Optional: true,
- },
- },
- },
- },
- "ipsec_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static IPSEC Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "nat_pools": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat_pool_name": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Name").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "nat_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "prefix_length": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Prefix Length").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "prefix_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "range_start": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range Start").String,
- Optional: true,
- },
- "range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "range_end": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range End").String,
- Optional: true,
- },
- "range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "overload": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Overload").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "direction": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Direction").AddStringEnumDescription("inside", "outside").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("inside", "outside"),
- },
- },
- "direction_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker_object_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- "nat_port_forwards": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Port Forward").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat_pool_name": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Name").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "nat_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_port": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source Port").String,
- Optional: true,
- },
- "source_port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "translate_port": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Translate Port").String,
- Optional: true,
- },
- "translate_port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source IP Address").String,
- Optional: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "translated_source_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Translated Source IP Address").String,
- Optional: true,
- },
- "translated_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Protocol").AddStringEnumDescription("TCP", "UDP").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("TCP", "UDP"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "static_nats": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Static NAT Rules").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat_pool_name": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Name").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "nat_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source IP Address").String,
- Optional: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "translated_source_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Translated Source IP Address").String,
- Optional: true,
- },
- "translated_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "static_nat_direction": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Static NAT Direction").AddStringEnumDescription("inside", "outside").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("inside", "outside"),
- },
- },
- "static_nat_direction_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker_object_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- "nat_64_v4_pools": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 V4 Pool").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 v4 Pool Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "range_start": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 Pool Range Start").String,
- Optional: true,
- },
- "range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "range_end": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 Pool Range End").String,
- Optional: true,
- },
- "range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "overload": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 Overload").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "route_leak_from_global_vpns": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable route leaking from Global to Service VPN").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Leak Routes of particular protocol from Global to Service VPN").AddStringEnumDescription("static", "connected", "bgp", "ospf").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("static", "connected", "bgp", "ospf"),
- },
- },
- "route_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "redistributions": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Redistribute Routes to specific Protocol on Service VPN").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Protocol to restributed leaked routes").AddStringEnumDescription("bgp", "ospf").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("bgp", "ospf"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "redistribution_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- },
- },
- },
- "route_leak_to_global_vpns": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable route leaking from Service to Global VPN").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Leak Routes of particular protocol from Service to Global VPN").AddStringEnumDescription("static", "connected", "bgp", "ospf").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("static", "connected", "bgp", "ospf"),
- },
- },
- "route_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "redistributions": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Redistribute Routes to specific Protocol on Global VPN").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Protocol to restributed leaked routes").AddStringEnumDescription("bgp", "ospf").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("bgp", "ospf"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "redistribution_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- },
- },
- },
- "route_leak_from_other_services": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable route leak from another Service VPN to current Service VPN").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source Service VPN from where route are to be leaked").AddIntegerRangeDescription(1, 65530).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65530),
- },
- },
- "source_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Leak Route of particular protocol from Source Service VPN").AddStringEnumDescription("static", "connected", "bgp", "ospf").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("static", "connected", "bgp", "ospf"),
- },
- },
- "route_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "redistributions": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Redistribute Route to specific Protocol on Current Service VPN").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Protocol to restributed leaked routes").AddStringEnumDescription("bgp", "ospf").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("bgp", "ospf"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "redistribution_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- },
- },
- },
- "ipv4_import_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
- },
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_export_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
- },
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_import_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
- },
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_export_route_targets": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "route_target": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Route target").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-9]+\.[0-9]+)|([0-9]+)|((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))):[0-9]+$`), ""),
- },
- },
- "route_target_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *ServiceLANVPNProfileParcelResource) 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 *ServiceLANVPNProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan ServiceLANVPN
-
- // 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 *ServiceLANVPNProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state ServiceLANVPN
-
- // 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 *ServiceLANVPNProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state ServiceLANVPN
-
- // 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 *ServiceLANVPNProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state ServiceLANVPN
-
- // 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 *ServiceLANVPNProfileParcelResource) 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_service_lan_vpn_profile_parcel_test.go b/internal/provider/resource_sdwan_service_lan_vpn_profile_parcel_test.go
deleted file mode 100644
index 8b259e264..000000000
--- a/internal/provider/resource_sdwan_service_lan_vpn_profile_parcel_test.go
+++ /dev/null
@@ -1,227 +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 TestAccSdwanServiceLANVPNProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "config_description", "VPN1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "omp_admin_distance_ipv4", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "omp_admin_distance_ipv6", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "enable_sdwan_remote_access", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "primary_dns_address_ipv4", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "secondary_dns_address_ipv4", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "host_mappings.0.host_name", "HOSTMAPPING1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv6_static_routes.0.prefix", "2001:0:0:1::0/12"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "services.0.service_type", "FW"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "services.0.tracking", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.service", "SIG"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "service_routes.0.vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "gre_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "gre_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "gre_routes.0.vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipsec_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipsec_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.nat_pool_name", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.prefix_length", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.range_start", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.range_end", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.overload", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_pools.0.direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.nat_pool_name", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.source_port", "122"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.translate_port", "330"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.translated_source_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_port_forwards.0.protocol", "TCP"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.nat_pool_name", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.translated_source_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "static_nats.0.static_nat_direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.name", "NATPOOL1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.range_start", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.range_end", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "nat_64_v4_pools.0.overload", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv4_import_route_targets.0.route_target", "1.1.1.3:200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv4_export_route_targets.0.route_target", "1.1.1.3:200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv6_import_route_targets.0.route_target", "1.1.1.3:200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_lan_vpn_profile_parcel.test", "ipv6_export_route_targets.0.route_target", "1.1.1.3:200"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanServiceLANVPNPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanServiceLANVPNPrerequisitesProfileParcelConfig + testAccSdwanServiceLANVPNProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanServiceLANVPNPrerequisitesProfileParcelConfig = `
-resource "sdwan_service_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanServiceLANVPNProfileParcelConfig_minimum() string {
- config := `resource "sdwan_service_lan_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanServiceLANVPNProfileParcelConfig_all() string {
- config := `resource "sdwan_service_lan_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
- config += ` vpn = 1` + "\n"
- config += ` config_description = "VPN1"` + "\n"
- config += ` omp_admin_distance_ipv4 = 1` + "\n"
- config += ` omp_admin_distance_ipv6 = 1` + "\n"
- config += ` enable_sdwan_remote_access = false` + "\n"
- config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
- config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
- config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
- config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
- config += ` host_mappings = [{` + "\n"
- config += ` host_name = "HOSTMAPPING1"` + "\n"
- config += ` list_of_ips = ["1.2.3.4"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_static_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_static_routes = [{` + "\n"
- config += ` prefix = "2001:0:0:1::0/12"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` services = [{` + "\n"
- config += ` service_type = "FW"` + "\n"
- config += ` ipv4_addresses = ["1.2.3.4"]` + "\n"
- config += ` tracking = true` + "\n"
- config += ` }]` + "\n"
- config += ` service_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` service = "SIG"` + "\n"
- config += ` vpn = 0` + "\n"
- config += ` }]` + "\n"
- config += ` gre_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` interface = ["gre01"]` + "\n"
- config += ` vpn = 0` + "\n"
- config += ` }]` + "\n"
- config += ` ipsec_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` interface = ["ipsec01"]` + "\n"
- config += ` }]` + "\n"
- config += ` nat_pools = [{` + "\n"
- config += ` nat_pool_name = 1` + "\n"
- config += ` prefix_length = 3` + "\n"
- config += ` range_start = "1.2.3.4"` + "\n"
- config += ` range_end = "2.3.4.5"` + "\n"
- config += ` overload = true` + "\n"
- config += ` direction = "inside"` + "\n"
- config += ` }]` + "\n"
- config += ` nat_port_forwards = [{` + "\n"
- config += ` nat_pool_name = 2` + "\n"
- config += ` source_port = 122` + "\n"
- config += ` translate_port = 330` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translated_source_ip = "2.3.4.5"` + "\n"
- config += ` protocol = "TCP"` + "\n"
- config += ` }]` + "\n"
- config += ` static_nats = [{` + "\n"
- config += ` nat_pool_name = 3` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translated_source_ip = "2.3.4.5"` + "\n"
- config += ` static_nat_direction = "inside"` + "\n"
- config += ` }]` + "\n"
- config += ` nat_64_v4_pools = [{` + "\n"
- config += ` name = "NATPOOL1"` + "\n"
- config += ` range_start = "1.2.3.4"` + "\n"
- config += ` range_end = "2.3.4.5"` + "\n"
- config += ` overload = false` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_import_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_export_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_import_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_export_route_targets = [{` + "\n"
- config += ` route_target = "1.1.1.3:200"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_object_tracker_feature.go b/internal/provider/resource_sdwan_service_object_tracker_feature.go
new file mode 100644
index 000000000..6ecb68783
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_object_tracker_feature.go
@@ -0,0 +1,301 @@
+// 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/int64validator"
+ "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 = &ServiceObjectTrackerProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceObjectTrackerProfileParcelResource{}
+
+func NewServiceObjectTrackerProfileParcelResource() resource.Resource {
+ return &ServiceObjectTrackerProfileParcelResource{}
+}
+
+type ServiceObjectTrackerProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceObjectTrackerProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_object_tracker_feature"
+}
+
+func (r *ServiceObjectTrackerProfileParcelResource) 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 Service Object Tracker Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "object_tracker_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Object tracker ID").AddIntegerRangeDescription(1, 1000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 1000),
+ },
+ },
+ "object_tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "object_tracker_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("objectTrackerType:Interface SIG Route").AddStringEnumDescription("Interface", "SIG", "Route").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("Interface", "SIG", "Route"),
+ },
+ },
+ "interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP address").String,
+ Optional: true,
+ },
+ "route_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").AddDefaultValueDescription("0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "route_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VPN").AddIntegerRangeDescription(0, 65530).String,
+ Optional: true,
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *ServiceObjectTrackerProfileParcelResource) 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 *ServiceObjectTrackerProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceObjectTracker
+
+ // 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 *ServiceObjectTrackerProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceObjectTracker
+
+ // 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 *ServiceObjectTrackerProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceObjectTracker
+
+ // 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 *ServiceObjectTrackerProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceObjectTracker
+
+ // 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 *ServiceObjectTrackerProfileParcelResource) 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_service_object_tracker_feature_test.go b/internal/provider/resource_sdwan_service_object_tracker_feature_test.go
new file mode 100644
index 000000000..d5d402712
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_object_tracker_feature_test.go
@@ -0,0 +1,94 @@
+// 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 TestAccSdwanServiceObjectTrackerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_object_tracker_feature.test", "object_tracker_type", "Interface"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_object_tracker_feature.test", "interface", "GigabitEthernet1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceObjectTrackerPrerequisitesProfileParcelConfig + testAccSdwanServiceObjectTrackerProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceObjectTrackerPrerequisitesProfileParcelConfig + testAccSdwanServiceObjectTrackerProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceObjectTrackerPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceObjectTrackerProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_object_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` object_tracker_id = 10` + "\n"
+ config += ` object_tracker_type = "Interface"` + "\n"
+ config += ` interface = "GigabitEthernet1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceObjectTrackerProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_object_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` object_tracker_id = 10` + "\n"
+ config += ` object_tracker_type = "Interface"` + "\n"
+ config += ` interface = "GigabitEthernet1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_object_tracker_group_feature.go b/internal/provider/resource_sdwan_service_object_tracker_group_feature.go
new file mode 100644
index 000000000..c88e36113
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_object_tracker_group_feature.go
@@ -0,0 +1,281 @@
+// 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/int64validator"
+ "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 = &ServiceObjectTrackerGroupProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceObjectTrackerGroupProfileParcelResource{}
+
+func NewServiceObjectTrackerGroupProfileParcelResource() resource.Resource {
+ return &ServiceObjectTrackerGroupProfileParcelResource{}
+}
+
+type ServiceObjectTrackerGroupProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceObjectTrackerGroupProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_object_tracker_group_feature"
+}
+
+func (r *ServiceObjectTrackerGroupProfileParcelResource) 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 Service Object Tracker Group Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "object_tracker_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Object ID").AddIntegerRangeDescription(1, 1000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 1000),
+ },
+ },
+ "object_tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_elements": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Group Tracks ID Refs").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "object_tracker_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "reachable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("tracker ref list criteria boolean and or").AddStringEnumDescription("and", "or").AddDefaultValueDescription("or").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("and", "or"),
+ },
+ },
+ "reachable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *ServiceObjectTrackerGroupProfileParcelResource) 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 *ServiceObjectTrackerGroupProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceObjectTrackerGroup
+
+ // 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 *ServiceObjectTrackerGroupProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceObjectTrackerGroup
+
+ // 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 *ServiceObjectTrackerGroupProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceObjectTrackerGroup
+
+ // 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 *ServiceObjectTrackerGroupProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceObjectTrackerGroup
+
+ // 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 *ServiceObjectTrackerGroupProfileParcelResource) 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_service_object_tracker_group_feature_test.go b/internal/provider/resource_sdwan_service_object_tracker_group_feature_test.go
new file mode 100644
index 000000000..dfcd5520a
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_object_tracker_group_feature_test.go
@@ -0,0 +1,101 @@
+// 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 TestAccSdwanServiceObjectTrackerGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_object_tracker_group_feature.test", "reachable", "or"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanServiceObjectTrackerGroupPrerequisitesProfileParcelConfig + testAccSdwanServiceObjectTrackerGroupProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceObjectTrackerGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_service_object_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "My Example"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ object_tracker_id = 11
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+}
+
+resource "sdwan_service_object_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "My Example"
+ feature_profile_id = sdwan_service_feature_profile.test.id
+ object_tracker_id = 12
+ object_tracker_type = "Interface"
+ interface = "GigabitEthernet1"
+}
+`
+
+// 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 testAccSdwanServiceObjectTrackerGroupProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_object_tracker_group_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` object_tracker_id = 10` + "\n"
+ config += ` tracker_elements = [{` + "\n"
+ config += ` object_tracker_id = sdwan_service_object_tracker_feature.test-1.id` + "\n"
+ config += ` }, {` + "\n"
+ config += ` object_tracker_id = sdwan_service_object_tracker_feature.test-2.id` + "\n"
+ config += ` }]` + "\n"
+ config += ` reachable = "or"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_route_policy_feature.go b/internal/provider/resource_sdwan_service_route_policy_feature.go
new file mode 100644
index 000000000..23772647f
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_route_policy_feature.go
@@ -0,0 +1,477 @@
+// 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/int64validator"
+ "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 = &ServiceRoutePolicyProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceRoutePolicyProfileParcelResource{}
+
+func NewServiceRoutePolicyProfileParcelResource() resource.Resource {
+ return &ServiceRoutePolicyProfileParcelResource{}
+}
+
+type ServiceRoutePolicyProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceRoutePolicyProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_route_policy_feature"
+}
+
+func (r *ServiceRoutePolicyProfileParcelResource) 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 Service Route Policy Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Default Action").AddStringEnumDescription("reject", "accept").AddDefaultValueDescription("reject").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("reject", "accept"),
+ },
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Route Policy List").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Id").AddIntegerRangeDescription(1, 65536).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 19),
+ },
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Base Action").AddStringEnumDescription("reject", "accept").AddDefaultValueDescription("reject").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("reject", "accept"),
+ },
+ },
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("protocol such as IPV4, IPV6, or BOTH").AddStringEnumDescription("IPV4", "IPV6", "BOTH").AddDefaultValueDescription("IPV4").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("IPV4", "IPV6", "BOTH"),
+ },
+ },
+ "match_entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Define match conditions").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "standard_community_list_criteria": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select a condition such as OR, AND or EXACT").AddStringEnumDescription("OR", "AND", "EXACT").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("OR", "AND", "EXACT"),
+ },
+ },
+ "standard_community_lists": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select a standard community list").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "expanded_community_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "extended_community_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "bgp_local_preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP Local Preference").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select Metric").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select OMP Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select OSPF Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "ipv4_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv4_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv6_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv6_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "actions": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Define list of actions").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_prepend": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "community_additive": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "community": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Local Preference").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Metric").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Metric Type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OMP Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "origin": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Origin").AddStringEnumDescription("EGP", "IGP", "Incomplete").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("EGP", "IGP", "Incomplete"),
+ },
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Weight").AddIntegerRangeDescription(0, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "ipv4_next_hop": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Ipv4 Next Hop").String,
+ Optional: true,
+ },
+ "ipv6_next_hop": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Ipv6 Next Hop").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ServiceRoutePolicyProfileParcelResource) 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 *ServiceRoutePolicyProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceRoutePolicy
+
+ // 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 *ServiceRoutePolicyProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceRoutePolicy
+
+ // 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 *ServiceRoutePolicyProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceRoutePolicy
+
+ // 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 *ServiceRoutePolicyProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceRoutePolicy
+
+ // 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 *ServiceRoutePolicyProfileParcelResource) 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_service_route_policy_feature_test.go b/internal/provider/resource_sdwan_service_route_policy_feature_test.go
new file mode 100644
index 000000000..de451bdd3
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_route_policy_feature_test.go
@@ -0,0 +1,119 @@
+// 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 TestAccSdwanServiceRoutePolicyProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "default_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.base_action", "reject"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.protocol", "IPV4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.community_additive", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.local_preference", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.metric", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.omp_tag", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.origin", "EGP"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.ospf_tag", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.weight", "2200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_route_policy_feature.test", "sequences.0.actions.0.ipv4_next_hop", "10.0.0.1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceRoutePolicyPrerequisitesProfileParcelConfig + testAccSdwanServiceRoutePolicyProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceRoutePolicyPrerequisitesProfileParcelConfig + testAccSdwanServiceRoutePolicyProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceRoutePolicyPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceRoutePolicyProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_route_policy_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceRoutePolicyProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_route_policy_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` default_action = "accept"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "reject"` + "\n"
+ config += ` protocol = "IPV4"` + "\n"
+ config += ` actions = [{` + "\n"
+ config += ` as_path_prepend = [65521]` + "\n"
+ config += ` community_additive = false` + "\n"
+ config += ` community = ["internet"]` + "\n"
+ config += ` local_preference = 100` + "\n"
+ config += ` metric = 20` + "\n"
+ config += ` metric_type = "type1"` + "\n"
+ config += ` omp_tag = 200` + "\n"
+ config += ` origin = "EGP"` + "\n"
+ config += ` ospf_tag = 1200` + "\n"
+ config += ` weight = 2200` + "\n"
+ config += ` ipv4_next_hop = "10.0.0.1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_routing_bgp_feature.go b/internal/provider/resource_sdwan_service_routing_bgp_feature.go
new file mode 100644
index 000000000..0b006a1d6
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_bgp_feature.go
@@ -0,0 +1,1043 @@
+// 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/int64validator"
+ "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 = &ServiceRoutingBGPProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceRoutingBGPProfileParcelResource{}
+
+func NewServiceRoutingBGPProfileParcelResource() resource.Resource {
+ return &ServiceRoutingBGPProfileParcelResource{}
+}
+
+type ServiceRoutingBGPProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceRoutingBGPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_bgp_feature"
+}
+
+func (r *ServiceRoutingBGPProfileParcelResource) 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 Service Routing BGP Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "as_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set autonomous system number <1..4294967295> or ").String,
+ Optional: true,
+ },
+ "as_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure BGP router identifier").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "propagate_as_path": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Propagate AS Path").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "propagate_as_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "propagate_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Propagate Community").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "propagate_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "external_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for external BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("20").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "external_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "internal_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for internal BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "internal_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for local BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("20").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "local_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) of keepalive messages sent to its BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
+ Optional: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) not receiving a keepalive message declares a BGP peer down").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
+ Optional: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "always_compare_med": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Compare MEDs from all ASs when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "always_compare_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "deterministic_med": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Compare MEDs from all routes from same AS when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "deterministic_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "missing_med_as_worst": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("If path has no MED, consider it to be worst path when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "missing_med_as_worst_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "compare_router_id": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Compare router IDs when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "compare_router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "multipath_relax": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Ignore AS for multipath selection").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "multipath_relax_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set BGP IPv4 neighbors").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set neighbor address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable a BGP neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set remote autonomous system number").String,
+ Optional: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.").String,
+ Optional: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) of keepalive messages sent to its BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) not receiving a keepalive message declares a BGP peer down").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source interface name for BGP neighbor").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set router to be next hop for routes advertised to neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send extended community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TTL value for peers that are not directly connected").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 password on TCP connection with BGP peer").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_label": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send label").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "send_label_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Override matching AS-number while sending update").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The number of accept as-path with my AS present in it").AddIntegerRangeDescription(1, 10).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 10),
+ },
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set BGP address family").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv4 unicast address family").String,
+ Optional: true,
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of prefixes accepted from BGP peer").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set threshold(1 to 100) at which to generate a warning message").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("75").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 100),
+ },
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Neighbor received maximum prefix policy is disabled.").String,
+ Optional: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv6_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set BGP IPv6 neighbors").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 neighbor address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable a BGP neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set remote autonomous system number").String,
+ Optional: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.").String,
+ Optional: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how often to advertise keepalive messages to BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to wait since receiving a keepalive message to consider BGP peer unavailable").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source interface name for BGP neighbor").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set router to be next hop for routes advertised to neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send extended community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TTL value for peers that are not directly connected").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 password on TCP connection with BGP peer").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Override matching AS-number while sending update").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The number of accept as-path with my AS present in it").AddIntegerRangeDescription(1, 10).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 10),
+ },
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 BGP address family").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 unicast address family").String,
+ Optional: true,
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of prefixes accepted from BGP peer").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set threshold(1 to 100) at which to generate a warning message").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("75").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 100),
+ },
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Neighbor received maximum prefix policy is disabled.").String,
+ Optional: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Aggregate prefixes in specific range").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set AS set path information").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Filter out more specific routes from updates").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_networks": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the networks for BGP to advertise").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of parallel IBGP paths for multipath load sharing").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "ipv4_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP Default Information Originate").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv4_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv4_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv4_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes into BGP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol to redistribute routes from").AddStringEnumDescription("static", "connected", "omp", "nat", "ospf", "ospfv3", "eigrp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "omp", "nat", "ospf", "ospfv3", "eigrp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "ipv6_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Aggregate prefixes in specific range").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "aggregate_prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the IPv6 prefixes to aggregate").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "aggregate_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set AS set path information").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Filter out more specific routes from updates").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_networks": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the networks for BGP to advertise").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the prefixes for BGP to announce").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "network_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of parallel IBGP paths for multipath load sharing").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "ipv6_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP Default Information Originate").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv6_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv6_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv6_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes into BGP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol to redistribute routes from").AddStringEnumDescription("static", "connected", "ospf", "omp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "ospf", "omp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ServiceRoutingBGPProfileParcelResource) 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 *ServiceRoutingBGPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceRoutingBGP
+
+ // 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 *ServiceRoutingBGPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceRoutingBGP
+
+ // 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 *ServiceRoutingBGPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceRoutingBGP
+
+ // 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 *ServiceRoutingBGPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceRoutingBGP
+
+ // 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 *ServiceRoutingBGPProfileParcelResource) 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_service_routing_bgp_feature_test.go b/internal/provider/resource_sdwan_service_routing_bgp_feature_test.go
new file mode 100644
index 000000000..9c91e7cb9
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_bgp_feature_test.go
@@ -0,0 +1,242 @@
+// 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 TestAccSdwanServiceRoutingBGPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "as_number", "429"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "propagate_as_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "propagate_community", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "external_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "internal_routes_distance", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "local_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "keepalive_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "hold_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "always_compare_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "deterministic_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "missing_med_as_worst", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "compare_router_id", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "multipath_relax", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.description", "neighbor1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.keepalive_time", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.hold_time", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.update_source_interface", "GigabitEthernet0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.next_hop_self", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.ebgp_multihop", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.send_label", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.as_override", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.allowas_in_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.family_type", "ipv4-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address", "2001::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.description", "neighbor2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.keepalive_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.hold_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.update_source_interface", "Loopback1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.next_hop_self", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.ebgp_multihop", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.as_override", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.allowas_in_number", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.family_type", "ipv6-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_networks.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_networks.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_eibgp_maximum_paths", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv4_table_map_filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.aggregate_prefix", "3001::1/128"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_networks.0.network_prefix", "2001:0DB8:0000:000b::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_eibgp_maximum_paths", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_originate", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_bgp_feature.test", "ipv6_table_map_filter", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceRoutingBGPPrerequisitesProfileParcelConfig + testAccSdwanServiceRoutingBGPProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceRoutingBGPPrerequisitesProfileParcelConfig + testAccSdwanServiceRoutingBGPProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceRoutingBGPPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceRoutingBGPProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_routing_bgp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` as_number = 429` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceRoutingBGPProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_routing_bgp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` as_number = 429` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` propagate_as_path = false` + "\n"
+ config += ` propagate_community = false` + "\n"
+ config += ` external_routes_distance = 20` + "\n"
+ config += ` internal_routes_distance = 200` + "\n"
+ config += ` local_routes_distance = 20` + "\n"
+ config += ` keepalive_time = 60` + "\n"
+ config += ` hold_time = 180` + "\n"
+ config += ` always_compare_med = false` + "\n"
+ config += ` deterministic_med = false` + "\n"
+ config += ` missing_med_as_worst = false` + "\n"
+ config += ` compare_router_id = false` + "\n"
+ config += ` multipath_relax = false` + "\n"
+ config += ` ipv4_neighbors = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` description = "neighbor1"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 40` + "\n"
+ config += ` hold_time = 200` + "\n"
+ config += ` update_source_interface = "GigabitEthernet0"` + "\n"
+ config += ` next_hop_self = false` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 1` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` send_label = true` + "\n"
+ config += ` as_override = false` + "\n"
+ config += ` allowas_in_number = 1` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv4-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_neighbors = [{` + "\n"
+ config += ` address = "2001::1"` + "\n"
+ config += ` description = "neighbor2"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 180` + "\n"
+ config += ` hold_time = 60` + "\n"
+ config += ` update_source_interface = "Loopback1"` + "\n"
+ config += ` next_hop_self = true` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 3` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` as_override = true` + "\n"
+ config += ` allowas_in_number = 3` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv6-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_aggregate_addresses = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_networks = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_eibgp_maximum_paths = 1` + "\n"
+ config += ` ipv4_originate = false` + "\n"
+ config += ` ipv4_table_map_filter = false` + "\n"
+ config += ` ipv6_aggregate_addresses = [{` + "\n"
+ config += ` aggregate_prefix = "3001::1/128"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_networks = [{` + "\n"
+ config += ` network_prefix = "2001:0DB8:0000:000b::/64"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_eibgp_maximum_paths = 2` + "\n"
+ config += ` ipv6_originate = true` + "\n"
+ config += ` ipv6_table_map_filter = false` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_routing_ospf_feature.go b/internal/provider/resource_sdwan_service_routing_ospf_feature.go
new file mode 100644
index 000000000..75a236225
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_ospf_feature.go
@@ -0,0 +1,642 @@
+// 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/int64validator"
+ "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 = &ServiceRoutingOSPFProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceRoutingOSPFProfileParcelResource{}
+
+func NewServiceRoutingOSPFProfileParcelResource() resource.Resource {
+ return &ServiceRoutingOSPFProfileParcelResource{}
+}
+
+type ServiceRoutingOSPFProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceRoutingOSPFProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_ospf_feature"
+}
+
+func (r *ServiceRoutingOSPFProfileParcelResource) 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 Service Routing OSPF Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF router ID to override system IP address").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set reference bandwidth method to assign OSPF cost").AddIntegerRangeDescription(1, 4294967).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967),
+ },
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Calculate summary route cost based on RFC 1583").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distribute default external route into OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always advertise default route").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set metric used to generate default route <0..16777214>").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set default route type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for external routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for inter-area routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for intra-area routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set delay from first change received until performing SPF calculation").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set initial hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("10000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol").AddStringEnumDescription("static", "connected", "bgp", "omp", "nat", "eigrp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "bgp", "omp", "nat", "eigrp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable NAT DIA for redistributed routes").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "router_lsas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Advertise own router LSA with infinite distance").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the router LSA advertisement type").AddStringEnumDescription("administrative", "on-startup").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("administrative", "on-startup"),
+ },
+ },
+ "time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to advertise maximum metric after router starts up").AddIntegerRangeDescription(5, 86400).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(5, 86400),
+ },
+ },
+ "time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure OSPF area").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF area number").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("set the area type").AddStringEnumDescription("stub", "nssa").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("stub", "nssa"),
+ },
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not inject interarea routes into STUB or NSSA").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface parameters").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval between OSPF hello packets").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval after which neighbor is declared to be down").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("40").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time between retransmitting LSAs").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost of OSPF interface").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "designated_router_priority": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set router’s priority to be elected as designated router").AddIntegerRangeDescription(0, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(255),
+ },
+ },
+ "designated_router_priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the OSPF network type").AddStringEnumDescription("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint").AddDefaultValueDescription("broadcast").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint"),
+ },
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface to advertise its address, but not to actively run OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication type").AddStringEnumDescription("message-digest").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("message-digest"),
+ },
+ },
+ "authentication_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "message_digest_key_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 message digest key").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "message_digest_key_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "message_digest_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 authentication key").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 127),
+ },
+ },
+ "message_digest_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Summarize OSPF routes at an area boundary").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost for this range").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(16777214),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not advertise this range").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ServiceRoutingOSPFProfileParcelResource) 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 *ServiceRoutingOSPFProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceRoutingOSPF
+
+ // 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 *ServiceRoutingOSPFProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceRoutingOSPF
+
+ // 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 *ServiceRoutingOSPFProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceRoutingOSPF
+
+ // 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 *ServiceRoutingOSPFProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceRoutingOSPF
+
+ // 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 *ServiceRoutingOSPFProfileParcelResource) 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_service_routing_ospf_feature_test.go b/internal/provider/resource_sdwan_service_routing_ospf_feature_test.go
new file mode 100644
index 000000000..5cbf836b1
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_ospf_feature_test.go
@@ -0,0 +1,164 @@
+// 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 TestAccSdwanServiceRoutingOSPFProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "router_lsas.0.type", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "router_lsas.0.time", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.no_summary", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.designated_router_priority", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.authentication_type", "message-digest"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.interfaces.0.message_digest_key_id", "7"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospf_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceRoutingOSPFPrerequisitesProfileParcelConfig + testAccSdwanServiceRoutingOSPFProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceRoutingOSPFPrerequisitesProfileParcelConfig + testAccSdwanServiceRoutingOSPFProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceRoutingOSPFPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceRoutingOSPFProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_routing_ospf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceRoutingOSPFProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_routing_ospf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsas = [{` + "\n"
+ config += ` type = "on-startup"` + "\n"
+ config += ` time = 5` + "\n"
+ config += ` }]` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` no_summary = false` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` designated_router_priority = 1` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "message-digest"` + "\n"
+ config += ` message_digest_key_id = 7` + "\n"
+ config += ` message_digest_key = "sdjfhsghbjdjr"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_routing_ospfv3_ipv4_feature.go b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv4_feature.go
new file mode 100644
index 000000000..9a6ec737d
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv4_feature.go
@@ -0,0 +1,643 @@
+// 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/int64validator"
+ "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 = &ServiceRoutingOSPFv3IPv4ProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceRoutingOSPFv3IPv4ProfileParcelResource{}
+
+func NewServiceRoutingOSPFv3IPv4ProfileParcelResource() resource.Resource {
+ return &ServiceRoutingOSPFv3IPv4ProfileParcelResource{}
+}
+
+type ServiceRoutingOSPFv3IPv4ProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceRoutingOSPFv3IPv4ProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_ospfv3_ipv4_feature"
+}
+
+func (r *ServiceRoutingOSPFv3IPv4ProfileParcelResource) 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 Service Routing OSPFv3 IPv4 Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF router ID to override system IP address").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distance").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for external routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for inter-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for intra-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set reference bandwidth method to assign OSPF cost").AddIntegerRangeDescription(1, 4294967).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967),
+ },
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Calculate summary route cost based on RFC 1583").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distribute default external route into OSPF disabled").String,
+ Optional: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always advertise default route").String,
+ Optional: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set metric used to generate default route <0..16777214>").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set default route metric type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set delay from first change received until performing SPF calculation").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set initial hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("10000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol").AddStringEnumDescription("connected", "static", "omp", "nat-route", "bgp", "eigrp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("connected", "static", "omp", "nat-route", "bgp", "eigrp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable NAT DIA for redistributed routes").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Not advertise maximum metric Router LSA policy by default").String,
+ Optional: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to advertise maximum metric after router boot up").AddIntegerRangeDescription(5, 86400).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(5, 86400),
+ },
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure OSPFv3 IPv4 area").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF area number").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("stub area type").AddStringEnumDescription("stub").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("stub"),
+ },
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not inject inter-area routes").String,
+ Optional: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always translate type7 LSAs").String,
+ Optional: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface parameters").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval between OSPF hello packets").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval after which neighbor is declared to be down").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("40").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time between retransmitting LSAs").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost of OSPF interface").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the OSPF network type").AddStringEnumDescription("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint"),
+ },
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface to advertise its address, but not to actively run OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("No Authentication by default").AddStringEnumDescription("no-auth").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("no-auth"),
+ },
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSec SPI, range 256..4294967295").AddIntegerRangeDescription(256, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(256, 4294967295),
+ },
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSEC key").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[0-9a-fA-F]{40}$`), ""),
+ },
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Summarize OSPF routes at an area boundary").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost for this range").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(16777214),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not advertise this range").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ServiceRoutingOSPFv3IPv4ProfileParcelResource) 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 *ServiceRoutingOSPFv3IPv4ProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceRoutingOSPFv3IPv4
+
+ // 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 *ServiceRoutingOSPFv3IPv4ProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceRoutingOSPFv3IPv4
+
+ // 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 *ServiceRoutingOSPFv3IPv4ProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceRoutingOSPFv3IPv4
+
+ // 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 *ServiceRoutingOSPFv3IPv4ProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceRoutingOSPFv3IPv4
+
+ // 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 *ServiceRoutingOSPFv3IPv4ProfileParcelResource) 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_service_routing_ospfv3_ipv4_feature_test.go b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv4_feature_test.go
new file mode 100644
index 000000000..b1ecb3fc9
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv4_feature_test.go
@@ -0,0 +1,149 @@
+// 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 TestAccSdwanServiceRoutingOSPFv3IPv4ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "redistributes.0.protocol", "nat-route"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanServiceRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig + testAccSdwanServiceRoutingOSPFv3IPv4ProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// 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 testAccSdwanServiceRoutingOSPFv3IPv4ProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_routing_ospfv3_ipv4_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "nat-route"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_routing_ospfv3_ipv6_feature.go b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv6_feature.go
new file mode 100644
index 000000000..81c1f0bb1
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv6_feature.go
@@ -0,0 +1,627 @@
+// 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/int64validator"
+ "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 = &ServiceRoutingOSPFv3IPv6ProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceRoutingOSPFv3IPv6ProfileParcelResource{}
+
+func NewServiceRoutingOSPFv3IPv6ProfileParcelResource() resource.Resource {
+ return &ServiceRoutingOSPFv3IPv6ProfileParcelResource{}
+}
+
+type ServiceRoutingOSPFv3IPv6ProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceRoutingOSPFv3IPv6ProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_routing_ospfv3_ipv6_feature"
+}
+
+func (r *ServiceRoutingOSPFv3IPv6ProfileParcelResource) 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 Service Routing OSPFv3 IPv6 Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF router ID to override system IP address").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distance").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for external routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for inter-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for intra-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set reference bandwidth method to assign OSPF cost").AddIntegerRangeDescription(1, 4294967).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967),
+ },
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Calculate summary route cost based on RFC 1583").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distribute default external route into OSPF disabled").String,
+ Optional: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always advertise default route").String,
+ Optional: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set metric used to generate default route <0..16777214>").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set default route metric type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set delay from first change received until performing SPF calculation").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set initial hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("10000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol").AddStringEnumDescription("connected", "static", "omp", "bgp", "eigrp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("connected", "static", "omp", "bgp", "eigrp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Not advertise maximum metric Router LSA policy by default").String,
+ Optional: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to advertise maximum metric after router boot up").AddIntegerRangeDescription(5, 86400).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(5, 86400),
+ },
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure OSPFv3 IPv6 area").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF area number").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("stub area type").AddStringEnumDescription("stub").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("stub"),
+ },
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not inject inter-area routes").String,
+ Optional: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always translate type7 LSAs").String,
+ Optional: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface parameters").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval between OSPF hello packets").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval after which neighbor is declared to be down").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("40").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time between retransmitting LSAs").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost of OSPF interface").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the OSPF network type").AddStringEnumDescription("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint"),
+ },
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface to advertise its address, but not to actively run OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("No Authentication by default").AddStringEnumDescription("no-auth").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("no-auth"),
+ },
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSec SPI, range 256..4294967295").AddIntegerRangeDescription(256, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(256, 4294967295),
+ },
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSEC key").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[0-9a-fA-F]{40}$`), ""),
+ },
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Summarize OSPF routes at an area boundary").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 prefix,for example 2001::/64").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost for this range").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(16777214),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not advertise this range").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ServiceRoutingOSPFv3IPv6ProfileParcelResource) 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 *ServiceRoutingOSPFv3IPv6ProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceRoutingOSPFv3IPv6
+
+ // 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 *ServiceRoutingOSPFv3IPv6ProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceRoutingOSPFv3IPv6
+
+ // 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 *ServiceRoutingOSPFv3IPv6ProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceRoutingOSPFv3IPv6
+
+ // 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 *ServiceRoutingOSPFv3IPv6ProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceRoutingOSPFv3IPv6
+
+ // 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 *ServiceRoutingOSPFv3IPv6ProfileParcelResource) 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_service_routing_ospfv3_ipv6_feature_test.go b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv6_feature_test.go
new file mode 100644
index 000000000..abec34f06
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_routing_ospfv3_ipv6_feature_test.go
@@ -0,0 +1,145 @@
+// 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 TestAccSdwanServiceRoutingOSPFv3IPv6ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.prefix", "3002::/96"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanServiceRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig + testAccSdwanServiceRoutingOSPFv3IPv6ProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// 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 testAccSdwanServiceRoutingOSPFv3IPv6ProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_routing_ospfv3_ipv6_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` prefix = "3002::/96"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_switchport_feature.go b/internal/provider/resource_sdwan_service_switchport_feature.go
new file mode 100644
index 000000000..1d5d38e88
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_switchport_feature.go
@@ -0,0 +1,507 @@
+// 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/int64validator"
+ "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 = &ServiceSwitchportProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceSwitchportProfileParcelResource{}
+
+func NewServiceSwitchportProfileParcelResource() resource.Resource {
+ return &ServiceSwitchportProfileParcelResource{}
+}
+
+type ServiceSwitchportProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceSwitchportProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_switchport_feature"
+}
+
+func (r *ServiceSwitchportProfileParcelResource) 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 Service Switchport Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name: GigabitEthernet0/<>/<> when present").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Interface name").String,
+ Optional: true,
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mode": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set type of switch port: access/trunk").AddStringEnumDescription("access", "trunk").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("access", "trunk"),
+ },
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface speed").AddStringEnumDescription("10", "100", "1000", "2500", "10000").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("10", "100", "1000", "2500", "10000"),
+ },
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Duplex mode").AddStringEnumDescription("full", "half").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("full", "half"),
+ },
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "switchport_access_vlan": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set VLAN identifier associated with bridging domain").AddIntegerRangeDescription(1, 4094).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4094),
+ },
+ },
+ "switchport_access_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "switchport_trunk_allowed_vlans": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure VLAN IDs used with the trunk").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(?:[1-9]\d{0,2}|[1-3]\d{3}|40(?:[0-8]\d|9[0-4]))(?:[,-](?:[1-9]\d{0,2}|[1-3]\d{3}|40(?:[0-8]\d|9[0-4])))*$`), ""),
+ },
+ },
+ "switchport_trunk_allowed_vlans_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "switchport_trunk_native_vlan": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure VLAN ID used for native VLAN").AddIntegerRangeDescription(1, 4094).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4094),
+ },
+ },
+ "switchport_trunk_native_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "port_control": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Port-Control Mode").AddStringEnumDescription("auto", "force-unauthorized", "force-authorized").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("auto", "force-unauthorized", "force-authorized"),
+ },
+ },
+ "port_control_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "voice_vlan": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Voice Vlan").AddIntegerRangeDescription(1, 4094).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4094),
+ },
+ },
+ "voice_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "pae_enable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set 802.1x Interface Pae Type").String,
+ Optional: true,
+ },
+ "pae_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_authentication_bypass": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Authentication Bypass").String,
+ Optional: true,
+ },
+ "mac_authentication_bypass_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "host_mode": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set host mode").AddStringEnumDescription("single-host", "multi-auth", "multi-host", "multi-domain").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("single-host", "multi-auth", "multi-host", "multi-domain"),
+ },
+ },
+ "host_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "enable_periodic_reauth": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Periodic Reauthentication").String,
+ Optional: true,
+ },
+ "enable_periodic_reauth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "inactivity": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Periodic Reauthentication Inactivity Timeout (in seconds)").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "inactivity_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "reauthentication": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Periodic Reauthentication Interval (in seconds)").AddIntegerRangeDescription(1, 1073741823).AddDefaultValueDescription("3600").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 1073741823),
+ },
+ },
+ "reauthentication_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "control_direction": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set uni or bi directional authorization mode").AddStringEnumDescription("both", "in").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("both", "in"),
+ },
+ },
+ "control_direction_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "restricted_vlan": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Restricted VLAN ID").AddIntegerRangeDescription(1, 4094).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4094),
+ },
+ },
+ "restricted_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "guest_vlan": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set vlan to drop non-802.1x enabled clients into if client is not in MAB list").AddIntegerRangeDescription(1, 4094).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4094),
+ },
+ },
+ "guest_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "critical_vlan": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Critical VLAN").AddIntegerRangeDescription(1, 4094).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4094),
+ },
+ },
+ "critical_vlan_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "enable_voice": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Critical Voice VLAN").String,
+ Optional: true,
+ },
+ "enable_voice_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "age_out_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set when a MAC table entry ages out (0 to disable, 10-1000000 otherwise)").AddIntegerRangeDescription(0, 1000000).AddDefaultValueDescription("300").String,
+ Optional: true,
+ },
+ "age_out_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "static_mac_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Add static MAC address entries for interface").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MAC address in xxxx.xxxx.xxxx format").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vlan_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure VLAN ID used with the mac and interface").AddIntegerRangeDescription(1, 4094).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4094),
+ },
+ },
+ "vlan_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name: GigabitEthernet0/<>/<>").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *ServiceSwitchportProfileParcelResource) 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 *ServiceSwitchportProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan ServiceSwitchport
+
+ // 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 *ServiceSwitchportProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state ServiceSwitchport
+
+ // 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 *ServiceSwitchportProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state ServiceSwitchport
+
+ // 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 *ServiceSwitchportProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state ServiceSwitchport
+
+ // 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 *ServiceSwitchportProfileParcelResource) 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_service_switchport_feature_test.go b/internal/provider/resource_sdwan_service_switchport_feature_test.go
new file mode 100644
index 000000000..9439c5409
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_switchport_feature_test.go
@@ -0,0 +1,139 @@
+// 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 TestAccSdwanServiceSwitchportProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.interface_name", "GigabitEthernet"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.mode", "access"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.speed", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.switchport_access_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.switchport_trunk_allowed_vlans", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.switchport_trunk_native_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.port_control", "auto"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.voice_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.pae_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.mac_authentication_bypass", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.host_mode", "single-host"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.enable_periodic_reauth", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.inactivity", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.reauthentication", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.control_direction", "both"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.restricted_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.guest_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.critical_vlan", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "interfaces.0.enable_voice", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "age_out_time", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "static_mac_addresses.0.mac_address", "01:02:03:04:05:06"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "static_mac_addresses.0.vlan_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_service_switchport_feature.test", "static_mac_addresses.0.interface_name", "GigabitEthernet0/0/0"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanServiceSwitchportPrerequisitesProfileParcelConfig + testAccSdwanServiceSwitchportProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanServiceSwitchportPrerequisitesProfileParcelConfig + testAccSdwanServiceSwitchportProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanServiceSwitchportPrerequisitesProfileParcelConfig = `
+resource "sdwan_service_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanServiceSwitchportProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_service_switchport_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanServiceSwitchportProfileParcelConfig_all() string {
+ config := `resource "sdwan_service_switchport_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_service_feature_profile.test.id` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` interface_name = "GigabitEthernet"` + "\n"
+ config += ` mode = "access"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` speed = "10"` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` switchport_access_vlan = 1` + "\n"
+ config += ` switchport_trunk_allowed_vlans = "1"` + "\n"
+ config += ` switchport_trunk_native_vlan = 1` + "\n"
+ config += ` port_control = "auto"` + "\n"
+ config += ` voice_vlan = 1` + "\n"
+ config += ` pae_enable = true` + "\n"
+ config += ` mac_authentication_bypass = false` + "\n"
+ config += ` host_mode = "single-host"` + "\n"
+ config += ` enable_periodic_reauth = false` + "\n"
+ config += ` inactivity = 60` + "\n"
+ config += ` reauthentication = 1` + "\n"
+ config += ` control_direction = "both"` + "\n"
+ config += ` restricted_vlan = 1` + "\n"
+ config += ` guest_vlan = 1` + "\n"
+ config += ` critical_vlan = 1` + "\n"
+ config += ` enable_voice = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` age_out_time = 300` + "\n"
+ config += ` static_mac_addresses = [{` + "\n"
+ config += ` mac_address = "01:02:03:04:05:06"` + "\n"
+ config += ` vlan_id = 1` + "\n"
+ config += ` interface_name = "GigabitEthernet0/0/0"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_service_tracker_feature.go b/internal/provider/resource_sdwan_service_tracker_feature.go
new file mode 100644
index 000000000..b89edc386
--- /dev/null
+++ b/internal/provider/resource_sdwan_service_tracker_feature.go
@@ -0,0 +1,363 @@
+// 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/int64validator"
+ "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 = &ServiceTrackerProfileParcelResource{}
+var _ resource.ResourceWithImportState = &ServiceTrackerProfileParcelResource{}
+
+func NewServiceTrackerProfileParcelResource() resource.Resource {
+ return &ServiceTrackerProfileParcelResource{}
+}
+
+type ServiceTrackerProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *ServiceTrackerProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_service_tracker_feature"
+}
+
+func (r *ServiceTrackerProfileParcelResource) 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 Service Tracker Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tracker Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[^ the device can have").AddIntegerRangeDescription(1, 100).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 100),
+ },
+ },
+ "max_omp_sessions_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "multi_tenant": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Device is multi-tenant").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "multi_tenant_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "track_default_gateway": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable default gateway tracking").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "track_default_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "admin_tech_on_failure": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Collect admin-tech before reboot due to daemon failure").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "admin_tech_on_failure_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "idle_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Idle CLI timeout in minutes").AddIntegerRangeDescription(0, 300).String,
+ Optional: true,
+ },
+ "idle_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "on_demand_enable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable On-demand Tunnel").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "on_demand_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "on_demand_idle_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the idle timeout for on-demand tunnels").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "on_demand_idle_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "transport_gateway": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable transport gateway").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "transport_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "enhanced_app_aware_routing": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable SLA Dampening and Enhanced App Routing.").AddStringEnumDescription("disabled", "aggressive", "moderate", "conservative").AddDefaultValueDescription("disabled").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("disabled", "aggressive", "moderate", "conservative"),
+ },
+ },
+ "enhanced_app_aware_routing_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "site_types": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Site Type").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "site_types_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "affinity_group_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Number").AddIntegerRangeDescription(1, 63).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 63),
+ },
+ },
+ "affinity_group_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "affinity_group_preferences": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Preference").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "affinity_group_preferences_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "affinity_preference_auto": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Preference Auto").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "affinity_preference_auto_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "affinity_per_vrfs": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Number for VRFs").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "affinity_group_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Number").AddIntegerRangeDescription(1, 63).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 63),
+ },
+ },
+ "affinity_group_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vrf_range": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Range of VRFs").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 11),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^\d+|\d+-\d+$`), ""),
+ },
+ },
+ "vrf_range_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemBasicProfileParcelResource) 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 *SystemBasicProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemBasic
+
+ // 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 *SystemBasicProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemBasic
+
+ // 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 *SystemBasicProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemBasic
+
+ // 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 *SystemBasicProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemBasic
+
+ // 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 *SystemBasicProfileParcelResource) 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_system_basic_feature_test.go b/internal/provider/resource_sdwan_system_basic_feature_test.go
new file mode 100644
index 000000000..be4826e5d
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_basic_feature_test.go
@@ -0,0 +1,151 @@
+// 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 TestAccSdwanSystemBasicProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "timezone", "UTC"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "config_description", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "location", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "gps_longitude", "-77"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "gps_latitude", "38"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "gps_geo_fencing_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "gps_geo_fencing_range", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "gps_sms_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "gps_sms_mobile_numbers.0.number", "+11111233"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "overlay_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "port_offset", "19"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "port_hopping", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "control_session_pps", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "track_transport", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "track_interface_tag", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "console_baud_rate", "9600"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "max_omp_sessions", "24"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "multi_tenant", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "track_default_gateway", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "admin_tech_on_failure", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "idle_timeout", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "on_demand_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "on_demand_idle_timeout", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "transport_gateway", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "enhanced_app_aware_routing", "aggressive"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "affinity_group_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "affinity_preference_auto", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "affinity_per_vrfs.0.affinity_group_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_feature.test", "affinity_per_vrfs.0.vrf_range", "123-456"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemBasicPrerequisitesProfileParcelConfig + testAccSdwanSystemBasicProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemBasicPrerequisitesProfileParcelConfig + testAccSdwanSystemBasicProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemBasicPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemBasicProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_basic_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemBasicProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_basic_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` timezone = "UTC"` + "\n"
+ config += ` config_description = "example"` + "\n"
+ config += ` location = "example"` + "\n"
+ config += ` gps_longitude = -77` + "\n"
+ config += ` gps_latitude = 38` + "\n"
+ config += ` gps_geo_fencing_enable = true` + "\n"
+ config += ` gps_geo_fencing_range = 100` + "\n"
+ config += ` gps_sms_enable = true` + "\n"
+ config += ` gps_sms_mobile_numbers = [{` + "\n"
+ config += ` number = "+11111233"` + "\n"
+ config += ` }]` + "\n"
+ config += ` device_groups = ["example"]` + "\n"
+ config += ` controller_groups = [1]` + "\n"
+ config += ` overlay_id = 1` + "\n"
+ config += ` port_offset = 19` + "\n"
+ config += ` port_hopping = true` + "\n"
+ config += ` control_session_pps = 300` + "\n"
+ config += ` track_transport = true` + "\n"
+ config += ` track_interface_tag = 2` + "\n"
+ config += ` console_baud_rate = "9600"` + "\n"
+ config += ` max_omp_sessions = 24` + "\n"
+ config += ` multi_tenant = false` + "\n"
+ config += ` track_default_gateway = true` + "\n"
+ config += ` admin_tech_on_failure = true` + "\n"
+ config += ` idle_timeout = 10` + "\n"
+ config += ` on_demand_enable = true` + "\n"
+ config += ` on_demand_idle_timeout = 10` + "\n"
+ config += ` transport_gateway = false` + "\n"
+ config += ` enhanced_app_aware_routing = "aggressive"` + "\n"
+ config += ` site_types = ["type-1"]` + "\n"
+ config += ` affinity_group_number = 1` + "\n"
+ config += ` affinity_group_preferences = [1]` + "\n"
+ config += ` affinity_preference_auto = false` + "\n"
+ config += ` affinity_per_vrfs = [{` + "\n"
+ config += ` affinity_group_number = 1` + "\n"
+ config += ` vrf_range = "123-456"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_basic_profile_parcel.go b/internal/provider/resource_sdwan_system_basic_profile_parcel.go
deleted file mode 100644
index 3127e31b3..000000000
--- a/internal/provider/resource_sdwan_system_basic_profile_parcel.go
+++ /dev/null
@@ -1,574 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &SystemBasicProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemBasicProfileParcelResource{}
-
-func NewSystemBasicProfileParcelResource() resource.Resource {
- return &SystemBasicProfileParcelResource{}
-}
-
-type SystemBasicProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemBasicProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_basic_profile_parcel"
-}
-
-func (r *SystemBasicProfileParcelResource) 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 System Basic 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,
- Optional: true,
- },
- "timezone": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the timezone").AddStringEnumDescription("Europe/Andorra", "Asia/Dubai", "Asia/Kabul", "America/Antigua", "America/Anguilla", "Europe/Tirane", "Asia/Yerevan", "Africa/Luanda", "Antarctica/McMurdo", "Antarctica/Rothera", "Antarctica/Palmer", "Antarctica/Mawson", "Antarctica/Davis", "Antarctica/Casey", "Antarctica/Vostok", "Antarctica/DumontDUrville", "Antarctica/Syowa", "America/Argentina/Buenos_Aires", "America/Argentina/Cordoba", "America/Argentina/Salta", "America/Argentina/Jujuy", "America/Argentina/Tucuman", "America/Argentina/Catamarca", "America/Argentina/La_Rioja", "America/Argentina/San_Juan", "America/Argentina/Mendoza", "America/Argentina/San_Luis", "America/Argentina/Rio_Gallegos", "America/Argentina/Ushuaia", "Pacific/Pago_Pago", "Europe/Vienna", "Australia/Lord_Howe", "Antarctica/Macquarie", "Australia/Hobart", "Australia/Currie", "Australia/Melbourne", "Australia/Sydney", "Australia/Broken_Hill", "Australia/Brisbane", "Australia/Lindeman", "Australia/Adelaide", "Australia/Darwin", "Australia/Perth", "Australia/Eucla", "America/Aruba", "Europe/Mariehamn", "Asia/Baku", "Europe/Sarajevo", "America/Barbados", "Asia/Dhaka", "Europe/Brussels", "Africa/Ouagadougou", "Europe/Sofia", "Asia/Bahrain", "Africa/Bujumbura", "Africa/Porto-Novo", "America/St_Barthelemy", "Atlantic/Bermuda", "Asia/Brunei", "America/La_Paz", "America/Kralendijk", "America/Noronha", "America/Belem", "America/Fortaleza", "America/Recife", "America/Araguaina", "America/Maceio", "America/Bahia", "America/Sao_Paulo", "America/Campo_Grande", "America/Cuiaba", "America/Santarem", "America/Porto_Velho", "America/Boa_Vista", "America/Manaus", "America/Eirunepe", "America/Rio_Branco", "America/Nassau", "Asia/Thimphu", "Africa/Gaborone", "Europe/Minsk", "America/Belize", "America/St_Johns", "America/Halifax", "America/Glace_Bay", "America/Moncton", "America/Goose_Bay", "America/Blanc-Sablon", "America/Toronto", "America/Nipigon", "America/Thunder_Bay", "America/Iqaluit", "America/Pangnirtung", "America/Resolute", "America/Atikokan", "America/Rankin_Inlet", "America/Winnipeg", "America/Rainy_River", "America/Regina", "America/Swift_Current", "America/Edmonton", "America/Cambridge_Bay", "America/Yellowknife", "America/Inuvik", "America/Creston", "America/Dawson_Creek", "America/Vancouver", "America/Whitehorse", "America/Dawson", "Indian/Cocos", "Africa/Kinshasa", "Africa/Lubumbashi", "Africa/Bangui", "Africa/Brazzaville", "Europe/Zurich", "Africa/Abidjan", "Pacific/Rarotonga", "America/Santiago", "Pacific/Easter", "Africa/Douala", "Asia/Shanghai", "Asia/Harbin", "Asia/Chongqing", "Asia/Urumqi", "Asia/Kashgar", "America/Bogota", "America/Costa_Rica", "America/Havana", "Atlantic/Cape_Verde", "America/Curacao", "Indian/Christmas", "Asia/Nicosia", "Europe/Prague", "Europe/Berlin", "Europe/Busingen", "Africa/Djibouti", "Europe/Copenhagen", "America/Dominica", "America/Santo_Domingo", "Africa/Algiers", "America/Guayaquil", "Pacific/Galapagos", "Europe/Tallinn", "Africa/Cairo", "Africa/El_Aaiun", "Africa/Asmara", "Europe/Madrid", "Africa/Ceuta", "Atlantic/Canary", "Africa/Addis_Ababa", "Europe/Helsinki", "Pacific/Fiji", "Atlantic/Stanley", "Pacific/Chuuk", "Pacific/Pohnpei", "Pacific/Kosrae", "Atlantic/Faroe", "Europe/Paris", "Africa/Libreville", "Europe/London", "America/Grenada", "Asia/Tbilisi", "America/Cayenne", "Europe/Guernsey", "Africa/Accra", "Europe/Gibraltar", "America/Godthab", "America/Danmarkshavn", "America/Scoresbysund", "America/Thule", "Africa/Banjul", "Africa/Conakry", "America/Guadeloupe", "Africa/Malabo", "Europe/Athens", "Atlantic/South_Georgia", "America/Guatemala", "Pacific/Guam", "Africa/Bissau", "America/Guyana", "Asia/Hong_Kong", "America/Tegucigalpa", "Europe/Zagreb", "America/Port-au-Prince", "Europe/Budapest", "Asia/Jakarta", "Asia/Pontianak", "Asia/Makassar", "Asia/Jayapura", "Europe/Dublin", "Asia/Jerusalem", "Europe/Isle_of_Man", "Asia/Kolkata", "Indian/Chagos", "Asia/Baghdad", "Asia/Tehran", "Atlantic/Reykjavik", "Europe/Rome", "Europe/Jersey", "America/Jamaica", "Asia/Amman", "Asia/Tokyo", "Africa/Nairobi", "Asia/Bishkek", "Asia/Phnom_Penh", "Pacific/Tarawa", "Pacific/Enderbury", "Pacific/Kiritimati", "Indian/Comoro", "America/St_Kitts", "Asia/Pyongyang", "Asia/Seoul", "Asia/Kuwait", "America/Cayman", "Asia/Almaty", "Asia/Qyzylorda", "Asia/Aqtobe", "Asia/Aqtau", "Asia/Oral", "Asia/Vientiane", "Asia/Beirut", "America/St_Lucia", "Europe/Vaduz", "Asia/Colombo", "Africa/Monrovia", "Africa/Maseru", "Europe/Vilnius", "Europe/Luxembourg", "Europe/Riga", "Africa/Tripoli", "Africa/Casablanca", "Europe/Monaco", "Europe/Chisinau", "Europe/Podgorica", "America/Marigot", "Indian/Antananarivo", "Pacific/Majuro", "Pacific/Kwajalein", "Europe/Skopje", "Africa/Bamako", "Asia/Rangoon", "Asia/Ulaanbaatar", "Asia/Hovd", "Asia/Choibalsan", "Asia/Macau", "Pacific/Saipan", "America/Martinique", "Africa/Nouakchott", "America/Montserrat", "Europe/Malta", "Indian/Mauritius", "Indian/Maldives", "Africa/Blantyre", "America/Mexico_City", "America/Cancun", "America/Merida", "America/Monterrey", "America/Matamoros", "America/Mazatlan", "America/Chihuahua", "America/Ojinaga", "America/Hermosillo", "America/Tijuana", "America/Santa_Isabel", "America/Bahia_Banderas", "Asia/Kuala_Lumpur", "Asia/Kuching", "Africa/Maputo", "Africa/Windhoek", "Pacific/Noumea", "Africa/Niamey", "Pacific/Norfolk", "Africa/Lagos", "America/Managua", "Europe/Amsterdam", "Europe/Oslo", "Asia/Kathmandu", "Pacific/Nauru", "Pacific/Niue", "Pacific/Auckland", "Pacific/Chatham", "Asia/Muscat", "America/Panama", "America/Lima", "Pacific/Tahiti", "Pacific/Marquesas", "Pacific/Gambier", "Pacific/Port_Moresby", "Asia/Manila", "Asia/Karachi", "Europe/Warsaw", "America/Miquelon", "Pacific/Pitcairn", "America/Puerto_Rico", "Asia/Gaza", "Asia/Hebron", "Europe/Lisbon", "Atlantic/Madeira", "Atlantic/Azores", "Pacific/Palau", "America/Asuncion", "Asia/Qatar", "Indian/Reunion", "Europe/Bucharest", "Europe/Belgrade", "Europe/Kaliningrad", "Europe/Moscow", "Europe/Volgograd", "Europe/Samara", "Asia/Yekaterinburg", "Asia/Omsk", "Asia/Novosibirsk", "Asia/Novokuznetsk", "Asia/Krasnoyarsk", "Asia/Irkutsk", "Asia/Yakutsk", "Asia/Khandyga", "Asia/Vladivostok", "Asia/Sakhalin", "Asia/Ust-Nera", "Asia/Magadan", "Asia/Kamchatka", "Asia/Anadyr", "Africa/Kigali", "Asia/Riyadh", "Pacific/Guadalcanal", "Indian/Mahe", "Africa/Khartoum", "Europe/Stockholm", "Asia/Singapore", "Atlantic/St_Helena", "Europe/Ljubljana", "Arctic/Longyearbyen", "Europe/Bratislava", "Africa/Freetown", "Europe/San_Marino", "Africa/Dakar", "Africa/Mogadishu", "America/Paramaribo", "Africa/Juba", "Africa/Sao_Tome", "America/El_Salvador", "America/Lower_Princes", "Asia/Damascus", "Africa/Mbabane", "America/Grand_Turk", "Africa/Ndjamena", "Indian/Kerguelen", "Africa/Lome", "Asia/Bangkok", "Asia/Dushanbe", "Pacific/Fakaofo", "Asia/Dili", "Asia/Ashgabat", "Africa/Tunis", "Pacific/Tongatapu", "Europe/Istanbul", "America/Port_of_Spain", "Pacific/Funafuti", "Asia/Taipei", "Africa/Dar_es_Salaam", "Europe/Kiev", "Europe/Uzhgorod", "Europe/Zaporozhye", "Europe/Simferopol", "Africa/Kampala", "Pacific/Johnston", "Pacific/Midway", "Pacific/Wake", "America/New_York", "America/Detroit", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Indiana/Indianapolis", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Vevay", "America/Chicago", "America/Indiana/Tell_City", "America/Indiana/Knox", "America/Menominee", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/North_Dakota/Beulah", "America/Denver", "America/Boise", "America/Phoenix", "America/Los_Angeles", "America/Anchorage", "America/Juneau", "America/Sitka", "America/Yakutat", "America/Nome", "America/Adak", "America/Metlakatla", "Pacific/Honolulu", "America/Montevideo", "Asia/Samarkand", "Asia/Tashkent", "Europe/Vatican", "America/St_Vincent", "America/Caracas", "America/Tortola", "America/St_Thomas", "Asia/Ho_Chi_Minh", "Pacific/Efate", "Pacific/Wallis", "Pacific/Apia", "Asia/Aden", "Indian/Mayotte", "Africa/Johannesburg", "Africa/Lusaka", "Africa/Harare", "UTC").AddDefaultValueDescription("UTC").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("Europe/Andorra", "Asia/Dubai", "Asia/Kabul", "America/Antigua", "America/Anguilla", "Europe/Tirane", "Asia/Yerevan", "Africa/Luanda", "Antarctica/McMurdo", "Antarctica/Rothera", "Antarctica/Palmer", "Antarctica/Mawson", "Antarctica/Davis", "Antarctica/Casey", "Antarctica/Vostok", "Antarctica/DumontDUrville", "Antarctica/Syowa", "America/Argentina/Buenos_Aires", "America/Argentina/Cordoba", "America/Argentina/Salta", "America/Argentina/Jujuy", "America/Argentina/Tucuman", "America/Argentina/Catamarca", "America/Argentina/La_Rioja", "America/Argentina/San_Juan", "America/Argentina/Mendoza", "America/Argentina/San_Luis", "America/Argentina/Rio_Gallegos", "America/Argentina/Ushuaia", "Pacific/Pago_Pago", "Europe/Vienna", "Australia/Lord_Howe", "Antarctica/Macquarie", "Australia/Hobart", "Australia/Currie", "Australia/Melbourne", "Australia/Sydney", "Australia/Broken_Hill", "Australia/Brisbane", "Australia/Lindeman", "Australia/Adelaide", "Australia/Darwin", "Australia/Perth", "Australia/Eucla", "America/Aruba", "Europe/Mariehamn", "Asia/Baku", "Europe/Sarajevo", "America/Barbados", "Asia/Dhaka", "Europe/Brussels", "Africa/Ouagadougou", "Europe/Sofia", "Asia/Bahrain", "Africa/Bujumbura", "Africa/Porto-Novo", "America/St_Barthelemy", "Atlantic/Bermuda", "Asia/Brunei", "America/La_Paz", "America/Kralendijk", "America/Noronha", "America/Belem", "America/Fortaleza", "America/Recife", "America/Araguaina", "America/Maceio", "America/Bahia", "America/Sao_Paulo", "America/Campo_Grande", "America/Cuiaba", "America/Santarem", "America/Porto_Velho", "America/Boa_Vista", "America/Manaus", "America/Eirunepe", "America/Rio_Branco", "America/Nassau", "Asia/Thimphu", "Africa/Gaborone", "Europe/Minsk", "America/Belize", "America/St_Johns", "America/Halifax", "America/Glace_Bay", "America/Moncton", "America/Goose_Bay", "America/Blanc-Sablon", "America/Toronto", "America/Nipigon", "America/Thunder_Bay", "America/Iqaluit", "America/Pangnirtung", "America/Resolute", "America/Atikokan", "America/Rankin_Inlet", "America/Winnipeg", "America/Rainy_River", "America/Regina", "America/Swift_Current", "America/Edmonton", "America/Cambridge_Bay", "America/Yellowknife", "America/Inuvik", "America/Creston", "America/Dawson_Creek", "America/Vancouver", "America/Whitehorse", "America/Dawson", "Indian/Cocos", "Africa/Kinshasa", "Africa/Lubumbashi", "Africa/Bangui", "Africa/Brazzaville", "Europe/Zurich", "Africa/Abidjan", "Pacific/Rarotonga", "America/Santiago", "Pacific/Easter", "Africa/Douala", "Asia/Shanghai", "Asia/Harbin", "Asia/Chongqing", "Asia/Urumqi", "Asia/Kashgar", "America/Bogota", "America/Costa_Rica", "America/Havana", "Atlantic/Cape_Verde", "America/Curacao", "Indian/Christmas", "Asia/Nicosia", "Europe/Prague", "Europe/Berlin", "Europe/Busingen", "Africa/Djibouti", "Europe/Copenhagen", "America/Dominica", "America/Santo_Domingo", "Africa/Algiers", "America/Guayaquil", "Pacific/Galapagos", "Europe/Tallinn", "Africa/Cairo", "Africa/El_Aaiun", "Africa/Asmara", "Europe/Madrid", "Africa/Ceuta", "Atlantic/Canary", "Africa/Addis_Ababa", "Europe/Helsinki", "Pacific/Fiji", "Atlantic/Stanley", "Pacific/Chuuk", "Pacific/Pohnpei", "Pacific/Kosrae", "Atlantic/Faroe", "Europe/Paris", "Africa/Libreville", "Europe/London", "America/Grenada", "Asia/Tbilisi", "America/Cayenne", "Europe/Guernsey", "Africa/Accra", "Europe/Gibraltar", "America/Godthab", "America/Danmarkshavn", "America/Scoresbysund", "America/Thule", "Africa/Banjul", "Africa/Conakry", "America/Guadeloupe", "Africa/Malabo", "Europe/Athens", "Atlantic/South_Georgia", "America/Guatemala", "Pacific/Guam", "Africa/Bissau", "America/Guyana", "Asia/Hong_Kong", "America/Tegucigalpa", "Europe/Zagreb", "America/Port-au-Prince", "Europe/Budapest", "Asia/Jakarta", "Asia/Pontianak", "Asia/Makassar", "Asia/Jayapura", "Europe/Dublin", "Asia/Jerusalem", "Europe/Isle_of_Man", "Asia/Kolkata", "Indian/Chagos", "Asia/Baghdad", "Asia/Tehran", "Atlantic/Reykjavik", "Europe/Rome", "Europe/Jersey", "America/Jamaica", "Asia/Amman", "Asia/Tokyo", "Africa/Nairobi", "Asia/Bishkek", "Asia/Phnom_Penh", "Pacific/Tarawa", "Pacific/Enderbury", "Pacific/Kiritimati", "Indian/Comoro", "America/St_Kitts", "Asia/Pyongyang", "Asia/Seoul", "Asia/Kuwait", "America/Cayman", "Asia/Almaty", "Asia/Qyzylorda", "Asia/Aqtobe", "Asia/Aqtau", "Asia/Oral", "Asia/Vientiane", "Asia/Beirut", "America/St_Lucia", "Europe/Vaduz", "Asia/Colombo", "Africa/Monrovia", "Africa/Maseru", "Europe/Vilnius", "Europe/Luxembourg", "Europe/Riga", "Africa/Tripoli", "Africa/Casablanca", "Europe/Monaco", "Europe/Chisinau", "Europe/Podgorica", "America/Marigot", "Indian/Antananarivo", "Pacific/Majuro", "Pacific/Kwajalein", "Europe/Skopje", "Africa/Bamako", "Asia/Rangoon", "Asia/Ulaanbaatar", "Asia/Hovd", "Asia/Choibalsan", "Asia/Macau", "Pacific/Saipan", "America/Martinique", "Africa/Nouakchott", "America/Montserrat", "Europe/Malta", "Indian/Mauritius", "Indian/Maldives", "Africa/Blantyre", "America/Mexico_City", "America/Cancun", "America/Merida", "America/Monterrey", "America/Matamoros", "America/Mazatlan", "America/Chihuahua", "America/Ojinaga", "America/Hermosillo", "America/Tijuana", "America/Santa_Isabel", "America/Bahia_Banderas", "Asia/Kuala_Lumpur", "Asia/Kuching", "Africa/Maputo", "Africa/Windhoek", "Pacific/Noumea", "Africa/Niamey", "Pacific/Norfolk", "Africa/Lagos", "America/Managua", "Europe/Amsterdam", "Europe/Oslo", "Asia/Kathmandu", "Pacific/Nauru", "Pacific/Niue", "Pacific/Auckland", "Pacific/Chatham", "Asia/Muscat", "America/Panama", "America/Lima", "Pacific/Tahiti", "Pacific/Marquesas", "Pacific/Gambier", "Pacific/Port_Moresby", "Asia/Manila", "Asia/Karachi", "Europe/Warsaw", "America/Miquelon", "Pacific/Pitcairn", "America/Puerto_Rico", "Asia/Gaza", "Asia/Hebron", "Europe/Lisbon", "Atlantic/Madeira", "Atlantic/Azores", "Pacific/Palau", "America/Asuncion", "Asia/Qatar", "Indian/Reunion", "Europe/Bucharest", "Europe/Belgrade", "Europe/Kaliningrad", "Europe/Moscow", "Europe/Volgograd", "Europe/Samara", "Asia/Yekaterinburg", "Asia/Omsk", "Asia/Novosibirsk", "Asia/Novokuznetsk", "Asia/Krasnoyarsk", "Asia/Irkutsk", "Asia/Yakutsk", "Asia/Khandyga", "Asia/Vladivostok", "Asia/Sakhalin", "Asia/Ust-Nera", "Asia/Magadan", "Asia/Kamchatka", "Asia/Anadyr", "Africa/Kigali", "Asia/Riyadh", "Pacific/Guadalcanal", "Indian/Mahe", "Africa/Khartoum", "Europe/Stockholm", "Asia/Singapore", "Atlantic/St_Helena", "Europe/Ljubljana", "Arctic/Longyearbyen", "Europe/Bratislava", "Africa/Freetown", "Europe/San_Marino", "Africa/Dakar", "Africa/Mogadishu", "America/Paramaribo", "Africa/Juba", "Africa/Sao_Tome", "America/El_Salvador", "America/Lower_Princes", "Asia/Damascus", "Africa/Mbabane", "America/Grand_Turk", "Africa/Ndjamena", "Indian/Kerguelen", "Africa/Lome", "Asia/Bangkok", "Asia/Dushanbe", "Pacific/Fakaofo", "Asia/Dili", "Asia/Ashgabat", "Africa/Tunis", "Pacific/Tongatapu", "Europe/Istanbul", "America/Port_of_Spain", "Pacific/Funafuti", "Asia/Taipei", "Africa/Dar_es_Salaam", "Europe/Kiev", "Europe/Uzhgorod", "Europe/Zaporozhye", "Europe/Simferopol", "Africa/Kampala", "Pacific/Johnston", "Pacific/Midway", "Pacific/Wake", "America/New_York", "America/Detroit", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Indiana/Indianapolis", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Vevay", "America/Chicago", "America/Indiana/Tell_City", "America/Indiana/Knox", "America/Menominee", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/North_Dakota/Beulah", "America/Denver", "America/Boise", "America/Phoenix", "America/Los_Angeles", "America/Anchorage", "America/Juneau", "America/Sitka", "America/Yakutat", "America/Nome", "America/Adak", "America/Metlakatla", "Pacific/Honolulu", "America/Montevideo", "Asia/Samarkand", "Asia/Tashkent", "Europe/Vatican", "America/St_Vincent", "America/Caracas", "America/Tortola", "America/St_Thomas", "Asia/Ho_Chi_Minh", "Pacific/Efate", "Pacific/Wallis", "Pacific/Apia", "Asia/Aden", "Indian/Mayotte", "Africa/Johannesburg", "Africa/Lusaka", "Africa/Harare", "UTC"),
- },
- },
- "timezone_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "config_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set a text description of the device").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "config_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "location": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the location of the device").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "location_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gps_longitude": schema.Float64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the device physical longitude").AddFloatRangeDescription(-180, 180).String,
- Optional: true,
- Validators: []validator.Float64{
- float64validator.Between(-180, 180),
- },
- },
- "gps_longitude_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gps_latitude": schema.Float64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the device physical latitude").AddFloatRangeDescription(-90, 90).String,
- Optional: true,
- Validators: []validator.Float64{
- float64validator.Between(-90, 90),
- },
- },
- "gps_latitude_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gps_geo_fencing_enable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable Geo fencing").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "gps_geo_fencing_range": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the device’s geo fencing range").AddIntegerRangeDescription(100, 10000).AddDefaultValueDescription("100").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 10000),
- },
- },
- "gps_geo_fencing_range_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gps_sms_enable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable device’s geo fencing SMS").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "gps_sms_mobile_numbers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set device’s geo fencing SMS phone number").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "number": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Mobile number, ex: 1231234414").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(7, 20),
- stringvalidator.RegexMatches(regexp.MustCompile(`[+][0-9]*`), ""),
- },
- },
- "number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "device_groups": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Device groups").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "device_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "controller_groups": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure a list of comma-separated controller groups").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "controller_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "overlay_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the Overlay ID").AddIntegerRangeDescription(1, 4294967295).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "overlay_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "port_offset": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the TLOC port offset when multiple devices are behind a NAT").AddIntegerRangeDescription(0, 19).AddDefaultValueDescription("0").String,
- Optional: true,
- },
- "port_offset_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "port_hopping": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable port hopping").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "port_hopping_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "control_session_pps": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the policer rate for control sessions").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("300").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65535),
- },
- },
- "control_session_pps_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_transport": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure tracking of transport").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "track_transport_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_interface_tag": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("OMP Tag attached to routes based on interface tracking").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "track_interface_tag_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "console_baud_rate": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the console baud rate").AddStringEnumDescription("1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200").AddDefaultValueDescription("9600").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200"),
- },
- },
- "console_baud_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "max_omp_sessions": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the maximum number of OMP sessions <1..100> the device can have").AddIntegerRangeDescription(1, 100).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 100),
- },
- },
- "max_omp_sessions_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "multi_tenant": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Device is multi-tenant").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "multi_tenant_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "track_default_gateway": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable or disable default gateway tracking").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "track_default_gateway_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "admin_tech_on_failure": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Collect admin-tech before reboot due to daemon failure").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "admin_tech_on_failure_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "idle_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Idle CLI timeout in minutes").AddIntegerRangeDescription(0, 300).String,
- Optional: true,
- },
- "idle_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "on_demand_enable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable or disable On-demand Tunnel").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "on_demand_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "on_demand_idle_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the idle timeout for on-demand tunnels").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65535),
- },
- },
- "on_demand_idle_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "transport_gateway": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable transport gateway").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "transport_gateway_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "enhanced_app_aware_routing": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable SLA Dampening and Enhanced App Routing.").AddStringEnumDescription("disabled", "aggressive", "moderate", "conservative").AddDefaultValueDescription("disabled").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("disabled", "aggressive", "moderate", "conservative"),
- },
- },
- "enhanced_app_aware_routing_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "site_types": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Site Type").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "site_types_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "affinity_group_number": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Number").AddIntegerRangeDescription(1, 63).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 63),
- },
- },
- "affinity_group_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "affinity_group_preferences": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Preference").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "affinity_group_preferences_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "affinity_preference_auto": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Preference Auto").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "affinity_preference_auto_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "affinity_per_vrfs": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Number for VRFs").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "affinity_group_number": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Affinity Group Number").AddIntegerRangeDescription(1, 63).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 63),
- },
- },
- "affinity_group_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vrf_range": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Range of VRFs").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 11),
- stringvalidator.RegexMatches(regexp.MustCompile(`^\d+|\d+-\d+$`), ""),
- },
- },
- "vrf_range_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *SystemBasicProfileParcelResource) 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 *SystemBasicProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemBasic
-
- // 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 *SystemBasicProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemBasic
-
- // 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 *SystemBasicProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemBasic
-
- // 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 *SystemBasicProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemBasic
-
- // 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 *SystemBasicProfileParcelResource) 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_system_basic_profile_parcel_test.go b/internal/provider/resource_sdwan_system_basic_profile_parcel_test.go
deleted file mode 100644
index 1b832ff41..000000000
--- a/internal/provider/resource_sdwan_system_basic_profile_parcel_test.go
+++ /dev/null
@@ -1,151 +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 TestAccSdwanSystemBasicProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "timezone", "UTC"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "config_description", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "location", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "gps_longitude", "-77"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "gps_latitude", "38"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "gps_geo_fencing_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "gps_geo_fencing_range", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "gps_sms_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "gps_sms_mobile_numbers.0.number", "+11111233"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "overlay_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "port_offset", "19"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "port_hopping", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "control_session_pps", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "track_transport", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "track_interface_tag", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "console_baud_rate", "9600"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "max_omp_sessions", "24"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "multi_tenant", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "track_default_gateway", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "admin_tech_on_failure", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "idle_timeout", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "on_demand_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "on_demand_idle_timeout", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "transport_gateway", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "enhanced_app_aware_routing", "aggressive"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "affinity_group_number", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "affinity_preference_auto", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "affinity_per_vrfs.0.affinity_group_number", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_basic_profile_parcel.test", "affinity_per_vrfs.0.vrf_range", "123-456"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemBasicPrerequisitesProfileParcelConfig + testAccSdwanSystemBasicProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemBasicPrerequisitesProfileParcelConfig + testAccSdwanSystemBasicProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemBasicPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemBasicProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_basic_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemBasicProfileParcelConfig_all() string {
- config := `resource "sdwan_system_basic_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` timezone = "UTC"` + "\n"
- config += ` config_description = "example"` + "\n"
- config += ` location = "example"` + "\n"
- config += ` gps_longitude = -77` + "\n"
- config += ` gps_latitude = 38` + "\n"
- config += ` gps_geo_fencing_enable = true` + "\n"
- config += ` gps_geo_fencing_range = 100` + "\n"
- config += ` gps_sms_enable = true` + "\n"
- config += ` gps_sms_mobile_numbers = [{` + "\n"
- config += ` number = "+11111233"` + "\n"
- config += ` }]` + "\n"
- config += ` device_groups = ["example"]` + "\n"
- config += ` controller_groups = [1]` + "\n"
- config += ` overlay_id = 1` + "\n"
- config += ` port_offset = 19` + "\n"
- config += ` port_hopping = true` + "\n"
- config += ` control_session_pps = 300` + "\n"
- config += ` track_transport = true` + "\n"
- config += ` track_interface_tag = 2` + "\n"
- config += ` console_baud_rate = "9600"` + "\n"
- config += ` max_omp_sessions = 24` + "\n"
- config += ` multi_tenant = false` + "\n"
- config += ` track_default_gateway = true` + "\n"
- config += ` admin_tech_on_failure = true` + "\n"
- config += ` idle_timeout = 10` + "\n"
- config += ` on_demand_enable = true` + "\n"
- config += ` on_demand_idle_timeout = 10` + "\n"
- config += ` transport_gateway = false` + "\n"
- config += ` enhanced_app_aware_routing = "aggressive"` + "\n"
- config += ` site_types = ["type-1"]` + "\n"
- config += ` affinity_group_number = 1` + "\n"
- config += ` affinity_group_preferences = [1]` + "\n"
- config += ` affinity_preference_auto = false` + "\n"
- config += ` affinity_per_vrfs = [{` + "\n"
- config += ` affinity_group_number = 1` + "\n"
- config += ` vrf_range = "123-456"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_bfd_feature.go b/internal/provider/resource_sdwan_system_bfd_feature.go
new file mode 100644
index 000000000..5d25c1ae3
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_bfd_feature.go
@@ -0,0 +1,333 @@
+// 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-validators/int64validator"
+ "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 = &SystemBFDProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemBFDProfileParcelResource{}
+
+func NewSystemBFDProfileParcelResource() resource.Resource {
+ return &SystemBFDProfileParcelResource{}
+}
+
+type SystemBFDProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemBFDProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_bfd_feature"
+}
+
+func (r *SystemBFDProfileParcelResource) 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 System BFD Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 6).AddDefaultValueDescription("6").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 6),
+ },
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "poll_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 4294967295).AddDefaultValueDescription("600000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "poll_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_dscp": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(0, 63).AddDefaultValueDescription("48").String,
+ Optional: true,
+ },
+ "default_dscp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "colors": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set color that identifies the WAN transport tunnel").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "color": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Color that identifies the WAN transport tunnel").AddStringEnumDescription("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6"),
+ },
+ },
+ "color_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Hello Interval (milliseconds)").AddIntegerRangeDescription(100, 300000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 300000),
+ },
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Multiplier").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("7").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 60),
+ },
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "pmtu_discovery": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Path MTU Discovery").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "pmtu_discovery_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dscp": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BFD Default DSCP value for tloc color").AddIntegerRangeDescription(0, 63).AddDefaultValueDescription("48").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(63),
+ },
+ },
+ "dscp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemBFDProfileParcelResource) 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 *SystemBFDProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemBFD
+
+ // 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 *SystemBFDProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemBFD
+
+ // 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 *SystemBFDProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemBFD
+
+ // 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 *SystemBFDProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemBFD
+
+ // 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 *SystemBFDProfileParcelResource) 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_system_bfd_feature_test.go b/internal/provider/resource_sdwan_system_bfd_feature_test.go
new file mode 100644
index 000000000..72555285f
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_bfd_feature_test.go
@@ -0,0 +1,103 @@
+// 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 TestAccSdwanSystemBFDProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "poll_interval", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "default_dscp", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "colors.0.color", "3g"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "colors.0.hello_interval", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "colors.0.multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "colors.0.pmtu_discovery", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_feature.test", "colors.0.dscp", "16"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemBFDPrerequisitesProfileParcelConfig + testAccSdwanSystemBFDProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemBFDPrerequisitesProfileParcelConfig + testAccSdwanSystemBFDProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemBFDPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemBFDProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_bfd_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemBFDProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_bfd_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` poll_interval = 100` + "\n"
+ config += ` default_dscp = 8` + "\n"
+ config += ` colors = [{` + "\n"
+ config += ` color = "3g"` + "\n"
+ config += ` hello_interval = 200` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` pmtu_discovery = true` + "\n"
+ config += ` dscp = 16` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_bfd_profile_parcel.go b/internal/provider/resource_sdwan_system_bfd_profile_parcel.go
deleted file mode 100644
index 03ab101cc..000000000
--- a/internal/provider/resource_sdwan_system_bfd_profile_parcel.go
+++ /dev/null
@@ -1,333 +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-validators/int64validator"
- "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 = &SystemBFDProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemBFDProfileParcelResource{}
-
-func NewSystemBFDProfileParcelResource() resource.Resource {
- return &SystemBFDProfileParcelResource{}
-}
-
-type SystemBFDProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemBFDProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_bfd_profile_parcel"
-}
-
-func (r *SystemBFDProfileParcelResource) 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 System BFD 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,
- },
- "multiplier": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 6).AddDefaultValueDescription("6").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 6),
- },
- },
- "multiplier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "poll_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(1, 4294967295).AddDefaultValueDescription("600000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "poll_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "default_dscp": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddIntegerRangeDescription(0, 63).AddDefaultValueDescription("48").String,
- Optional: true,
- },
- "default_dscp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "colors": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set color that identifies the WAN transport tunnel").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "color": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Color that identifies the WAN transport tunnel").AddStringEnumDescription("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6"),
- },
- },
- "color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "hello_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Hello Interval (milliseconds)").AddIntegerRangeDescription(100, 300000).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 300000),
- },
- },
- "hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "multiplier": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Multiplier").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("7").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 60),
- },
- },
- "multiplier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "pmtu_discovery": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Path MTU Discovery").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "pmtu_discovery_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "dscp": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("BFD Default DSCP value for tloc color").AddIntegerRangeDescription(0, 63).AddDefaultValueDescription("48").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(63),
- },
- },
- "dscp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *SystemBFDProfileParcelResource) 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 *SystemBFDProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemBFD
-
- // 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 *SystemBFDProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemBFD
-
- // 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 *SystemBFDProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemBFD
-
- // 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 *SystemBFDProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemBFD
-
- // 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 *SystemBFDProfileParcelResource) 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_system_bfd_profile_parcel_test.go b/internal/provider/resource_sdwan_system_bfd_profile_parcel_test.go
deleted file mode 100644
index 418c79bd6..000000000
--- a/internal/provider/resource_sdwan_system_bfd_profile_parcel_test.go
+++ /dev/null
@@ -1,103 +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 TestAccSdwanSystemBFDProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "multiplier", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "poll_interval", "100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "default_dscp", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "colors.0.color", "3g"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "colors.0.hello_interval", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "colors.0.multiplier", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "colors.0.pmtu_discovery", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_bfd_profile_parcel.test", "colors.0.dscp", "16"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemBFDPrerequisitesProfileParcelConfig + testAccSdwanSystemBFDProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemBFDPrerequisitesProfileParcelConfig + testAccSdwanSystemBFDProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemBFDPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemBFDProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_bfd_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemBFDProfileParcelConfig_all() string {
- config := `resource "sdwan_system_bfd_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` multiplier = 3` + "\n"
- config += ` poll_interval = 100` + "\n"
- config += ` default_dscp = 8` + "\n"
- config += ` colors = [{` + "\n"
- config += ` color = "3g"` + "\n"
- config += ` hello_interval = 200` + "\n"
- config += ` multiplier = 3` + "\n"
- config += ` pmtu_discovery = true` + "\n"
- config += ` dscp = 16` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_feature_profile.go b/internal/provider/resource_sdwan_system_feature_profile.go
index 8039baea4..470bdf5e8 100644
--- a/internal/provider/resource_sdwan_system_feature_profile.go
+++ b/internal/provider/resource_sdwan_system_feature_profile.go
@@ -60,7 +60,7 @@ func (r *SystemFeatureProfileResource) Metadata(ctx context.Context, req resourc
func (r *SystemFeatureProfileResource) 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 System Feature Profile .").String,
+ MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a System Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
@@ -138,7 +138,7 @@ func (r *SystemFeatureProfileResource) Read(ctx context.Context, req resource.Re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_system_flexible_port_speed_feature.go b/internal/provider/resource_sdwan_system_flexible_port_speed_feature.go
new file mode 100644
index 000000000..d5aabeeca
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_flexible_port_speed_feature.go
@@ -0,0 +1,253 @@
+// 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-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 = &SystemFlexiblePortSpeedProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemFlexiblePortSpeedProfileParcelResource{}
+
+func NewSystemFlexiblePortSpeedProfileParcelResource() resource.Resource {
+ return &SystemFlexiblePortSpeedProfileParcelResource{}
+}
+
+type SystemFlexiblePortSpeedProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemFlexiblePortSpeedProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_flexible_port_speed_feature"
+}
+
+func (r *SystemFlexiblePortSpeedProfileParcelResource) 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 System Flexible Port Speed Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "port_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("port Type").AddStringEnumDescription("12 ports of 1/10GE + 3 ports 40GE", "8 ports of 1/10GE + 4 ports of 40GE", "2 ports of 100 GE", "12 ports of 1/10GE + 1 port of 100GE", "8 ports of 1/10GE + 1 port of 40GE + 1 port of 100GE", "3 ports of 40GE + 1port of 100GE").AddDefaultValueDescription("12 ports of 1/10GE + 3 ports 40GE").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("12 ports of 1/10GE + 3 ports 40GE", "8 ports of 1/10GE + 4 ports of 40GE", "2 ports of 100 GE", "12 ports of 1/10GE + 1 port of 100GE", "8 ports of 1/10GE + 1 port of 40GE + 1 port of 100GE", "3 ports of 40GE + 1port of 100GE"),
+ },
+ },
+ "port_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *SystemFlexiblePortSpeedProfileParcelResource) 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 *SystemFlexiblePortSpeedProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemFlexiblePortSpeed
+
+ // 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 *SystemFlexiblePortSpeedProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemFlexiblePortSpeed
+
+ // 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 *SystemFlexiblePortSpeedProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemFlexiblePortSpeed
+
+ // 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 *SystemFlexiblePortSpeedProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemFlexiblePortSpeed
+
+ // 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 *SystemFlexiblePortSpeedProfileParcelResource) 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_system_flexible_port_speed_feature_test.go b/internal/provider/resource_sdwan_system_flexible_port_speed_feature_test.go
new file mode 100644
index 000000000..7ae691c33
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_flexible_port_speed_feature_test.go
@@ -0,0 +1,87 @@
+// 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 TestAccSdwanSystemFlexiblePortSpeedProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_flexible_port_speed_feature.test", "port_type", "12 ports of 1/10GE + 3 ports 40GE"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig + testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig + testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_flexible_port_speed_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_flexible_port_speed_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` port_type = "12 ports of 1/10GE + 3 ports 40GE"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_flexible_port_speed_profile_parcel.go b/internal/provider/resource_sdwan_system_flexible_port_speed_profile_parcel.go
deleted file mode 100644
index 100389c65..000000000
--- a/internal/provider/resource_sdwan_system_flexible_port_speed_profile_parcel.go
+++ /dev/null
@@ -1,253 +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-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 = &SystemFlexiblePortSpeedProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemFlexiblePortSpeedProfileParcelResource{}
-
-func NewSystemFlexiblePortSpeedProfileParcelResource() resource.Resource {
- return &SystemFlexiblePortSpeedProfileParcelResource{}
-}
-
-type SystemFlexiblePortSpeedProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemFlexiblePortSpeedProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_flexible_port_speed_profile_parcel"
-}
-
-func (r *SystemFlexiblePortSpeedProfileParcelResource) 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 System Flexible Port Speed 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,
- },
- "port_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("port Type").AddStringEnumDescription("12 ports of 1/10GE + 3 ports 40GE", "8 ports of 1/10GE + 4 ports of 40GE", "2 ports of 100 GE", "12 ports of 1/10GE + 1 port of 100GE", "8 ports of 1/10GE + 1 port of 40GE + 1 port of 100GE", "3 ports of 40GE + 1port of 100GE").AddDefaultValueDescription("12 ports of 1/10GE + 3 ports 40GE").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("12 ports of 1/10GE + 3 ports 40GE", "8 ports of 1/10GE + 4 ports of 40GE", "2 ports of 100 GE", "12 ports of 1/10GE + 1 port of 100GE", "8 ports of 1/10GE + 1 port of 40GE + 1 port of 100GE", "3 ports of 40GE + 1port of 100GE"),
- },
- },
- "port_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *SystemFlexiblePortSpeedProfileParcelResource) 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 *SystemFlexiblePortSpeedProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemFlexiblePortSpeed
-
- // 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 *SystemFlexiblePortSpeedProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemFlexiblePortSpeed
-
- // 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 *SystemFlexiblePortSpeedProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemFlexiblePortSpeed
-
- // 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 *SystemFlexiblePortSpeedProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemFlexiblePortSpeed
-
- // 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 *SystemFlexiblePortSpeedProfileParcelResource) 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_system_flexible_port_speed_profile_parcel_test.go b/internal/provider/resource_sdwan_system_flexible_port_speed_profile_parcel_test.go
deleted file mode 100644
index 2aeef7128..000000000
--- a/internal/provider/resource_sdwan_system_flexible_port_speed_profile_parcel_test.go
+++ /dev/null
@@ -1,87 +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 TestAccSdwanSystemFlexiblePortSpeedProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_flexible_port_speed_profile_parcel.test", "port_type", "12 ports of 1/10GE + 3 ports 40GE"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig + testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig + testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemFlexiblePortSpeedPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_flexible_port_speed_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemFlexiblePortSpeedProfileParcelConfig_all() string {
- config := `resource "sdwan_system_flexible_port_speed_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` port_type = "12 ports of 1/10GE + 3 ports 40GE"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_global_feature.go b/internal/provider/resource_sdwan_system_global_feature.go
new file mode 100644
index 000000000..76652b4a4
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_global_feature.go
@@ -0,0 +1,444 @@
+// 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/int64validator"
+ "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 = &SystemGlobalProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemGlobalProfileParcelResource{}
+
+func NewSystemGlobalProfileParcelResource() resource.Resource {
+ return &SystemGlobalProfileParcelResource{}
+}
+
+type SystemGlobalProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemGlobalProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_global_feature"
+}
+
+func (r *SystemGlobalProfileParcelResource) 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 System Global Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "http_server": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set a HTTP Server").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "http_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "https_server": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set a HTTPS Server").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "https_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ftp_passive": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Passive FTP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ftp_passive_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "domain_lookup": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Domain-Lookup").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "domain_lookup_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arp_proxy": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set ARP Proxy").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "arp_proxy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "rsh_rcp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set RSH/RCP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "rsh_rcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "line_vty": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Telnet (Outbound)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "line_vty_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cdp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure CDP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "cdp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "lldp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure LLDP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "lldp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify interface for source address in all HTTP(S) client connections").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_keepalives_in": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure tcp-keepalives-in").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tcp_keepalives_in_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_keepalives_out": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure tcp-keepalives-out").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tcp_keepalives_out_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_small_servers": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure tcp-small-servers").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tcp_small_servers_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "udp_small_servers": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure udp-small-servers").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "udp_small_servers_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "console_logging": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Console Logging").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "console_logging_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_source_routing": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Source Route").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ip_source_routing_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vty_line_logging": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure VTY Line Logging").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "vty_line_logging_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "snmp_ifindex_persist": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP Ifindex Persist").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "snmp_ifindex_persist_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ignore_bootp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Ignore BOOTP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "ignore_bootp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat64_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT64 UDP session timeout, in seconds").AddIntegerRangeDescription(1, 536870).AddDefaultValueDescription("300").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 536870),
+ },
+ },
+ "nat64_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat64_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT64 TCP session timeout, in seconds").AddIntegerRangeDescription(1, 536870).AddDefaultValueDescription("3600").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 536870),
+ },
+ },
+ "nat64_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "http_authentication": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set preference for HTTP Authentication").AddStringEnumDescription("local", "aaa").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("local", "aaa"),
+ },
+ },
+ "http_authentication_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ssh_version": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set SSH version").AddStringEnumDescription("2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("2"),
+ },
+ },
+ "ssh_version_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *SystemGlobalProfileParcelResource) 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 *SystemGlobalProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemGlobal
+
+ // 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 *SystemGlobalProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemGlobal
+
+ // 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 *SystemGlobalProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemGlobal
+
+ // 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 *SystemGlobalProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemGlobal
+
+ // 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 *SystemGlobalProfileParcelResource) 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_system_global_feature_test.go b/internal/provider/resource_sdwan_system_global_feature_test.go
new file mode 100644
index 000000000..ddbb19218
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_global_feature_test.go
@@ -0,0 +1,131 @@
+// 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 TestAccSdwanSystemGlobalProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "http_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "https_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "ftp_passive", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "domain_lookup", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "arp_proxy", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "rsh_rcp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "line_vty", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "cdp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "lldp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "source_interface", "GigabitEthernet0/0/1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "tcp_keepalives_in", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "tcp_keepalives_out", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "tcp_small_servers", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "udp_small_servers", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "console_logging", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "ip_source_routing", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "vty_line_logging", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "snmp_ifindex_persist", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "ignore_bootp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "nat64_udp_timeout", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "nat64_tcp_timeout", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "http_authentication", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_feature.test", "ssh_version", "2"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemGlobalPrerequisitesProfileParcelConfig + testAccSdwanSystemGlobalProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemGlobalPrerequisitesProfileParcelConfig + testAccSdwanSystemGlobalProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemGlobalPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemGlobalProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_global_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemGlobalProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_global_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` http_server = false` + "\n"
+ config += ` https_server = false` + "\n"
+ config += ` ftp_passive = false` + "\n"
+ config += ` domain_lookup = false` + "\n"
+ config += ` arp_proxy = false` + "\n"
+ config += ` rsh_rcp = false` + "\n"
+ config += ` line_vty = false` + "\n"
+ config += ` cdp = true` + "\n"
+ config += ` lldp = true` + "\n"
+ config += ` source_interface = "GigabitEthernet0/0/1"` + "\n"
+ config += ` tcp_keepalives_in = true` + "\n"
+ config += ` tcp_keepalives_out = true` + "\n"
+ config += ` tcp_small_servers = false` + "\n"
+ config += ` udp_small_servers = false` + "\n"
+ config += ` console_logging = true` + "\n"
+ config += ` ip_source_routing = false` + "\n"
+ config += ` vty_line_logging = false` + "\n"
+ config += ` snmp_ifindex_persist = true` + "\n"
+ config += ` ignore_bootp = true` + "\n"
+ config += ` nat64_udp_timeout = 300` + "\n"
+ config += ` nat64_tcp_timeout = 3600` + "\n"
+ config += ` http_authentication = "aaa"` + "\n"
+ config += ` ssh_version = "2"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_global_profile_parcel.go b/internal/provider/resource_sdwan_system_global_profile_parcel.go
deleted file mode 100644
index 1fcdb09ef..000000000
--- a/internal/provider/resource_sdwan_system_global_profile_parcel.go
+++ /dev/null
@@ -1,444 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &SystemGlobalProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemGlobalProfileParcelResource{}
-
-func NewSystemGlobalProfileParcelResource() resource.Resource {
- return &SystemGlobalProfileParcelResource{}
-}
-
-type SystemGlobalProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemGlobalProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_global_profile_parcel"
-}
-
-func (r *SystemGlobalProfileParcelResource) 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 System Global 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,
- },
- "http_server": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set a HTTP Server").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "http_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "https_server": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set a HTTPS Server").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "https_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ftp_passive": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set Passive FTP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ftp_passive_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "domain_lookup": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Domain-Lookup").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "domain_lookup_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arp_proxy": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set ARP Proxy").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "arp_proxy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "rsh_rcp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set RSH/RCP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "rsh_rcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "line_vty": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Telnet (Outbound)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "line_vty_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "cdp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure CDP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "cdp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "lldp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure LLDP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "lldp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify interface for source address in all HTTP(S) client connections").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_keepalives_in": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure tcp-keepalives-in").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tcp_keepalives_in_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_keepalives_out": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure tcp-keepalives-out").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tcp_keepalives_out_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_small_servers": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure tcp-small-servers").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tcp_small_servers_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "udp_small_servers": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure udp-small-servers").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "udp_small_servers_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "console_logging": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Console Logging").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "console_logging_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_source_routing": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set Source Route").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ip_source_routing_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vty_line_logging": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure VTY Line Logging").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "vty_line_logging_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "snmp_ifindex_persist": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP Ifindex Persist").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "snmp_ifindex_persist_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ignore_bootp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Ignore BOOTP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "ignore_bootp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat64_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT64 UDP session timeout, in seconds").AddIntegerRangeDescription(1, 536870).AddDefaultValueDescription("300").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 536870),
- },
- },
- "nat64_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat64_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT64 TCP session timeout, in seconds").AddIntegerRangeDescription(1, 536870).AddDefaultValueDescription("3600").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 536870),
- },
- },
- "nat64_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "http_authentication": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set preference for HTTP Authentication").AddStringEnumDescription("local", "aaa").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("local", "aaa"),
- },
- },
- "http_authentication_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ssh_version": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set SSH version").AddStringEnumDescription("2").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("2"),
- },
- },
- "ssh_version_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *SystemGlobalProfileParcelResource) 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 *SystemGlobalProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemGlobal
-
- // 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 *SystemGlobalProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemGlobal
-
- // 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 *SystemGlobalProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemGlobal
-
- // 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 *SystemGlobalProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemGlobal
-
- // 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 *SystemGlobalProfileParcelResource) 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_system_global_profile_parcel_test.go b/internal/provider/resource_sdwan_system_global_profile_parcel_test.go
deleted file mode 100644
index eacbcdfee..000000000
--- a/internal/provider/resource_sdwan_system_global_profile_parcel_test.go
+++ /dev/null
@@ -1,131 +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 TestAccSdwanSystemGlobalProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "http_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "https_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "ftp_passive", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "domain_lookup", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "arp_proxy", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "rsh_rcp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "line_vty", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "cdp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "lldp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "source_interface", "GigabitEthernet0/0/1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "tcp_keepalives_in", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "tcp_keepalives_out", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "tcp_small_servers", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "udp_small_servers", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "console_logging", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "ip_source_routing", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "vty_line_logging", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "snmp_ifindex_persist", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "ignore_bootp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "nat64_udp_timeout", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "nat64_tcp_timeout", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "http_authentication", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_global_profile_parcel.test", "ssh_version", "2"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemGlobalPrerequisitesProfileParcelConfig + testAccSdwanSystemGlobalProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemGlobalPrerequisitesProfileParcelConfig + testAccSdwanSystemGlobalProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemGlobalPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemGlobalProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_global_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemGlobalProfileParcelConfig_all() string {
- config := `resource "sdwan_system_global_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` http_server = false` + "\n"
- config += ` https_server = false` + "\n"
- config += ` ftp_passive = false` + "\n"
- config += ` domain_lookup = false` + "\n"
- config += ` arp_proxy = false` + "\n"
- config += ` rsh_rcp = false` + "\n"
- config += ` line_vty = false` + "\n"
- config += ` cdp = true` + "\n"
- config += ` lldp = true` + "\n"
- config += ` source_interface = "GigabitEthernet0/0/1"` + "\n"
- config += ` tcp_keepalives_in = true` + "\n"
- config += ` tcp_keepalives_out = true` + "\n"
- config += ` tcp_small_servers = false` + "\n"
- config += ` udp_small_servers = false` + "\n"
- config += ` console_logging = true` + "\n"
- config += ` ip_source_routing = false` + "\n"
- config += ` vty_line_logging = false` + "\n"
- config += ` snmp_ifindex_persist = true` + "\n"
- config += ` ignore_bootp = true` + "\n"
- config += ` nat64_udp_timeout = 300` + "\n"
- config += ` nat64_tcp_timeout = 3600` + "\n"
- config += ` http_authentication = "aaa"` + "\n"
- config += ` ssh_version = "2"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_ipv4_device_access_feature.go b/internal/provider/resource_sdwan_system_ipv4_device_access_feature.go
new file mode 100644
index 000000000..5cf87536a
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_ipv4_device_access_feature.go
@@ -0,0 +1,321 @@
+// 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/int64validator"
+ "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 = &SystemIPv4DeviceAccessProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemIPv4DeviceAccessProfileParcelResource{}
+
+func NewSystemIPv4DeviceAccessProfileParcelResource() resource.Resource {
+ return &SystemIPv4DeviceAccessProfileParcelResource{}
+}
+
+type SystemIPv4DeviceAccessProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemIPv4DeviceAccessProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_ipv4_device_access_feature"
+}
+
+func (r *SystemIPv4DeviceAccessProfileParcelResource) 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 System IPv4 Device Access Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Default Action").AddStringEnumDescription("drop", "accept").AddDefaultValueDescription("drop").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("drop", "accept"),
+ },
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Device Access Control List").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Id").AddIntegerRangeDescription(1, 65536).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 19),
+ },
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Base Action").AddStringEnumDescription("drop", "accept").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("drop", "accept"),
+ },
+ },
+ "device_access_port": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("device access protocol").String,
+ Optional: true,
+ },
+ "destination_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "destination_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Destination Data IP Prefix List").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "destination_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_ports": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source Port List").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "source_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "source_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source Data IP Prefix List").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "source_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemIPv4DeviceAccessProfileParcelResource) 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 *SystemIPv4DeviceAccessProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemIPv4DeviceAccess
+
+ // 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 *SystemIPv4DeviceAccessProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemIPv4DeviceAccess
+
+ // 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 *SystemIPv4DeviceAccessProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemIPv4DeviceAccess
+
+ // 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 *SystemIPv4DeviceAccessProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemIPv4DeviceAccess
+
+ // 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 *SystemIPv4DeviceAccessProfileParcelResource) 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_system_ipv4_device_access_feature_test.go b/internal/provider/resource_sdwan_system_ipv4_device_access_feature_test.go
new file mode 100644
index 000000000..465ae5778
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_ipv4_device_access_feature_test.go
@@ -0,0 +1,98 @@
+// 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 TestAccSdwanSystemIPv4DeviceAccessProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_feature.test", "default_action", "drop"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_feature.test", "sequences.0.base_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_feature.test", "sequences.0.device_access_port", "161"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_ipv4_device_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_ipv4_device_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` default_action = "drop"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "accept"` + "\n"
+ config += ` device_access_port = 161` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_ipv4_device_access_profile_parcel.go b/internal/provider/resource_sdwan_system_ipv4_device_access_profile_parcel.go
deleted file mode 100644
index 5109a4a12..000000000
--- a/internal/provider/resource_sdwan_system_ipv4_device_access_profile_parcel.go
+++ /dev/null
@@ -1,321 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &SystemIPv4DeviceAccessProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemIPv4DeviceAccessProfileParcelResource{}
-
-func NewSystemIPv4DeviceAccessProfileParcelResource() resource.Resource {
- return &SystemIPv4DeviceAccessProfileParcelResource{}
-}
-
-type SystemIPv4DeviceAccessProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemIPv4DeviceAccessProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_ipv4_device_access_profile_parcel"
-}
-
-func (r *SystemIPv4DeviceAccessProfileParcelResource) 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 System IPv4 Device Access 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,
- },
- "default_action": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Default Action").AddStringEnumDescription("drop", "accept").AddDefaultValueDescription("drop").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("drop", "accept"),
- },
- },
- "sequences": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Device Access Control List").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Sequence Id").AddIntegerRangeDescription(1, 65536).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65536),
- },
- },
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Sequence Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 19),
- },
- },
- "base_action": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Base Action").AddStringEnumDescription("drop", "accept").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("drop", "accept"),
- },
- },
- "device_access_port": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("device access protocol").String,
- Optional: true,
- },
- "destination_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "destination_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Destination Data IP Prefix List").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "destination_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_ports": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source Port List").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "source_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "source_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source Data IP Prefix List").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "source_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *SystemIPv4DeviceAccessProfileParcelResource) 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 *SystemIPv4DeviceAccessProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemIPv4DeviceAccess
-
- // 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 *SystemIPv4DeviceAccessProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemIPv4DeviceAccess
-
- // 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 *SystemIPv4DeviceAccessProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemIPv4DeviceAccess
-
- // 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 *SystemIPv4DeviceAccessProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemIPv4DeviceAccess
-
- // 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 *SystemIPv4DeviceAccessProfileParcelResource) 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_system_ipv4_device_access_profile_parcel_test.go b/internal/provider/resource_sdwan_system_ipv4_device_access_profile_parcel_test.go
deleted file mode 100644
index 6904dc103..000000000
--- a/internal/provider/resource_sdwan_system_ipv4_device_access_profile_parcel_test.go
+++ /dev/null
@@ -1,98 +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 TestAccSdwanSystemIPv4DeviceAccessProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_profile_parcel.test", "default_action", "drop"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.name", "SEQ_1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.base_action", "accept"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv4_device_access_profile_parcel.test", "sequences.0.device_access_port", "161"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemIPv4DeviceAccessPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_ipv4_device_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemIPv4DeviceAccessProfileParcelConfig_all() string {
- config := `resource "sdwan_system_ipv4_device_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` default_action = "drop"` + "\n"
- config += ` sequences = [{` + "\n"
- config += ` id = 1` + "\n"
- config += ` name = "SEQ_1"` + "\n"
- config += ` base_action = "accept"` + "\n"
- config += ` device_access_port = 161` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_ipv6_device_access_feature.go b/internal/provider/resource_sdwan_system_ipv6_device_access_feature.go
new file mode 100644
index 000000000..77a8f6ffa
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_ipv6_device_access_feature.go
@@ -0,0 +1,321 @@
+// 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/int64validator"
+ "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 = &SystemIPv6DeviceAccessProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemIPv6DeviceAccessProfileParcelResource{}
+
+func NewSystemIPv6DeviceAccessProfileParcelResource() resource.Resource {
+ return &SystemIPv6DeviceAccessProfileParcelResource{}
+}
+
+type SystemIPv6DeviceAccessProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemIPv6DeviceAccessProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_ipv6_device_access_feature"
+}
+
+func (r *SystemIPv6DeviceAccessProfileParcelResource) 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 System IPv6 Device Access Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Default Action").AddStringEnumDescription("drop", "accept").AddDefaultValueDescription("drop").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("drop", "accept"),
+ },
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Device Access Control List").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Id").AddIntegerRangeDescription(1, 65536).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 19),
+ },
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Base Action").AddStringEnumDescription("drop", "accept").AddDefaultValueDescription("accept").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("drop", "accept"),
+ },
+ },
+ "device_access_port": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("device access protocol").String,
+ Optional: true,
+ },
+ "destination_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "destination_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Destination Data IP Prefix List").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "destination_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_ports": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source Port List").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "source_data_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "source_ip_prefix_list": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source Data IP Prefix List").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "source_ip_prefix_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemIPv6DeviceAccessProfileParcelResource) 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 *SystemIPv6DeviceAccessProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemIPv6DeviceAccess
+
+ // 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 *SystemIPv6DeviceAccessProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemIPv6DeviceAccess
+
+ // 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 *SystemIPv6DeviceAccessProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemIPv6DeviceAccess
+
+ // 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 *SystemIPv6DeviceAccessProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemIPv6DeviceAccess
+
+ // 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 *SystemIPv6DeviceAccessProfileParcelResource) 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_system_ipv6_device_access_feature_test.go b/internal/provider/resource_sdwan_system_ipv6_device_access_feature_test.go
new file mode 100644
index 000000000..77d336430
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_ipv6_device_access_feature_test.go
@@ -0,0 +1,98 @@
+// 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 TestAccSdwanSystemIPv6DeviceAccessProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_feature.test", "default_action", "drop"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_feature.test", "sequences.0.base_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_feature.test", "sequences.0.device_access_port", "22"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_ipv6_device_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_ipv6_device_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` default_action = "drop"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "accept"` + "\n"
+ config += ` device_access_port = 22` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_ipv6_device_access_profile_parcel.go b/internal/provider/resource_sdwan_system_ipv6_device_access_profile_parcel.go
deleted file mode 100644
index 80842bd16..000000000
--- a/internal/provider/resource_sdwan_system_ipv6_device_access_profile_parcel.go
+++ /dev/null
@@ -1,321 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &SystemIPv6DeviceAccessProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemIPv6DeviceAccessProfileParcelResource{}
-
-func NewSystemIPv6DeviceAccessProfileParcelResource() resource.Resource {
- return &SystemIPv6DeviceAccessProfileParcelResource{}
-}
-
-type SystemIPv6DeviceAccessProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemIPv6DeviceAccessProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_ipv6_device_access_profile_parcel"
-}
-
-func (r *SystemIPv6DeviceAccessProfileParcelResource) 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 System IPv6 Device Access 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,
- },
- "default_action": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Default Action").AddStringEnumDescription("drop", "accept").AddDefaultValueDescription("drop").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("drop", "accept"),
- },
- },
- "sequences": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Device Access Control List").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Sequence Id").AddIntegerRangeDescription(1, 65536).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65536),
- },
- },
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Sequence Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 19),
- },
- },
- "base_action": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Base Action").AddStringEnumDescription("drop", "accept").AddDefaultValueDescription("accept").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("drop", "accept"),
- },
- },
- "device_access_port": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("device access protocol").String,
- Optional: true,
- },
- "destination_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "destination_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Destination Data IP Prefix List").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "destination_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_ports": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source Port List").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "source_data_prefix_list_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "source_ip_prefix_list": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source Data IP Prefix List").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "source_ip_prefix_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *SystemIPv6DeviceAccessProfileParcelResource) 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 *SystemIPv6DeviceAccessProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemIPv6DeviceAccess
-
- // 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 *SystemIPv6DeviceAccessProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemIPv6DeviceAccess
-
- // 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 *SystemIPv6DeviceAccessProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemIPv6DeviceAccess
-
- // 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 *SystemIPv6DeviceAccessProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemIPv6DeviceAccess
-
- // 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 *SystemIPv6DeviceAccessProfileParcelResource) 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_system_ipv6_device_access_profile_parcel_test.go b/internal/provider/resource_sdwan_system_ipv6_device_access_profile_parcel_test.go
deleted file mode 100644
index df82dbab3..000000000
--- a/internal/provider/resource_sdwan_system_ipv6_device_access_profile_parcel_test.go
+++ /dev/null
@@ -1,98 +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 TestAccSdwanSystemIPv6DeviceAccessProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_profile_parcel.test", "default_action", "drop"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.name", "SEQ_1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.base_action", "accept"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ipv6_device_access_profile_parcel.test", "sequences.0.device_access_port", "22"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemIPv6DeviceAccessPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_ipv6_device_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemIPv6DeviceAccessProfileParcelConfig_all() string {
- config := `resource "sdwan_system_ipv6_device_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` default_action = "drop"` + "\n"
- config += ` sequences = [{` + "\n"
- config += ` id = 1` + "\n"
- config += ` name = "SEQ_1"` + "\n"
- config += ` base_action = "accept"` + "\n"
- config += ` device_access_port = 22` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_logging_feature.go b/internal/provider/resource_sdwan_system_logging_feature.go
new file mode 100644
index 000000000..2f0c251c7
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_logging_feature.go
@@ -0,0 +1,464 @@
+// 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-validators/int64validator"
+ "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 = &SystemLoggingProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemLoggingProfileParcelResource{}
+
+func NewSystemLoggingProfileParcelResource() resource.Resource {
+ return &SystemLoggingProfileParcelResource{}
+}
+
+type SystemLoggingProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemLoggingProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_logging_feature"
+}
+
+func (r *SystemLoggingProfileParcelResource) 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 System Logging Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "disk_enable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable logging to local disk").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "disk_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "disk_file_size": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum size of file before it is rotated").AddIntegerRangeDescription(1, 20).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 20),
+ },
+ },
+ "disk_file_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "disk_file_rotate": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set number of syslog files to create before discarding oldest files").AddIntegerRangeDescription(1, 10).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 10),
+ },
+ },
+ "disk_file_rotate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_profiles": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure a TLS profile").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "profile": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify the name of the TLS profile").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_version": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TLS Version").AddStringEnumDescription("TLSv1.1", "TLSv1.2").AddDefaultValueDescription("TLSv1.1").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("TLSv1.1", "TLSv1.2"),
+ },
+ },
+ "tls_version_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cipher_suites": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Syslog secure server ciphersuites").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "cipher_suites_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_servers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable logging to remote server").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "hostname_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IPv4 address of server").String,
+ Optional: true,
+ },
+ "hostname_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IPv4 address of server").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface to use to reach syslog server").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "priority": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set logging level for messages logged to server").AddStringEnumDescription("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency").AddDefaultValueDescription("informational").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency"),
+ },
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_enable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable TLS Profile").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tls_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_properties_custom_profile": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Define custom profile").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tls_properties_custom_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_properties_profile": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure a TLS profile").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "tls_properties_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_servers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable logging to remote ipv6 server").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "hostname_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 hostname or IPv6 address of server").String,
+ Optional: true,
+ },
+ "hostname_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IPv4 address of server").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface to use to reach syslog server").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "priority": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set logging level for messages logged to server").AddStringEnumDescription("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency").AddDefaultValueDescription("informational").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency"),
+ },
+ },
+ "priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_enable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable TLS Profile").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tls_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_properties_custom_profile": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Define custom profile").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tls_properties_custom_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tls_properties_profile": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure a TLS profile").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "tls_properties_profile_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemLoggingProfileParcelResource) 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 *SystemLoggingProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemLogging
+
+ // 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 *SystemLoggingProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemLogging
+
+ // 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 *SystemLoggingProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemLogging
+
+ // 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 *SystemLoggingProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemLogging
+
+ // 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 *SystemLoggingProfileParcelResource) 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_system_logging_feature_test.go b/internal/provider/resource_sdwan_system_logging_feature_test.go
new file mode 100644
index 000000000..9f1c0e163
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_logging_feature_test.go
@@ -0,0 +1,131 @@
+// 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 TestAccSdwanSystemLoggingProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "disk_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "disk_file_size", "9"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "disk_file_rotate", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "tls_profiles.0.profile", "test"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "tls_profiles.0.tls_version", "TLSv1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv4_servers.0.hostname_ip", "1.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv4_servers.0.vpn", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv4_servers.0.source_interface", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv4_servers.0.priority", "informational"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv4_servers.0.tls_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv4_servers.0.tls_properties_custom_profile", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv4_servers.0.tls_properties_profile", "test"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv6_servers.0.hostname_ip", "1.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv6_servers.0.vpn", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv6_servers.0.source_interface", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv6_servers.0.priority", "informational"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv6_servers.0.tls_enable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv6_servers.0.tls_properties_custom_profile", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_feature.test", "ipv6_servers.0.tls_properties_profile", "test"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemLoggingPrerequisitesProfileParcelConfig + testAccSdwanSystemLoggingProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemLoggingPrerequisitesProfileParcelConfig + testAccSdwanSystemLoggingProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemLoggingPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemLoggingProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_logging_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemLoggingProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_logging_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` disk_enable = true` + "\n"
+ config += ` disk_file_size = 9` + "\n"
+ config += ` disk_file_rotate = 10` + "\n"
+ config += ` tls_profiles = [{` + "\n"
+ config += ` profile = "test"` + "\n"
+ config += ` tls_version = "TLSv1.1"` + "\n"
+ config += ` cipher_suites = ["aes-128-cbc-sha"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_servers = [{` + "\n"
+ config += ` hostname_ip = "1.1.1.1"` + "\n"
+ config += ` vpn = 512` + "\n"
+ config += ` source_interface = "GigabitEthernet1"` + "\n"
+ config += ` priority = "informational"` + "\n"
+ config += ` tls_enable = true` + "\n"
+ config += ` tls_properties_custom_profile = true` + "\n"
+ config += ` tls_properties_profile = "test"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_servers = [{` + "\n"
+ config += ` hostname_ip = "1.1.1.1"` + "\n"
+ config += ` vpn = 512` + "\n"
+ config += ` source_interface = "GigabitEthernet1"` + "\n"
+ config += ` priority = "informational"` + "\n"
+ config += ` tls_enable = true` + "\n"
+ config += ` tls_properties_custom_profile = true` + "\n"
+ config += ` tls_properties_profile = "test"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_logging_profile_parcel.go b/internal/provider/resource_sdwan_system_logging_profile_parcel.go
deleted file mode 100644
index e248d0c8d..000000000
--- a/internal/provider/resource_sdwan_system_logging_profile_parcel.go
+++ /dev/null
@@ -1,464 +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-validators/int64validator"
- "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 = &SystemLoggingProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemLoggingProfileParcelResource{}
-
-func NewSystemLoggingProfileParcelResource() resource.Resource {
- return &SystemLoggingProfileParcelResource{}
-}
-
-type SystemLoggingProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemLoggingProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_logging_profile_parcel"
-}
-
-func (r *SystemLoggingProfileParcelResource) 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 System Logging 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,
- Optional: true,
- },
- "disk_enable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable logging to local disk").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "disk_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "disk_file_size": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set maximum size of file before it is rotated").AddIntegerRangeDescription(1, 20).AddDefaultValueDescription("10").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 20),
- },
- },
- "disk_file_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "disk_file_rotate": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set number of syslog files to create before discarding oldest files").AddIntegerRangeDescription(1, 10).AddDefaultValueDescription("10").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 10),
- },
- },
- "disk_file_rotate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_profiles": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure a TLS profile").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "profile": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify the name of the TLS profile").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_version": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("TLS Version").AddStringEnumDescription("TLSv1.1", "TLSv1.2").AddDefaultValueDescription("TLSv1.1").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("TLSv1.1", "TLSv1.2"),
- },
- },
- "tls_version_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "cipher_suites": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Syslog secure server ciphersuites").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "cipher_suites_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_servers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable logging to remote server").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "hostname_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IPv4 address of server").String,
- Optional: true,
- },
- "hostname_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IPv4 address of server").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65530),
- },
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface to use to reach syslog server").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "priority": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set logging level for messages logged to server").AddStringEnumDescription("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency").AddDefaultValueDescription("informational").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency"),
- },
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_enable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable TLS Profile").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tls_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_properties_custom_profile": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Define custom profile").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tls_properties_custom_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_properties_profile": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure a TLS profile").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "tls_properties_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_servers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable logging to remote ipv6 server").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "hostname_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 hostname or IPv6 address of server").String,
- Optional: true,
- },
- "hostname_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IPv4 address of server").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65530),
- },
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface to use to reach syslog server").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "priority": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set logging level for messages logged to server").AddStringEnumDescription("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency").AddDefaultValueDescription("informational").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency"),
- },
- },
- "priority_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_enable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable TLS Profile").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tls_enable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_properties_custom_profile": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Define custom profile").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tls_properties_custom_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tls_properties_profile": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure a TLS profile").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "tls_properties_profile_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *SystemLoggingProfileParcelResource) 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 *SystemLoggingProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemLogging
-
- // 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 *SystemLoggingProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemLogging
-
- // 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 *SystemLoggingProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemLogging
-
- // 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 *SystemLoggingProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemLogging
-
- // 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 *SystemLoggingProfileParcelResource) 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_system_logging_profile_parcel_test.go b/internal/provider/resource_sdwan_system_logging_profile_parcel_test.go
deleted file mode 100644
index a60f541cc..000000000
--- a/internal/provider/resource_sdwan_system_logging_profile_parcel_test.go
+++ /dev/null
@@ -1,131 +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 TestAccSdwanSystemLoggingProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "disk_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "disk_file_size", "9"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "disk_file_rotate", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "tls_profiles.0.profile", "test"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "tls_profiles.0.tls_version", "TLSv1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.hostname_ip", "1.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.vpn", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.source_interface", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.priority", "informational"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.tls_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.tls_properties_custom_profile", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv4_servers.0.tls_properties_profile", "test"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.hostname_ip", "1.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.vpn", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.source_interface", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.priority", "informational"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.tls_enable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.tls_properties_custom_profile", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_logging_profile_parcel.test", "ipv6_servers.0.tls_properties_profile", "test"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemLoggingPrerequisitesProfileParcelConfig + testAccSdwanSystemLoggingProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemLoggingPrerequisitesProfileParcelConfig + testAccSdwanSystemLoggingProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemLoggingPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemLoggingProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_logging_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemLoggingProfileParcelConfig_all() string {
- config := `resource "sdwan_system_logging_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` disk_enable = true` + "\n"
- config += ` disk_file_size = 9` + "\n"
- config += ` disk_file_rotate = 10` + "\n"
- config += ` tls_profiles = [{` + "\n"
- config += ` profile = "test"` + "\n"
- config += ` tls_version = "TLSv1.1"` + "\n"
- config += ` cipher_suites = ["aes-128-cbc-sha"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_servers = [{` + "\n"
- config += ` hostname_ip = "1.1.1.1"` + "\n"
- config += ` vpn = 512` + "\n"
- config += ` source_interface = "GigabitEthernet1"` + "\n"
- config += ` priority = "informational"` + "\n"
- config += ` tls_enable = true` + "\n"
- config += ` tls_properties_custom_profile = true` + "\n"
- config += ` tls_properties_profile = "test"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_servers = [{` + "\n"
- config += ` hostname_ip = "1.1.1.1"` + "\n"
- config += ` vpn = 512` + "\n"
- config += ` source_interface = "GigabitEthernet1"` + "\n"
- config += ` priority = "informational"` + "\n"
- config += ` tls_enable = true` + "\n"
- config += ` tls_properties_custom_profile = true` + "\n"
- config += ` tls_properties_profile = "test"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_mrf_feature.go b/internal/provider/resource_sdwan_system_mrf_feature.go
new file mode 100644
index 000000000..400f1539d
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_mrf_feature.go
@@ -0,0 +1,286 @@
+// 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-validators/int64validator"
+ "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 = &SystemMRFProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemMRFProfileParcelResource{}
+
+func NewSystemMRFProfileParcelResource() resource.Resource {
+ return &SystemMRFProfileParcelResource{}
+}
+
+type SystemMRFProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemMRFProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_mrf_feature"
+}
+
+func (r *SystemMRFProfileParcelResource) 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 System MRF Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "region_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set region ID").AddIntegerRangeDescription(1, 63).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 63),
+ },
+ },
+ "secondary_region_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set secondary region ID").AddIntegerRangeDescription(1, 63).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 63),
+ },
+ },
+ "secondary_region_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "role": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the role for router").AddStringEnumDescription("edge-router", "border-router").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("edge-router", "border-router"),
+ },
+ },
+ "role_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "enable_migration_to_mrf": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable migration mode to Multi-Region Fabric").AddStringEnumDescription("enabled", "enabled-from-bgp-core").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("enabled", "enabled-from-bgp-core"),
+ },
+ },
+ "migration_bgp_community": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set BGP community during migration from BGP-core based network").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemMRFProfileParcelResource) 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 *SystemMRFProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemMRF
+
+ // 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 *SystemMRFProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemMRF
+
+ // 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 *SystemMRFProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemMRF
+
+ // 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 *SystemMRFProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemMRF
+
+ // 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 *SystemMRFProfileParcelResource) 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_system_mrf_feature_test.go b/internal/provider/resource_sdwan_system_mrf_feature_test.go
new file mode 100644
index 000000000..44a58cbde
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_mrf_feature_test.go
@@ -0,0 +1,95 @@
+// 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 TestAccSdwanSystemMRFProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_feature.test", "region_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_feature.test", "secondary_region_id", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_feature.test", "role", "edge-router"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_feature.test", "enable_migration_to_mrf", "enabled"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_feature.test", "migration_bgp_community", "100"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemMRFPrerequisitesProfileParcelConfig + testAccSdwanSystemMRFProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemMRFPrerequisitesProfileParcelConfig + testAccSdwanSystemMRFProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemMRFPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemMRFProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_mrf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemMRFProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_mrf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` region_id = 1` + "\n"
+ config += ` secondary_region_id = 2` + "\n"
+ config += ` role = "edge-router"` + "\n"
+ config += ` enable_migration_to_mrf = "enabled"` + "\n"
+ config += ` migration_bgp_community = 100` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_mrf_profile_parcel.go b/internal/provider/resource_sdwan_system_mrf_profile_parcel.go
deleted file mode 100644
index 88e92bcc9..000000000
--- a/internal/provider/resource_sdwan_system_mrf_profile_parcel.go
+++ /dev/null
@@ -1,286 +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-validators/int64validator"
- "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 = &SystemMRFProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemMRFProfileParcelResource{}
-
-func NewSystemMRFProfileParcelResource() resource.Resource {
- return &SystemMRFProfileParcelResource{}
-}
-
-type SystemMRFProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemMRFProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_mrf_profile_parcel"
-}
-
-func (r *SystemMRFProfileParcelResource) 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 System MRF 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,
- Optional: true,
- },
- "region_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set region ID").AddIntegerRangeDescription(1, 63).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 63),
- },
- },
- "secondary_region_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set secondary region ID").AddIntegerRangeDescription(1, 63).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 63),
- },
- },
- "secondary_region_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "role": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the role for router").AddStringEnumDescription("edge-router", "border-router").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("edge-router", "border-router"),
- },
- },
- "role_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "enable_migration_to_mrf": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable migration mode to Multi-Region Fabric").AddStringEnumDescription("enabled", "enabled-from-bgp-core").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("enabled", "enabled-from-bgp-core"),
- },
- },
- "migration_bgp_community": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set BGP community during migration from BGP-core based network").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- },
- }
-}
-
-func (r *SystemMRFProfileParcelResource) 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 *SystemMRFProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemMRF
-
- // 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 *SystemMRFProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemMRF
-
- // 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 *SystemMRFProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemMRF
-
- // 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 *SystemMRFProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemMRF
-
- // 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 *SystemMRFProfileParcelResource) 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_system_mrf_profile_parcel_test.go b/internal/provider/resource_sdwan_system_mrf_profile_parcel_test.go
deleted file mode 100644
index 7342c77de..000000000
--- a/internal/provider/resource_sdwan_system_mrf_profile_parcel_test.go
+++ /dev/null
@@ -1,95 +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 TestAccSdwanSystemMRFProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_profile_parcel.test", "region_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_profile_parcel.test", "secondary_region_id", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_profile_parcel.test", "role", "edge-router"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_profile_parcel.test", "enable_migration_to_mrf", "enabled"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_mrf_profile_parcel.test", "migration_bgp_community", "100"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemMRFPrerequisitesProfileParcelConfig + testAccSdwanSystemMRFProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemMRFPrerequisitesProfileParcelConfig + testAccSdwanSystemMRFProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemMRFPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemMRFProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_mrf_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemMRFProfileParcelConfig_all() string {
- config := `resource "sdwan_system_mrf_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` region_id = 1` + "\n"
- config += ` secondary_region_id = 2` + "\n"
- config += ` role = "edge-router"` + "\n"
- config += ` enable_migration_to_mrf = "enabled"` + "\n"
- config += ` migration_bgp_community = 100` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_ntp_feature.go b/internal/provider/resource_sdwan_system_ntp_feature.go
new file mode 100644
index 000000000..ca6d28f53
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_ntp_feature.go
@@ -0,0 +1,383 @@
+// 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/int64validator"
+ "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 = &SystemNTPProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemNTPProfileParcelResource{}
+
+func NewSystemNTPProfileParcelResource() resource.Resource {
+ return &SystemNTPProfileParcelResource{}
+}
+
+type SystemNTPProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemNTPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_ntp_feature"
+}
+
+func (r *SystemNTPProfileParcelResource) 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 System NTP Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "servers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure NTP servers").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "hostname_ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IP address of server").String,
+ Optional: true,
+ },
+ "hostname_ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_key": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set authentication key for the server").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set VPN in which NTP server is located").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ntp_version": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NTP version").AddIntegerRangeDescription(1, 4).AddDefaultValueDescription("4").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4),
+ },
+ },
+ "ntp_version_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface to use to reach NTP server").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "prefer_this_ntp_server": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Prefer this NTP server").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "prefer_this_ntp_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "authentication_keys": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 authentication key").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "key_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MD5 authentication key ID").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "key_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "md5_value": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enter cleartext or AES-encrypted MD5 authentication key").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "md5_value_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "trusted_keys": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Designate authentication key as trustworthy").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "trusted_keys_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authoritative_ntp_server": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable device as NTP Leader").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "authoritative_ntp_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "stratum": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable device as NTP Leader").AddIntegerRangeDescription(1, 15).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 15),
+ },
+ },
+ "stratum_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable device as NTP Leader").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *SystemNTPProfileParcelResource) 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 *SystemNTPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemNTP
+
+ // 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 *SystemNTPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemNTP
+
+ // 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 *SystemNTPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemNTP
+
+ // 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 *SystemNTPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemNTP
+
+ // 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 *SystemNTPProfileParcelResource) 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_system_ntp_feature_test.go b/internal/provider/resource_sdwan_system_ntp_feature_test.go
new file mode 100644
index 000000000..79ca2d300
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_ntp_feature_test.go
@@ -0,0 +1,112 @@
+// 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 TestAccSdwanSystemNTPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "servers.0.hostname_ip_address", "1.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "servers.0.authentication_key", "41673"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "servers.0.vpn", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "servers.0.ntp_version", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "servers.0.source_interface", "Ethernet"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "servers.0.prefer_this_ntp_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "authentication_keys.0.key_id", "49737"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "authentication_keys.0.md5_value", "$CRYPT_CLUSTER"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "authoritative_ntp_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "stratum", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_feature.test", "source_interface", "ATM"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemNTPPrerequisitesProfileParcelConfig + testAccSdwanSystemNTPProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemNTPPrerequisitesProfileParcelConfig + testAccSdwanSystemNTPProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemNTPPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemNTPProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_ntp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemNTPProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_ntp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` servers = [{` + "\n"
+ config += ` hostname_ip_address = "1.1.1.1"` + "\n"
+ config += ` authentication_key = 41673` + "\n"
+ config += ` vpn = 1` + "\n"
+ config += ` ntp_version = 4` + "\n"
+ config += ` source_interface = "Ethernet"` + "\n"
+ config += ` prefer_this_ntp_server = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` authentication_keys = [{` + "\n"
+ config += ` key_id = 49737` + "\n"
+ config += ` md5_value = "$CRYPT_CLUSTER"` + "\n"
+ config += ` }]` + "\n"
+ config += ` trusted_keys = [49737]` + "\n"
+ config += ` authoritative_ntp_server = false` + "\n"
+ config += ` stratum = 1` + "\n"
+ config += ` source_interface = "ATM"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_ntp_profile_parcel.go b/internal/provider/resource_sdwan_system_ntp_profile_parcel.go
deleted file mode 100644
index 511ce9ff5..000000000
--- a/internal/provider/resource_sdwan_system_ntp_profile_parcel.go
+++ /dev/null
@@ -1,383 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &SystemNTPProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemNTPProfileParcelResource{}
-
-func NewSystemNTPProfileParcelResource() resource.Resource {
- return &SystemNTPProfileParcelResource{}
-}
-
-type SystemNTPProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemNTPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_ntp_profile_parcel"
-}
-
-func (r *SystemNTPProfileParcelResource) 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 System NTP 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,
- Optional: true,
- },
- "servers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure NTP servers").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "hostname_ip_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set hostname or IP address of server").String,
- Optional: true,
- },
- "hostname_ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "authentication_key": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set authentication key for the server").AddIntegerRangeDescription(1, 65535).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65535),
- },
- },
- "authentication_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set VPN in which NTP server is located").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65530),
- },
- },
- "vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ntp_version": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NTP version").AddIntegerRangeDescription(1, 4).AddDefaultValueDescription("4").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4),
- },
- },
- "ntp_version_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface to use to reach NTP server").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "prefer_this_ntp_server": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Prefer this NTP server").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "prefer_this_ntp_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "authentication_keys": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set MD5 authentication key").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "key_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("MD5 authentication key ID").AddIntegerRangeDescription(1, 65535).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65535),
- },
- },
- "key_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "md5_value": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enter cleartext or AES-encrypted MD5 authentication key").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "md5_value_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "trusted_keys": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Designate authentication key as trustworthy").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "trusted_keys_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "authoritative_ntp_server": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable device as NTP Leader").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "authoritative_ntp_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "stratum": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable device as NTP Leader").AddIntegerRangeDescription(1, 15).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 15),
- },
- },
- "stratum_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable device as NTP Leader").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *SystemNTPProfileParcelResource) 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 *SystemNTPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemNTP
-
- // 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 *SystemNTPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemNTP
-
- // 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 *SystemNTPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemNTP
-
- // 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 *SystemNTPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemNTP
-
- // 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 *SystemNTPProfileParcelResource) 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_system_ntp_profile_parcel_test.go b/internal/provider/resource_sdwan_system_ntp_profile_parcel_test.go
deleted file mode 100644
index d3b46fa7e..000000000
--- a/internal/provider/resource_sdwan_system_ntp_profile_parcel_test.go
+++ /dev/null
@@ -1,112 +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 TestAccSdwanSystemNTPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "servers.0.hostname_ip_address", "1.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "servers.0.authentication_key", "41673"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "servers.0.vpn", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "servers.0.ntp_version", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "servers.0.source_interface", "Ethernet"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "servers.0.prefer_this_ntp_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "authentication_keys.0.key_id", "49737"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "authentication_keys.0.md5_value", "$CRYPT_CLUSTER"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "authoritative_ntp_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "stratum", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_ntp_profile_parcel.test", "source_interface", "ATM"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemNTPPrerequisitesProfileParcelConfig + testAccSdwanSystemNTPProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemNTPPrerequisitesProfileParcelConfig + testAccSdwanSystemNTPProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemNTPPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemNTPProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_ntp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemNTPProfileParcelConfig_all() string {
- config := `resource "sdwan_system_ntp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` servers = [{` + "\n"
- config += ` hostname_ip_address = "1.1.1.1"` + "\n"
- config += ` authentication_key = 41673` + "\n"
- config += ` vpn = 1` + "\n"
- config += ` ntp_version = 4` + "\n"
- config += ` source_interface = "Ethernet"` + "\n"
- config += ` prefer_this_ntp_server = false` + "\n"
- config += ` }]` + "\n"
- config += ` authentication_keys = [{` + "\n"
- config += ` key_id = 49737` + "\n"
- config += ` md5_value = "$CRYPT_CLUSTER"` + "\n"
- config += ` }]` + "\n"
- config += ` trusted_keys = [49737]` + "\n"
- config += ` authoritative_ntp_server = false` + "\n"
- config += ` stratum = 1` + "\n"
- config += ` source_interface = "ATM"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_omp_feature.go b/internal/provider/resource_sdwan_system_omp_feature.go
new file mode 100644
index 000000000..a2da471f2
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_omp_feature.go
@@ -0,0 +1,497 @@
+// 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-validators/int64validator"
+ "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 = &SystemOMPProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemOMPProfileParcelResource{}
+
+func NewSystemOMPProfileParcelResource() resource.Resource {
+ return &SystemOMPProfileParcelResource{}
+}
+
+type SystemOMPProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemOMPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_omp_feature"
+}
+
+func (r *SystemOMPProfileParcelResource) 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 System OMP Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "graceful_restart": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Graceful Restart for OMP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "graceful_restart_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "overlay_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Overlay AS Number").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "overlay_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "paths_advertised_per_prefix": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Number of Paths Advertised per Prefix").AddIntegerRangeDescription(1, 16).AddDefaultValueDescription("4").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 16),
+ },
+ },
+ "paths_advertised_per_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ecmp_limit": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of OMP paths to install in cEdge route table").AddIntegerRangeDescription(1, 0).AddDefaultValueDescription("4").String,
+ Optional: true,
+ },
+ "ecmp_limit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shutdown").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "omp_admin_distance_ipv4": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv4").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("251").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "omp_admin_distance_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "omp_admin_distance_ipv6": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv6").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("251").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "omp_admin_distance_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertisement_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Advertisement Interval (seconds)").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("1").String,
+ Optional: true,
+ },
+ "advertisement_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "graceful_restart_timer": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Graceful Restart Timer (seconds)").AddIntegerRangeDescription(1, 604800).AddDefaultValueDescription("43200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 604800),
+ },
+ },
+ "graceful_restart_timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "eor_timer": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("EOR Timer").AddIntegerRangeDescription(1, 3600).AddDefaultValueDescription("300").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 3600),
+ },
+ },
+ "eor_timer_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "holdtime": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Hold Time (seconds)").AddDefaultValueDescription("60").String,
+ Optional: true,
+ },
+ "holdtime_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_bgp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv4_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_ospf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv4_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_ospf_v3": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OSPFV3").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv4_ospf_v3_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_connected": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Connected").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "advertise_ipv4_connected_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_static": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Static").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "advertise_ipv4_static_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_eigrp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("EIGRP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv4_eigrp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_lisp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("LISP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv4_lisp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv4_isis": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ISIS").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv4_isis_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv6_bgp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv6_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv6_ospf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv6_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv6_connected": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Connected").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv6_connected_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv6_static": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Static").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv6_static_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv6_eigrp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("EIGRP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv6_eigrp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv6_lisp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("LISP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv6_lisp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "advertise_ipv6_isis": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ISIS").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "advertise_ipv6_isis_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ignore_region_path_length": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Treat hierarchical and direct (secondary region) paths equally").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ignore_region_path_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "transport_gateway": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Transport Gateway Path Behavior").AddStringEnumDescription("prefer", "ecmp-with-direct-path").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("prefer", "ecmp-with-direct-path"),
+ },
+ },
+ "transport_gateway_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "site_types": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Site Types").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "site_types_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *SystemOMPProfileParcelResource) 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 *SystemOMPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemOMP
+
+ // 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 *SystemOMPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemOMP
+
+ // 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 *SystemOMPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemOMP
+
+ // 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 *SystemOMPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemOMP
+
+ // 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 *SystemOMPProfileParcelResource) 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_system_omp_feature_test.go b/internal/provider/resource_sdwan_system_omp_feature_test.go
new file mode 100644
index 000000000..3200a299a
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_omp_feature_test.go
@@ -0,0 +1,142 @@
+// 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 TestAccSdwanSystemOMPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "graceful_restart", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "overlay_as", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "paths_advertised_per_prefix", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "ecmp_limit", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "omp_admin_distance_ipv4", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "omp_admin_distance_ipv6", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertisement_interval", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "graceful_restart_timer", "43200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "eor_timer", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "holdtime", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_ospf_v3", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_connected", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_static", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_eigrp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_lisp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv4_isis", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv6_bgp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv6_ospf", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv6_connected", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv6_static", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv6_eigrp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv6_lisp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "advertise_ipv6_isis", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "ignore_region_path_length", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_feature.test", "transport_gateway", "prefer"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemOMPPrerequisitesProfileParcelConfig + testAccSdwanSystemOMPProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemOMPPrerequisitesProfileParcelConfig + testAccSdwanSystemOMPProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemOMPPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemOMPProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_omp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemOMPProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_omp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` graceful_restart = true` + "\n"
+ config += ` overlay_as = 10` + "\n"
+ config += ` paths_advertised_per_prefix = 4` + "\n"
+ config += ` ecmp_limit = 4` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` omp_admin_distance_ipv4 = 10` + "\n"
+ config += ` omp_admin_distance_ipv6 = 20` + "\n"
+ config += ` advertisement_interval = 1` + "\n"
+ config += ` graceful_restart_timer = 43200` + "\n"
+ config += ` eor_timer = 300` + "\n"
+ config += ` holdtime = 60` + "\n"
+ config += ` advertise_ipv4_bgp = false` + "\n"
+ config += ` advertise_ipv4_ospf = false` + "\n"
+ config += ` advertise_ipv4_ospf_v3 = false` + "\n"
+ config += ` advertise_ipv4_connected = false` + "\n"
+ config += ` advertise_ipv4_static = false` + "\n"
+ config += ` advertise_ipv4_eigrp = false` + "\n"
+ config += ` advertise_ipv4_lisp = false` + "\n"
+ config += ` advertise_ipv4_isis = false` + "\n"
+ config += ` advertise_ipv6_bgp = true` + "\n"
+ config += ` advertise_ipv6_ospf = true` + "\n"
+ config += ` advertise_ipv6_connected = true` + "\n"
+ config += ` advertise_ipv6_static = true` + "\n"
+ config += ` advertise_ipv6_eigrp = true` + "\n"
+ config += ` advertise_ipv6_lisp = true` + "\n"
+ config += ` advertise_ipv6_isis = true` + "\n"
+ config += ` ignore_region_path_length = false` + "\n"
+ config += ` transport_gateway = "prefer"` + "\n"
+ config += ` site_types = ["type-1"]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_omp_profile_parcel.go b/internal/provider/resource_sdwan_system_omp_profile_parcel.go
deleted file mode 100644
index 41845edbb..000000000
--- a/internal/provider/resource_sdwan_system_omp_profile_parcel.go
+++ /dev/null
@@ -1,497 +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-validators/int64validator"
- "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 = &SystemOMPProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemOMPProfileParcelResource{}
-
-func NewSystemOMPProfileParcelResource() resource.Resource {
- return &SystemOMPProfileParcelResource{}
-}
-
-type SystemOMPProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemOMPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_omp_profile_parcel"
-}
-
-func (r *SystemOMPProfileParcelResource) 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 System OMP 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,
- },
- "graceful_restart": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Graceful Restart for OMP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "graceful_restart_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "overlay_as": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Overlay AS Number").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "overlay_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "paths_advertised_per_prefix": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Number of Paths Advertised per Prefix").AddIntegerRangeDescription(1, 16).AddDefaultValueDescription("4").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 16),
- },
- },
- "paths_advertised_per_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ecmp_limit": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of OMP paths to install in cEdge route table").AddIntegerRangeDescription(1, 0).AddDefaultValueDescription("4").String,
- Optional: true,
- },
- "ecmp_limit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shutdown").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "omp_admin_distance_ipv4": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv4").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("251").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "omp_admin_distance_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "omp_admin_distance_ipv6": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("OMP Admin Distance IPv6").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("251").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "omp_admin_distance_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertisement_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Advertisement Interval (seconds)").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("1").String,
- Optional: true,
- },
- "advertisement_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "graceful_restart_timer": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Graceful Restart Timer (seconds)").AddIntegerRangeDescription(1, 604800).AddDefaultValueDescription("43200").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 604800),
- },
- },
- "graceful_restart_timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "eor_timer": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("EOR Timer").AddIntegerRangeDescription(1, 3600).AddDefaultValueDescription("300").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 3600),
- },
- },
- "eor_timer_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "holdtime": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Hold Time (seconds)").AddDefaultValueDescription("60").String,
- Optional: true,
- },
- "holdtime_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_bgp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("BGP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv4_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_ospf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("OSPF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv4_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_ospf_v3": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("OSPFV3").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv4_ospf_v3_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_connected": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Connected").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "advertise_ipv4_connected_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_static": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Static").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "advertise_ipv4_static_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_eigrp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("EIGRP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv4_eigrp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_lisp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("LISP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv4_lisp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv4_isis": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("ISIS").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv4_isis_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv6_bgp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("BGP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv6_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv6_ospf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("OSPF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv6_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv6_connected": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Connected").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv6_connected_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv6_static": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Static").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv6_static_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv6_eigrp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("EIGRP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv6_eigrp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv6_lisp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("LISP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv6_lisp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "advertise_ipv6_isis": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("ISIS").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "advertise_ipv6_isis_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ignore_region_path_length": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Treat hierarchical and direct (secondary region) paths equally").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ignore_region_path_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "transport_gateway": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Transport Gateway Path Behavior").AddStringEnumDescription("prefer", "ecmp-with-direct-path").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("prefer", "ecmp-with-direct-path"),
- },
- },
- "transport_gateway_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "site_types": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Site Types").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "site_types_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *SystemOMPProfileParcelResource) 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 *SystemOMPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemOMP
-
- // 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 *SystemOMPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemOMP
-
- // 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 *SystemOMPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemOMP
-
- // 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 *SystemOMPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemOMP
-
- // 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 *SystemOMPProfileParcelResource) 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_system_omp_profile_parcel_test.go b/internal/provider/resource_sdwan_system_omp_profile_parcel_test.go
deleted file mode 100644
index 943e81a48..000000000
--- a/internal/provider/resource_sdwan_system_omp_profile_parcel_test.go
+++ /dev/null
@@ -1,142 +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 TestAccSdwanSystemOMPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "graceful_restart", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "overlay_as", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "paths_advertised_per_prefix", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "ecmp_limit", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "omp_admin_distance_ipv4", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "omp_admin_distance_ipv6", "20"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertisement_interval", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "graceful_restart_timer", "43200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "eor_timer", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "holdtime", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_ospf_v3", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_connected", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_static", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_eigrp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_lisp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv4_isis", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv6_bgp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv6_ospf", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv6_connected", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv6_static", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv6_eigrp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv6_lisp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "advertise_ipv6_isis", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "ignore_region_path_length", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_omp_profile_parcel.test", "transport_gateway", "prefer"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemOMPPrerequisitesProfileParcelConfig + testAccSdwanSystemOMPProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemOMPPrerequisitesProfileParcelConfig + testAccSdwanSystemOMPProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemOMPPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemOMPProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_omp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemOMPProfileParcelConfig_all() string {
- config := `resource "sdwan_system_omp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` graceful_restart = true` + "\n"
- config += ` overlay_as = 10` + "\n"
- config += ` paths_advertised_per_prefix = 4` + "\n"
- config += ` ecmp_limit = 4` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` omp_admin_distance_ipv4 = 10` + "\n"
- config += ` omp_admin_distance_ipv6 = 20` + "\n"
- config += ` advertisement_interval = 1` + "\n"
- config += ` graceful_restart_timer = 43200` + "\n"
- config += ` eor_timer = 300` + "\n"
- config += ` holdtime = 60` + "\n"
- config += ` advertise_ipv4_bgp = false` + "\n"
- config += ` advertise_ipv4_ospf = false` + "\n"
- config += ` advertise_ipv4_ospf_v3 = false` + "\n"
- config += ` advertise_ipv4_connected = false` + "\n"
- config += ` advertise_ipv4_static = false` + "\n"
- config += ` advertise_ipv4_eigrp = false` + "\n"
- config += ` advertise_ipv4_lisp = false` + "\n"
- config += ` advertise_ipv4_isis = false` + "\n"
- config += ` advertise_ipv6_bgp = true` + "\n"
- config += ` advertise_ipv6_ospf = true` + "\n"
- config += ` advertise_ipv6_connected = true` + "\n"
- config += ` advertise_ipv6_static = true` + "\n"
- config += ` advertise_ipv6_eigrp = true` + "\n"
- config += ` advertise_ipv6_lisp = true` + "\n"
- config += ` advertise_ipv6_isis = true` + "\n"
- config += ` ignore_region_path_length = false` + "\n"
- config += ` transport_gateway = "prefer"` + "\n"
- config += ` site_types = ["type-1"]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_performance_monitoring_feature.go b/internal/provider/resource_sdwan_system_performance_monitoring_feature.go
new file mode 100644
index 000000000..4f8c737c6
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_performance_monitoring_feature.go
@@ -0,0 +1,271 @@
+// 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-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 = &SystemPerformanceMonitoringProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemPerformanceMonitoringProfileParcelResource{}
+
+func NewSystemPerformanceMonitoringProfileParcelResource() resource.Resource {
+ return &SystemPerformanceMonitoringProfileParcelResource{}
+}
+
+type SystemPerformanceMonitoringProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemPerformanceMonitoringProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_performance_monitoring_feature"
+}
+
+func (r *SystemPerformanceMonitoringProfileParcelResource) 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 System Performance Monitoring Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "app_perf_monitor_enabled": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Application performance monitoring enable or disable").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "app_perf_monitor_app_group": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Application groups to be monitored").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "monitoring_config_enabled": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("UMTS monitoring enable or disable").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "monitoring_config_interval": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("UMTS monitoring interval(Minutes)").AddStringEnumDescription("30", "60").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("30", "60"),
+ },
+ },
+ "event_driven_config_enabled": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("UMTS event driven monitoring enable or disable").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "event_driven_events": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("UMTS events").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *SystemPerformanceMonitoringProfileParcelResource) 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 *SystemPerformanceMonitoringProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemPerformanceMonitoring
+
+ // 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 *SystemPerformanceMonitoringProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemPerformanceMonitoring
+
+ // 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 *SystemPerformanceMonitoringProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemPerformanceMonitoring
+
+ // 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 *SystemPerformanceMonitoringProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemPerformanceMonitoring
+
+ // 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 *SystemPerformanceMonitoringProfileParcelResource) 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_system_performance_monitoring_feature_test.go b/internal/provider/resource_sdwan_system_performance_monitoring_feature_test.go
new file mode 100644
index 000000000..5f1c28794
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_performance_monitoring_feature_test.go
@@ -0,0 +1,95 @@
+// 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 TestAccSdwanSystemPerformanceMonitoringProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_feature.test", "app_perf_monitor_enabled", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_feature.test", "monitoring_config_enabled", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_feature.test", "monitoring_config_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_feature.test", "event_driven_config_enabled", "true"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig + testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig + testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_performance_monitoring_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_performance_monitoring_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` app_perf_monitor_enabled = true` + "\n"
+ config += ` app_perf_monitor_app_group = ["amazon-group"]` + "\n"
+ config += ` monitoring_config_enabled = true` + "\n"
+ config += ` monitoring_config_interval = "30"` + "\n"
+ config += ` event_driven_config_enabled = true` + "\n"
+ config += ` event_driven_events = ["SLA_CHANGE"]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_performance_monitoring_profile_parcel.go b/internal/provider/resource_sdwan_system_performance_monitoring_profile_parcel.go
deleted file mode 100644
index a285dc07b..000000000
--- a/internal/provider/resource_sdwan_system_performance_monitoring_profile_parcel.go
+++ /dev/null
@@ -1,271 +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-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 = &SystemPerformanceMonitoringProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemPerformanceMonitoringProfileParcelResource{}
-
-func NewSystemPerformanceMonitoringProfileParcelResource() resource.Resource {
- return &SystemPerformanceMonitoringProfileParcelResource{}
-}
-
-type SystemPerformanceMonitoringProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemPerformanceMonitoringProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_performance_monitoring_profile_parcel"
-}
-
-func (r *SystemPerformanceMonitoringProfileParcelResource) 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 System Performance Monitoring 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,
- Optional: true,
- },
- "app_perf_monitor_enabled": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Application performance monitoring enable or disable").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "app_perf_monitor_app_group": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Application groups to be monitored").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "monitoring_config_enabled": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("UMTS monitoring enable or disable").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "monitoring_config_interval": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("UMTS monitoring interval(Minutes)").AddStringEnumDescription("30", "60").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("30", "60"),
- },
- },
- "event_driven_config_enabled": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("UMTS event driven monitoring enable or disable").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "event_driven_events": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("UMTS events").String,
- ElementType: types.StringType,
- Optional: true,
- },
- },
- }
-}
-
-func (r *SystemPerformanceMonitoringProfileParcelResource) 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 *SystemPerformanceMonitoringProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemPerformanceMonitoring
-
- // 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 *SystemPerformanceMonitoringProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemPerformanceMonitoring
-
- // 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 *SystemPerformanceMonitoringProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemPerformanceMonitoring
-
- // 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 *SystemPerformanceMonitoringProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemPerformanceMonitoring
-
- // 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 *SystemPerformanceMonitoringProfileParcelResource) 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_system_performance_monitoring_profile_parcel_test.go b/internal/provider/resource_sdwan_system_performance_monitoring_profile_parcel_test.go
deleted file mode 100644
index aa8949781..000000000
--- a/internal/provider/resource_sdwan_system_performance_monitoring_profile_parcel_test.go
+++ /dev/null
@@ -1,95 +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 TestAccSdwanSystemPerformanceMonitoringProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_profile_parcel.test", "app_perf_monitor_enabled", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_profile_parcel.test", "monitoring_config_enabled", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_profile_parcel.test", "monitoring_config_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_performance_monitoring_profile_parcel.test", "event_driven_config_enabled", "true"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig + testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig + testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemPerformanceMonitoringPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_performance_monitoring_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemPerformanceMonitoringProfileParcelConfig_all() string {
- config := `resource "sdwan_system_performance_monitoring_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` app_perf_monitor_enabled = true` + "\n"
- config += ` app_perf_monitor_app_group = ["amazon-group"]` + "\n"
- config += ` monitoring_config_enabled = true` + "\n"
- config += ` monitoring_config_interval = "30"` + "\n"
- config += ` event_driven_config_enabled = true` + "\n"
- config += ` event_driven_events = ["SLA_CHANGE"]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_remote_access_feature.go b/internal/provider/resource_sdwan_system_remote_access_feature.go
new file mode 100644
index 000000000..de2fb7bbc
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_remote_access_feature.go
@@ -0,0 +1,442 @@
+// 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-validators/int64validator"
+ "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 = &SystemRemoteAccessProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemRemoteAccessProfileParcelResource{}
+
+func NewSystemRemoteAccessProfileParcelResource() resource.Resource {
+ return &SystemRemoteAccessProfileParcelResource{}
+}
+
+type SystemRemoteAccessProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemRemoteAccessProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_remote_access_feature"
+}
+
+func (r *SystemRemoteAccessProfileParcelResource) 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 System Remote Access Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "connection_type_ssl": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enabled SSL VPN").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "any_connect_eap_authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("user", "device").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("user", "device"),
+ },
+ },
+ "ipv4_pool_size": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Pool Size").AddDefaultValueDescription("1000").String,
+ Optional: true,
+ },
+ "ipv4_pool_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_pool_size": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Pool Size").AddDefaultValueDescription("1024").String,
+ Optional: true,
+ },
+ "ipv6_pool_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "enable_certificate_list_check": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "enable_certificate_list_check_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "psk_authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("PSK Selection, Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("aaa", "group").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("aaa", "group"),
+ },
+ },
+ "psk_authentication_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "psk_authentication_pre_shared_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("PSK Pre Shared Key, Attribute conditional on `psk_authentication_type` being equal to `group`").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "psk_authentication_pre_shared_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "radius_group_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "radius_group_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "aaa_specify_name_policy_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "aaa_specify_name_policy_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "aaa_specify_name_policy_password": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "aaa_specify_name_policy_password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "aaa_derive_name_from_peer_identity": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "aaa_derive_name_from_peer_identity_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "aaa_derive_name_from_peer_domain": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "aaa_derive_name_from_peer_domain_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "aaa_enable_accounting": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Accounting").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "aaa_enable_accounting_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ikev2_local_ike_identity_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("EMAIL", "FQDN", "KEYID", "IPv4 ADDRESS", "IPv6 ADDRESS").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("EMAIL", "FQDN", "KEYID", "IPv4 ADDRESS", "IPv6 ADDRESS"),
+ },
+ },
+ "ikev2_local_ike_identity_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ikev2_local_ike_identity_value": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "ikev2_local_ike_identity_value_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ikev2_security_association_lifetime": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("86400").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(3600, 86400),
+ },
+ },
+ "ikev2_security_association_lifetime_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ikev2_anti_dos_threshold": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Anti-DOS Threshold, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(10, 1000).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(10, 1000),
+ },
+ },
+ "ikev2_anti_dos_threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_enable_anti_replay": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Anti-Replay, Attribute conditional on `connection_type_ssl` being equal to `false`").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "ipsec_enable_anti_replay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_anti_replay_window_size": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime, Attribute conditional on `ipsec_enable_anti_replay` being equal to `true`").AddDefaultValueDescription("64").String,
+ Optional: true,
+ },
+ "ipsec_anti_replay_window_size_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_security_association_lifetime": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("3600").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(3600, 86400),
+ },
+ },
+ "ipsec_security_association_lifetime_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_enable_perfect_foward_secrecy": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime, Attribute conditional on `connection_type_ssl` being equal to `false`").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipsec_enable_perfect_foward_secrecy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *SystemRemoteAccessProfileParcelResource) 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 *SystemRemoteAccessProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemRemoteAccess
+
+ // 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 *SystemRemoteAccessProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemRemoteAccess
+
+ // 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 *SystemRemoteAccessProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemRemoteAccess
+
+ // 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 *SystemRemoteAccessProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemRemoteAccess
+
+ // 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 *SystemRemoteAccessProfileParcelResource) 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_system_remote_access_feature_test.go b/internal/provider/resource_sdwan_system_remote_access_feature_test.go
new file mode 100644
index 000000000..8fb0bdaaa
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_remote_access_feature_test.go
@@ -0,0 +1,119 @@
+// 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 TestAccSdwanSystemRemoteAccessProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "connection_type_ssl", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "any_connect_eap_authentication_type", "user"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ipv4_pool_size", "50"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ipv6_pool_size", "1024"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "enable_certificate_list_check", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "psk_authentication_type", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "radius_group_name", "radius-1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "aaa_derive_name_from_peer_identity", "MyPassword"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "aaa_enable_accounting", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ikev2_local_ike_identity_type", "EMAIL"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ikev2_local_ike_identity_value", "abc@xyz.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ikev2_security_association_lifetime", "86400"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ikev2_anti_dos_threshold", "99"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ipsec_enable_anti_replay", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ipsec_security_association_lifetime", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_feature.test", "ipsec_enable_perfect_foward_secrecy", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemRemoteAccessProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemRemoteAccessProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemRemoteAccessProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_remote_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` any_connect_eap_authentication_type = "user"` + "\n"
+ config += ` radius_group_name = "radius-1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemRemoteAccessProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_remote_access_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` connection_type_ssl = false` + "\n"
+ config += ` any_connect_eap_authentication_type = "user"` + "\n"
+ config += ` ipv4_pool_size = 50` + "\n"
+ config += ` ipv6_pool_size = 1024` + "\n"
+ config += ` enable_certificate_list_check = false` + "\n"
+ config += ` psk_authentication_type = "aaa"` + "\n"
+ config += ` radius_group_name = "radius-1"` + "\n"
+ config += ` aaa_derive_name_from_peer_identity = "MyPassword"` + "\n"
+ config += ` aaa_enable_accounting = false` + "\n"
+ config += ` ikev2_local_ike_identity_type = "EMAIL"` + "\n"
+ config += ` ikev2_local_ike_identity_value = "abc@xyz.com"` + "\n"
+ config += ` ikev2_security_association_lifetime = 86400` + "\n"
+ config += ` ikev2_anti_dos_threshold = 99` + "\n"
+ config += ` ipsec_enable_anti_replay = false` + "\n"
+ config += ` ipsec_security_association_lifetime = 3600` + "\n"
+ config += ` ipsec_enable_perfect_foward_secrecy = false` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_remote_access_profile_parcel.go b/internal/provider/resource_sdwan_system_remote_access_profile_parcel.go
deleted file mode 100644
index 85a51a955..000000000
--- a/internal/provider/resource_sdwan_system_remote_access_profile_parcel.go
+++ /dev/null
@@ -1,442 +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-validators/int64validator"
- "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 = &SystemRemoteAccessProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemRemoteAccessProfileParcelResource{}
-
-func NewSystemRemoteAccessProfileParcelResource() resource.Resource {
- return &SystemRemoteAccessProfileParcelResource{}
-}
-
-type SystemRemoteAccessProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemRemoteAccessProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_remote_access_profile_parcel"
-}
-
-func (r *SystemRemoteAccessProfileParcelResource) 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 System Remote Access 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,
- Optional: true,
- },
- "connection_type_ssl": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enabled SSL VPN").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "any_connect_eap_authentication_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("user", "device").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("user", "device"),
- },
- },
- "ipv4_pool_size": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Pool Size").AddDefaultValueDescription("1000").String,
- Optional: true,
- },
- "ipv4_pool_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_pool_size": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Pool Size").AddDefaultValueDescription("1024").String,
- Optional: true,
- },
- "ipv6_pool_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "enable_certificate_list_check": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "enable_certificate_list_check_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "psk_authentication_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("PSK Selection, Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("aaa", "group").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("aaa", "group"),
- },
- },
- "psk_authentication_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "psk_authentication_pre_shared_key": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("PSK Pre Shared Key, Attribute conditional on `psk_authentication_type` being equal to `group`").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 25),
- },
- },
- "psk_authentication_pre_shared_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "radius_group_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "radius_group_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "aaa_specify_name_policy_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "aaa_specify_name_policy_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "aaa_specify_name_policy_password": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 25),
- },
- },
- "aaa_specify_name_policy_password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "aaa_derive_name_from_peer_identity": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 25),
- },
- },
- "aaa_derive_name_from_peer_identity_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "aaa_derive_name_from_peer_domain": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 25),
- },
- },
- "aaa_derive_name_from_peer_domain_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "aaa_enable_accounting": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable Accounting").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "aaa_enable_accounting_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ikev2_local_ike_identity_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("EMAIL", "FQDN", "KEYID", "IPv4 ADDRESS", "IPv6 ADDRESS").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("EMAIL", "FQDN", "KEYID", "IPv4 ADDRESS", "IPv6 ADDRESS"),
- },
- },
- "ikev2_local_ike_identity_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ikev2_local_ike_identity_value": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "ikev2_local_ike_identity_value_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ikev2_security_association_lifetime": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("86400").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(3600, 86400),
- },
- },
- "ikev2_security_association_lifetime_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ikev2_anti_dos_threshold": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Anti-DOS Threshold, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(10, 1000).AddDefaultValueDescription("100").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(10, 1000),
- },
- },
- "ikev2_anti_dos_threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_enable_anti_replay": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable Anti-Replay, Attribute conditional on `connection_type_ssl` being equal to `false`").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "ipsec_enable_anti_replay_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_anti_replay_window_size": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime, Attribute conditional on `ipsec_enable_anti_replay` being equal to `true`").AddDefaultValueDescription("64").String,
- Optional: true,
- },
- "ipsec_anti_replay_window_size_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_security_association_lifetime": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("3600").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(3600, 86400),
- },
- },
- "ipsec_security_association_lifetime_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_enable_perfect_foward_secrecy": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime, Attribute conditional on `connection_type_ssl` being equal to `false`").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipsec_enable_perfect_foward_secrecy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *SystemRemoteAccessProfileParcelResource) 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 *SystemRemoteAccessProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemRemoteAccess
-
- // 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 *SystemRemoteAccessProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemRemoteAccess
-
- // 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 *SystemRemoteAccessProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemRemoteAccess
-
- // 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 *SystemRemoteAccessProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemRemoteAccess
-
- // 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 *SystemRemoteAccessProfileParcelResource) 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_system_remote_access_profile_parcel_test.go b/internal/provider/resource_sdwan_system_remote_access_profile_parcel_test.go
deleted file mode 100644
index 10e0a656e..000000000
--- a/internal/provider/resource_sdwan_system_remote_access_profile_parcel_test.go
+++ /dev/null
@@ -1,123 +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 TestAccSdwanSystemRemoteAccessProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "connection_type_ssl", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_authentication_type", "user"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipv4_pool_size", "50"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipv6_pool_size", "1024"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "enable_certificate_list_check", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "psk_authentication_type", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "psk_authentication_pre_shared_key", "Cisco123"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "radius_group_name", "radius-1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "aaa_derive_name_from_peer_identity", "MyPassword"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "aaa_enable_accounting", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_type", "EMAIL"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_value", "abc@xyz.com"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ikev2_security_association_lifetime", "86400"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ikev2_anti_dos_threshold", "99"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipsec_enable_anti_replay", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipsec_anti_replay_window_size", "64"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipsec_security_association_lifetime", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipsec_enable_perfect_foward_secrecy", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemRemoteAccessProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig + testAccSdwanSystemRemoteAccessProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemRemoteAccessPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemRemoteAccessProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_remote_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` any_connect_eap_authentication_type = "user"` + "\n"
- config += ` radius_group_name = "radius-1"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemRemoteAccessProfileParcelConfig_all() string {
- config := `resource "sdwan_system_remote_access_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` connection_type_ssl = false` + "\n"
- config += ` any_connect_eap_authentication_type = "user"` + "\n"
- config += ` ipv4_pool_size = 50` + "\n"
- config += ` ipv6_pool_size = 1024` + "\n"
- config += ` enable_certificate_list_check = false` + "\n"
- config += ` psk_authentication_type = "aaa"` + "\n"
- config += ` psk_authentication_pre_shared_key = "Cisco123"` + "\n"
- config += ` radius_group_name = "radius-1"` + "\n"
- config += ` aaa_derive_name_from_peer_identity = "MyPassword"` + "\n"
- config += ` aaa_enable_accounting = false` + "\n"
- config += ` ikev2_local_ike_identity_type = "EMAIL"` + "\n"
- config += ` ikev2_local_ike_identity_value = "abc@xyz.com"` + "\n"
- config += ` ikev2_security_association_lifetime = 86400` + "\n"
- config += ` ikev2_anti_dos_threshold = 99` + "\n"
- config += ` ipsec_enable_anti_replay = false` + "\n"
- config += ` ipsec_anti_replay_window_size = 64` + "\n"
- config += ` ipsec_security_association_lifetime = 3600` + "\n"
- config += ` ipsec_enable_perfect_foward_secrecy = false` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_security_feature.go b/internal/provider/resource_sdwan_system_security_feature.go
new file mode 100644
index 000000000..a90f482a6
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_security_feature.go
@@ -0,0 +1,457 @@
+// 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-validators/int64validator"
+ "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 = &SystemSecurityProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemSecurityProfileParcelResource{}
+
+func NewSystemSecurityProfileParcelResource() resource.Resource {
+ return &SystemSecurityProfileParcelResource{}
+}
+
+type SystemSecurityProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemSecurityProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_security_feature"
+}
+
+func (r *SystemSecurityProfileParcelResource) 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 System Security Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "rekey": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how often to change the AES key for DTLS connections").AddIntegerRangeDescription(10, 1209600).AddDefaultValueDescription("86400").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(10, 1209600),
+ },
+ },
+ "rekey_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "anti_replay_window": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the sliding replay window size").AddStringEnumDescription("64", "128", "256", "512", "1024", "2048", "4096", "8192").AddDefaultValueDescription("512").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("64", "128", "256", "512", "1024", "2048", "4096", "8192"),
+ },
+ },
+ "anti_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "extended_anti_replay_window": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Extended Anti-Replay Window").AddIntegerRangeDescription(10, 2048).AddDefaultValueDescription("256").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(10, 2048),
+ },
+ },
+ "extended_anti_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_pairwise_keying": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable IPsec pairwise-keying").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipsec_pairwise_keying_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "integrity_type": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the authentication type for DTLS connections").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "integrity_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "keychains": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure a Keychain").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "key_chain_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify the name of the Keychain").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtMost(236),
+ },
+ },
+ "key_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify the Key ID").AddIntegerRangeDescription(0, 2147483647).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(2147483647),
+ },
+ },
+ },
+ },
+ },
+ "keys": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure a Key").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select the Key ID").String,
+ Optional: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select the chain name").String,
+ Optional: true,
+ },
+ "send_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify the Send ID").AddIntegerRangeDescription(0, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(255),
+ },
+ },
+ "send_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "receiver_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify the Receiver ID").AddIntegerRangeDescription(0, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(255),
+ },
+ },
+ "receiver_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "include_tcp_options": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Include TCP Options").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "include_tcp_options_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "accept_ao_mismatch": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Accept AO Mismatch").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "accept_ao_mismatch_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "crypto_algorithm": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Crypto Algorithm").AddStringEnumDescription("aes-128-cmac", "hmac-sha-1", "hmac-sha-256").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("aes-128-cmac", "hmac-sha-1", "hmac-sha-256"),
+ },
+ },
+ "key_string": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify the Key String").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "key_string_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_life_time_local": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Send lifetime Local").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "send_life_time_local_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_life_time_start_epoch": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime start time").String,
+ Optional: true,
+ },
+ "send_life_time_infinite": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Infinite lifetime").String,
+ Optional: true,
+ },
+ "send_life_time_infinite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_life_time_duration": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send lifetime Duration (seconds)").AddIntegerRangeDescription(1, 2147483646).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 2147483646),
+ },
+ },
+ "send_life_time_duration_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_life_time_exact": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime end time").String,
+ Optional: true,
+ },
+ "accept_life_time_local": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Send lifetime Local").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "accept_life_time_local_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "accept_life_time_start_epoch": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime start time").String,
+ Optional: true,
+ },
+ "accept_life_time_infinite": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Infinite lifetime").String,
+ Optional: true,
+ },
+ "accept_life_time_infinite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "accept_life_time_duration": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send lifetime Duration (seconds)").AddIntegerRangeDescription(1, 2147483646).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 2147483646),
+ },
+ },
+ "accept_life_time_duration_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "accept_life_time_exact": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime end time").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemSecurityProfileParcelResource) 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 *SystemSecurityProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemSecurity
+
+ // 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 *SystemSecurityProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemSecurity
+
+ // 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 *SystemSecurityProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemSecurity
+
+ // 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 *SystemSecurityProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemSecurity
+
+ // 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 *SystemSecurityProfileParcelResource) 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_system_security_feature_test.go b/internal/provider/resource_sdwan_system_security_feature_test.go
new file mode 100644
index 000000000..70451ef47
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_security_feature_test.go
@@ -0,0 +1,129 @@
+// 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 TestAccSdwanSystemSecurityProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "rekey", "86400"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "anti_replay_window", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "extended_anti_replay_window", "256"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "ipsec_pairwise_keying", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keychains.0.key_chain_name", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keychains.0.key_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.id", "0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.name", "aaa"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.send_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.receiver_id", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.include_tcp_options", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.accept_ao_mismatch", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.crypto_algorithm", "aes-128-cmac"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.send_life_time_local", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.send_life_time_start_epoch", "1659284400"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.send_life_time_infinite", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.accept_life_time_local", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.accept_life_time_start_epoch", "1659284400"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_feature.test", "keys.0.accept_life_time_infinite", "true"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemSecurityPrerequisitesProfileParcelConfig + testAccSdwanSystemSecurityProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemSecurityPrerequisitesProfileParcelConfig + testAccSdwanSystemSecurityProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemSecurityPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemSecurityProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_security_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemSecurityProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_security_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` rekey = 86400` + "\n"
+ config += ` anti_replay_window = "512"` + "\n"
+ config += ` extended_anti_replay_window = 256` + "\n"
+ config += ` ipsec_pairwise_keying = false` + "\n"
+ config += ` integrity_type = ["esp"]` + "\n"
+ config += ` keychains = [{` + "\n"
+ config += ` key_chain_name = "aaa"` + "\n"
+ config += ` key_id = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` keys = [{` + "\n"
+ config += ` id = 0` + "\n"
+ config += ` name = "aaa"` + "\n"
+ config += ` send_id = 1` + "\n"
+ config += ` receiver_id = 2` + "\n"
+ config += ` include_tcp_options = false` + "\n"
+ config += ` accept_ao_mismatch = false` + "\n"
+ config += ` crypto_algorithm = "aes-128-cmac"` + "\n"
+ config += ` key_string = "abcabc"` + "\n"
+ config += ` send_life_time_local = true` + "\n"
+ config += ` send_life_time_start_epoch = 1659284400` + "\n"
+ config += ` send_life_time_infinite = true` + "\n"
+ config += ` accept_life_time_local = true` + "\n"
+ config += ` accept_life_time_start_epoch = 1659284400` + "\n"
+ config += ` accept_life_time_infinite = true` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_security_profile_parcel.go b/internal/provider/resource_sdwan_system_security_profile_parcel.go
deleted file mode 100644
index 84a4a9329..000000000
--- a/internal/provider/resource_sdwan_system_security_profile_parcel.go
+++ /dev/null
@@ -1,457 +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-validators/int64validator"
- "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 = &SystemSecurityProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemSecurityProfileParcelResource{}
-
-func NewSystemSecurityProfileParcelResource() resource.Resource {
- return &SystemSecurityProfileParcelResource{}
-}
-
-type SystemSecurityProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemSecurityProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_security_profile_parcel"
-}
-
-func (r *SystemSecurityProfileParcelResource) 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 System Security 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,
- Optional: true,
- },
- "rekey": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set how often to change the AES key for DTLS connections").AddIntegerRangeDescription(10, 1209600).AddDefaultValueDescription("86400").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(10, 1209600),
- },
- },
- "rekey_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "anti_replay_window": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the sliding replay window size").AddStringEnumDescription("64", "128", "256", "512", "1024", "2048", "4096", "8192").AddDefaultValueDescription("512").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("64", "128", "256", "512", "1024", "2048", "4096", "8192"),
- },
- },
- "anti_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "extended_anti_replay_window": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Extended Anti-Replay Window").AddIntegerRangeDescription(10, 2048).AddDefaultValueDescription("256").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(10, 2048),
- },
- },
- "extended_anti_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_pairwise_keying": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable or disable IPsec pairwise-keying").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipsec_pairwise_keying_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "integrity_type": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the authentication type for DTLS connections").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "integrity_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "keychains": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure a Keychain").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "key_chain_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify the name of the Keychain").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtMost(236),
- },
- },
- "key_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify the Key ID").AddIntegerRangeDescription(0, 2147483647).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(2147483647),
- },
- },
- },
- },
- },
- "keys": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure a Key").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Select the Key ID").String,
- Optional: true,
- },
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Select the chain name").String,
- Optional: true,
- },
- "send_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify the Send ID").AddIntegerRangeDescription(0, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(255),
- },
- },
- "send_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "receiver_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify the Receiver ID").AddIntegerRangeDescription(0, 255).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(255),
- },
- },
- "receiver_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "include_tcp_options": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Include TCP Options").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "include_tcp_options_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "accept_ao_mismatch": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Accept AO Mismatch").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "accept_ao_mismatch_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "crypto_algorithm": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Crypto Algorithm").AddStringEnumDescription("aes-128-cmac", "hmac-sha-1", "hmac-sha-256").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("aes-128-cmac", "hmac-sha-1", "hmac-sha-256"),
- },
- },
- "key_string": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify the Key String").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "key_string_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_life_time_local": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Send lifetime Local").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "send_life_time_local_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_life_time_start_epoch": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime start time").String,
- Optional: true,
- },
- "send_life_time_infinite": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Infinite lifetime").String,
- Optional: true,
- },
- "send_life_time_infinite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_life_time_duration": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send lifetime Duration (seconds)").AddIntegerRangeDescription(1, 2147483646).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2147483646),
- },
- },
- "send_life_time_duration_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_life_time_exact": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime end time").String,
- Optional: true,
- },
- "accept_life_time_local": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Send lifetime Local").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "accept_life_time_local_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "accept_life_time_start_epoch": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime start time").String,
- Optional: true,
- },
- "accept_life_time_infinite": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Infinite lifetime").String,
- Optional: true,
- },
- "accept_life_time_infinite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "accept_life_time_duration": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send lifetime Duration (seconds)").AddIntegerRangeDescription(1, 2147483646).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2147483646),
- },
- },
- "accept_life_time_duration_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "accept_life_time_exact": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Key lifetime end time").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *SystemSecurityProfileParcelResource) 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 *SystemSecurityProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemSecurity
-
- // 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 *SystemSecurityProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemSecurity
-
- // 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 *SystemSecurityProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemSecurity
-
- // 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 *SystemSecurityProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemSecurity
-
- // 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 *SystemSecurityProfileParcelResource) 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_system_security_profile_parcel_test.go b/internal/provider/resource_sdwan_system_security_profile_parcel_test.go
deleted file mode 100644
index 703e7ffde..000000000
--- a/internal/provider/resource_sdwan_system_security_profile_parcel_test.go
+++ /dev/null
@@ -1,129 +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 TestAccSdwanSystemSecurityProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "rekey", "86400"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "anti_replay_window", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "extended_anti_replay_window", "256"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "ipsec_pairwise_keying", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keychains.0.key_chain_name", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keychains.0.key_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.id", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.name", "aaa"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.send_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.receiver_id", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.include_tcp_options", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.accept_ao_mismatch", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.crypto_algorithm", "aes-128-cmac"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.send_life_time_local", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.send_life_time_start_epoch", "1659284400"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.send_life_time_infinite", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.accept_life_time_local", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.accept_life_time_start_epoch", "1659284400"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_security_profile_parcel.test", "keys.0.accept_life_time_infinite", "true"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemSecurityPrerequisitesProfileParcelConfig + testAccSdwanSystemSecurityProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemSecurityPrerequisitesProfileParcelConfig + testAccSdwanSystemSecurityProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemSecurityPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemSecurityProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_security_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemSecurityProfileParcelConfig_all() string {
- config := `resource "sdwan_system_security_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` rekey = 86400` + "\n"
- config += ` anti_replay_window = "512"` + "\n"
- config += ` extended_anti_replay_window = 256` + "\n"
- config += ` ipsec_pairwise_keying = false` + "\n"
- config += ` integrity_type = ["esp"]` + "\n"
- config += ` keychains = [{` + "\n"
- config += ` key_chain_name = "aaa"` + "\n"
- config += ` key_id = 1` + "\n"
- config += ` }]` + "\n"
- config += ` keys = [{` + "\n"
- config += ` id = 0` + "\n"
- config += ` name = "aaa"` + "\n"
- config += ` send_id = 1` + "\n"
- config += ` receiver_id = 2` + "\n"
- config += ` include_tcp_options = false` + "\n"
- config += ` accept_ao_mismatch = false` + "\n"
- config += ` crypto_algorithm = "aes-128-cmac"` + "\n"
- config += ` key_string = "abcabc"` + "\n"
- config += ` send_life_time_local = true` + "\n"
- config += ` send_life_time_start_epoch = 1659284400` + "\n"
- config += ` send_life_time_infinite = true` + "\n"
- config += ` accept_life_time_local = true` + "\n"
- config += ` accept_life_time_start_epoch = 1659284400` + "\n"
- config += ` accept_life_time_infinite = true` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_snmp_feature.go b/internal/provider/resource_sdwan_system_snmp_feature.go
new file mode 100644
index 000000000..4fec81f11
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_snmp_feature.go
@@ -0,0 +1,530 @@
+// 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/int64validator"
+ "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 = &SystemSNMPProfileParcelResource{}
+var _ resource.ResourceWithImportState = &SystemSNMPProfileParcelResource{}
+
+func NewSystemSNMPProfileParcelResource() resource.Resource {
+ return &SystemSNMPProfileParcelResource{}
+}
+
+type SystemSNMPProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *SystemSNMPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_system_snmp_feature"
+}
+
+func (r *SystemSNMPProfileParcelResource) 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 System SNMP Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable SNMP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "contact_person": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the contact for this managed node").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 255),
+ },
+ },
+ "contact_person_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "location_of_device": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the physical location of this managed node").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 255),
+ },
+ },
+ "location_of_device_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "views": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure a view record").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the name of the SNMP view").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "oids": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP object identifier").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure identifier of subtree of MIB objects").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))(\.(0|\*|([1-9]\d*))){0,126}$`), ""),
+ },
+ },
+ "id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "exclude": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Exclude the OID").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "exclude_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "communities": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP community").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set name of the SNMP community").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[\S]+$`), ""),
+ },
+ },
+ "user_label": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set user label of the SNMP community").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "view": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set name of the SNMP view").String,
+ Optional: true,
+ },
+ "view_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authorization": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure access permissions").AddStringEnumDescription("read-only", "read-write").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("read-only", "read-write"),
+ },
+ },
+ "authorization_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "groups": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure an SNMP group").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP group").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "security_level": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure security level").AddStringEnumDescription("no-auth-no-priv", "auth-no-priv", "auth-priv").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("no-auth-no-priv", "auth-no-priv", "auth-priv"),
+ },
+ },
+ "view": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP view").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "view_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "users": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure an SNMP user").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP user").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "authentication_protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure authentication protocol").AddStringEnumDescription("sha").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("sha"),
+ },
+ },
+ "authentication_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_password": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify authentication protocol password").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "authentication_password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "privacy_protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure privacy protocol").AddStringEnumDescription("aes-cfb-128", "aes-256-cfb-128").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("aes-cfb-128", "aes-256-cfb-128"),
+ },
+ },
+ "privacy_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "privacy_password": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Specify privacy protocol password").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "privacy_password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "group": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP group").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "trap_target_servers": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP server to receive SNMP traps").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "vpn_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set VPN in which SNMP server is located").AddIntegerRangeDescription(0, 65530).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "vpn_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv4/IPv6 address of SNMP server").String,
+ Optional: true,
+ },
+ "ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "port": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set UDP port number to connect to SNMP server").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "user_label": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set user label of the SNMP community").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtLeast(1),
+ },
+ },
+ "user": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set name of the SNMP user").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "user_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source interface for outgoing SNMP traps").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(^GigabitEthernet|Loopback|TenGigabitEthernet|TwoGigabitEthernet|FortyGigabitEthernet|HundredGigE|Vlan)(([1-9]\d|\d)/){0,2}(0|[1-9]\d*)([:|\.][1-9]\d*)?`), ""),
+ },
+ },
+ "source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *SystemSNMPProfileParcelResource) 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 *SystemSNMPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan SystemSNMP
+
+ // 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 *SystemSNMPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state SystemSNMP
+
+ // 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 *SystemSNMPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state SystemSNMP
+
+ // 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 *SystemSNMPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state SystemSNMP
+
+ // 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 *SystemSNMPProfileParcelResource) 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_system_snmp_feature_test.go b/internal/provider/resource_sdwan_system_snmp_feature_test.go
new file mode 100644
index 000000000..d91195c80
--- /dev/null
+++ b/internal/provider/resource_sdwan_system_snmp_feature_test.go
@@ -0,0 +1,146 @@
+// 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 TestAccSdwanSystemSNMPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "contact_person", "wixie.cisco"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "location_of_device", "SHANGHAI"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "views.0.name", "VIEW1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "views.0.oids.0.id", "1.3.6.1.4.1.9.9.394"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "views.0.oids.0.exclude", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "communities.0.user_label", "COMMUNITY1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "communities.0.view", "VIEW1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "communities.0.authorization", "read-only"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "groups.0.name", "GROUP1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "groups.0.security_level", "auth-priv"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "groups.0.view", "VIEW1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "users.0.name", "USER1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "users.0.authentication_protocol", "sha"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "users.0.authentication_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "users.0.privacy_protocol", "aes-256-cfb-128"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "users.0.privacy_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "users.0.group", "GROUP1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "trap_target_servers.0.vpn_id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "trap_target_servers.0.ip", "10.75.221.156"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "trap_target_servers.0.port", "161"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "trap_target_servers.0.user_label", "TARGET1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "trap_target_servers.0.user", "USER1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_feature.test", "trap_target_servers.0.source_interface", "GigabitEthernet1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanSystemSNMPPrerequisitesProfileParcelConfig + testAccSdwanSystemSNMPProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanSystemSNMPPrerequisitesProfileParcelConfig + testAccSdwanSystemSNMPProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanSystemSNMPPrerequisitesProfileParcelConfig = `
+resource "sdwan_system_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanSystemSNMPProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_system_snmp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanSystemSNMPProfileParcelConfig_all() string {
+ config := `resource "sdwan_system_snmp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` contact_person = "wixie.cisco"` + "\n"
+ config += ` location_of_device = "SHANGHAI"` + "\n"
+ config += ` views = [{` + "\n"
+ config += ` name = "VIEW1"` + "\n"
+ config += ` oids = [{` + "\n"
+ config += ` id = "1.3.6.1.4.1.9.9.394"` + "\n"
+ config += ` exclude = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` communities = [{` + "\n"
+ config += ` name = "example"` + "\n"
+ config += ` user_label = "COMMUNITY1"` + "\n"
+ config += ` view = "VIEW1"` + "\n"
+ config += ` authorization = "read-only"` + "\n"
+ config += ` }]` + "\n"
+ config += ` groups = [{` + "\n"
+ config += ` name = "GROUP1"` + "\n"
+ config += ` security_level = "auth-priv"` + "\n"
+ config += ` view = "VIEW1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` users = [{` + "\n"
+ config += ` name = "USER1"` + "\n"
+ config += ` authentication_protocol = "sha"` + "\n"
+ config += ` authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
+ config += ` privacy_protocol = "aes-256-cfb-128"` + "\n"
+ config += ` privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
+ config += ` group = "GROUP1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` trap_target_servers = [{` + "\n"
+ config += ` vpn_id = 1` + "\n"
+ config += ` ip = "10.75.221.156"` + "\n"
+ config += ` port = 161` + "\n"
+ config += ` user_label = "TARGET1"` + "\n"
+ config += ` user = "USER1"` + "\n"
+ config += ` source_interface = "GigabitEthernet1"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_system_snmp_profile_parcel.go b/internal/provider/resource_sdwan_system_snmp_profile_parcel.go
deleted file mode 100644
index 7e23a9391..000000000
--- a/internal/provider/resource_sdwan_system_snmp_profile_parcel.go
+++ /dev/null
@@ -1,530 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &SystemSNMPProfileParcelResource{}
-var _ resource.ResourceWithImportState = &SystemSNMPProfileParcelResource{}
-
-func NewSystemSNMPProfileParcelResource() resource.Resource {
- return &SystemSNMPProfileParcelResource{}
-}
-
-type SystemSNMPProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *SystemSNMPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_system_snmp_profile_parcel"
-}
-
-func (r *SystemSNMPProfileParcelResource) 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 System SNMP 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,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable or disable SNMP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "contact_person": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the contact for this managed node").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 255),
- },
- },
- "contact_person_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "location_of_device": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the physical location of this managed node").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 255),
- },
- },
- "location_of_device_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "views": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure a view record").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the name of the SNMP view").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "oids": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP object identifier").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure identifier of subtree of MIB objects").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- stringvalidator.RegexMatches(regexp.MustCompile(`^(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))(\.(0|\*|([1-9]\d*))){0,126}$`), ""),
- },
- },
- "id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "exclude": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Exclude the OID").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "exclude_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- },
- },
- "communities": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP community").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set name of the SNMP community").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- stringvalidator.RegexMatches(regexp.MustCompile(`^[\S]+$`), ""),
- },
- },
- "user_label": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set user label of the SNMP community").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "view": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set name of the SNMP view").String,
- Optional: true,
- },
- "view_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "authorization": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure access permissions").AddStringEnumDescription("read-only", "read-write").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("read-only", "read-write"),
- },
- },
- "authorization_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "groups": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure an SNMP group").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP group").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "security_level": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure security level").AddStringEnumDescription("no-auth-no-priv", "auth-no-priv", "auth-priv").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("no-auth-no-priv", "auth-no-priv", "auth-priv"),
- },
- },
- "view": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP view").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "view_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "users": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure an SNMP user").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP user").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "authentication_protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure authentication protocol").AddStringEnumDescription("sha").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("sha"),
- },
- },
- "authentication_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "authentication_password": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify authentication protocol password").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "authentication_password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "privacy_protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure privacy protocol").AddStringEnumDescription("aes-cfb-128", "aes-256-cfb-128").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("aes-cfb-128", "aes-256-cfb-128"),
- },
- },
- "privacy_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "privacy_password": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Specify privacy protocol password").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "privacy_password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "group": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Name of the SNMP group").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "trap_target_servers": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure SNMP server to receive SNMP traps").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "vpn_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set VPN in which SNMP server is located").AddIntegerRangeDescription(0, 65530).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65530),
- },
- },
- "vpn_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set IPv4/IPv6 address of SNMP server").String,
- Optional: true,
- },
- "ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "port": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set UDP port number to connect to SNMP server").AddIntegerRangeDescription(1, 65535).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65535),
- },
- },
- "port_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "user_label": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set user label of the SNMP community").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtLeast(1),
- },
- },
- "user": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set name of the SNMP user").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "user_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source interface for outgoing SNMP traps").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(^GigabitEthernet|Loopback|TenGigabitEthernet|TwoGigabitEthernet|FortyGigabitEthernet|HundredGigE|Vlan)(([1-9]\d|\d)/){0,2}(0|[1-9]\d*)([:|\.][1-9]\d*)?`), ""),
- },
- },
- "source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *SystemSNMPProfileParcelResource) 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 *SystemSNMPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan SystemSNMP
-
- // 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 *SystemSNMPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state SystemSNMP
-
- // 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 *SystemSNMPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state SystemSNMP
-
- // 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 *SystemSNMPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state SystemSNMP
-
- // 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 *SystemSNMPProfileParcelResource) 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_system_snmp_profile_parcel_test.go b/internal/provider/resource_sdwan_system_snmp_profile_parcel_test.go
deleted file mode 100644
index b2eb2a5fd..000000000
--- a/internal/provider/resource_sdwan_system_snmp_profile_parcel_test.go
+++ /dev/null
@@ -1,146 +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 TestAccSdwanSystemSNMPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "contact_person", "wixie.cisco"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "location_of_device", "SHANGHAI"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "views.0.name", "VIEW1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "views.0.oids.0.id", "1.3.6.1.4.1.9.9.394"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "views.0.oids.0.exclude", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "communities.0.user_label", "COMMUNITY1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "communities.0.view", "VIEW1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "communities.0.authorization", "read-only"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "groups.0.name", "GROUP1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "groups.0.security_level", "auth-priv"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "groups.0.view", "VIEW1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "users.0.name", "USER1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "users.0.authentication_protocol", "sha"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "users.0.authentication_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "users.0.privacy_protocol", "aes-256-cfb-128"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "users.0.privacy_password", "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "users.0.group", "GROUP1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.vpn_id", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.ip", "10.75.221.156"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.port", "161"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.user_label", "TARGET1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.user", "USER1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_snmp_profile_parcel.test", "trap_target_servers.0.source_interface", "GigabitEthernet1"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanSystemSNMPPrerequisitesProfileParcelConfig + testAccSdwanSystemSNMPProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanSystemSNMPPrerequisitesProfileParcelConfig + testAccSdwanSystemSNMPProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanSystemSNMPPrerequisitesProfileParcelConfig = `
-resource "sdwan_system_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanSystemSNMPProfileParcelConfig_minimum() string {
- config := `resource "sdwan_system_snmp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanSystemSNMPProfileParcelConfig_all() string {
- config := `resource "sdwan_system_snmp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` contact_person = "wixie.cisco"` + "\n"
- config += ` location_of_device = "SHANGHAI"` + "\n"
- config += ` views = [{` + "\n"
- config += ` name = "VIEW1"` + "\n"
- config += ` oids = [{` + "\n"
- config += ` id = "1.3.6.1.4.1.9.9.394"` + "\n"
- config += ` exclude = false` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` communities = [{` + "\n"
- config += ` name = "example"` + "\n"
- config += ` user_label = "COMMUNITY1"` + "\n"
- config += ` view = "VIEW1"` + "\n"
- config += ` authorization = "read-only"` + "\n"
- config += ` }]` + "\n"
- config += ` groups = [{` + "\n"
- config += ` name = "GROUP1"` + "\n"
- config += ` security_level = "auth-priv"` + "\n"
- config += ` view = "VIEW1"` + "\n"
- config += ` }]` + "\n"
- config += ` users = [{` + "\n"
- config += ` name = "USER1"` + "\n"
- config += ` authentication_protocol = "sha"` + "\n"
- config += ` authentication_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
- config += ` privacy_protocol = "aes-256-cfb-128"` + "\n"
- config += ` privacy_password = "$CRYPT_CLUSTER$su56l1Z0Tk4Qc9N7+T/uOg==$sD6b0HLqEdI+RNwsEOoLcQ=="` + "\n"
- config += ` group = "GROUP1"` + "\n"
- config += ` }]` + "\n"
- config += ` trap_target_servers = [{` + "\n"
- config += ` vpn_id = 1` + "\n"
- config += ` ip = "10.75.221.156"` + "\n"
- config += ` port = 161` + "\n"
- config += ` user_label = "TARGET1"` + "\n"
- config += ` user = "USER1"` + "\n"
- config += ` source_interface = "GigabitEthernet1"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_tloc_list_policy_object.go b/internal/provider/resource_sdwan_tloc_list_policy_object.go
index 248ba79c8..49238e3a5 100644
--- a/internal/provider/resource_sdwan_tloc_list_policy_object.go
+++ b/internal/provider/resource_sdwan_tloc_list_policy_object.go
@@ -179,7 +179,7 @@ func (r *TLOCListPolicyObjectResource) Read(ctx context.Context, req resource.Re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go b/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go
index e6bc77b1a..e0c99a73c 100644
--- a/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go
+++ b/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go
@@ -312,7 +312,7 @@ func (r *TLSSSLDecryptionPolicyDefinitionResource) Read(ctx context.Context, req
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go b/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go
index dce661004..eedc2774a 100644
--- a/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go
+++ b/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go
@@ -198,7 +198,7 @@ func (r *TLSSSLProfilePolicyDefinitionResource) Read(ctx context.Context, req re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_traffic_data_policy_definition.go b/internal/provider/resource_sdwan_traffic_data_policy_definition.go
index 6915bfc36..9936eee4f 100644
--- a/internal/provider/resource_sdwan_traffic_data_policy_definition.go
+++ b/internal/provider/resource_sdwan_traffic_data_policy_definition.go
@@ -139,10 +139,10 @@ func (r *TrafficDataPolicyDefinitionResource) Schema(ctx context.Context, req re
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Type of match entry").AddStringEnumDescription("appList", "dnsAppList", "dns", "dscp", "packetLength", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "tcp", "trafficTo").String,
+ MarkdownDescription: helpers.NewAttributeDescription("Type of match entry").AddStringEnumDescription("appList", "dnsAppList", "dns", "dscp", "packetLength", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "tcp", "trafficTo", "icmpMessage").String,
Required: true,
Validators: []validator.String{
- stringvalidator.OneOf("appList", "dnsAppList", "dns", "dscp", "packetLength", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "tcp", "trafficTo"),
+ stringvalidator.OneOf("appList", "dnsAppList", "dns", "dscp", "packetLength", "plp", "protocol", "sourceDataPrefixList", "sourceIp", "sourcePort", "destinationDataPrefixList", "destinationIp", "destinationRegion", "destinationPort", "tcp", "trafficTo", "icmpMessage"),
},
},
"application_list_id": schema.StringAttribute{
@@ -161,6 +161,10 @@ func (r *TrafficDataPolicyDefinitionResource) Schema(ctx context.Context, req re
MarkdownDescription: helpers.NewAttributeDescription("DNS Application list version").String,
Optional: true,
},
+ "icmp_message": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ICMP Message").String,
+ Optional: true,
+ },
"dns": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("DNS request or response").AddStringEnumDescription("request", "response").String,
Optional: true,
@@ -302,12 +306,9 @@ func (r *TrafficDataPolicyDefinitionResource) Schema(ctx context.Context, req re
stringvalidator.OneOf("fecAdaptive", "fecAlways", "packetDuplication"),
},
},
- "loss_correction_fec_threshold": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Loss correction FEC threshold").AddIntegerRangeDescription(1, 5).String,
+ "loss_correction_fec_threshold": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Loss correction FEC threshold").String,
Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 5),
- },
},
"nat_pool": schema.StringAttribute{
MarkdownDescription: helpers.NewAttributeDescription("NAT pool").AddStringEnumDescription("pool").String,
@@ -584,7 +585,7 @@ func (r *TrafficDataPolicyDefinitionResource) Read(ctx context.Context, req reso
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_transport_feature_profile.go b/internal/provider/resource_sdwan_transport_feature_profile.go
index 00558c5e5..bff5f519a 100644
--- a/internal/provider/resource_sdwan_transport_feature_profile.go
+++ b/internal/provider/resource_sdwan_transport_feature_profile.go
@@ -60,7 +60,7 @@ func (r *TransportFeatureProfileResource) Metadata(ctx context.Context, req reso
func (r *TransportFeatureProfileResource) 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 Transport Feature Profile .").String,
+ MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Transport Feature Profile .").AddMinimumVersionDescription("20.12.0").String,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
@@ -138,7 +138,7 @@ func (r *TransportFeatureProfileResource) Read(ctx context.Context, req resource
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_transport_gps_feature.go b/internal/provider/resource_sdwan_transport_gps_feature.go
new file mode 100644
index 000000000..f5fb741b0
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_gps_feature.go
@@ -0,0 +1,297 @@
+// 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-validators/int64validator"
+ "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 = &TransportGPSProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportGPSProfileParcelResource{}
+
+func NewTransportGPSProfileParcelResource() resource.Resource {
+ return &TransportGPSProfileParcelResource{}
+}
+
+type TransportGPSProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportGPSProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_gps_feature"
+}
+
+func (r *TransportGPSProfileParcelResource) 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 Transport GPS Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "gps_enable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable/disable GPS").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "gps_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "gps_mode": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select GPS mode").AddStringEnumDescription("ms-based", "standalone").AddDefaultValueDescription("ms-based").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("ms-based", "standalone"),
+ },
+ },
+ "gps_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nmea_enable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable/disable NMEA data").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "nmea_enable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nmea_source_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source address").String,
+ Optional: true,
+ },
+ "nmea_source_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nmea_destination_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Destination address").String,
+ Optional: true,
+ },
+ "nmea_destination_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nmea_destination_port": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Destination port").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "nmea_destination_port_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportGPSProfileParcelResource) 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 *TransportGPSProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportGPS
+
+ // 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 *TransportGPSProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportGPS
+
+ // 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 *TransportGPSProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportGPS
+
+ // 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 *TransportGPSProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportGPS
+
+ // 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 *TransportGPSProfileParcelResource) 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_transport_gps_feature_test.go b/internal/provider/resource_sdwan_transport_gps_feature_test.go
new file mode 100644
index 000000000..74267f310
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_gps_feature_test.go
@@ -0,0 +1,97 @@
+// 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 TestAccSdwanTransportGPSProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_gps_feature.test", "gps_enable", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_gps_feature.test", "gps_mode", "ms-based"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_gps_feature.test", "nmea_enable", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_gps_feature.test", "nmea_source_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_gps_feature.test", "nmea_destination_address", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_gps_feature.test", "nmea_destination_port", "22"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportGPSPrerequisitesProfileParcelConfig + testAccSdwanTransportGPSProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportGPSPrerequisitesProfileParcelConfig + testAccSdwanTransportGPSProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportGPSPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportGPSProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_gps_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportGPSProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_gps_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` gps_enable = false` + "\n"
+ config += ` gps_mode = "ms-based"` + "\n"
+ config += ` nmea_enable = false` + "\n"
+ config += ` nmea_source_address = "1.2.3.4"` + "\n"
+ config += ` nmea_destination_address = "2.3.4.5"` + "\n"
+ config += ` nmea_destination_port = 22` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_ipv6_tracker_feature.go b/internal/provider/resource_sdwan_transport_ipv6_tracker_feature.go
new file mode 100644
index 000000000..2b8a4dd09
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_ipv6_tracker_feature.go
@@ -0,0 +1,339 @@
+// 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-validators/int64validator"
+ "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 = &TransportIPv6TrackerProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportIPv6TrackerProfileParcelResource{}
+
+func NewTransportIPv6TrackerProfileParcelResource() resource.Resource {
+ return &TransportIPv6TrackerProfileParcelResource{}
+}
+
+type TransportIPv6TrackerProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportIPv6TrackerProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_ipv6_tracker_feature"
+}
+
+func (r *TransportIPv6TrackerProfileParcelResource) 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 Transport IPv6 Tracker Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tracker Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "tracker_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "endpoint_api_url": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("API url of endpoint").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtMost(512),
+ },
+ },
+ "endpoint_api_url_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "endpoint_dns_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Endpoint DNS Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtMost(63),
+ },
+ },
+ "endpoint_dns_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "endpoint_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Endpoint IP").String,
+ Optional: true,
+ },
+ "endpoint_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval").AddIntegerRangeDescription(20, 600).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(20, 600),
+ },
+ },
+ "interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "multiplier": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Multiplier").AddIntegerRangeDescription(1, 10).AddDefaultValueDescription("3").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 10),
+ },
+ },
+ "multiplier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Threshold").AddIntegerRangeDescription(100, 1000).AddDefaultValueDescription("300").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 1000),
+ },
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "endpoint_tracker_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Endpoint Tracker Type").AddStringEnumDescription("ipv6-interface").AddDefaultValueDescription("ipv6-interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("ipv6-interface"),
+ },
+ },
+ "endpoint_tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tracker Type").AddStringEnumDescription("endpoint").AddDefaultValueDescription("endpoint").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("endpoint"),
+ },
+ },
+ "tracker_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportIPv6TrackerProfileParcelResource) 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 *TransportIPv6TrackerProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportIPv6Tracker
+
+ // 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 *TransportIPv6TrackerProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportIPv6Tracker
+
+ // 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 *TransportIPv6TrackerProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportIPv6Tracker
+
+ // 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 *TransportIPv6TrackerProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportIPv6Tracker
+
+ // 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 *TransportIPv6TrackerProfileParcelResource) 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_transport_ipv6_tracker_feature_test.go b/internal/provider/resource_sdwan_transport_ipv6_tracker_feature_test.go
new file mode 100644
index 000000000..2de0904fb
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_ipv6_tracker_feature_test.go
@@ -0,0 +1,104 @@
+// 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 TestAccSdwanTransportIPv6TrackerProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "tracker_name", "TRACKER_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "endpoint_api_url", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "endpoint_dns_name", "google.com"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "endpoint_ip", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "multiplier", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "threshold", "300"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "endpoint_tracker_type", "ipv6-interface"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_feature.test", "tracker_type", "endpoint"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig + testAccSdwanTransportIPv6TrackerProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig + testAccSdwanTransportIPv6TrackerProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportIPv6TrackerProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_ipv6_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` tracker_name = "TRACKER_1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportIPv6TrackerProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_ipv6_tracker_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` tracker_name = "TRACKER_1"` + "\n"
+ config += ` endpoint_api_url = "google.com"` + "\n"
+ config += ` endpoint_dns_name = "google.com"` + "\n"
+ config += ` endpoint_ip = "2001:0:0:1::0"` + "\n"
+ config += ` interval = 30` + "\n"
+ config += ` multiplier = 3` + "\n"
+ config += ` threshold = 300` + "\n"
+ config += ` endpoint_tracker_type = "ipv6-interface"` + "\n"
+ config += ` tracker_type = "endpoint"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_ipv6_tracker_group_feature.go b/internal/provider/resource_sdwan_transport_ipv6_tracker_group_feature.go
new file mode 100644
index 000000000..9391e6510
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_ipv6_tracker_group_feature.go
@@ -0,0 +1,280 @@
+// 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 = &TransportIPv6TrackerGroupProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportIPv6TrackerGroupProfileParcelResource{}
+
+func NewTransportIPv6TrackerGroupProfileParcelResource() resource.Resource {
+ return &TransportIPv6TrackerGroupProfileParcelResource{}
+}
+
+type TransportIPv6TrackerGroupProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportIPv6TrackerGroupProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_ipv6_tracker_group_feature"
+}
+
+func (r *TransportIPv6TrackerGroupProfileParcelResource) 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 Transport IPv6 Tracker Group Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tracker Name").String,
+ Required: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "tracker_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_elements": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("trackers ref list").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "tracker_boolean": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("tracker ref list combine boolean and or").AddStringEnumDescription("and", "or").AddDefaultValueDescription("or").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("and", "or"),
+ },
+ },
+ "tracker_boolean_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportIPv6TrackerGroupProfileParcelResource) 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 *TransportIPv6TrackerGroupProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportIPv6TrackerGroup
+
+ // 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 *TransportIPv6TrackerGroupProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportIPv6TrackerGroup
+
+ // 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 *TransportIPv6TrackerGroupProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportIPv6TrackerGroup
+
+ // 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 *TransportIPv6TrackerGroupProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportIPv6TrackerGroup
+
+ // 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 *TransportIPv6TrackerGroupProfileParcelResource) 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_transport_ipv6_tracker_group_feature_test.go b/internal/provider/resource_sdwan_transport_ipv6_tracker_group_feature_test.go
new file mode 100644
index 000000000..bb9c76d72
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_ipv6_tracker_group_feature_test.go
@@ -0,0 +1,114 @@
+// 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 TestAccSdwanTransportIPv6TrackerGroupProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_group_feature.test", "tracker_name", "TRACKER_GROUP_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_group_feature.test", "tracker_boolean", "or"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanTransportIPv6TrackerGroupPrerequisitesProfileParcelConfig + testAccSdwanTransportIPv6TrackerGroupProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportIPv6TrackerGroupPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_ipv6_tracker_feature" "test-1" {
+ name = "TF_TEST_1"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+}
+
+resource "sdwan_transport_ipv6_tracker_feature" "test-2" {
+ name = "TF_TEST_2"
+ description = "Terraform Test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ tracker_name = "TRACKER_1"
+ endpoint_api_url = "google.com"
+ endpoint_dns_name = "google.com"
+ endpoint_ip = "2001:0:0:1::0"
+ interval = 30
+ multiplier = 3
+ threshold = 300
+ endpoint_tracker_type = "ipv6-interface"
+ tracker_type = "endpoint"
+}
+`
+
+// 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 testAccSdwanTransportIPv6TrackerGroupProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_ipv6_tracker_group_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` tracker_name = "TRACKER_GROUP_1"` + "\n"
+ config += ` tracker_elements = [{` + "\n"
+ config += ` tracker_id = sdwan_transport_ipv6_tracker_feature.test-1.id` + "\n"
+ config += ` }, {` + "\n"
+ config += ` tracker_id = sdwan_transport_ipv6_tracker_feature.test-2.id` + "\n"
+ config += ` }]` + "\n"
+ config += ` tracker_boolean = "or"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_ipv6_tracker_profile_parcel.go b/internal/provider/resource_sdwan_transport_ipv6_tracker_profile_parcel.go
deleted file mode 100644
index 8d38e6b2a..000000000
--- a/internal/provider/resource_sdwan_transport_ipv6_tracker_profile_parcel.go
+++ /dev/null
@@ -1,339 +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-validators/int64validator"
- "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 = &TransportIPv6TrackerProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportIPv6TrackerProfileParcelResource{}
-
-func NewTransportIPv6TrackerProfileParcelResource() resource.Resource {
- return &TransportIPv6TrackerProfileParcelResource{}
-}
-
-type TransportIPv6TrackerProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportIPv6TrackerProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_ipv6_tracker_profile_parcel"
-}
-
-func (r *TransportIPv6TrackerProfileParcelResource) 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 Transport IPv6 Tracker 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,
- },
- "tracker_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tracker Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "tracker_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "endpoint_api_url": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("API url of endpoint").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtMost(512),
- },
- },
- "endpoint_api_url_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "endpoint_dns_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Endpoint DNS Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtMost(63),
- },
- },
- "endpoint_dns_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "endpoint_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Endpoint IP").String,
- Optional: true,
- },
- "endpoint_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval").AddIntegerRangeDescription(20, 600).AddDefaultValueDescription("60").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(20, 600),
- },
- },
- "interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "multiplier": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Multiplier").AddIntegerRangeDescription(1, 10).AddDefaultValueDescription("3").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 10),
- },
- },
- "multiplier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "threshold": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Threshold").AddIntegerRangeDescription(100, 1000).AddDefaultValueDescription("300").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 1000),
- },
- },
- "threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "endpoint_tracker_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Endpoint Tracker Type").AddStringEnumDescription("ipv6-interface").AddDefaultValueDescription("ipv6-interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("ipv6-interface"),
- },
- },
- "endpoint_tracker_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tracker Type").AddStringEnumDescription("endpoint").AddDefaultValueDescription("endpoint").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("endpoint"),
- },
- },
- "tracker_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *TransportIPv6TrackerProfileParcelResource) 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 *TransportIPv6TrackerProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportIPv6Tracker
-
- // 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 *TransportIPv6TrackerProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportIPv6Tracker
-
- // 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 *TransportIPv6TrackerProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportIPv6Tracker
-
- // 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 *TransportIPv6TrackerProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportIPv6Tracker
-
- // 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 *TransportIPv6TrackerProfileParcelResource) 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_transport_ipv6_tracker_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_ipv6_tracker_profile_parcel_test.go
deleted file mode 100644
index 23151d21a..000000000
--- a/internal/provider/resource_sdwan_transport_ipv6_tracker_profile_parcel_test.go
+++ /dev/null
@@ -1,104 +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 TestAccSdwanTransportIPv6TrackerProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "tracker_name", "TRACKER_1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_api_url", "google.com"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_dns_name", "google.com"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_ip", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "multiplier", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "threshold", "300"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "endpoint_tracker_type", "ipv6-interface"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_ipv6_tracker_profile_parcel.test", "tracker_type", "endpoint"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig + testAccSdwanTransportIPv6TrackerProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig + testAccSdwanTransportIPv6TrackerProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportIPv6TrackerPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportIPv6TrackerProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_ipv6_tracker_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` tracker_name = "TRACKER_1"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportIPv6TrackerProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_ipv6_tracker_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` tracker_name = "TRACKER_1"` + "\n"
- config += ` endpoint_api_url = "google.com"` + "\n"
- config += ` endpoint_dns_name = "google.com"` + "\n"
- config += ` endpoint_ip = "2001:0:0:1::0"` + "\n"
- config += ` interval = 30` + "\n"
- config += ` multiplier = 3` + "\n"
- config += ` threshold = 300` + "\n"
- config += ` endpoint_tracker_type = "ipv6-interface"` + "\n"
- config += ` tracker_type = "endpoint"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_management_vpn_feature.go b/internal/provider/resource_sdwan_transport_management_vpn_feature.go
new file mode 100644
index 000000000..f2dca2287
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_management_vpn_feature.go
@@ -0,0 +1,455 @@
+// 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/int64validator"
+ "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 = &TransportManagementVPNProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportManagementVPNProfileParcelResource{}
+
+func NewTransportManagementVPNProfileParcelResource() resource.Resource {
+ return &TransportManagementVPNProfileParcelResource{}
+}
+
+type TransportManagementVPNProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportManagementVPNProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_feature"
+}
+
+func (r *TransportManagementVPNProfileParcelResource) 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 Transport Management VPN Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "vpn_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtMost(244),
+ },
+ },
+ "vpn_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv4)").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv4": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv4)").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv6)").String,
+ Optional: true,
+ },
+ "primary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv6": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv6)").String,
+ Optional: true,
+ },
+ "secondary_dns_address_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "new_host_mappings": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "host_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Hostname").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "host_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "list_of_ip_addresses": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of IP").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "list_of_ip_addresses_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static Route").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "gateway": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Gateway").AddStringEnumDescription("nextHop", "dhcp", "null0").AddDefaultValueDescription("nextHop").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("nextHop", "dhcp", "null0"),
+ },
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop`").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative distance, Attribute conditional on `gateway` being equal to `null0`").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_static_routes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Static Route").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Prefix").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "gateway": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Gateway").AddStringEnumDescription("next_hop", "null0", "nat").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("next_hop", "null0", "nat"),
+ },
+ },
+ "next_hops": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `next_hop`").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "administrative_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "administrative_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "null0": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `null0`").String,
+ Optional: true,
+ },
+ "nat": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Nat, Attribute conditional on `gateway` being equal to `nat`").AddStringEnumDescription("NAT64", "NAT66").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("NAT64", "NAT66"),
+ },
+ },
+ "nat_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *TransportManagementVPNProfileParcelResource) 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 *TransportManagementVPNProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportManagementVPN
+
+ // 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 *TransportManagementVPNProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportManagementVPN
+
+ // 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 *TransportManagementVPNProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportManagementVPN
+
+ // 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 *TransportManagementVPNProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportManagementVPN
+
+ // 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 *TransportManagementVPNProfileParcelResource) 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_transport_management_vpn_feature_test.go b/internal/provider/resource_sdwan_transport_management_vpn_feature_test.go
new file mode 100644
index 000000000..3bc398917
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_management_vpn_feature_test.go
@@ -0,0 +1,127 @@
+// 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 TestAccSdwanTransportManagementVPNProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "vpn_description", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "primary_dns_address_ipv4", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "secondary_dns_address_ipv4", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "new_host_mappings.0.host_name", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.gateway", "nextHop"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.prefix", "2002::/16"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.gateway", "next_hop"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_feature.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportManagementVPNPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportManagementVPNPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportManagementVPNPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportManagementVPNProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_management_vpn_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportManagementVPNProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_management_vpn_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` vpn_description = "example"` + "\n"
+ config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
+ config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
+ config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
+ config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
+ config += ` new_host_mappings = [{` + "\n"
+ config += ` host_name = "example"` + "\n"
+ config += ` list_of_ip_addresses = ["1.2.3.4"]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_static_routes = [{` + "\n"
+ config += ` network_address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` gateway = "nextHop"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_static_routes = [{` + "\n"
+ config += ` prefix = "2002::/16"` + "\n"
+ config += ` gateway = "next_hop"` + "\n"
+ config += ` next_hops = [{` + "\n"
+ config += ` address = "2001:0:0:1::1"` + "\n"
+ config += ` administrative_distance = 1` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature.go b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..4c9a13d0c
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature.go
@@ -0,0 +1,531 @@
+// 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/int64validator"
+ "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 = &TransportManagementVPNInterfaceEthernetProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportManagementVPNInterfaceEthernetProfileParcelResource{}
+
+func NewTransportManagementVPNInterfaceEthernetProfileParcelResource() resource.Resource {
+ return &TransportManagementVPNInterfaceEthernetProfileParcelResource{}
+}
+
+type TransportManagementVPNInterfaceEthernetProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_interface_ethernet_feature"
+}
+
+func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) 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 Transport Management VPN Interface Ethernet Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "transport_management_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Transport Management VPN Feature ID").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 200),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_configuration_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Configuration Type").AddStringEnumDescription("dynamic", "static").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("dynamic", "static"),
+ },
+ },
+ "ipv4_dhcp_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`").AddIntegerRangeDescription(1, 65536).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "ipv4_dhcp_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
+ Optional: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helper": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of DHCP IPv4 helper addresses (min 1, max 8)").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "ipv4_dhcp_helper_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_iperf_server": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Iperf server for auto bandwidth detect").String,
+ Optional: true,
+ },
+ "ipv4_iperf_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_auto_detect_bandwidth": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface auto detect bandwidth").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv4_auto_detect_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_configuration_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Configuration Type").AddStringEnumDescription("dynamic", "static", "none").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("dynamic", "static", "none"),
+ },
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String,
+ Optional: true,
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arp_entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPV4 Address").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Duplex mode").AddStringEnumDescription("full", "half", "auto").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("full", "half", "auto"),
+ },
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1500, 9216),
+ },
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface speed").AddStringEnumDescription("10", "100", "1000", "2500", "10000").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("10", "100", "1000", "2500", "10000"),
+ },
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2147483).AddDefaultValueDescription("1200").String,
+ Optional: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "autonegotiate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Link autonegotiation").String,
+ Optional: true,
+ },
+ "autonegotiate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "media_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Media type").AddStringEnumDescription("auto-select", "rj45", "sfp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("auto-select", "rj45", "sfp"),
+ },
+ },
+ "media_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "load_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval for interface load calculation").AddIntegerRangeDescription(30, 600).AddDefaultValueDescription("30").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(30, 600),
+ },
+ },
+ "load_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportManagementVPNInterfaceEthernet
+
+ // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportManagementVPNInterfaceEthernet
+
+ // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportManagementVPNInterfaceEthernet
+
+ // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportManagementVPNInterfaceEthernet
+
+ // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) 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_transport_management_vpn_interface_ethernet_feature_test.go b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature_test.go
new file mode 100644
index 000000000..589761eb1
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_feature_test.go
@@ -0,0 +1,152 @@
+// 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 TestAccSdwanTransportManagementVPNInterfaceEthernetProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_description", "Transport Management VPN Interface Ethernet"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_iperf_server", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv4_auto_detect_bandwidth", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ipv6_address", "2001:0:0:1::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_entries.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "tcp_mss", "505"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "speed", "2500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "autonegotiate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "media_type", "rj45"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "load_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "icmp_redirect_disable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_management_vpn_feature" "test" {
+ name = "TF_TEST_VPN"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_management_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_management_vpn_feature_id = sdwan_transport_management_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_management_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_management_vpn_feature_id = sdwan_transport_management_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` interface_description = "Transport Management VPN Interface Ethernet"` + "\n"
+ config += ` ipv4_configuration_type = "static"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` ipv4_iperf_server = "example"` + "\n"
+ config += ` ipv4_auto_detect_bandwidth = false` + "\n"
+ config += ` ipv6_configuration_type = "static"` + "\n"
+ config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
+ config += ` arp_entries = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 505` + "\n"
+ config += ` speed = "2500"` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` autonegotiate = false` + "\n"
+ config += ` media_type = "rj45"` + "\n"
+ config += ` load_interval = 30` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index b8b5f3819..000000000
--- a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,531 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportManagementVPNInterfaceEthernetProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportManagementVPNInterfaceEthernetProfileParcelResource{}
-
-func NewTransportManagementVPNInterfaceEthernetProfileParcelResource() resource.Resource {
- return &TransportManagementVPNInterfaceEthernetProfileParcelResource{}
-}
-
-type TransportManagementVPNInterfaceEthernetProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_interface_ethernet_profile_parcel"
-}
-
-func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) 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 Transport Management VPN Interface Ethernet 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,
- Optional: true,
- },
- "transport_management_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Transport Management VPN Profile Parcel ID").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 200),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_configuration_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Configuration Type").AddStringEnumDescription("dynamic", "static").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("dynamic", "static"),
- },
- },
- "ipv4_dhcp_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`").AddIntegerRangeDescription(1, 65536).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65536),
- },
- },
- "ipv4_dhcp_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
- Optional: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of DHCP IPv4 helper addresses (min 1, max 8)").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_iperf_server": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Iperf server for auto bandwidth detect").String,
- Optional: true,
- },
- "ipv4_iperf_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_auto_detect_bandwidth": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface auto detect bandwidth").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipv4_auto_detect_bandwidth_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_configuration_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Configuration Type").AddStringEnumDescription("dynamic", "static", "none").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("dynamic", "static", "none"),
- },
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String,
- Optional: true,
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arp_entries": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPV4 Address").String,
- Optional: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "duplex": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Duplex mode").AddStringEnumDescription("full", "half", "auto").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("full", "half", "auto"),
- },
- },
- "duplex_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1500, 9216),
- },
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "speed": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface speed").AddStringEnumDescription("10", "100", "1000", "2500", "10000").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("10", "100", "1000", "2500", "10000"),
- },
- },
- "speed_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2147483).AddDefaultValueDescription("1200").String,
- Optional: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "autonegotiate": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Link autonegotiation").String,
- Optional: true,
- },
- "autonegotiate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "media_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Media type").AddStringEnumDescription("auto-select", "rj45", "sfp").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("auto-select", "rj45", "sfp"),
- },
- },
- "media_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "load_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval for interface load calculation").AddIntegerRangeDescription(30, 600).AddDefaultValueDescription("30").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(30, 600),
- },
- },
- "load_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *TransportManagementVPNInterfaceEthernetProfileParcelResource) 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportManagementVPNInterfaceEthernet
-
- // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportManagementVPNInterfaceEthernet
-
- // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportManagementVPNInterfaceEthernet
-
- // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportManagementVPNInterfaceEthernet
-
- // 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 *TransportManagementVPNInterfaceEthernetProfileParcelResource) 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_transport_management_vpn_interface_ethernet_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_profile_parcel_test.go
deleted file mode 100644
index da7857280..000000000
--- a/internal/provider/resource_sdwan_transport_management_vpn_interface_ethernet_profile_parcel_test.go
+++ /dev/null
@@ -1,152 +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 TestAccSdwanTransportManagementVPNInterfaceEthernetProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "interface_name", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "interface_description", "Transport Management VPN Interface Ethernet"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_iperf_server", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv4_auto_detect_bandwidth", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv6_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ipv6_address", "2001:0:0:1::/64"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "arp_entries.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "arp_entries.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "duplex", "full"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "tcp_mss", "505"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "speed", "2500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "autonegotiate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "media_type", "rj45"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "load_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "icmp_redirect_disable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_interface_ethernet_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportManagementVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_management_vpn_profile_parcel" "test" {
- name = "TF_TEST_VPN"
- feature_profile_id = sdwan_transport_feature_profile.test.id
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_management_vpn_profile_parcel_id = sdwan_transport_management_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportManagementVPNInterfaceEthernetProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_management_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_management_vpn_profile_parcel_id = sdwan_transport_management_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` interface_description = "Transport Management VPN Interface Ethernet"` + "\n"
- config += ` ipv4_configuration_type = "static"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` ipv4_iperf_server = "example"` + "\n"
- config += ` ipv4_auto_detect_bandwidth = false` + "\n"
- config += ` ipv6_configuration_type = "static"` + "\n"
- config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
- config += ` arp_entries = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` duplex = "full"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 505` + "\n"
- config += ` speed = "2500"` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` autonegotiate = false` + "\n"
- config += ` media_type = "rj45"` + "\n"
- config += ` load_interval = 30` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel.go b/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel.go
deleted file mode 100644
index 893f5537c..000000000
--- a/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel.go
+++ /dev/null
@@ -1,455 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportManagementVPNProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportManagementVPNProfileParcelResource{}
-
-func NewTransportManagementVPNProfileParcelResource() resource.Resource {
- return &TransportManagementVPNProfileParcelResource{}
-}
-
-type TransportManagementVPNProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportManagementVPNProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_management_vpn_profile_parcel"
-}
-
-func (r *TransportManagementVPNProfileParcelResource) 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 Transport Management VPN 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,
- Optional: true,
- },
- "vpn_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtMost(244),
- },
- },
- "vpn_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "primary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv4)").String,
- Optional: true,
- },
- "primary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv4)").String,
- Optional: true,
- },
- "secondary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "primary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv6)").String,
- Optional: true,
- },
- "primary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv6)").String,
- Optional: true,
- },
- "secondary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "new_host_mappings": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "host_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Hostname").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "host_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "list_of_ip_addresses": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of IP").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "list_of_ip_addresses_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gateway": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Gateway").AddStringEnumDescription("nextHop", "dhcp", "null0").AddDefaultValueDescription("nextHop").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("nextHop", "dhcp", "null0"),
- },
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop`").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance, Attribute conditional on `gateway` being equal to `null0`").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Static Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gateway": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Gateway").AddStringEnumDescription("next_hop", "null0", "nat").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("next_hop", "null0", "nat"),
- },
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `next_hop`").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 254),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `null0`").String,
- Optional: true,
- },
- "nat": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Nat, Attribute conditional on `gateway` being equal to `nat`").AddStringEnumDescription("NAT64", "NAT66").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("NAT64", "NAT66"),
- },
- },
- "nat_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *TransportManagementVPNProfileParcelResource) 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 *TransportManagementVPNProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportManagementVPN
-
- // 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 *TransportManagementVPNProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportManagementVPN
-
- // 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 *TransportManagementVPNProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportManagementVPN
-
- // 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 *TransportManagementVPNProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportManagementVPN
-
- // 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 *TransportManagementVPNProfileParcelResource) 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_transport_management_vpn_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel_test.go
deleted file mode 100644
index b68dca9a2..000000000
--- a/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel_test.go
+++ /dev/null
@@ -1,129 +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 TestAccSdwanTransportManagementVPNProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "vpn_description", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "primary_dns_address_ipv4", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "secondary_dns_address_ipv4", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "new_host_mappings.0.host_name", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.gateway", "nextHop"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv4_static_routes.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.prefix", "2002::/16"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.gateway", "next_hop"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_management_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportManagementVPNPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportManagementVPNPrerequisitesProfileParcelConfig + testAccSdwanTransportManagementVPNProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportManagementVPNPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportManagementVPNProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_management_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportManagementVPNProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_management_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` vpn_description = "example"` + "\n"
- config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
- config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
- config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
- config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
- config += ` new_host_mappings = [{` + "\n"
- config += ` host_name = "example"` + "\n"
- config += ` list_of_ip_addresses = ["1.2.3.4"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_static_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` gateway = "nextHop"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_static_routes = [{` + "\n"
- config += ` prefix = "2002::/16"` + "\n"
- config += ` gateway = "next_hop"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "2001:0:0:1::1"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_route_policy_feature.go b/internal/provider/resource_sdwan_transport_route_policy_feature.go
new file mode 100644
index 000000000..d000eca9f
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_route_policy_feature.go
@@ -0,0 +1,477 @@
+// 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/int64validator"
+ "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 = &TransportRoutePolicyProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportRoutePolicyProfileParcelResource{}
+
+func NewTransportRoutePolicyProfileParcelResource() resource.Resource {
+ return &TransportRoutePolicyProfileParcelResource{}
+}
+
+type TransportRoutePolicyProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportRoutePolicyProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_route_policy_feature"
+}
+
+func (r *TransportRoutePolicyProfileParcelResource) 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 Transport Route Policy Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "default_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Default Action").AddStringEnumDescription("reject", "accept").AddDefaultValueDescription("reject").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("reject", "accept"),
+ },
+ },
+ "sequences": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Route Policy List").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Id").AddIntegerRangeDescription(1, 65536).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Sequence Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 19),
+ },
+ },
+ "base_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Base Action").AddStringEnumDescription("reject", "accept").AddDefaultValueDescription("reject").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("reject", "accept"),
+ },
+ },
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("protocol such as IPV4, IPV6, or BOTH").AddStringEnumDescription("IPV4", "IPV6", "BOTH").AddDefaultValueDescription("IPV4").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("IPV4", "IPV6", "BOTH"),
+ },
+ },
+ "match_entries": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Define match conditions").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "standard_community_list_criteria": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select a condition such as OR, AND or EXACT").AddStringEnumDescription("OR", "AND", "EXACT").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("OR", "AND", "EXACT"),
+ },
+ },
+ "standard_community_lists": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select a standard community list").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "expanded_community_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "extended_community_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "bgp_local_preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP Local Preference").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select Metric").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select OMP Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Select OSPF Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "ipv4_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv4_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv6_address_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv6_next_hop_prefix_list_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "actions": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Define list of actions").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "as_path_prepend": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "community_additive": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "community": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Local Preference").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Metric").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Metric Type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "omp_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OMP Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "origin": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Origin").AddStringEnumDescription("EGP", "IGP", "Incomplete").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("EGP", "IGP", "Incomplete"),
+ },
+ },
+ "ospf_tag": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF Tag").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Weight").AddIntegerRangeDescription(0, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "ipv4_next_hop": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Ipv4 Next Hop").String,
+ Optional: true,
+ },
+ "ipv6_next_hop": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set Ipv6 Next Hop").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *TransportRoutePolicyProfileParcelResource) 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 *TransportRoutePolicyProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportRoutePolicy
+
+ // 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 *TransportRoutePolicyProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportRoutePolicy
+
+ // 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 *TransportRoutePolicyProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportRoutePolicy
+
+ // 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 *TransportRoutePolicyProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportRoutePolicy
+
+ // 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 *TransportRoutePolicyProfileParcelResource) 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_transport_route_policy_feature_test.go b/internal/provider/resource_sdwan_transport_route_policy_feature_test.go
new file mode 100644
index 000000000..00556d3b7
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_route_policy_feature_test.go
@@ -0,0 +1,119 @@
+// 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 TestAccSdwanTransportRoutePolicyProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "default_action", "accept"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.id", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.name", "SEQ_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.base_action", "reject"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.protocol", "IPV4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.community_additive", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.local_preference", "100"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.metric", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.omp_tag", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.origin", "EGP"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.ospf_tag", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.weight", "2200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_route_policy_feature.test", "sequences.0.actions.0.ipv4_next_hop", "10.0.0.1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportRoutePolicyPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutePolicyProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportRoutePolicyPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutePolicyProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportRoutePolicyPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportRoutePolicyProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_route_policy_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportRoutePolicyProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_route_policy_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` default_action = "accept"` + "\n"
+ config += ` sequences = [{` + "\n"
+ config += ` id = 1` + "\n"
+ config += ` name = "SEQ_1"` + "\n"
+ config += ` base_action = "reject"` + "\n"
+ config += ` protocol = "IPV4"` + "\n"
+ config += ` actions = [{` + "\n"
+ config += ` as_path_prepend = [65521]` + "\n"
+ config += ` community_additive = false` + "\n"
+ config += ` community = ["internet"]` + "\n"
+ config += ` local_preference = 100` + "\n"
+ config += ` metric = 20` + "\n"
+ config += ` metric_type = "type1"` + "\n"
+ config += ` omp_tag = 200` + "\n"
+ config += ` origin = "EGP"` + "\n"
+ config += ` ospf_tag = 1200` + "\n"
+ config += ` weight = 2200` + "\n"
+ config += ` ipv4_next_hop = "10.0.0.1"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_routing_bgp_feature.go b/internal/provider/resource_sdwan_transport_routing_bgp_feature.go
new file mode 100644
index 000000000..004ea074b
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_bgp_feature.go
@@ -0,0 +1,1073 @@
+// 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/int64validator"
+ "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 = &TransportRoutingBGPProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportRoutingBGPProfileParcelResource{}
+
+func NewTransportRoutingBGPProfileParcelResource() resource.Resource {
+ return &TransportRoutingBGPProfileParcelResource{}
+}
+
+type TransportRoutingBGPProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportRoutingBGPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_bgp_feature"
+}
+
+func (r *TransportRoutingBGPProfileParcelResource) 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 Transport Routing BGP Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Optional: true,
+ },
+ "as_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set autonomous system number <1..4294967295> or ").String,
+ Optional: true,
+ },
+ "as_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure BGP router identifier").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "propagate_as_path": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Propagate AS Path").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "propagate_as_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "propagate_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Propagate Community").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "propagate_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "external_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for external BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("20").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "external_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "internal_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for internal BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "internal_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_routes_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for local BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("20").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "local_routes_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) of keepalive messages sent to its BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
+ Optional: true,
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) not receiving a keepalive message declares a BGP peer down").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
+ Optional: true,
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "always_compare_med": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Compare MEDs from all ASs when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "always_compare_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "deterministic_med": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Compare MEDs from all routes from same AS when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "deterministic_med_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "missing_med_as_worst": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("If path has no MED, consider it to be worst path when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "missing_med_as_worst_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "compare_router_id": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Compare router IDs when selecting active BGP paths").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "compare_router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "multipath_relax": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Ignore AS for multipath selection").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "multipath_relax_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set BGP IPv4 neighbors").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set neighbor address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable a BGP neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set remote autonomous system number").String,
+ Optional: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.").String,
+ Optional: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how often to advertise keepalive messages to BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to wait since receiving a keepalive message to consider BGP peer unavailable").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source interface name for BGP neighbor").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set router to be next hop for routes advertised to neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send extended community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TTL value for peers that are not directly connected").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 password on TCP connection with BGP peer").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_label": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send label").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "explicit_null": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send explicit null label").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "explicit_null_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Override matching AS-number while sending update").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The number of accept as-path with my AS present in it").AddIntegerRangeDescription(1, 10).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 10),
+ },
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set BGP address family").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv4 unicast address family").AddStringEnumDescription("ipv4-unicast", "vpnv4-unicast", "vpnv6-unicast").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("ipv4-unicast", "vpnv4-unicast", "vpnv6-unicast"),
+ },
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of prefixes accepted from BGP peer").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set threshold(1 to 100) at which to generate a warning message").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("75").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 100),
+ },
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Neighbor received maximum prefix policy is disabled.").String,
+ Optional: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv6_neighbors": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set BGP IPv6 neighbors").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 neighbor address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable or disable a BGP neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "remote_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set remote autonomous system number").String,
+ Optional: true,
+ },
+ "remote_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "local_as": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.").String,
+ Optional: true,
+ },
+ "local_as_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "keepalive_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) of keepalive messages sent to its BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "keepalive_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) not receiving a keepalive message declares a BGP peer down").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65535),
+ },
+ },
+ "hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "update_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source interface name for BGP neighbor").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "update_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "next_hop_self": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set router to be next hop for routes advertised to neighbor").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "next_hop_self_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "send_extended_community": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Send extended community attribute").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "send_extended_community_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ebgp_multihop": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TTL value for peers that are not directly connected").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "ebgp_multihop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "password": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 password on TCP connection with BGP peer").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 25),
+ },
+ },
+ "password_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_override": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Override matching AS-number while sending update").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_override_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "allowas_in_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("The number of accept as-path with my AS present in it").AddIntegerRangeDescription(1, 10).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 10),
+ },
+ },
+ "allowas_in_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "address_families": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 BGP address family").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "family_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 unicast address family").AddStringEnumDescription("ipv6-unicast", "vpnv6-unicast").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("ipv6-unicast", "vpnv6-unicast"),
+ },
+ },
+ "max_number_of_prefixes": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of prefixes accepted from BGP peer").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "max_number_of_prefixes_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "threshold": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set threshold(1 to 100) at which to generate a warning message").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("75").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 100),
+ },
+ },
+ "threshold_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "policy_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Neighbor received maximum prefix policy is disabled.").String,
+ Optional: true,
+ },
+ "restart_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "restart_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "in_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "out_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "ipv4_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Aggregate prefixes in specific range").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set AS set path information").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Filter out more specific routes from updates").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_networks": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the networks for BGP to advertise").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "network_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of parallel IBGP paths for multipath load sharing").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "ipv4_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP Default Information Originate").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv4_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv4_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv4_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes into BGP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol to redistribute routes from").AddStringEnumDescription("static", "connected", "ospf", "ospfv3", "nat").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "ospf", "ospfv3", "nat"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "ipv6_aggregate_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Aggregate prefixes in specific range").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "aggregate_prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the IPv6 prefixes to aggregate").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "aggregate_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "as_set_path": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set AS set path information").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "as_set_path_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "summary_only": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Filter out more specific routes from updates").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "summary_only_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_networks": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the networks for BGP to advertise").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "network_prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure the prefixes for BGP to announce").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "network_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_eibgp_maximum_paths": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of parallel IBGP paths for multipath load sharing").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "ipv6_eibgp_maximum_paths_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("BGP Default Information Originate").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv6_originate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_table_map_route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "ipv6_table_map_filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ipv6_table_map_filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes into BGP").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol to redistribute routes from").AddStringEnumDescription("static", "connected", "ospf").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "ospf"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "mpls_interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MPLS BGP Interface").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(AppGigabitEthernet|BD-VIF|BDI|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *TransportRoutingBGPProfileParcelResource) 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 *TransportRoutingBGPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportRoutingBGP
+
+ // 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 *TransportRoutingBGPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportRoutingBGP
+
+ // 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 *TransportRoutingBGPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportRoutingBGP
+
+ // 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 *TransportRoutingBGPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportRoutingBGP
+
+ // 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 *TransportRoutingBGPProfileParcelResource) 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_transport_routing_bgp_feature_test.go b/internal/provider/resource_sdwan_transport_routing_bgp_feature_test.go
new file mode 100644
index 000000000..4a3a5f654
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_bgp_feature_test.go
@@ -0,0 +1,248 @@
+// 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 TestAccSdwanTransportRoutingBGPProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "as_number", "429"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "propagate_as_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "propagate_community", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "external_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "internal_routes_distance", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "local_routes_distance", "20"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "keepalive_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "hold_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "always_compare_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "deterministic_med", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "missing_med_as_worst", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "compare_router_id", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "multipath_relax", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.description", "neighbor1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.keepalive_time", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.hold_time", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.update_source_interface", "GigabitEthernet0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.next_hop_self", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.ebgp_multihop", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.send_label", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.explicit_null", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.as_override", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.allowas_in_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.family_type", "ipv4-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address", "2001::1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.description", "neighbor2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.shutdown", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.remote_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.local_as", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.keepalive_time", "180"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.hold_time", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.update_source_interface", "Loopback1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.next_hop_self", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.send_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.send_extended_community", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.ebgp_multihop", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.as_override", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.allowas_in_number", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.family_type", "ipv6-unicast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.threshold", "75"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.policy_type", "restart"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_neighbors.0.address_families.0.restart_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_networks.0.network_address", "10.10.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_networks.0.subnet_mask", "255.255.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_eibgp_maximum_paths", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv4_table_map_filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.aggregate_prefix", "3001::1/128"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.as_set_path", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_aggregate_addresses.0.summary_only", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_networks.0.network_prefix", "2001:0DB8:0000:000b::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_eibgp_maximum_paths", "2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_originate", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "ipv6_table_map_filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_feature.test", "mpls_interfaces.0.interface_name", "GigabitEthernet1"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingBGPProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingBGPProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportRoutingBGPProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_routing_bgp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` as_number = 429` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportRoutingBGPProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_routing_bgp_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` as_number = 429` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` propagate_as_path = false` + "\n"
+ config += ` propagate_community = false` + "\n"
+ config += ` external_routes_distance = 20` + "\n"
+ config += ` internal_routes_distance = 200` + "\n"
+ config += ` local_routes_distance = 20` + "\n"
+ config += ` keepalive_time = 60` + "\n"
+ config += ` hold_time = 180` + "\n"
+ config += ` always_compare_med = false` + "\n"
+ config += ` deterministic_med = false` + "\n"
+ config += ` missing_med_as_worst = false` + "\n"
+ config += ` compare_router_id = false` + "\n"
+ config += ` multipath_relax = false` + "\n"
+ config += ` ipv4_neighbors = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` description = "neighbor1"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 40` + "\n"
+ config += ` hold_time = 200` + "\n"
+ config += ` update_source_interface = "GigabitEthernet0"` + "\n"
+ config += ` next_hop_self = false` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 1` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` send_label = true` + "\n"
+ config += ` explicit_null = false` + "\n"
+ config += ` as_override = false` + "\n"
+ config += ` allowas_in_number = 1` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv4-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_neighbors = [{` + "\n"
+ config += ` address = "2001::1"` + "\n"
+ config += ` description = "neighbor2"` + "\n"
+ config += ` shutdown = false` + "\n"
+ config += ` remote_as = 200` + "\n"
+ config += ` local_as = 200` + "\n"
+ config += ` keepalive_time = 180` + "\n"
+ config += ` hold_time = 60` + "\n"
+ config += ` update_source_interface = "Loopback1"` + "\n"
+ config += ` next_hop_self = true` + "\n"
+ config += ` send_community = true` + "\n"
+ config += ` send_extended_community = true` + "\n"
+ config += ` ebgp_multihop = 3` + "\n"
+ config += ` password = "myPassword"` + "\n"
+ config += ` as_override = true` + "\n"
+ config += ` allowas_in_number = 3` + "\n"
+ config += ` address_families = [{` + "\n"
+ config += ` family_type = "ipv6-unicast"` + "\n"
+ config += ` max_number_of_prefixes = 2000` + "\n"
+ config += ` threshold = 75` + "\n"
+ config += ` policy_type = "restart"` + "\n"
+ config += ` restart_interval = 30` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_aggregate_addresses = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_networks = [{` + "\n"
+ config += ` network_address = "10.10.0.0"` + "\n"
+ config += ` subnet_mask = "255.255.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_eibgp_maximum_paths = 1` + "\n"
+ config += ` ipv4_originate = false` + "\n"
+ config += ` ipv4_table_map_filter = false` + "\n"
+ config += ` ipv6_aggregate_addresses = [{` + "\n"
+ config += ` aggregate_prefix = "3001::1/128"` + "\n"
+ config += ` as_set_path = false` + "\n"
+ config += ` summary_only = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_networks = [{` + "\n"
+ config += ` network_prefix = "2001:0DB8:0000:000b::/64"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv6_eibgp_maximum_paths = 2` + "\n"
+ config += ` ipv6_originate = true` + "\n"
+ config += ` ipv6_table_map_filter = false` + "\n"
+ config += ` mpls_interfaces = [{` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_routing_bgp_profile_parcel.go b/internal/provider/resource_sdwan_transport_routing_bgp_profile_parcel.go
deleted file mode 100644
index 0bf8060cd..000000000
--- a/internal/provider/resource_sdwan_transport_routing_bgp_profile_parcel.go
+++ /dev/null
@@ -1,1073 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportRoutingBGPProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportRoutingBGPProfileParcelResource{}
-
-func NewTransportRoutingBGPProfileParcelResource() resource.Resource {
- return &TransportRoutingBGPProfileParcelResource{}
-}
-
-type TransportRoutingBGPProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportRoutingBGPProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_routing_bgp_profile_parcel"
-}
-
-func (r *TransportRoutingBGPProfileParcelResource) 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 Transport Routing BGP 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,
- Optional: true,
- },
- "as_number": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set autonomous system number <1..4294967295> or ").String,
- Optional: true,
- },
- "as_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "router_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure BGP router identifier").String,
- Optional: true,
- },
- "router_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "propagate_as_path": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Propagate AS Path").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "propagate_as_path_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "propagate_community": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Propagate Community").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "propagate_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "external_routes_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for external BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("20").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "external_routes_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "internal_routes_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for internal BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("200").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "internal_routes_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "local_routes_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set administrative distance for local BGP routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("20").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "local_routes_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "keepalive_time": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) of keepalive messages sent to its BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
- Optional: true,
- },
- "keepalive_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "hold_time": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) not receiving a keepalive message declares a BGP peer down").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
- Optional: true,
- },
- "hold_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "always_compare_med": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Compare MEDs from all ASs when selecting active BGP paths").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "always_compare_med_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "deterministic_med": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Compare MEDs from all routes from same AS when selecting active BGP paths").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "deterministic_med_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "missing_med_as_worst": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("If path has no MED, consider it to be worst path when selecting active BGP paths").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "missing_med_as_worst_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "compare_router_id": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Compare router IDs when selecting active BGP paths").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "compare_router_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "multipath_relax": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Ignore AS for multipath selection").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "multipath_relax_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_neighbors": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set BGP IPv4 neighbors").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set neighbor address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set description").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable or disable a BGP neighbor").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "remote_as": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set remote autonomous system number").String,
- Optional: true,
- },
- "remote_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "local_as": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set local autonomous number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.").String,
- Optional: true,
- },
- "local_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "keepalive_time": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set how often to advertise keepalive messages to BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65535),
- },
- },
- "keepalive_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "hold_time": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set how long to wait since receiving a keepalive message to consider BGP peer unavailable").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65535),
- },
- },
- "hold_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "update_source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source interface name for BGP neighbor").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "update_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "next_hop_self": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set router to be next hop for routes advertised to neighbor").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "next_hop_self_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_community": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send community attribute").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "send_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_extended_community": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send extended community attribute").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "send_extended_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ebgp_multihop": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TTL value for peers that are not directly connected").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "ebgp_multihop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "password": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set MD5 password on TCP connection with BGP peer").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 25),
- },
- },
- "password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_label": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send label").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "explicit_null": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send explicit null label").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "explicit_null_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "as_override": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Override matching AS-number while sending update").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "as_override_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "allowas_in_number": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("The number of accept as-path with my AS present in it").AddIntegerRangeDescription(1, 10).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 10),
- },
- },
- "allowas_in_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "address_families": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set BGP address family").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "family_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set IPv4 unicast address family").AddStringEnumDescription("ipv4-unicast", "vpnv4-unicast", "vpnv6-unicast").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("ipv4-unicast", "vpnv4-unicast", "vpnv6-unicast"),
- },
- },
- "max_number_of_prefixes": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of prefixes accepted from BGP peer").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "max_number_of_prefixes_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "threshold": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set threshold(1 to 100) at which to generate a warning message").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("75").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 100),
- },
- },
- "threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "policy_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Neighbor received maximum prefix policy is disabled.").String,
- Optional: true,
- },
- "restart_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded").AddIntegerRangeDescription(1, 65535).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65535),
- },
- },
- "restart_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "in_route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "out_route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- },
- },
- },
- "ipv6_neighbors": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set BGP IPv6 neighbors").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 neighbor address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set description").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable or disable a BGP neighbor").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "remote_as": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set remote autonomous system number").String,
- Optional: true,
- },
- "remote_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "local_as": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set local autonomous system number,Local-AS cannot have the local BGP protocol AS number or the AS number of the remote peer.The local-as is valid only if the peer is a true eBGP peer. It does not work for two peers in different sub-ASs in a confederation.").String,
- Optional: true,
- },
- "local_as_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "keepalive_time": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) of keepalive messages sent to its BGP peer").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("60").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65535),
- },
- },
- "keepalive_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "hold_time": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval (seconds) not receiving a keepalive message declares a BGP peer down").AddIntegerRangeDescription(0, 65535).AddDefaultValueDescription("180").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65535),
- },
- },
- "hold_time_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "update_source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source interface name for BGP neighbor").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "update_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "next_hop_self": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set router to be next hop for routes advertised to neighbor").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "next_hop_self_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_community": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send community attribute").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "send_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "send_extended_community": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Send extended community attribute").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "send_extended_community_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ebgp_multihop": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TTL value for peers that are not directly connected").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "ebgp_multihop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "password": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set MD5 password on TCP connection with BGP peer").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 25),
- },
- },
- "password_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "as_override": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Override matching AS-number while sending update").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "as_override_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "allowas_in_number": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("The number of accept as-path with my AS present in it").AddIntegerRangeDescription(1, 10).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 10),
- },
- },
- "allowas_in_number_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "address_families": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 BGP address family").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "family_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set IPv6 unicast address family").AddStringEnumDescription("ipv6-unicast", "vpnv6-unicast").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("ipv6-unicast", "vpnv6-unicast"),
- },
- },
- "max_number_of_prefixes": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of prefixes accepted from BGP peer").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "max_number_of_prefixes_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "threshold": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set threshold(1 to 100) at which to generate a warning message").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("75").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 100),
- },
- },
- "threshold_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "policy_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Neighbor received maximum prefix policy is disabled.").String,
- Optional: true,
- },
- "restart_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the restart interval(minutes) when to restart BGP connection if threshold is exceeded").AddIntegerRangeDescription(1, 65535).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65535),
- },
- },
- "restart_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "in_route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "out_route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- },
- },
- },
- "ipv4_aggregate_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Aggregate prefixes in specific range").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "as_set_path": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set AS set path information").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "as_set_path_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "summary_only": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Filter out more specific routes from updates").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "summary_only_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_networks": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure the networks for BGP to advertise").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_eibgp_maximum_paths": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of parallel IBGP paths for multipath load sharing").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "ipv4_eibgp_maximum_paths_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_originate": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("BGP Default Information Originate").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipv4_originate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_table_map_route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "ipv4_table_map_filter": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipv4_table_map_filter_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_redistributes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes into BGP").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the protocol to redistribute routes from").AddStringEnumDescription("static", "connected", "ospf", "ospfv3", "nat").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("static", "connected", "ospf", "ospfv3", "nat"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- "ipv6_aggregate_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Aggregate prefixes in specific range").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "aggregate_prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure the IPv6 prefixes to aggregate").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "aggregate_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "as_set_path": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set AS set path information").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "as_set_path_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "summary_only": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Filter out more specific routes from updates").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "summary_only_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_networks": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure the networks for BGP to advertise").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure the prefixes for BGP to announce").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "network_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_eibgp_maximum_paths": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set maximum number of parallel IBGP paths for multipath load sharing").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "ipv6_eibgp_maximum_paths_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_originate": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("BGP Default Information Originate").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipv6_originate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_table_map_route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- "ipv6_table_map_filter": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ipv6_table_map_filter_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_redistributes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes into BGP").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the protocol to redistribute routes from").AddStringEnumDescription("static", "connected", "ospf").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("static", "connected", "ospf"),
- },
- },
- "protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "route_policy_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
- },
- },
- },
- },
- },
- "mpls_interfaces": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MPLS BGP Interface").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(AppGigabitEthernet|BD-VIF|BDI|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *TransportRoutingBGPProfileParcelResource) 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 *TransportRoutingBGPProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportRoutingBGP
-
- // 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 *TransportRoutingBGPProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportRoutingBGP
-
- // 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 *TransportRoutingBGPProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportRoutingBGP
-
- // 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 *TransportRoutingBGPProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportRoutingBGP
-
- // 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 *TransportRoutingBGPProfileParcelResource) 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_transport_routing_bgp_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_routing_bgp_profile_parcel_test.go
deleted file mode 100644
index 0ea365340..000000000
--- a/internal/provider/resource_sdwan_transport_routing_bgp_profile_parcel_test.go
+++ /dev/null
@@ -1,248 +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 TestAccSdwanTransportRoutingBGPProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "as_number", "429"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "router_id", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "propagate_as_path", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "propagate_community", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "external_routes_distance", "20"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "internal_routes_distance", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "local_routes_distance", "20"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "keepalive_time", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "hold_time", "180"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "always_compare_med", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "deterministic_med", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "missing_med_as_worst", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "compare_router_id", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "multipath_relax", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.description", "neighbor1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.remote_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.local_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.keepalive_time", "40"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.hold_time", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.update_source_interface", "GigabitEthernet0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.next_hop_self", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.send_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.send_extended_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.ebgp_multihop", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.send_label", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.explicit_null", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.as_override", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.allowas_in_number", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.family_type", "ipv4-unicast"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.threshold", "75"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.policy_type", "restart"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_neighbors.0.address_families.0.restart_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address", "2001::1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.description", "neighbor2"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.shutdown", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.remote_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.local_as", "200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.keepalive_time", "180"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.hold_time", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.update_source_interface", "Loopback1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.next_hop_self", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.send_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.send_extended_community", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.ebgp_multihop", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.as_override", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.allowas_in_number", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.family_type", "ipv6-unicast"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.max_number_of_prefixes", "2000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.threshold", "75"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.policy_type", "restart"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_neighbors.0.address_families.0.restart_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.network_address", "10.10.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.subnet_mask", "255.255.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.as_set_path", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_aggregate_addresses.0.summary_only", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_networks.0.network_address", "10.10.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_networks.0.subnet_mask", "255.255.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_eibgp_maximum_paths", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_originate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv4_table_map_filter", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_aggregate_addresses.0.aggregate_prefix", "3001::1/128"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_aggregate_addresses.0.as_set_path", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_aggregate_addresses.0.summary_only", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_networks.0.network_prefix", "2001:0DB8:0000:000b::/64"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_eibgp_maximum_paths", "2"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_originate", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "ipv6_table_map_filter", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_bgp_profile_parcel.test", "mpls_interfaces.0.interface_name", "GigabitEthernet1"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingBGPProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingBGPProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportRoutingBGPPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportRoutingBGPProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_routing_bgp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` as_number = 429` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportRoutingBGPProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_routing_bgp_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` as_number = 429` + "\n"
- config += ` router_id = "1.2.3.4"` + "\n"
- config += ` propagate_as_path = false` + "\n"
- config += ` propagate_community = false` + "\n"
- config += ` external_routes_distance = 20` + "\n"
- config += ` internal_routes_distance = 200` + "\n"
- config += ` local_routes_distance = 20` + "\n"
- config += ` keepalive_time = 60` + "\n"
- config += ` hold_time = 180` + "\n"
- config += ` always_compare_med = false` + "\n"
- config += ` deterministic_med = false` + "\n"
- config += ` missing_med_as_worst = false` + "\n"
- config += ` compare_router_id = false` + "\n"
- config += ` multipath_relax = false` + "\n"
- config += ` ipv4_neighbors = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` description = "neighbor1"` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` remote_as = 200` + "\n"
- config += ` local_as = 200` + "\n"
- config += ` keepalive_time = 40` + "\n"
- config += ` hold_time = 200` + "\n"
- config += ` update_source_interface = "GigabitEthernet0"` + "\n"
- config += ` next_hop_self = false` + "\n"
- config += ` send_community = true` + "\n"
- config += ` send_extended_community = true` + "\n"
- config += ` ebgp_multihop = 1` + "\n"
- config += ` password = "myPassword"` + "\n"
- config += ` send_label = true` + "\n"
- config += ` explicit_null = false` + "\n"
- config += ` as_override = false` + "\n"
- config += ` allowas_in_number = 1` + "\n"
- config += ` address_families = [{` + "\n"
- config += ` family_type = "ipv4-unicast"` + "\n"
- config += ` max_number_of_prefixes = 2000` + "\n"
- config += ` threshold = 75` + "\n"
- config += ` policy_type = "restart"` + "\n"
- config += ` restart_interval = 30` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_neighbors = [{` + "\n"
- config += ` address = "2001::1"` + "\n"
- config += ` description = "neighbor2"` + "\n"
- config += ` shutdown = false` + "\n"
- config += ` remote_as = 200` + "\n"
- config += ` local_as = 200` + "\n"
- config += ` keepalive_time = 180` + "\n"
- config += ` hold_time = 60` + "\n"
- config += ` update_source_interface = "Loopback1"` + "\n"
- config += ` next_hop_self = true` + "\n"
- config += ` send_community = true` + "\n"
- config += ` send_extended_community = true` + "\n"
- config += ` ebgp_multihop = 3` + "\n"
- config += ` password = "myPassword"` + "\n"
- config += ` as_override = true` + "\n"
- config += ` allowas_in_number = 3` + "\n"
- config += ` address_families = [{` + "\n"
- config += ` family_type = "ipv6-unicast"` + "\n"
- config += ` max_number_of_prefixes = 2000` + "\n"
- config += ` threshold = 75` + "\n"
- config += ` policy_type = "restart"` + "\n"
- config += ` restart_interval = 30` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_aggregate_addresses = [{` + "\n"
- config += ` network_address = "10.10.0.0"` + "\n"
- config += ` subnet_mask = "255.255.0.0"` + "\n"
- config += ` as_set_path = false` + "\n"
- config += ` summary_only = false` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_networks = [{` + "\n"
- config += ` network_address = "10.10.0.0"` + "\n"
- config += ` subnet_mask = "255.255.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_eibgp_maximum_paths = 1` + "\n"
- config += ` ipv4_originate = false` + "\n"
- config += ` ipv4_table_map_filter = false` + "\n"
- config += ` ipv6_aggregate_addresses = [{` + "\n"
- config += ` aggregate_prefix = "3001::1/128"` + "\n"
- config += ` as_set_path = false` + "\n"
- config += ` summary_only = false` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_networks = [{` + "\n"
- config += ` network_prefix = "2001:0DB8:0000:000b::/64"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_eibgp_maximum_paths = 2` + "\n"
- config += ` ipv6_originate = true` + "\n"
- config += ` ipv6_table_map_filter = false` + "\n"
- config += ` mpls_interfaces = [{` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_routing_ospf_feature.go b/internal/provider/resource_sdwan_transport_routing_ospf_feature.go
new file mode 100644
index 000000000..793794e9f
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_ospf_feature.go
@@ -0,0 +1,642 @@
+// 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/int64validator"
+ "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 = &TransportRoutingOSPFProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportRoutingOSPFProfileParcelResource{}
+
+func NewTransportRoutingOSPFProfileParcelResource() resource.Resource {
+ return &TransportRoutingOSPFProfileParcelResource{}
+}
+
+type TransportRoutingOSPFProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportRoutingOSPFProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_ospf_feature"
+}
+
+func (r *TransportRoutingOSPFProfileParcelResource) 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 Transport Routing OSPF Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF router ID to override system IP address").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set reference bandwidth method to assign OSPF cost").AddIntegerRangeDescription(1, 4294967).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967),
+ },
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Calculate summary route cost based on RFC 1583").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distribute default external route into OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always advertise default route").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set metric used to generate default route <0..16777214>").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set default route type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for external routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for inter-area routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for intra-area routes").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set delay from first change received until performing SPF calculation").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set initial hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("10000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol").AddStringEnumDescription("static", "connected", "bgp", "omp", "nat", "eigrp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("static", "connected", "bgp", "omp", "nat", "eigrp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable NAT DIA for redistributed routes").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "router_lsas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Advertise own router LSA with infinite distance").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the router LSA advertisement type").AddStringEnumDescription("administrative", "on-startup").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("administrative", "on-startup"),
+ },
+ },
+ "time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to advertise maximum metric after router starts up").AddIntegerRangeDescription(5, 86400).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(5, 86400),
+ },
+ },
+ "time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure OSPF area").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF area number").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("set the area type").AddStringEnumDescription("stub", "nssa").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("stub", "nssa"),
+ },
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not inject interarea routes into STUB or NSSA").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface parameters").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval between OSPF hello packets").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval after which neighbor is declared to be down").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("40").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time between retransmitting LSAs").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost of OSPF interface").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "designated_router_priority": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set router’s priority to be elected as designated router").AddIntegerRangeDescription(0, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(255),
+ },
+ },
+ "designated_router_priority_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the OSPF network type").AddStringEnumDescription("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint").AddDefaultValueDescription("broadcast").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint"),
+ },
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface to advertise its address, but not to actively run OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication type").AddStringEnumDescription("message-digest").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("message-digest"),
+ },
+ },
+ "authentication_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "message_digest_key_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 message digest key").AddIntegerRangeDescription(1, 255).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "message_digest_key_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "message_digest_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set MD5 authentication key").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 127),
+ },
+ },
+ "message_digest_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Summarize OSPF routes at an area boundary").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost for this range").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(16777214),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not advertise this range").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *TransportRoutingOSPFProfileParcelResource) 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 *TransportRoutingOSPFProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportRoutingOSPF
+
+ // 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 *TransportRoutingOSPFProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportRoutingOSPF
+
+ // 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 *TransportRoutingOSPFProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportRoutingOSPF
+
+ // 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 *TransportRoutingOSPFProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportRoutingOSPF
+
+ // 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 *TransportRoutingOSPFProfileParcelResource) 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_transport_routing_ospf_feature_test.go b/internal/provider/resource_sdwan_transport_routing_ospf_feature_test.go
new file mode 100644
index 000000000..f0d12af55
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_ospf_feature_test.go
@@ -0,0 +1,164 @@
+// 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 TestAccSdwanTransportRoutingOSPFProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "router_lsas.0.type", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "router_lsas.0.time", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.no_summary", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.designated_router_priority", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.authentication_type", "message-digest"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.interfaces.0.message_digest_key_id", "7"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospf_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportRoutingOSPFPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingOSPFProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportRoutingOSPFPrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingOSPFProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportRoutingOSPFPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportRoutingOSPFProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_routing_ospf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportRoutingOSPFProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_routing_ospf_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsas = [{` + "\n"
+ config += ` type = "on-startup"` + "\n"
+ config += ` time = 5` + "\n"
+ config += ` }]` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` no_summary = false` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` designated_router_priority = 1` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "message-digest"` + "\n"
+ config += ` message_digest_key_id = 7` + "\n"
+ config += ` message_digest_key = "sdjfhsghbjdjr"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv4_feature.go b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv4_feature.go
new file mode 100644
index 000000000..df8535641
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv4_feature.go
@@ -0,0 +1,643 @@
+// 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/int64validator"
+ "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 = &TransportRoutingOSPFv3IPv4ProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportRoutingOSPFv3IPv4ProfileParcelResource{}
+
+func NewTransportRoutingOSPFv3IPv4ProfileParcelResource() resource.Resource {
+ return &TransportRoutingOSPFv3IPv4ProfileParcelResource{}
+}
+
+type TransportRoutingOSPFv3IPv4ProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportRoutingOSPFv3IPv4ProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_ospfv3_ipv4_feature"
+}
+
+func (r *TransportRoutingOSPFv3IPv4ProfileParcelResource) 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 Transport Routing OSPFv3 IPv4 Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF router ID to override system IP address").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distance").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for external routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for inter-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for intra-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set reference bandwidth method to assign OSPF cost").AddIntegerRangeDescription(1, 4294967).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967),
+ },
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Calculate summary route cost based on RFC 1583").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distribute default external route into OSPF disabled").String,
+ Optional: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always advertise default route").String,
+ Optional: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set metric used to generate default route <0..16777214>").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set default route metric type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set delay from first change received until performing SPF calculation").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set initial hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("10000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol").AddStringEnumDescription("connected", "static", "omp", "nat-route", "bgp", "eigrp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("connected", "static", "omp", "nat-route", "bgp", "eigrp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_dia": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable NAT DIA for redistributed routes").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "nat_dia_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Not advertise maximum metric Router LSA policy by default").String,
+ Optional: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to advertise maximum metric after router boot up").AddIntegerRangeDescription(5, 86400).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(5, 86400),
+ },
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure OSPFv3 IPv4 area").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF area number").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("stub area type").AddStringEnumDescription("stub").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("stub"),
+ },
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not inject inter-area routes").String,
+ Optional: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always translate type7 LSAs").String,
+ Optional: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface parameters").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval between OSPF hello packets").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval after which neighbor is declared to be down").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("40").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time between retransmitting LSAs").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost of OSPF interface").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the OSPF network type").AddStringEnumDescription("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint"),
+ },
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface to advertise its address, but not to actively run OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("No Authentication by default").AddStringEnumDescription("no-auth").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("no-auth"),
+ },
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSec SPI, range 256..4294967295").AddIntegerRangeDescription(256, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(256, 4294967295),
+ },
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSEC key").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[0-9a-fA-F]{40}$`), ""),
+ },
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Summarize OSPF routes at an area boundary").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost for this range").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(16777214),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not advertise this range").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *TransportRoutingOSPFv3IPv4ProfileParcelResource) 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 *TransportRoutingOSPFv3IPv4ProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportRoutingOSPFv3IPv4
+
+ // 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 *TransportRoutingOSPFv3IPv4ProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportRoutingOSPFv3IPv4
+
+ // 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 *TransportRoutingOSPFv3IPv4ProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportRoutingOSPFv3IPv4
+
+ // 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 *TransportRoutingOSPFv3IPv4ProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportRoutingOSPFv3IPv4
+
+ // 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 *TransportRoutingOSPFv3IPv4ProfileParcelResource) 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_transport_routing_ospfv3_ipv4_feature_test.go b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv4_feature_test.go
new file mode 100644
index 000000000..03b0973c6
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv4_feature_test.go
@@ -0,0 +1,149 @@
+// 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 TestAccSdwanTransportRoutingOSPFv3IPv4ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "redistributes.0.protocol", "nat-route"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "redistributes.0.nat_dia", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.ip_address", "10.1.1.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.subnet_mask", "255.255.255.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv4_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanTransportRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingOSPFv3IPv4ProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportRoutingOSPFv3IPv4PrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// 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 testAccSdwanTransportRoutingOSPFv3IPv4ProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_routing_ospfv3_ipv4_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "nat-route"` + "\n"
+ config += ` nat_dia = true` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` ip_address = "10.1.1.0"` + "\n"
+ config += ` subnet_mask = "255.255.255.0"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv6_feature.go b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv6_feature.go
new file mode 100644
index 000000000..9f2fe75cd
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv6_feature.go
@@ -0,0 +1,627 @@
+// 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/int64validator"
+ "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 = &TransportRoutingOSPFv3IPv6ProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportRoutingOSPFv3IPv6ProfileParcelResource{}
+
+func NewTransportRoutingOSPFv3IPv6ProfileParcelResource() resource.Resource {
+ return &TransportRoutingOSPFv3IPv6ProfileParcelResource{}
+}
+
+type TransportRoutingOSPFv3IPv6ProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportRoutingOSPFv3IPv6ProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_routing_ospfv3_ipv6_feature"
+}
+
+func (r *TransportRoutingOSPFv3IPv6ProfileParcelResource) 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 Transport Routing OSPFv3 IPv6 Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "router_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF router ID to override system IP address").String,
+ Optional: true,
+ },
+ "router_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distance").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_external": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for external routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_external_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_inter_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for inter-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_inter_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "distance_intra_area": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set distance for intra-area routes").AddIntegerRangeDescription(1, 254).AddDefaultValueDescription("110").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 254),
+ },
+ },
+ "distance_intra_area_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "reference_bandwidth": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set reference bandwidth method to assign OSPF cost").AddIntegerRangeDescription(1, 4294967).AddDefaultValueDescription("100").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967),
+ },
+ },
+ "reference_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Calculate summary route cost based on RFC 1583").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "rfc_1583_compatible_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Distribute default external route into OSPF disabled").String,
+ Optional: true,
+ },
+ "default_information_originate_always": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always advertise default route").String,
+ Optional: true,
+ },
+ "default_information_originate_always_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set metric used to generate default route <0..16777214>").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ },
+ "default_information_originate_metric_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "default_information_originate_metric_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set default route metric type").AddStringEnumDescription("type1", "type2").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("type1", "type2"),
+ },
+ },
+ "default_information_originate_metric_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_calculation_delay": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set delay from first change received until performing SPF calculation").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("200").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_calculation_delay_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_initial_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set initial hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_initial_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "spf_maximum_hold_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set maximum hold time between consecutive SPF calculations").AddIntegerRangeDescription(1, 600000).AddDefaultValueDescription("10000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 600000),
+ },
+ },
+ "spf_maximum_hold_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ "filter": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Table map filtered or not").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "filter_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "redistributes": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Redistribute routes").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the protocol").AddStringEnumDescription("connected", "static", "omp", "bgp", "eigrp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("connected", "static", "omp", "bgp", "eigrp"),
+ },
+ },
+ "protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "route_policy_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`), ""),
+ },
+ },
+ },
+ },
+ },
+ "router_lsa_action": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Not advertise maximum metric Router LSA policy by default").String,
+ Optional: true,
+ },
+ "router_lsa_on_startup_time": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set how long to advertise maximum metric after router boot up").AddIntegerRangeDescription(5, 86400).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(5, 86400),
+ },
+ },
+ "router_lsa_on_startup_time_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "areas": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure OSPFv3 IPv6 area").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "area_number": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF area number").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "area_number_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "area_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("stub area type").AddStringEnumDescription("stub").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("stub"),
+ },
+ },
+ "no_summary": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not inject inter-area routes").String,
+ Optional: true,
+ },
+ "no_summary_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "always_translate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Always translate type7 LSAs").String,
+ Optional: true,
+ },
+ "always_translate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interfaces": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface parameters").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(AppGigabitEthernet|BDI|BD-VIF|Virtual-Template|Dialer|Ethernet|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GigabitEthernet|HundredGigE|Loopback|Port-channel|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwoGigabitEthernet|TwoHundredGigE|Vlan|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval between OSPF hello packets").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dead_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interval after which neighbor is declared to be down").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("40").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "dead_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "lsa_retransmit_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time between retransmitting LSAs").AddIntegerRangeDescription(1, 65535).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "lsa_retransmit_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost of OSPF interface").AddIntegerRangeDescription(1, 65535).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65535),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "network_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the OSPF network type").AddStringEnumDescription("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("broadcast", "point-to-point", "non-broadcast", "point-to-multipoint"),
+ },
+ },
+ "network_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "passive_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface to advertise its address, but not to actively run OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "passive_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("No Authentication by default").AddStringEnumDescription("no-auth").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("no-auth"),
+ },
+ },
+ "authentication_spi": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSec SPI, range 256..4294967295").AddIntegerRangeDescription(256, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(256, 4294967295),
+ },
+ },
+ "authentication_spi_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "authentication_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set OSPF interface authentication IPSEC key").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[0-9a-fA-F]{40}$`), ""),
+ },
+ },
+ "authentication_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ranges": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Summarize OSPF routes at an area boundary").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 prefix,for example 2001::/64").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "cost": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set cost for this range").AddIntegerRangeDescription(0, 16777214).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(16777214),
+ },
+ },
+ "cost_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "no_advertise": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Do not advertise this range").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "no_advertise_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *TransportRoutingOSPFv3IPv6ProfileParcelResource) 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 *TransportRoutingOSPFv3IPv6ProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportRoutingOSPFv3IPv6
+
+ // 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 *TransportRoutingOSPFv3IPv6ProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportRoutingOSPFv3IPv6
+
+ // 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 *TransportRoutingOSPFv3IPv6ProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportRoutingOSPFv3IPv6
+
+ // 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 *TransportRoutingOSPFv3IPv6ProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportRoutingOSPFv3IPv6
+
+ // 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 *TransportRoutingOSPFv3IPv6ProfileParcelResource) 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_transport_routing_ospfv3_ipv6_feature_test.go b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv6_feature_test.go
new file mode 100644
index 000000000..089ca2c9d
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_routing_ospfv3_ipv6_feature_test.go
@@ -0,0 +1,145 @@
+// 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 TestAccSdwanTransportRoutingOSPFv3IPv6ProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "router_id", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance_external", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance_inter_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "distance_intra_area", "110"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "reference_bandwidth", "101"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "rfc_1583_compatible", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate_always", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "default_information_originate_metric_type", "type1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "spf_calculation_delay", "200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "spf_initial_hold_time", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "spf_maximum_hold_time", "10000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "filter", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "redistributes.0.protocol", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "router_lsa_action", "on-startup"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "router_lsa_on_startup_time", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.area_number", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.area_type", "stub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.name", "GigabitEthernet2"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.hello_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.dead_interval", "40"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.lsa_retransmit_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.cost", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.network_type", "broadcast"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.passive_interface", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.interfaces.0.authentication_type", "no-auth"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.prefix", "3002::/96"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.cost", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_routing_ospfv3_ipv6_feature.test", "areas.0.ranges.0.no_advertise", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+
+ {
+ Config: testAccSdwanTransportRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig + testAccSdwanTransportRoutingOSPFv3IPv6ProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportRoutingOSPFv3IPv6PrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+`
+
+// 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 testAccSdwanTransportRoutingOSPFv3IPv6ProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_routing_ospfv3_ipv6_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` router_id = "1.2.3.4"` + "\n"
+ config += ` distance = 110` + "\n"
+ config += ` distance_external = 110` + "\n"
+ config += ` distance_inter_area = 110` + "\n"
+ config += ` distance_intra_area = 110` + "\n"
+ config += ` reference_bandwidth = 101` + "\n"
+ config += ` rfc_1583_compatible = true` + "\n"
+ config += ` default_information_originate = false` + "\n"
+ config += ` default_information_originate_always = false` + "\n"
+ config += ` default_information_originate_metric = 1` + "\n"
+ config += ` default_information_originate_metric_type = "type1"` + "\n"
+ config += ` spf_calculation_delay = 200` + "\n"
+ config += ` spf_initial_hold_time = 1000` + "\n"
+ config += ` spf_maximum_hold_time = 10000` + "\n"
+ config += ` filter = false` + "\n"
+ config += ` redistributes = [{` + "\n"
+ config += ` protocol = "static"` + "\n"
+ config += ` }]` + "\n"
+ config += ` router_lsa_action = "on-startup"` + "\n"
+ config += ` router_lsa_on_startup_time = 30` + "\n"
+ config += ` areas = [{` + "\n"
+ config += ` area_number = 1` + "\n"
+ config += ` area_type = "stub"` + "\n"
+ config += ` interfaces = [{` + "\n"
+ config += ` name = "GigabitEthernet2"` + "\n"
+ config += ` hello_interval = 10` + "\n"
+ config += ` dead_interval = 40` + "\n"
+ config += ` lsa_retransmit_interval = 5` + "\n"
+ config += ` cost = 10` + "\n"
+ config += ` network_type = "broadcast"` + "\n"
+ config += ` passive_interface = false` + "\n"
+ config += ` authentication_type = "no-auth"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ranges = [{` + "\n"
+ config += ` prefix = "3002::/96"` + "\n"
+ config += ` cost = 1` + "\n"
+ config += ` no_advertise = false` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_tracker_feature.go b/internal/provider/resource_sdwan_transport_tracker_feature.go
new file mode 100644
index 000000000..1eb7b6e2d
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_tracker_feature.go
@@ -0,0 +1,341 @@
+// 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/int64validator"
+ "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 = &TransportTrackerProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportTrackerProfileParcelResource{}
+
+func NewTransportTrackerProfileParcelResource() resource.Resource {
+ return &TransportTrackerProfileParcelResource{}
+}
+
+type TransportTrackerProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportTrackerProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_tracker_feature"
+}
+
+func (r *TransportTrackerProfileParcelResource) 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 Transport Tracker Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "tracker_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tracker Name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^[^ milli seconds").AddIntegerRangeDescription(100, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 600000),
+ },
+ },
+ "tunnel_interface_hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_hello_tolerance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set tolerance of control hello packets <12..6000> seconds").AddIntegerRangeDescription(12, 6000).AddDefaultValueDescription("12").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(12, 6000),
+ },
+ },
+ "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as last resort").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_color_restrict": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Restrict this TLOC behavior").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_color_restrict_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_groups": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of groups").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "tunnel_interface_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_border": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as border TLOC").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_border_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_max_control_connections": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Maximum Control Connections").AddIntegerRangeDescription(0, 100).String,
+ Optional: true,
+ },
+ "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time period of nat refresh packets <1...60> seconds").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 60),
+ },
+ },
+ "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Put this wan interface in STUN mode only").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Exclude the following controller groups defined in this list.").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface preference for control connection to vManage <0..8>").AddIntegerRangeDescription(0, 8).AddDefaultValueDescription("5").String,
+ Optional: true,
+ },
+ "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_port_hop": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Disallow port hopping on the tunnel interface").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_port_hop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface as a low-bandwidth circuit").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_network_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Accept and respond to network-prefix-directed broadcasts").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_all": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow all traffic. Overrides all other allow-service options if allow-service all is set").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_all_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bgp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/deny BGP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dhcp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DHCP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ntp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NTP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ssh": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SSH").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dns": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DNS").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dns_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_icmp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny ICMP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_https": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny HTTPS").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_https_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ospf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_stun": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny STUN").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_stun_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_snmp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SNMP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_netconf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NETCONF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bfd": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny BFD").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_encapsulations": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Encapsulation for TLOC").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Encapsulation").AddStringEnumDescription("gre", "ipsec").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("gre", "ipsec"),
+ },
+ },
+ "preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set preference for TLOC").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set weight for TLOC").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "weight_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "nat_ipv4": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Network Address Translation on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "nat_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT UDP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 8947),
+ },
+ },
+ "nat_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT TCP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 8947),
+ },
+ },
+ "nat_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "qos_adaptive_period": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adapt Period(Minutes)").AddIntegerRangeDescription(1, 720).AddDefaultValueDescription("15").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 720),
+ },
+ },
+ "qos_adaptive_period_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Upstream").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "qos_adaptive_min_upstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Upstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_min_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_max_upstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Upstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_max_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_default_upstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default upstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_default_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Downstream").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "qos_adaptive_min_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Downstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_min_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_max_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Downstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_max_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_default_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default downstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_default_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate (Kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP V4 Address").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1500, 9216),
+ },
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tloc_extension": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Extends a local TLOC to a remote node only for vpn 0").String,
+ Optional: true,
+ },
+ "tloc_extension_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
+ Optional: true,
+ },
+ "tracker_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportWANVPNInterfaceCellularProfileParcelResource) 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportWANVPNInterfaceCellular
+
+ // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportWANVPNInterfaceCellular
+
+ // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportWANVPNInterfaceCellular
+
+ // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportWANVPNInterfaceCellular
+
+ // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) 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_transport_wan_vpn_interface_cellular_feature_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_test.go
new file mode 100644
index 000000000..62871e633
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_test.go
@@ -0,0 +1,261 @@
+// 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 TestAccSdwanTransportWANVPNInterfaceCellularProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "interface_name", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "interface_description", "WAN"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "service_provider", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "bandwidth_upstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "bandwidth_downstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "per_tunnel_qos", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_qos_mode", "hub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_bandwidth_percent", "82"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_bind_loopback_tunnel", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_carrier", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_color", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_hello_interval", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_hello_tolerance", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_last_resort_circuit", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_color_restrict", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_groups", "42949672"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_border", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_max_control_connections", "62"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_nat_refresh_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_vbond_as_stun_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_vmanage_connection_preference", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_port_hop", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_low_bandwidth_link", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_network_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_all", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_dhcp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_ntp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_ssh", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_dns", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_icmp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_https", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_stun", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_snmp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_netconf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_allow_bfd", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tunnel_interface_encapsulations.0.weight", "250"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "nat_ipv4", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "nat_udp_timeout", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "nat_tcp_timeout", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tcp_mss", "505"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tloc_extension", "tloc"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "tracker", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_cellular_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_cellular_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` interface_description = "WAN"` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` service_provider = "example"` + "\n"
+ config += ` bandwidth_upstream = 21474836` + "\n"
+ config += ` bandwidth_downstream = 21474836` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += ` per_tunnel_qos = true` + "\n"
+ config += ` tunnel_qos_mode = "hub"` + "\n"
+ config += ` tunnel_bandwidth_percent = 82` + "\n"
+ config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
+ config += ` tunnel_interface_carrier = "default"` + "\n"
+ config += ` tunnel_interface_color = "default"` + "\n"
+ config += ` tunnel_interface_hello_interval = 1000` + "\n"
+ config += ` tunnel_interface_hello_tolerance = 12` + "\n"
+ config += ` tunnel_interface_last_resort_circuit = false` + "\n"
+ config += ` tunnel_interface_color_restrict = true` + "\n"
+ config += ` tunnel_interface_groups = 42949672` + "\n"
+ config += ` tunnel_interface_border = false` + "\n"
+ config += ` tunnel_interface_max_control_connections = 62` + "\n"
+ config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
+ config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
+ config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
+ config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
+ config += ` tunnel_interface_port_hop = true` + "\n"
+ config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
+ config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
+ config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
+ config += ` tunnel_interface_network_broadcast = false` + "\n"
+ config += ` tunnel_interface_allow_all = false` + "\n"
+ config += ` tunnel_interface_allow_bgp = false` + "\n"
+ config += ` tunnel_interface_allow_dhcp = true` + "\n"
+ config += ` tunnel_interface_allow_ntp = false` + "\n"
+ config += ` tunnel_interface_allow_ssh = false` + "\n"
+ config += ` tunnel_interface_allow_dns = true` + "\n"
+ config += ` tunnel_interface_allow_icmp = true` + "\n"
+ config += ` tunnel_interface_allow_https = true` + "\n"
+ config += ` tunnel_interface_allow_ospf = false` + "\n"
+ config += ` tunnel_interface_allow_stun = false` + "\n"
+ config += ` tunnel_interface_allow_snmp = false` + "\n"
+ config += ` tunnel_interface_allow_netconf = false` + "\n"
+ config += ` tunnel_interface_allow_bfd = false` + "\n"
+ config += ` tunnel_interface_encapsulations = [{` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = 4294967` + "\n"
+ config += ` weight = 250` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_ipv4 = true` + "\n"
+ config += ` nat_udp_timeout = 1` + "\n"
+ config += ` nat_tcp_timeout = 60` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 505` + "\n"
+ config += ` tloc_extension = "tloc"` + "\n"
+ config += ` tracker = "example"` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go
deleted file mode 100644
index 9073b21a9..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go
+++ /dev/null
@@ -1,879 +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-validators/int64validator"
- "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 = &TransportWANVPNInterfaceCellularProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceCellularProfileParcelResource{}
-
-func NewTransportWANVPNInterfaceCellularProfileParcelResource() resource.Resource {
- return &TransportWANVPNInterfaceCellularProfileParcelResource{}
-}
-
-type TransportWANVPNInterfaceCellularProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportWANVPNInterfaceCellularProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_cellular_profile_parcel"
-}
-
-func (r *TransportWANVPNInterfaceCellularProfileParcelResource) 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 Transport WAN VPN Interface Cellular 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Profile Parcel ID").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of DHCP IPv4 helper addresses (min 1, max 8)").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "service_provider": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service Provider Name").String,
- Optional: true,
- },
- "service_provider_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "bandwidth_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface upstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2147483647),
- },
- },
- "bandwidth_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "bandwidth_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface downstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2147483647),
- },
- },
- "bandwidth_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel Interface on/off").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "per_tunnel_qos": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel Qos").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "per_tunnel_qos_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_qos_mode": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set tunnel QoS mode").AddStringEnumDescription("hub", "spoke").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("hub", "spoke"),
- },
- },
- "tunnel_qos_mode_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_bandwidth_percent": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnels Bandwidth Percent").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("50").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 100),
- },
- },
- "tunnel_bandwidth_percent_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Bind loopback tunnel interface to a physical interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_carrier": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set carrier for TLOC").AddStringEnumDescription("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8").AddDefaultValueDescription("default").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8"),
- },
- },
- "tunnel_interface_carrier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_color": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set color for TLOC").AddStringEnumDescription("default", "mpls", "metro ethernet", "biz internet", "public internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6").AddDefaultValueDescription("mpls").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("default", "mpls", "metro ethernet", "biz internet", "public internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6"),
- },
- },
- "tunnel_interface_color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_hello_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set time period of control hello packets <100..600000> milli seconds").AddIntegerRangeDescription(100, 600000).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 600000),
- },
- },
- "tunnel_interface_hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_hello_tolerance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set tolerance of control hello packets <12..6000> seconds").AddIntegerRangeDescription(12, 6000).AddDefaultValueDescription("12").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(12, 6000),
- },
- },
- "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as last resort").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_color_restrict": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Restrict this TLOC behavior").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_color_restrict_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_groups": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of groups").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "tunnel_interface_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_border": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as border TLOC").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_border_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_max_control_connections": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Maximum Control Connections").AddIntegerRangeDescription(0, 100).String,
- Optional: true,
- },
- "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set time period of nat refresh packets <1...60> seconds").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("5").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 60),
- },
- },
- "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Put this wan interface in STUN mode only").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Exclude the following controller groups defined in this list.").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface preference for control connection to vManage <0..8>").AddIntegerRangeDescription(0, 8).AddDefaultValueDescription("5").String,
- Optional: true,
- },
- "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_port_hop": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Disallow port hopping on the tunnel interface").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_port_hop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the interface as a low-bandwidth circuit").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_network_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Accept and respond to network-prefix-directed broadcasts").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_all": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow all traffic. Overrides all other allow-service options if allow-service all is set").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_all_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_bgp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/deny BGP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_dhcp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DHCP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ntp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NTP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ssh": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SSH").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_dns": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DNS").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_dns_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_icmp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny ICMP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_https": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny HTTPS").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_https_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ospf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny OSPF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_stun": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny STUN").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_stun_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_snmp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SNMP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_netconf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NETCONF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_bfd": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny BFD").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_encapsulations": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Encapsulation for TLOC").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Encapsulation").AddStringEnumDescription("gre", "ipsec").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("gre", "ipsec"),
- },
- },
- "preference": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set preference for TLOC").AddIntegerRangeDescription(0, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(4294967295),
- },
- },
- "preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "weight": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set weight for TLOC").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "weight_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "nat_ipv4": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Network Address Translation on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "nat_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT UDP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 8947),
- },
- },
- "nat_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT TCP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("60").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 8947),
- },
- },
- "nat_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "qos_adaptive_period": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adapt Period(Minutes)").AddIntegerRangeDescription(1, 720).AddDefaultValueDescription("15").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 720),
- },
- },
- "qos_adaptive_period_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Upstream").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "qos_adaptive_min_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Upstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_min_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_max_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Upstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_max_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_default_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default upstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_default_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Downstream").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "qos_adaptive_min_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Downstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_min_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_max_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Downstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_max_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_default_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default downstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_default_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate (Kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP V4 Address").String,
- Optional: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1500, 9216),
- },
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tloc_extension": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Extends a local TLOC to a remote node only for vpn 0").String,
- Optional: true,
- },
- "tloc_extension_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
- Optional: true,
- },
- "tracker_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *TransportWANVPNInterfaceCellularProfileParcelResource) 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportWANVPNInterfaceCellular
-
- // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportWANVPNInterfaceCellular
-
- // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportWANVPNInterfaceCellular
-
- // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportWANVPNInterfaceCellular
-
- // 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 *TransportWANVPNInterfaceCellularProfileParcelResource) 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_transport_wan_vpn_interface_cellular_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_profile_parcel_test.go
deleted file mode 100644
index ccbe3d2d5..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_profile_parcel_test.go
+++ /dev/null
@@ -1,262 +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 TestAccSdwanTransportWANVPNInterfaceCellularProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "interface_name", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "interface_description", "WAN"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "service_provider", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "bandwidth_upstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "bandwidth_downstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "per_tunnel_qos", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_qos_mode", "hub"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_bandwidth_percent", "82"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_bind_loopback_tunnel", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_carrier", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_color", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_hello_interval", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_hello_tolerance", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_last_resort_circuit", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_color_restrict", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_groups", "42949672"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_border", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_max_control_connections", "62"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_nat_refresh_interval", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_vbond_as_stun_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_vmanage_connection_preference", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_port_hop", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_low_bandwidth_link", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_network_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_all", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_dhcp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_ntp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_ssh", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_dns", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_icmp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_https", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_stun", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_snmp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_netconf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_allow_bfd", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tunnel_interface_encapsulations.0.weight", "250"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "nat_ipv4", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "nat_udp_timeout", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "nat_tcp_timeout", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tcp_mss", "505"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tloc_extension", "tloc"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "tracker", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_cellular_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportWANVPNInterfaceCellularPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportWANVPNInterfaceCellularProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_wan_vpn_interface_cellular_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` interface_description = "WAN"` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` service_provider = "example"` + "\n"
- config += ` bandwidth_upstream = 21474836` + "\n"
- config += ` bandwidth_downstream = 21474836` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += ` per_tunnel_qos = true` + "\n"
- config += ` tunnel_qos_mode = "hub"` + "\n"
- config += ` tunnel_bandwidth_percent = 82` + "\n"
- config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
- config += ` tunnel_interface_carrier = "default"` + "\n"
- config += ` tunnel_interface_color = "default"` + "\n"
- config += ` tunnel_interface_hello_interval = 1000` + "\n"
- config += ` tunnel_interface_hello_tolerance = 12` + "\n"
- config += ` tunnel_interface_last_resort_circuit = false` + "\n"
- config += ` tunnel_interface_color_restrict = true` + "\n"
- config += ` tunnel_interface_groups = 42949672` + "\n"
- config += ` tunnel_interface_border = false` + "\n"
- config += ` tunnel_interface_max_control_connections = 62` + "\n"
- config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
- config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
- config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
- config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
- config += ` tunnel_interface_port_hop = true` + "\n"
- config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
- config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
- config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
- config += ` tunnel_interface_network_broadcast = false` + "\n"
- config += ` tunnel_interface_allow_all = false` + "\n"
- config += ` tunnel_interface_allow_bgp = false` + "\n"
- config += ` tunnel_interface_allow_dhcp = true` + "\n"
- config += ` tunnel_interface_allow_ntp = false` + "\n"
- config += ` tunnel_interface_allow_ssh = false` + "\n"
- config += ` tunnel_interface_allow_dns = true` + "\n"
- config += ` tunnel_interface_allow_icmp = true` + "\n"
- config += ` tunnel_interface_allow_https = true` + "\n"
- config += ` tunnel_interface_allow_ospf = false` + "\n"
- config += ` tunnel_interface_allow_stun = false` + "\n"
- config += ` tunnel_interface_allow_snmp = false` + "\n"
- config += ` tunnel_interface_allow_netconf = false` + "\n"
- config += ` tunnel_interface_allow_bfd = false` + "\n"
- config += ` tunnel_interface_encapsulations = [{` + "\n"
- config += ` encapsulation = "gre"` + "\n"
- config += ` preference = 4294967` + "\n"
- config += ` weight = 250` + "\n"
- config += ` }]` + "\n"
- config += ` nat_ipv4 = true` + "\n"
- config += ` nat_udp_timeout = 1` + "\n"
- config += ` nat_tcp_timeout = 60` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 505` + "\n"
- config += ` tloc_extension = "tloc"` + "\n"
- config += ` tracker = "example"` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go
new file mode 100644
index 000000000..95627ef0d
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature.go
@@ -0,0 +1,1293 @@
+// 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/int64validator"
+ "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 = &TransportWANVPNInterfaceEthernetProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceEthernetProfileParcelResource{}
+
+func NewTransportWANVPNInterfaceEthernetProfileParcelResource() resource.Resource {
+ return &TransportWANVPNInterfaceEthernetProfileParcelResource{}
+}
+
+type TransportWANVPNInterfaceEthernetProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ethernet_feature"
+}
+
+func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) 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 Transport WAN VPN Interface Ethernet Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 200),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_configuration_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Configuration Type").AddStringEnumDescription("dynamic", "static").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("dynamic", "static"),
+ },
+ },
+ "ipv4_dhcp_distance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`").AddIntegerRangeDescription(1, 65536).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 65536),
+ },
+ },
+ "ipv4_dhcp_distance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
+ Optional: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
+ Optional: true,
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv4_dhcp_helper": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of DHCP IPv4 helper addresses (min 1, max 8)").String,
+ ElementType: types.StringType,
+ Optional: true,
+ },
+ "ipv4_dhcp_helper_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_configuration_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Configuration Type").AddStringEnumDescription("dynamic", "static", "none").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("dynamic", "static", "none"),
+ },
+ },
+ "enable_dhcpv6": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String,
+ Optional: true,
+ },
+ "ipv6_dhcp_secondary_address": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_secondary_addresses": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Static secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "iperf_server": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Iperf server for auto bandwidth detect").String,
+ Optional: true,
+ },
+ "iperf_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "block_non_source_ip": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Block packets originating from IP address that is not from this source").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "block_non_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "service_provider": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Service Provider Name").String,
+ Optional: true,
+ },
+ "service_provider_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "bandwidth_upstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface upstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 2147483647),
+ },
+ },
+ "bandwidth_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "bandwidth_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface downstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 2147483647),
+ },
+ },
+ "bandwidth_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "auto_detect_bandwidth": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface auto detect bandwidth").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "auto_detect_bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel Interface on/off").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "per_tunnel_qos": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel Qos").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "per_tunnel_qos_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_qos_mode": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set tunnel QoS mode").AddStringEnumDescription("hub", "spoke").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("hub", "spoke"),
+ },
+ },
+ "tunnel_qos_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_bandwidth_percent": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnels Bandwidth Percent").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("50").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 100),
+ },
+ },
+ "tunnel_bandwidth_percent_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Bind loopback tunnel interface to a physical interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_carrier": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set carrier for TLOC").AddStringEnumDescription("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8").AddDefaultValueDescription("default").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8"),
+ },
+ },
+ "tunnel_interface_carrier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_color": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set color for TLOC").AddStringEnumDescription("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6").AddDefaultValueDescription("mpls").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6"),
+ },
+ },
+ "tunnel_interface_color_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time period of control hello packets <100..600000> milli seconds").AddIntegerRangeDescription(100, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 600000),
+ },
+ },
+ "tunnel_interface_hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_hello_tolerance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set tolerance of control hello packets <12..6000> seconds").AddIntegerRangeDescription(12, 6000).AddDefaultValueDescription("12").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(12, 6000),
+ },
+ },
+ "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as last resort").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_gre_tunnel_destination_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("GRE tunnel destination IP").String,
+ Optional: true,
+ },
+ "tunnel_interface_gre_tunnel_destination_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_color_restrict": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Restrict this TLOC behavior").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_color_restrict_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_groups": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of groups").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "tunnel_interface_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_border": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as border TLOC").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_border_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_max_control_connections": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Maximum Control Connections").AddIntegerRangeDescription(0, 100).String,
+ Optional: true,
+ },
+ "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time period of nat refresh packets <1...60> seconds").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 60),
+ },
+ },
+ "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Put this wan interface in STUN mode only").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Exclude the following controller groups defined in this list.").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface preference for control connection to vManage <0..8>").AddIntegerRangeDescription(0, 8).AddDefaultValueDescription("5").String,
+ Optional: true,
+ },
+ "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_port_hop": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Disallow port hopping on the tunnel interface").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_port_hop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface as a low-bandwidth circuit").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_cts_sgt_propagation": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("CTS SGT Propagation configuration").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_cts_sgt_propagation_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_network_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Accept and respond to network-prefix-directed broadcasts").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_all": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow all traffic. Overrides all other allow-service options if allow-service all is set").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_all_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bgp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/deny BGP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dhcp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DHCP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ntp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NTP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ssh": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SSH").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dns": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DNS").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dns_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_icmp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny ICMP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_https": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny HTTPS").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_https_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ospf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_stun": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny STUN").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_stun_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_snmp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SNMP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_netconf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NETCONF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bfd": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny BFD").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_encapsulations": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Encapsulation for TLOC").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Encapsulation").AddStringEnumDescription("gre", "ipsec").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("gre", "ipsec"),
+ },
+ },
+ "preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set preference for TLOC").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set weight for TLOC").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "weight_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "nat_ipv4": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "nat_ipv4_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Type").AddStringEnumDescription("interface", "pool", "loopback").AddDefaultValueDescription("interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("interface", "pool", "loopback"),
+ },
+ },
+ "nat_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_range_start": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range Start").String,
+ Optional: true,
+ },
+ "nat_range_start_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_range_end": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range End").String,
+ Optional: true,
+ },
+ "nat_range_end_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_prefix_length": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Prefix Length").AddIntegerRangeDescription(1, 32).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 32),
+ },
+ },
+ "nat_prefix_length_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_overload": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Overload").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "nat_overload_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_loopback": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT Inside Source Loopback Interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "nat_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_udp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT UDP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 8947),
+ },
+ },
+ "nat_udp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat_tcp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set NAT TCP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("60").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 8947),
+ },
+ },
+ "nat_tcp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "new_static_nats": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("static NAT").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source IP address to be translated").String,
+ Optional: true,
+ },
+ "source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "translated_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Statically translated source IP address").String,
+ Optional: true,
+ },
+ "translated_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "direction": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Direction of static NAT translation").AddStringEnumDescription("inside", "outside").AddDefaultValueDescription("inside").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("inside", "outside"),
+ },
+ },
+ "source_vpn": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source VPN ID").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "source_vpn_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "nat_ipv6": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation ipv6 on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "nat_ipv6_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "nat64": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT64 on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "nat66": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("NAT66 on this interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "static_nat66": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("static NAT66").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "source_prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source Prefix").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "source_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "translated_source_prefix": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Translated Source Prefix").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "translated_source_prefix_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "source_vpn_id": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Source VPN ID").AddIntegerRangeDescription(0, 65530).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(65530),
+ },
+ },
+ "source_vpn_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "qos_adaptive": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "qos_adaptive_period": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adapt Period(Minutes)").AddIntegerRangeDescription(1, 720).AddDefaultValueDescription("15").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 720),
+ },
+ },
+ "qos_adaptive_period_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Upstream").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "qos_adaptive_min_upstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Upstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_min_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_max_upstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Upstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_max_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_default_upstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default upstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_default_upstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Downstream").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "qos_adaptive_min_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Downstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_min_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_max_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Downstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_max_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_adaptive_default_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default downstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_adaptive_default_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "qos_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate (Kbps)").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arps": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "ip_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP V4 Address").String,
+ Optional: true,
+ },
+ "ip_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "icmp_redirect_disable": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "icmp_redirect_disable_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "duplex": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Duplex mode").AddStringEnumDescription("full", "half", "auto").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("full", "half", "auto"),
+ },
+ },
+ "duplex_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mac_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
+ Optional: true,
+ },
+ "mac_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1500, 9216),
+ },
+ },
+ "interface_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "speed": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface speed").AddStringEnumDescription("10", "100", "1000", "2500", "10000").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("10", "100", "1000", "2500", "10000"),
+ },
+ },
+ "speed_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "arp_timeout": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2147483).AddDefaultValueDescription("1200").String,
+ Optional: true,
+ },
+ "arp_timeout_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "autonegotiate": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Link autonegotiation").String,
+ Optional: true,
+ },
+ "autonegotiate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "media_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Media type").AddStringEnumDescription("auto-select", "rj45", "sfp").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("auto-select", "rj45", "sfp"),
+ },
+ },
+ "media_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tloc_extension": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Extends a local TLOC to a remote node only for vpn 0").String,
+ Optional: true,
+ },
+ "tloc_extension_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "gre_tunnel_source_ip": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("GRE tunnel source IP").String,
+ Optional: true,
+ },
+ "gre_tunnel_source_ip_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "xconnect": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Extend remote TLOC over a GRE tunnel to a local WAN interface").String,
+ Optional: true,
+ },
+ "xconnect_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "load_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interval for interface load calculation").AddIntegerRangeDescription(30, 600).AddDefaultValueDescription("30").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(30, 600),
+ },
+ },
+ "load_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
+ Optional: true,
+ },
+ "tracker_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "ip_directed_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportWANVPNInterfaceEthernet
+
+ // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportWANVPNInterfaceEthernet
+
+ // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportWANVPNInterfaceEthernet
+
+ // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportWANVPNInterfaceEthernet
+
+ // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) 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_transport_wan_vpn_interface_ethernet_feature_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go
new file mode 100644
index 000000000..83bdbc128
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_test.go
@@ -0,0 +1,332 @@
+// 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 TestAccSdwanTransportWANVPNInterfaceEthernetProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_name", "GigabitEthernet1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_description", "WAN"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ipv6_configuration_type", "static"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "iperf_server", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "block_non_source_ip", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "service_provider", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "bandwidth_upstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "bandwidth_downstream", "21474836"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "auto_detect_bandwidth", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "per_tunnel_qos", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_qos_mode", "hub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_bandwidth_percent", "82"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_bind_loopback_tunnel", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_carrier", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_color", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_hello_interval", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_hello_tolerance", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_last_resort_circuit", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_gre_tunnel_destination_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_color_restrict", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_groups", "42949672"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_border", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_max_control_connections", "62"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_nat_refresh_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_vbond_as_stun_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_vmanage_connection_preference", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_port_hop", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_low_bandwidth_link", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_cts_sgt_propagation", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_network_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_all", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_dhcp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_ntp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_ssh", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_dns", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_icmp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_https", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_stun", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_snmp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_netconf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_allow_bfd", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tunnel_interface_encapsulations.0.weight", "250"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_ipv4", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_type", "interface"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_udp_timeout", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_tcp_timeout", "60"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.translated_ip", "2.3.4.5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.direction", "inside"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "new_static_nats.0.source_vpn", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat_ipv6", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat64", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "nat66", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "static_nat66.0.source_prefix", "2001:0db8:85a3::/48"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "static_nat66.0.translated_source_prefix", "abcd:1234:5678::/48"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "static_nat66.0.source_vpn_id", "4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "arps.0.ip_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "icmp_redirect_disable", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "duplex", "full"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "mac_address", "00-B0-D0-63-C2-26"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "interface_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tcp_mss", "505"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "speed", "2500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "arp_timeout", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "autonegotiate", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "media_type", "rj45"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tloc_extension", "tloc"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "gre_tunnel_source_ip", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "xconnect", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "load_interval", "30"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "tracker", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_feature.test", "ip_directed_broadcast", "false"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_ethernet_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "GigabitEthernet1"` + "\n"
+ config += ` interface_description = "WAN"` + "\n"
+ config += ` ipv4_configuration_type = "static"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv4_secondary_addresses = [{` + "\n"
+ config += ` address = "1.2.3.4"` + "\n"
+ config += ` subnet_mask = "0.0.0.0"` + "\n"
+ config += ` }]` + "\n"
+ config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
+ config += ` ipv6_configuration_type = "static"` + "\n"
+ config += ` iperf_server = "example"` + "\n"
+ config += ` block_non_source_ip = false` + "\n"
+ config += ` service_provider = "example"` + "\n"
+ config += ` bandwidth_upstream = 21474836` + "\n"
+ config += ` bandwidth_downstream = 21474836` + "\n"
+ config += ` auto_detect_bandwidth = false` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += ` per_tunnel_qos = true` + "\n"
+ config += ` tunnel_qos_mode = "hub"` + "\n"
+ config += ` tunnel_bandwidth_percent = 82` + "\n"
+ config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
+ config += ` tunnel_interface_carrier = "default"` + "\n"
+ config += ` tunnel_interface_color = "default"` + "\n"
+ config += ` tunnel_interface_hello_interval = 1000` + "\n"
+ config += ` tunnel_interface_hello_tolerance = 12` + "\n"
+ config += ` tunnel_interface_last_resort_circuit = false` + "\n"
+ config += ` tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"` + "\n"
+ config += ` tunnel_interface_color_restrict = true` + "\n"
+ config += ` tunnel_interface_groups = 42949672` + "\n"
+ config += ` tunnel_interface_border = false` + "\n"
+ config += ` tunnel_interface_max_control_connections = 62` + "\n"
+ config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
+ config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
+ config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
+ config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
+ config += ` tunnel_interface_port_hop = true` + "\n"
+ config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
+ config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
+ config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
+ config += ` tunnel_interface_cts_sgt_propagation = false` + "\n"
+ config += ` tunnel_interface_network_broadcast = false` + "\n"
+ config += ` tunnel_interface_allow_all = false` + "\n"
+ config += ` tunnel_interface_allow_bgp = false` + "\n"
+ config += ` tunnel_interface_allow_dhcp = true` + "\n"
+ config += ` tunnel_interface_allow_ntp = false` + "\n"
+ config += ` tunnel_interface_allow_ssh = false` + "\n"
+ config += ` tunnel_interface_allow_dns = true` + "\n"
+ config += ` tunnel_interface_allow_icmp = true` + "\n"
+ config += ` tunnel_interface_allow_https = true` + "\n"
+ config += ` tunnel_interface_allow_ospf = false` + "\n"
+ config += ` tunnel_interface_allow_stun = false` + "\n"
+ config += ` tunnel_interface_allow_snmp = false` + "\n"
+ config += ` tunnel_interface_allow_netconf = false` + "\n"
+ config += ` tunnel_interface_allow_bfd = false` + "\n"
+ config += ` tunnel_interface_encapsulations = [{` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = 4294967` + "\n"
+ config += ` weight = 250` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_ipv4 = true` + "\n"
+ config += ` nat_type = "interface"` + "\n"
+ config += ` nat_udp_timeout = 1` + "\n"
+ config += ` nat_tcp_timeout = 60` + "\n"
+ config += ` new_static_nats = [{` + "\n"
+ config += ` source_ip = "1.2.3.4"` + "\n"
+ config += ` translated_ip = "2.3.4.5"` + "\n"
+ config += ` direction = "inside"` + "\n"
+ config += ` source_vpn = 3` + "\n"
+ config += ` }]` + "\n"
+ config += ` nat_ipv6 = true` + "\n"
+ config += ` nat64 = false` + "\n"
+ config += ` nat66 = true` + "\n"
+ config += ` static_nat66 = [{` + "\n"
+ config += ` source_prefix = "2001:0db8:85a3::/48"` + "\n"
+ config += ` translated_source_prefix = "abcd:1234:5678::/48"` + "\n"
+ config += ` source_vpn_id = 4` + "\n"
+ config += ` }]` + "\n"
+ config += ` arps = [{` + "\n"
+ config += ` ip_address = "1.2.3.4"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` }]` + "\n"
+ config += ` icmp_redirect_disable = true` + "\n"
+ config += ` duplex = "full"` + "\n"
+ config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` interface_mtu = 1500` + "\n"
+ config += ` tcp_mss = 505` + "\n"
+ config += ` speed = "2500"` + "\n"
+ config += ` arp_timeout = 1200` + "\n"
+ config += ` autonegotiate = false` + "\n"
+ config += ` media_type = "rj45"` + "\n"
+ config += ` tloc_extension = "tloc"` + "\n"
+ config += ` gre_tunnel_source_ip = "1.2.3.4"` + "\n"
+ config += ` xconnect = "example"` + "\n"
+ config += ` load_interval = 30` + "\n"
+ config += ` tracker = "example"` + "\n"
+ config += ` ip_directed_broadcast = false` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go
deleted file mode 100644
index 2b19b200a..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go
+++ /dev/null
@@ -1,1293 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportWANVPNInterfaceEthernetProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceEthernetProfileParcelResource{}
-
-func NewTransportWANVPNInterfaceEthernetProfileParcelResource() resource.Resource {
- return &TransportWANVPNInterfaceEthernetProfileParcelResource{}
-}
-
-type TransportWANVPNInterfaceEthernetProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ethernet_profile_parcel"
-}
-
-func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) 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 Transport WAN VPN Interface Ethernet 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Profile Parcel ID").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 200),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_configuration_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Configuration Type").AddStringEnumDescription("dynamic", "static").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("dynamic", "static"),
- },
- },
- "ipv4_dhcp_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("DHCP Distance, Attribute conditional on `ipv4_configuration_type` being equal to `dynamic`").AddIntegerRangeDescription(1, 65536).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 65536),
- },
- },
- "ipv4_dhcp_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
- Optional: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask, Attribute conditional on `ipv4_configuration_type` being equal to `static`").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary IpV4 Addresses, Attribute conditional on `ipv4_configuration_type` being equal to `static`").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IpV4 Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_dhcp_helper": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of DHCP IPv4 helper addresses (min 1, max 8)").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "ipv4_dhcp_helper_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_configuration_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Configuration Type").AddStringEnumDescription("dynamic", "static", "none").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("dynamic", "static", "none"),
- },
- },
- "enable_dhcpv6": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable DHCPv6, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String,
- Optional: true,
- },
- "ipv6_dhcp_secondary_address": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `dynamic`").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_secondary_addresses": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Static secondary IPv6 addresses, Attribute conditional on `ipv6_configuration_type` being equal to `static`").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Address Secondary").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "iperf_server": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Iperf server for auto bandwidth detect").String,
- Optional: true,
- },
- "iperf_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "block_non_source_ip": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Block packets originating from IP address that is not from this source").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "block_non_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "service_provider": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service Provider Name").String,
- Optional: true,
- },
- "service_provider_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "bandwidth_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface upstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2147483647),
- },
- },
- "bandwidth_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "bandwidth_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface downstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2147483647),
- },
- },
- "bandwidth_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "auto_detect_bandwidth": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface auto detect bandwidth").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "auto_detect_bandwidth_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel Interface on/off").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "per_tunnel_qos": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel Qos").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "per_tunnel_qos_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_qos_mode": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set tunnel QoS mode").AddStringEnumDescription("hub", "spoke").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("hub", "spoke"),
- },
- },
- "tunnel_qos_mode_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_bandwidth_percent": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnels Bandwidth Percent").AddIntegerRangeDescription(1, 100).AddDefaultValueDescription("50").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 100),
- },
- },
- "tunnel_bandwidth_percent_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Bind loopback tunnel interface to a physical interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_carrier": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set carrier for TLOC").AddStringEnumDescription("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8").AddDefaultValueDescription("default").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8"),
- },
- },
- "tunnel_interface_carrier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_color": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set color for TLOC").AddStringEnumDescription("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6").AddDefaultValueDescription("mpls").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6"),
- },
- },
- "tunnel_interface_color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_hello_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set time period of control hello packets <100..600000> milli seconds").AddIntegerRangeDescription(100, 600000).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 600000),
- },
- },
- "tunnel_interface_hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_hello_tolerance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set tolerance of control hello packets <12..6000> seconds").AddIntegerRangeDescription(12, 6000).AddDefaultValueDescription("12").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(12, 6000),
- },
- },
- "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as last resort").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_gre_tunnel_destination_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("GRE tunnel destination IP").String,
- Optional: true,
- },
- "tunnel_interface_gre_tunnel_destination_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_color_restrict": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Restrict this TLOC behavior").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_color_restrict_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_groups": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of groups").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "tunnel_interface_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_border": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as border TLOC").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_border_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_max_control_connections": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Maximum Control Connections").AddIntegerRangeDescription(0, 100).String,
- Optional: true,
- },
- "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set time period of nat refresh packets <1...60> seconds").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("5").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 60),
- },
- },
- "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Put this wan interface in STUN mode only").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Exclude the following controller groups defined in this list.").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface preference for control connection to vManage <0..8>").AddIntegerRangeDescription(0, 8).AddDefaultValueDescription("5").String,
- Optional: true,
- },
- "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_port_hop": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Disallow port hopping on the tunnel interface").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_port_hop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the interface as a low-bandwidth circuit").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_cts_sgt_propagation": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("CTS SGT Propagation configuration").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_cts_sgt_propagation_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_network_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Accept and respond to network-prefix-directed broadcasts").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_network_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_all": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow all traffic. Overrides all other allow-service options if allow-service all is set").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_all_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_bgp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/deny BGP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_dhcp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DHCP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ntp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NTP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ssh": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SSH").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_dns": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DNS").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_dns_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_icmp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny ICMP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_https": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny HTTPS").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_https_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ospf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny OSPF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_stun": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny STUN").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_stun_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_snmp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SNMP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_netconf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NETCONF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_bfd": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny BFD").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_encapsulations": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Encapsulation for TLOC").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Encapsulation").AddStringEnumDescription("gre", "ipsec").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("gre", "ipsec"),
- },
- },
- "preference": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set preference for TLOC").AddIntegerRangeDescription(0, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(4294967295),
- },
- },
- "preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "weight": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set weight for TLOC").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "weight_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "nat_ipv4": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "nat_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Type").AddStringEnumDescription("interface", "pool", "loopback").AddDefaultValueDescription("interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("interface", "pool", "loopback"),
- },
- },
- "nat_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_range_start": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range Start").String,
- Optional: true,
- },
- "nat_range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_range_end": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Range End").String,
- Optional: true,
- },
- "nat_range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_prefix_length": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Pool Prefix Length").AddIntegerRangeDescription(1, 32).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 32),
- },
- },
- "nat_prefix_length_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_overload": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Overload").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "nat_overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_loopback": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT Inside Source Loopback Interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "nat_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_udp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT UDP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 8947),
- },
- },
- "nat_udp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat_tcp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set NAT TCP session timeout, in minutes").AddIntegerRangeDescription(1, 8947).AddDefaultValueDescription("60").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 8947),
- },
- },
- "nat_tcp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "new_static_nats": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("static NAT").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source IP address to be translated").String,
- Optional: true,
- },
- "source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "translated_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Statically translated source IP address").String,
- Optional: true,
- },
- "translated_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "direction": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Direction of static NAT translation").AddStringEnumDescription("inside", "outside").AddDefaultValueDescription("inside").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("inside", "outside"),
- },
- },
- "source_vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source VPN ID").AddIntegerRangeDescription(0, 65530).AddDefaultValueDescription("0").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65530),
- },
- },
- "source_vpn_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "nat_ipv6": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("enable Network Address Translation ipv6 on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "nat_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat64": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "nat66": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT66 on this interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "static_nat66": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("static NAT66").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "source_prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "source_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "translated_source_prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Translated Source Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "translated_source_prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "source_vpn_id": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Source VPN ID").AddIntegerRangeDescription(0, 65530).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(65530),
- },
- },
- "source_vpn_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "qos_adaptive": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "qos_adaptive_period": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adapt Period(Minutes)").AddIntegerRangeDescription(1, 720).AddDefaultValueDescription("15").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 720),
- },
- },
- "qos_adaptive_period_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_bandwidth_upstream": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Upstream").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "qos_adaptive_min_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Upstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_min_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_max_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Upstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_max_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_default_upstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default upstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_default_upstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_bandwidth_downstream": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate Downstream").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "qos_adaptive_min_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Downstream min bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_min_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_max_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Downstream max bandwidth limit (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_max_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_adaptive_default_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Adaptive QoS default downstream bandwidth (kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_adaptive_default_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "qos_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Shaping Rate (Kbps)").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arps": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure ARP entries").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "ip_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP V4 Address").String,
- Optional: true,
- },
- "ip_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "icmp_redirect_disable": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("ICMP/ICMPv6 Redirect Disable").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "icmp_redirect_disable_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "duplex": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Duplex mode").AddStringEnumDescription("full", "half", "auto").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("full", "half", "auto"),
- },
- },
- "duplex_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mac_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("MAC Address").String,
- Optional: true,
- },
- "mac_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP MTU for GigabitEthernet main <576..Interface MTU>, GigabitEthernet subinterface <576..9216>, Other Interfaces <576..2000> in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU GigabitEthernet0 <1500..1518>, Other GigabitEthernet <1500..9216> in bytes").AddIntegerRangeDescription(1500, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1500, 9216),
- },
- },
- "interface_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "speed": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface speed").AddStringEnumDescription("10", "100", "1000", "2500", "10000").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("10", "100", "1000", "2500", "10000"),
- },
- },
- "speed_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "arp_timeout": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Timeout value for dynamically learned ARP entries, <0..2678400> seconds").AddIntegerRangeDescription(0, 2147483).AddDefaultValueDescription("1200").String,
- Optional: true,
- },
- "arp_timeout_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "autonegotiate": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Link autonegotiation").String,
- Optional: true,
- },
- "autonegotiate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "media_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Media type").AddStringEnumDescription("auto-select", "rj45", "sfp").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("auto-select", "rj45", "sfp"),
- },
- },
- "media_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tloc_extension": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Extends a local TLOC to a remote node only for vpn 0").String,
- Optional: true,
- },
- "tloc_extension_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gre_tunnel_source_ip": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("GRE tunnel source IP").String,
- Optional: true,
- },
- "gre_tunnel_source_ip_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "xconnect": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Extend remote TLOC over a GRE tunnel to a local WAN interface").String,
- Optional: true,
- },
- "xconnect_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "load_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interval for interface load calculation").AddIntegerRangeDescription(30, 600).AddDefaultValueDescription("30").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(30, 600),
- },
- },
- "load_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
- Optional: true,
- },
- "tracker_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_directed_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Directed-Broadcast").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "ip_directed_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *TransportWANVPNInterfaceEthernetProfileParcelResource) 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportWANVPNInterfaceEthernet
-
- // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportWANVPNInterfaceEthernet
-
- // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportWANVPNInterfaceEthernet
-
- // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportWANVPNInterfaceEthernet
-
- // 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 *TransportWANVPNInterfaceEthernetProfileParcelResource) 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_transport_wan_vpn_interface_ethernet_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel_test.go
deleted file mode 100644
index 0ef6217c6..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel_test.go
+++ /dev/null
@@ -1,333 +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 TestAccSdwanTransportWANVPNInterfaceEthernetProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "interface_name", "GigabitEthernet1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "interface_description", "WAN"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv4_secondary_addresses.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ipv6_configuration_type", "static"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "iperf_server", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "block_non_source_ip", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "service_provider", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "bandwidth_upstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "bandwidth_downstream", "21474836"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "auto_detect_bandwidth", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "per_tunnel_qos", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_qos_mode", "hub"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_bandwidth_percent", "82"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_bind_loopback_tunnel", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_carrier", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_color", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_hello_interval", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_hello_tolerance", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_last_resort_circuit", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_gre_tunnel_destination_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_color_restrict", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_groups", "42949672"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_border", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_max_control_connections", "62"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_nat_refresh_interval", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_vbond_as_stun_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_vmanage_connection_preference", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_port_hop", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_low_bandwidth_link", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_cts_sgt_propagation", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_network_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_all", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_dhcp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_ntp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_ssh", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_dns", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_icmp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_https", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_stun", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_snmp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_netconf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_allow_bfd", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tunnel_interface_encapsulations.0.weight", "250"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_ipv4", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_type", "interface"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_udp_timeout", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_tcp_timeout", "60"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.translated_ip", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.direction", "inside"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "new_static_nats.0.source_vpn", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat_ipv6", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat64", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "nat66", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "static_nat66.0.source_prefix", "2001:0db8:85a3::/48"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "static_nat66.0.translated_source_prefix", "abcd:1234:5678::/48"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "static_nat66.0.source_vpn_id", "4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "arps.0.ip_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "arps.0.mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "icmp_redirect_disable", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "duplex", "full"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "mac_address", "00-B0-D0-63-C2-26"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "interface_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tcp_mss", "505"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "speed", "2500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "arp_timeout", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "autonegotiate", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "media_type", "rj45"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tloc_extension", "tloc"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "gre_tunnel_source_ip", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "xconnect", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "load_interval", "30"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "tracker", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.test", "ip_directed_broadcast", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportWANVPNInterfaceEthernetPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportWANVPNInterfaceEthernetProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_wan_vpn_interface_ethernet_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "GigabitEthernet1"` + "\n"
- config += ` interface_description = "WAN"` + "\n"
- config += ` ipv4_configuration_type = "static"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv4_secondary_addresses = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_dhcp_helper = ["1.2.3.4"]` + "\n"
- config += ` ipv6_configuration_type = "static"` + "\n"
- config += ` iperf_server = "example"` + "\n"
- config += ` block_non_source_ip = false` + "\n"
- config += ` service_provider = "example"` + "\n"
- config += ` bandwidth_upstream = 21474836` + "\n"
- config += ` bandwidth_downstream = 21474836` + "\n"
- config += ` auto_detect_bandwidth = false` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += ` per_tunnel_qos = true` + "\n"
- config += ` tunnel_qos_mode = "hub"` + "\n"
- config += ` tunnel_bandwidth_percent = 82` + "\n"
- config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
- config += ` tunnel_interface_carrier = "default"` + "\n"
- config += ` tunnel_interface_color = "default"` + "\n"
- config += ` tunnel_interface_hello_interval = 1000` + "\n"
- config += ` tunnel_interface_hello_tolerance = 12` + "\n"
- config += ` tunnel_interface_last_resort_circuit = false` + "\n"
- config += ` tunnel_interface_gre_tunnel_destination_ip = "1.2.3.4"` + "\n"
- config += ` tunnel_interface_color_restrict = true` + "\n"
- config += ` tunnel_interface_groups = 42949672` + "\n"
- config += ` tunnel_interface_border = false` + "\n"
- config += ` tunnel_interface_max_control_connections = 62` + "\n"
- config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
- config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
- config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
- config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
- config += ` tunnel_interface_port_hop = true` + "\n"
- config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
- config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
- config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
- config += ` tunnel_interface_cts_sgt_propagation = false` + "\n"
- config += ` tunnel_interface_network_broadcast = false` + "\n"
- config += ` tunnel_interface_allow_all = false` + "\n"
- config += ` tunnel_interface_allow_bgp = false` + "\n"
- config += ` tunnel_interface_allow_dhcp = true` + "\n"
- config += ` tunnel_interface_allow_ntp = false` + "\n"
- config += ` tunnel_interface_allow_ssh = false` + "\n"
- config += ` tunnel_interface_allow_dns = true` + "\n"
- config += ` tunnel_interface_allow_icmp = true` + "\n"
- config += ` tunnel_interface_allow_https = true` + "\n"
- config += ` tunnel_interface_allow_ospf = false` + "\n"
- config += ` tunnel_interface_allow_stun = false` + "\n"
- config += ` tunnel_interface_allow_snmp = false` + "\n"
- config += ` tunnel_interface_allow_netconf = false` + "\n"
- config += ` tunnel_interface_allow_bfd = false` + "\n"
- config += ` tunnel_interface_encapsulations = [{` + "\n"
- config += ` encapsulation = "gre"` + "\n"
- config += ` preference = 4294967` + "\n"
- config += ` weight = 250` + "\n"
- config += ` }]` + "\n"
- config += ` nat_ipv4 = true` + "\n"
- config += ` nat_type = "interface"` + "\n"
- config += ` nat_udp_timeout = 1` + "\n"
- config += ` nat_tcp_timeout = 60` + "\n"
- config += ` new_static_nats = [{` + "\n"
- config += ` source_ip = "1.2.3.4"` + "\n"
- config += ` translated_ip = "2.3.4.5"` + "\n"
- config += ` direction = "inside"` + "\n"
- config += ` source_vpn = 3` + "\n"
- config += ` }]` + "\n"
- config += ` nat_ipv6 = true` + "\n"
- config += ` nat64 = false` + "\n"
- config += ` nat66 = true` + "\n"
- config += ` static_nat66 = [{` + "\n"
- config += ` source_prefix = "2001:0db8:85a3::/48"` + "\n"
- config += ` translated_source_prefix = "abcd:1234:5678::/48"` + "\n"
- config += ` source_vpn_id = 4` + "\n"
- config += ` }]` + "\n"
- config += ` arps = [{` + "\n"
- config += ` ip_address = "1.2.3.4"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` }]` + "\n"
- config += ` icmp_redirect_disable = true` + "\n"
- config += ` duplex = "full"` + "\n"
- config += ` mac_address = "00-B0-D0-63-C2-26"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` interface_mtu = 1500` + "\n"
- config += ` tcp_mss = 505` + "\n"
- config += ` speed = "2500"` + "\n"
- config += ` arp_timeout = 1200` + "\n"
- config += ` autonegotiate = false` + "\n"
- config += ` media_type = "rj45"` + "\n"
- config += ` tloc_extension = "tloc"` + "\n"
- config += ` gre_tunnel_source_ip = "1.2.3.4"` + "\n"
- config += ` xconnect = "example"` + "\n"
- config += ` load_interval = 30` + "\n"
- config += ` tracker = "example"` + "\n"
- config += ` ip_directed_broadcast = false` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature.go
new file mode 100644
index 000000000..5a6c01b7f
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature.go
@@ -0,0 +1,388 @@
+// 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/int64validator"
+ "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 = &TransportWANVPNInterfaceGREProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceGREProfileParcelResource{}
+
+func NewTransportWANVPNInterfaceGREProfileParcelResource() resource.Resource {
+ return &TransportWANVPNInterfaceGREProfileParcelResource{}
+}
+
+type TransportWANVPNInterfaceGREProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportWANVPNInterfaceGREProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_gre_feature"
+}
+
+func (r *TransportWANVPNInterfaceGREProfileParcelResource) 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 Transport WAN VPN Interface GRE Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name (1..255)").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(4, 6),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^gre([1-9]|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 128),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel source IP Address").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_interface_loopback": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_source_interface_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_route_via_loopback": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name, can't be Loopback interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_route_via_loopback_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel destination IP Address").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <576..9976>, in bytes").AddIntegerRangeDescription(576, 9976).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9976),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("none", "sig"),
+ },
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportWANVPNInterfaceGREProfileParcelResource) 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 *TransportWANVPNInterfaceGREProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportWANVPNInterfaceGRE
+
+ // 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 *TransportWANVPNInterfaceGREProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportWANVPNInterfaceGRE
+
+ // 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 *TransportWANVPNInterfaceGREProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportWANVPNInterfaceGRE
+
+ // 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 *TransportWANVPNInterfaceGREProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportWANVPNInterfaceGRE
+
+ // 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 *TransportWANVPNInterfaceGREProfileParcelResource) 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_transport_wan_vpn_interface_gre_feature_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_test.go
new file mode 100644
index 000000000..a8f3048a8
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_test.go
@@ -0,0 +1,165 @@
+// 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 TestAccSdwanTransportWANVPNInterfaceGREProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_feature.test", "interface_description", "gre1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_feature.test", "tunnel_source_ipv4_address", "78.1.1.1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_feature.test", "application_tunnel_type", "none"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_gre_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "gre1"` + "\n"
+ config += ` ipv4_address = "70.1.1.1"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_gre_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "gre1"` + "\n"
+ config += ` interface_description = "gre1"` + "\n"
+ config += ` ipv4_address = "70.1.1.1"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go
deleted file mode 100644
index ec3677e6a..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go
+++ /dev/null
@@ -1,388 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportWANVPNInterfaceGREProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceGREProfileParcelResource{}
-
-func NewTransportWANVPNInterfaceGREProfileParcelResource() resource.Resource {
- return &TransportWANVPNInterfaceGREProfileParcelResource{}
-}
-
-type TransportWANVPNInterfaceGREProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportWANVPNInterfaceGREProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_gre_profile_parcel"
-}
-
-func (r *TransportWANVPNInterfaceGREProfileParcelResource) 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 Transport WAN VPN Interface GRE 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Profile Parcel ID").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface name (1..255)").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(4, 6),
- stringvalidator.RegexMatches(regexp.MustCompile(`^gre([1-9]|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 128),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel source IP Address").String,
- Optional: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_interface_loopback": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_source_interface_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_route_via_loopback": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name, can't be Loopback interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_route_via_loopback_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel destination IP Address").String,
- Required: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <576..9976>, in bytes").AddIntegerRangeDescription(576, 9976).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9976),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("none", "sig"),
- },
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *TransportWANVPNInterfaceGREProfileParcelResource) 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 *TransportWANVPNInterfaceGREProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportWANVPNInterfaceGRE
-
- // 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 *TransportWANVPNInterfaceGREProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportWANVPNInterfaceGRE
-
- // 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 *TransportWANVPNInterfaceGREProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportWANVPNInterfaceGRE
-
- // 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 *TransportWANVPNInterfaceGREProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportWANVPNInterfaceGRE
-
- // 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 *TransportWANVPNInterfaceGREProfileParcelResource) 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_transport_wan_vpn_interface_gre_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_profile_parcel_test.go
deleted file mode 100644
index 42c01c8ee..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_profile_parcel_test.go
+++ /dev/null
@@ -1,170 +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 TestAccSdwanTransportWANVPNInterfaceGREProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "interface_name", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "interface_description", "gre1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "ipv4_address", "70.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "tunnel_source_ipv4_address", "78.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "tunnel_destination_ipv4_address", "79.1.1.1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_gre_profile_parcel.test", "application_tunnel_type", "none"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportWANVPNInterfaceGREPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "gre1"` + "\n"
- config += ` ipv4_address = "70.1.1.1"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportWANVPNInterfaceGREProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_wan_vpn_interface_gre_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "gre1"` + "\n"
- config += ` interface_description = "gre1"` + "\n"
- config += ` ipv4_address = "70.1.1.1"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` tunnel_source_ipv4_address = "78.1.1.1"` + "\n"
- config += ` tunnel_destination_ipv4_address = "79.1.1.1"` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature.go
new file mode 100644
index 000000000..440aa65ce
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature.go
@@ -0,0 +1,558 @@
+// 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/int64validator"
+ "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 = &TransportWANVPNInterfaceIPSECProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceIPSECProfileParcelResource{}
+
+func NewTransportWANVPNInterfaceIPSECProfileParcelResource() resource.Resource {
+ return &TransportWANVPNInterfaceIPSECProfileParcelResource{}
+}
+
+type TransportWANVPNInterfaceIPSECProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportWANVPNInterfaceIPSECProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ipsec_feature"
+}
+
+func (r *TransportWANVPNInterfaceIPSECProfileParcelResource) 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 Transport WAN VPN Interface IPSEC Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface name: IPsec when present").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(6, 8),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^ipsec\d{1,3}$`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_description": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthAtMost(240),
+ },
+ },
+ "interface_description_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_source_interface": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(3, 32),
+ stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "tunnel_source_interface_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "application_tunnel_type": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("none", "sig"),
+ },
+ },
+ "application_tunnel_type_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <68..9216>, in bytes").AddIntegerRangeDescription(68, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(68, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dpd_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive interval (seconds)").AddIntegerRangeDescription(10, 3600).AddDefaultValueDescription("10").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(10, 3600),
+ },
+ },
+ "dpd_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "dpd_retries": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive retries").AddIntegerRangeDescription(2, 60).AddDefaultValueDescription("3").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(2, 60),
+ },
+ },
+ "dpd_retries_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_preshared_key": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Use preshared key to authenticate IKE peer").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 127),
+ },
+ },
+ "ike_preshared_key_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_version": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE Version <1..2>").AddIntegerRangeDescription(1, 2).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 2),
+ },
+ },
+ "ike_integrity_protocol": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE integrity protocol").AddStringEnumDescription("main", "aggressive").AddDefaultValueDescription("main").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("main", "aggressive"),
+ },
+ },
+ "ike_integrity_protocol_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE rekey interval <60..86400> seconds").AddIntegerRangeDescription(60, 86400).AddDefaultValueDescription("14400").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(60, 86400),
+ },
+ },
+ "ike_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE identity the IKE preshared secret belongs to").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2").AddDefaultValueDescription("aes256-cbc-sha1").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2"),
+ },
+ },
+ "ike_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_diffie_hellman_group": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE Diffie Hellman Groups").AddStringEnumDescription("2", "14", "15", "16", "19", "20", "21", "24").AddDefaultValueDescription("16").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("2", "14", "15", "16", "19", "20", "21", "24"),
+ },
+ },
+ "ike_diffie_hellman_group_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_id_local_end_point": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the local endpoint. Input IPv4 address, domain name, or email address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 63),
+ },
+ },
+ "ike_id_local_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ike_id_remote_end_point": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 63),
+ },
+ },
+ "ike_id_remote_end_point_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_rekey_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPsec rekey interval <300..1209600> seconds").AddIntegerRangeDescription(120, 2592000).AddDefaultValueDescription("3600").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(120, 2592000),
+ },
+ },
+ "ipsec_rekey_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_replay_window": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Replay window size 32..8192 (must be a power of 2)").AddIntegerRangeDescription(64, 4096).AddDefaultValueDescription("512").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(64, 4096),
+ },
+ },
+ "ipsec_replay_window_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipsec_ciphersuite": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPsec(ESP) encryption and integrity protocol").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512").AddDefaultValueDescription("aes256-gcm").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512"),
+ },
+ },
+ "ipsec_ciphersuite_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "perfect_forward_secrecy": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("IPsec perfect forward secrecy settings").AddStringEnumDescription("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none").AddDefaultValueDescription("group-16").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none"),
+ },
+ },
+ "perfect_forward_secrecy_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tracker_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
+ Optional: true,
+ },
+ "tracker_id_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_route_via": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_route_via_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportWANVPNInterfaceIPSECProfileParcelResource) 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportWANVPNInterfaceIPSEC
+
+ // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportWANVPNInterfaceIPSEC
+
+ // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportWANVPNInterfaceIPSEC
+
+ // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportWANVPNInterfaceIPSEC
+
+ // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) 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_transport_wan_vpn_interface_ipsec_feature_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_test.go
new file mode 100644
index 000000000..217eabd6c
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_test.go
@@ -0,0 +1,201 @@
+// 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 TestAccSdwanTransportWANVPNInterfaceIPSECProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "interface_description", "ipsec987"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "dpd_interval", "10"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "dpd_retries", "3"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_version", "1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_integrity_protocol", "main"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_rekey_interval", "14400"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_ciphersuite", "aes256-cbc-sha1"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_diffie_hellman_group", "16"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_id_local_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ike_id_remote_end_point", "xxx"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ipsec_rekey_interval", "3600"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ipsec_replay_window", "512"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "ipsec_ciphersuite", "aes256-gcm"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "perfect_forward_secrecy", "group-16"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_feature.test", "tunnel_route_via", "2222"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_ipsec_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "ipsec987"` + "\n"
+ config += ` ipv4_address = "9.7.5.4"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
+ config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
+ config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += ` ike_preshared_key = "123"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_ipsec_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "ipsec987"` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_description = "ipsec987"` + "\n"
+ config += ` ipv4_address = "9.7.5.4"` + "\n"
+ config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
+ config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
+ config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
+ config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
+ config += ` application_tunnel_type = "none"` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` clear_dont_fragment = false` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` dpd_interval = 10` + "\n"
+ config += ` dpd_retries = 3` + "\n"
+ config += ` ike_preshared_key = "123"` + "\n"
+ config += ` ike_version = 1` + "\n"
+ config += ` ike_integrity_protocol = "main"` + "\n"
+ config += ` ike_rekey_interval = 14400` + "\n"
+ config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
+ config += ` ike_diffie_hellman_group = "16"` + "\n"
+ config += ` ike_id_local_end_point = "xxx"` + "\n"
+ config += ` ike_id_remote_end_point = "xxx"` + "\n"
+ config += ` ipsec_rekey_interval = 3600` + "\n"
+ config += ` ipsec_replay_window = 512` + "\n"
+ config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
+ config += ` perfect_forward_secrecy = "group-16"` + "\n"
+ config += ` tunnel_route_via = "2222"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go
deleted file mode 100644
index 0a356e1f9..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go
+++ /dev/null
@@ -1,558 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportWANVPNInterfaceIPSECProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceIPSECProfileParcelResource{}
-
-func NewTransportWANVPNInterfaceIPSECProfileParcelResource() resource.Resource {
- return &TransportWANVPNInterfaceIPSECProfileParcelResource{}
-}
-
-type TransportWANVPNInterfaceIPSECProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportWANVPNInterfaceIPSECProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_ipsec_profile_parcel"
-}
-
-func (r *TransportWANVPNInterfaceIPSECProfileParcelResource) 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 Transport WAN VPN Interface IPSEC 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Profile Parcel ID").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface name: IPsec when present").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(6, 8),
- stringvalidator.RegexMatches(regexp.MustCompile(`^ipsec\d{1,3}$`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_description": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface description").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthAtMost(240),
- },
- },
- "interface_description_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "tunnel_source_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "tunnel_source_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_source_interface": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(3, 32),
- stringvalidator.RegexMatches(regexp.MustCompile(`(ATM|ATM-ACR|AppGigabitEthernet|AppNav-Compress|AppNav-UnCompress|Async|BD-VIF|BDI|CEM|CEM-ACR|Cellular|Dialer|Embedded-Service-Engine|Ethernet|Ethernet-Internal|FastEthernet|FiftyGigabitEthernet|FiveGigabitEthernet|FortyGigabitEthernet|FourHundredGigE|GMPLS|GigabitEthernet|Group-Async|HundredGigE|L2LISP|LISP|Loopback|MFR|Multilink|Port-channel|SM|Serial|Service-Engine|TenGigabitEthernet|Tunnel|TwentyFiveGigE|TwentyFiveGigabitEthernet|TwoGigabitEthernet|TwoHundredGigE|Vif|Virtual-PPP|Virtual-Template|VirtualPortGroup|Vlan|Wlan-GigabitEthernet|nat64|nat66|ntp|nve|ospfv3|overlay|pseudowire|ucse|vasileft|vasiright|vmi)([0-9]*(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "tunnel_source_interface_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_destination_ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Required: true,
- },
- "tunnel_destination_ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_destination_ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "tunnel_destination_ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "application_tunnel_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable Application Tunnel Type").AddStringEnumDescription("none", "sig").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.OneOf("none", "sig"),
- },
- },
- "application_tunnel_type_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <68..9216>, in bytes").AddIntegerRangeDescription(68, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(68, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "dpd_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive interval (seconds)").AddIntegerRangeDescription(10, 3600).AddDefaultValueDescription("10").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(10, 3600),
- },
- },
- "dpd_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "dpd_retries": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE keepalive retries").AddIntegerRangeDescription(2, 60).AddDefaultValueDescription("3").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(2, 60),
- },
- },
- "dpd_retries_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_preshared_key": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Use preshared key to authenticate IKE peer").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 127),
- },
- },
- "ike_preshared_key_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_version": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE Version <1..2>").AddIntegerRangeDescription(1, 2).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2),
- },
- },
- "ike_integrity_protocol": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE integrity protocol").AddStringEnumDescription("main", "aggressive").AddDefaultValueDescription("main").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("main", "aggressive"),
- },
- },
- "ike_integrity_protocol_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE rekey interval <60..86400> seconds").AddIntegerRangeDescription(60, 86400).AddDefaultValueDescription("14400").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(60, 86400),
- },
- },
- "ike_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_ciphersuite": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE identity the IKE preshared secret belongs to").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2").AddDefaultValueDescription("aes256-cbc-sha1").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha2", "aes128-cbc-sha1", "aes128-cbc-sha2"),
- },
- },
- "ike_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_diffie_hellman_group": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE Diffie Hellman Groups").AddStringEnumDescription("2", "14", "15", "16", "19", "20", "21", "24").AddDefaultValueDescription("16").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("2", "14", "15", "16", "19", "20", "21", "24"),
- },
- },
- "ike_diffie_hellman_group_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_id_local_end_point": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the local endpoint. Input IPv4 address, domain name, or email address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 63),
- },
- },
- "ike_id_local_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ike_id_remote_end_point": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IKE ID for the remote endpoint. Input IPv4 address, domain name, or email address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 63),
- },
- },
- "ike_id_remote_end_point_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_rekey_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPsec rekey interval <300..1209600> seconds").AddIntegerRangeDescription(120, 2592000).AddDefaultValueDescription("3600").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(120, 2592000),
- },
- },
- "ipsec_rekey_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_replay_window": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Replay window size 32..8192 (must be a power of 2)").AddIntegerRangeDescription(64, 4096).AddDefaultValueDescription("512").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(64, 4096),
- },
- },
- "ipsec_replay_window_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipsec_ciphersuite": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPsec(ESP) encryption and integrity protocol").AddStringEnumDescription("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512").AddDefaultValueDescription("aes256-gcm").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("aes256-cbc-sha1", "aes256-cbc-sha384", "aes256-cbc-sha256", "aes256-cbc-sha512", "aes256-gcm", "null-sha1", "null-sha384", "null-sha256", "null-sha512"),
- },
- },
- "ipsec_ciphersuite_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "perfect_forward_secrecy": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPsec perfect forward secrecy settings").AddStringEnumDescription("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none").AddDefaultValueDescription("group-16").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("group-1", "group-2", "group-5", "group-14", "group-15", "group-16", "group-19", "group-20", "group-21", "group-24", "none"),
- },
- },
- "perfect_forward_secrecy_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tracker_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable tracker for this interface").String,
- Optional: true,
- },
- "tracker_id_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_route_via": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("<1..32 characters> Interface name: ge0/<0-..> or ge0/<0-..>.vlanid").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_route_via_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *TransportWANVPNInterfaceIPSECProfileParcelResource) 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportWANVPNInterfaceIPSEC
-
- // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportWANVPNInterfaceIPSEC
-
- // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportWANVPNInterfaceIPSEC
-
- // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportWANVPNInterfaceIPSEC
-
- // 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 *TransportWANVPNInterfaceIPSECProfileParcelResource) 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_transport_wan_vpn_interface_ipsec_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel_test.go
deleted file mode 100644
index e3ff61ae5..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel_test.go
+++ /dev/null
@@ -1,212 +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 TestAccSdwanTransportWANVPNInterfaceIPSECProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "interface_name", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "interface_description", "ipsec987"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipv4_address", "9.7.5.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_address", "1.3.5.88"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_source_interface", "GigabitEthernet8"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_address", "2.55.67.99"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_destination_ipv4_subnet_mask", "255.255.255.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "application_tunnel_type", "none"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "dpd_interval", "10"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "dpd_retries", "3"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_preshared_key", "123"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_version", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_integrity_protocol", "main"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_rekey_interval", "14400"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_ciphersuite", "aes256-cbc-sha1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_diffie_hellman_group", "16"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_id_local_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ike_id_remote_end_point", "xxx"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipsec_rekey_interval", "3600"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipsec_replay_window", "512"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "ipsec_ciphersuite", "aes256-gcm"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "perfect_forward_secrecy", "group-16"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.test", "tunnel_route_via", "2222"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportWANVPNInterfaceIPSECPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "ipsec987"` + "\n"
- config += ` ipv4_address = "9.7.5.4"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
- config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
- config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
- config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += ` ike_preshared_key = "123"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportWANVPNInterfaceIPSECProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_wan_vpn_interface_ipsec_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "ipsec987"` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_description = "ipsec987"` + "\n"
- config += ` ipv4_address = "9.7.5.4"` + "\n"
- config += ` ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_ipv4_address = "1.3.5.88"` + "\n"
- config += ` tunnel_source_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` tunnel_source_interface = "GigabitEthernet8"` + "\n"
- config += ` tunnel_destination_ipv4_address = "2.55.67.99"` + "\n"
- config += ` tunnel_destination_ipv4_subnet_mask = "255.255.255.0"` + "\n"
- config += ` application_tunnel_type = "none"` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` clear_dont_fragment = false` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` dpd_interval = 10` + "\n"
- config += ` dpd_retries = 3` + "\n"
- config += ` ike_preshared_key = "123"` + "\n"
- config += ` ike_version = 1` + "\n"
- config += ` ike_integrity_protocol = "main"` + "\n"
- config += ` ike_rekey_interval = 14400` + "\n"
- config += ` ike_ciphersuite = "aes256-cbc-sha1"` + "\n"
- config += ` ike_diffie_hellman_group = "16"` + "\n"
- config += ` ike_id_local_end_point = "xxx"` + "\n"
- config += ` ike_id_remote_end_point = "xxx"` + "\n"
- config += ` ipsec_rekey_interval = 3600` + "\n"
- config += ` ipsec_replay_window = 512` + "\n"
- config += ` ipsec_ciphersuite = "aes256-gcm"` + "\n"
- config += ` perfect_forward_secrecy = "group-16"` + "\n"
- config += ` tunnel_route_via = "2222"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go
new file mode 100644
index 000000000..8fe6dc7bc
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.go
@@ -0,0 +1,746 @@
+// 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/int64validator"
+ "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 = &TransportWANVPNInterfaceT1E1SerialProfileParcelResource{}
+var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceT1E1SerialProfileParcelResource{}
+
+func NewTransportWANVPNInterfaceT1E1SerialProfileParcelResource() resource.Resource {
+ return &TransportWANVPNInterfaceT1E1SerialProfileParcelResource{}
+}
+
+type TransportWANVPNInterfaceT1E1SerialProfileParcelResource struct {
+ client *sdwan.Client
+ updateMutex *sync.Mutex
+}
+
+func (r *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_t1_e1_serial_feature"
+}
+
+func (r *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) 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 Transport WAN VPN Interface T1 E1 Serial Feature.").AddMinimumVersionDescription("20.12.0").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the Feature",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "version": schema.Int64Attribute{
+ MarkdownDescription: "The version of the Feature",
+ Computed: true,
+ },
+ "name": schema.StringAttribute{
+ MarkdownDescription: "The name of the Feature",
+ Required: true,
+ },
+ "description": schema.StringAttribute{
+ MarkdownDescription: "The description of the Feature",
+ Optional: true,
+ },
+ "feature_profile_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String,
+ Required: true,
+ },
+ "transport_wan_vpn_feature_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Feature ID").String,
+ Optional: true,
+ },
+ "shutdown": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "shutdown_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "interface_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(7, 255),
+ stringvalidator.RegexMatches(regexp.MustCompile(`^(Serial)([0-9]{1,}(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
+ },
+ },
+ "interface_name_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").String,
+ Optional: true,
+ },
+ "ipv4_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv4_subnet_mask": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
+ },
+ },
+ "ipv4_subnet_mask_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ipv6_address": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Assign IPv6 address").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
+ },
+ },
+ "ipv6_address_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "bandwidth": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 200000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 200000000),
+ },
+ },
+ "bandwidth_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "bandwidth_downstream": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface downstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 2147483647),
+ },
+ },
+ "bandwidth_downstream_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "clock_rate": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set preference for interface Clock speed").AddStringEnumDescription("1200", "2400", "4800", "9600", "14400", "19200", "28800", "32000", "38400", "48000", "56000", "57600", "64000", "72000", "115200", "125000", "148000", "192000", "250000", "256000", "384000", "500000", "512000", "768000", "800000", "1000000", "2000000", "4000000", "5300000", "8000000").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("1200", "2400", "4800", "9600", "14400", "19200", "28800", "32000", "38400", "48000", "56000", "57600", "64000", "72000", "115200", "125000", "148000", "192000", "250000", "256000", "384000", "500000", "512000", "768000", "800000", "1000000", "2000000", "4000000", "5300000", "8000000"),
+ },
+ },
+ "clock_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Configure Encapsulation for interface").AddStringEnumDescription("hdlc", "ppp", "frame-relay").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("hdlc", "ppp", "frame-relay"),
+ },
+ },
+ "encapsulation_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel Interface").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "per_tunnel_qos": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel Qos").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "per_tunnel_qos_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "per_tunnel_qos_aggregator": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel QoS Aggregator").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "per_tunnel_qos_aggregator_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_qos_mode": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set tunnel QoS mode").AddStringEnumDescription("spoke", "hub").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("spoke", "hub"),
+ },
+ },
+ "tunnel_qos_mode_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_color": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set color for TLOC").AddStringEnumDescription("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6").AddDefaultValueDescription("default").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6"),
+ },
+ },
+ "tunnel_interface_color_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_restrict": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Restrict this TLOC behavior").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_restrict_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_groups": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of groups").AddIntegerRangeDescription(1, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 4294967295),
+ },
+ },
+ "tunnel_interface_groups_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_border": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as border TLOC").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_border_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_max_control_connections": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the maximum number of control connections for this TLOC").AddIntegerRangeDescription(0, 100).String,
+ Optional: true,
+ },
+ "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Put this wan interface in STUN mode only").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Exclude the following controller groups defined in this list").String,
+ ElementType: types.Int64Type,
+ Optional: true,
+ },
+ "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set interface preference for control connection to vManage <0..8>").AddIntegerRangeDescription(0, 8).AddDefaultValueDescription("5").String,
+ Optional: true,
+ },
+ "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_port_hop": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Disallow port hopping on the tunnel interface").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_port_hop_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set the interface as a low-bandwidth circuit").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Tunnel TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_network_broadcast": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Accept and respond to network-prefix-directed broadcasts)").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_clear_network_broadcast_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_carrier": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set carrier for TLOC").AddStringEnumDescription("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8").AddDefaultValueDescription("default").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8"),
+ },
+ },
+ "tunnel_interface_carrier_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Bind loopback tunnel interface to a physical interface").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as last resort").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time period of nat refresh packets <1...60> seconds").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("5").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 60),
+ },
+ },
+ "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_hello_interval": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set time period of control hello packets <100..600000> milli seconds").AddIntegerRangeDescription(100, 600000).AddDefaultValueDescription("1000").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(100, 600000),
+ },
+ },
+ "tunnel_interface_hello_interval_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_hello_tolerance": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set tolerance of control hello packets <12..6000> seconds").AddIntegerRangeDescription(12, 6000).AddDefaultValueDescription("12").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(12, 6000),
+ },
+ },
+ "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_all": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow all traffic. Overrides all other allow-service options if allow-service all is set").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_all_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bgp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/deny BGP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dhcp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DHCP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dns": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DNS").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_dns_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_icmp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny ICMP").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_netconf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NETCONF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ntp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NTP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ospf": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny OSPF").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ssh": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SSH").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_stun": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny STUN").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_stun_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_https": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny Https").AddDefaultValueDescription("true").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_https_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_snmp": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SNMP").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bfd": schema.BoolAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny BFD").AddDefaultValueDescription("false").String,
+ Optional: true,
+ },
+ "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tunnel_interface_encapsulations": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Encapsulation for TLOC").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "encapsulation": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Encapsulation").AddStringEnumDescription("gre", "ipsec").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.OneOf("gre", "ipsec"),
+ },
+ },
+ "preference": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set preference for TLOC").AddIntegerRangeDescription(0, 4294967295).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.AtMost(4294967295),
+ },
+ },
+ "preference_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "weight": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set weight for TLOC").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(1, 255),
+ },
+ },
+ "weight_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ "qos_shaping_rate": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps").AddIntegerRangeDescription(8, 100000000).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(8, 100000000),
+ },
+ },
+ "qos_shaping_rate_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tcp_mss": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(500, 1460),
+ },
+ },
+ "tcp_mss_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <68...2000>, in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9216),
+ },
+ },
+ "mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "ip_mtu": schema.Int64Attribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Set ip mtu").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
+ Optional: true,
+ Validators: []validator.Int64{
+ int64validator.Between(576, 9216),
+ },
+ },
+ "ip_mtu_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ "tloc_extension": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Extends a local TLOC to a remote node only for vpn 0").String,
+ Optional: true,
+ Validators: []validator.String{
+ stringvalidator.LengthBetween(1, 32),
+ },
+ },
+ "tloc_extension_variable": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
+ Optional: true,
+ },
+ },
+ }
+}
+
+func (r *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan TransportWANVPNInterfaceT1E1Serial
+
+ // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state TransportWANVPNInterfaceT1E1Serial
+
+ // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state TransportWANVPNInterfaceT1E1Serial
+
+ // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state TransportWANVPNInterfaceT1E1Serial
+
+ // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) 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_transport_wan_vpn_interface_t1_e1_serial_feature_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature_test.go
new file mode 100644
index 000000000..e82fc9aec
--- /dev/null
+++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_feature_test.go
@@ -0,0 +1,250 @@
+// 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 TestAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcel(t *testing.T) {
+ if os.Getenv("SDWAN_2012") == "" {
+ t.Skip("skipping test, set environment variable SDWAN_2012")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "shutdown", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ipv4_address", "1.2.3.4"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ipv4_subnet_mask", "0.0.0.0"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ipv6_address", "2001:0:0:1::/64"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "bandwidth", "123456"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "bandwidth_downstream", "123456"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "clock_rate", "1200"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "encapsulation", "ppp"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "per_tunnel_qos", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "per_tunnel_qos_aggregator", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_qos_mode", "hub"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_color", "mpls"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_restrict", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_groups", "42949672"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_border", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_max_control_connections", "62"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_vbond_as_stun_server", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_vmanage_connection_preference", "8"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_port_hop", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_low_bandwidth_link", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_clear_dont_fragment", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_clear_network_broadcast", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_carrier", "default"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_bind_loopback_tunnel", "example"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_last_resort_circuit", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_nat_refresh_interval", "5"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_hello_interval", "1000"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_hello_tolerance", "12"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_all", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_bgp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_dhcp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_dns", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_icmp", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_netconf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_ntp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_ospf", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_ssh", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_stun", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_https", "true"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_snmp", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_allow_bfd", "false"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tunnel_interface_encapsulations.0.weight", "250"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tcp_mss", "1460"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "ip_mtu", "1500"))
+ checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_feature.test", "tloc_extension", "tloc"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_minimum(),
+ },
+ {
+ Config: testAccSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+const testAccSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig = `
+resource "sdwan_transport_feature_profile" "test" {
+ name = "TF_TEST"
+ description = "Terraform test"
+}
+
+resource "sdwan_transport_wan_vpn_feature" "test" {
+ name = "TF_TEST_WAN"
+ description = "Terraform test"
+ feature_profile_id = sdwan_transport_feature_profile.test.id
+ vpn = 0
+ enhance_ecmp_keying = true
+ primary_dns_address_ipv4 = "1.2.3.4"
+ secondary_dns_address_ipv4 = "2.3.4.5"
+ primary_dns_address_ipv6 = "2001:0:0:1::0"
+ secondary_dns_address_ipv6 = "2001:0:0:2::0"
+ new_host_mappings = [
+ {
+ host_name = "example"
+ list_of_ip_addresses = ["1.2.3.4"]
+ }
+ ]
+ ipv4_static_routes = [
+ {
+ network_address = "1.2.3.4"
+ subnet_mask = "0.0.0.0"
+ gateway = "nextHop"
+ next_hops = [
+ {
+ address = "1.2.3.4"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ ipv6_static_routes = [
+ {
+ prefix = "2002::/16"
+ next_hops = [
+ {
+ address = "2001:0:0:1::0"
+ administrative_distance = 1
+ }
+ ]
+ }
+ ]
+ services = [
+ {
+ service_type = "TE"
+ }
+ ]
+ nat_64_v4_pools = [
+ {
+ nat64_v4_pool_name = "example"
+ nat64_v4_pool_range_start = "203.0.113.50"
+ nat64_v4_pool_range_end = "203.0.113.100"
+ nat64_v4_pool_overload = false
+ }
+ ]
+}
+
+`
+
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
+func testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_minimum() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_MIN"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` interface_name = "Serial0"` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += ` tunnel_interface_color = "mpls"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimum
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_all() string {
+ config := `resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_feature" "test" {` + "\n"
+ config += ` name = "TF_TEST_ALL"` + "\n"
+ config += ` description = "Terraform integration test"` + "\n"
+ config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
+ config += ` transport_wan_vpn_feature_id = sdwan_transport_wan_vpn_feature.test.id` + "\n"
+ config += ` shutdown = true` + "\n"
+ config += ` interface_name = "Serial0"` + "\n"
+ config += ` ipv4_address = "1.2.3.4"` + "\n"
+ config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
+ config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
+ config += ` bandwidth = 123456` + "\n"
+ config += ` bandwidth_downstream = 123456` + "\n"
+ config += ` clock_rate = "1200"` + "\n"
+ config += ` encapsulation = "ppp"` + "\n"
+ config += ` tunnel_interface = true` + "\n"
+ config += ` per_tunnel_qos = true` + "\n"
+ config += ` per_tunnel_qos_aggregator = false` + "\n"
+ config += ` tunnel_qos_mode = "hub"` + "\n"
+ config += ` tunnel_interface_color = "mpls"` + "\n"
+ config += ` tunnel_interface_restrict = true` + "\n"
+ config += ` tunnel_interface_groups = 42949672` + "\n"
+ config += ` tunnel_interface_border = false` + "\n"
+ config += ` tunnel_interface_max_control_connections = 62` + "\n"
+ config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
+ config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
+ config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
+ config += ` tunnel_interface_port_hop = true` + "\n"
+ config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
+ config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
+ config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
+ config += ` tunnel_interface_clear_network_broadcast = false` + "\n"
+ config += ` tunnel_interface_carrier = "default"` + "\n"
+ config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
+ config += ` tunnel_interface_last_resort_circuit = false` + "\n"
+ config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
+ config += ` tunnel_interface_hello_interval = 1000` + "\n"
+ config += ` tunnel_interface_hello_tolerance = 12` + "\n"
+ config += ` tunnel_interface_allow_all = false` + "\n"
+ config += ` tunnel_interface_allow_bgp = false` + "\n"
+ config += ` tunnel_interface_allow_dhcp = true` + "\n"
+ config += ` tunnel_interface_allow_dns = true` + "\n"
+ config += ` tunnel_interface_allow_icmp = true` + "\n"
+ config += ` tunnel_interface_allow_netconf = false` + "\n"
+ config += ` tunnel_interface_allow_ntp = false` + "\n"
+ config += ` tunnel_interface_allow_ospf = false` + "\n"
+ config += ` tunnel_interface_allow_ssh = false` + "\n"
+ config += ` tunnel_interface_allow_stun = false` + "\n"
+ config += ` tunnel_interface_allow_https = true` + "\n"
+ config += ` tunnel_interface_allow_snmp = false` + "\n"
+ config += ` tunnel_interface_allow_bfd = false` + "\n"
+ config += ` tunnel_interface_encapsulations = [{` + "\n"
+ config += ` encapsulation = "gre"` + "\n"
+ config += ` preference = 4294967` + "\n"
+ config += ` weight = 250` + "\n"
+ config += ` }]` + "\n"
+ config += ` tcp_mss = 1460` + "\n"
+ config += ` mtu = 1500` + "\n"
+ config += ` ip_mtu = 1500` + "\n"
+ config += ` tloc_extension = "tloc"` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go
deleted file mode 100644
index b788d3f29..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go
+++ /dev/null
@@ -1,746 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportWANVPNInterfaceT1E1SerialProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportWANVPNInterfaceT1E1SerialProfileParcelResource{}
-
-func NewTransportWANVPNInterfaceT1E1SerialProfileParcelResource() resource.Resource {
- return &TransportWANVPNInterfaceT1E1SerialProfileParcelResource{}
-}
-
-type TransportWANVPNInterfaceT1E1SerialProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_interface_t1_e1_serial_profile_parcel"
-}
-
-func (r *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) 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 Transport WAN VPN Interface T1 E1 Serial 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,
- },
- "transport_wan_vpn_profile_parcel_id": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Transport WAN VPN Profile Parcel ID").String,
- Optional: true,
- },
- "shutdown": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative state").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "shutdown_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "interface_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Serial Interface Name - slot/subslot/port:channel-group for T1/E1, slot/subslot/port for NIM-1T").String,
- Required: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(7, 255),
- stringvalidator.RegexMatches(regexp.MustCompile(`^(Serial)([0-9]{1,}(. ?[1-9][0-9]*)*|[0-9/]+|[0-9]+/[0-9]+/[0-9]+:[0-9]+|[0-9]+/[0-9]+/[0-9]+|[0-9]+/[0-9]+|[0-9]+)`), ""),
- },
- },
- "interface_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- },
- "ipv4_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv4_subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "ipv4_subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ipv6_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Assign IPv6 address").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "ipv6_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "bandwidth": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 200000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 200000000),
- },
- },
- "bandwidth_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "bandwidth_downstream": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface downstream bandwidth capacity, in kbps").AddIntegerRangeDescription(1, 2147483647).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 2147483647),
- },
- },
- "bandwidth_downstream_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "clock_rate": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set preference for interface Clock speed").AddStringEnumDescription("1200", "2400", "4800", "9600", "14400", "19200", "28800", "32000", "38400", "48000", "56000", "57600", "64000", "72000", "115200", "125000", "148000", "192000", "250000", "256000", "384000", "500000", "512000", "768000", "800000", "1000000", "2000000", "4000000", "5300000", "8000000").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("1200", "2400", "4800", "9600", "14400", "19200", "28800", "32000", "38400", "48000", "56000", "57600", "64000", "72000", "115200", "125000", "148000", "192000", "250000", "256000", "384000", "500000", "512000", "768000", "800000", "1000000", "2000000", "4000000", "5300000", "8000000"),
- },
- },
- "clock_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Configure Encapsulation for interface").AddStringEnumDescription("hdlc", "ppp", "frame-relay").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("hdlc", "ppp", "frame-relay"),
- },
- },
- "encapsulation_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel Interface").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "per_tunnel_qos": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel Qos").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "per_tunnel_qos_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "per_tunnel_qos_aggregator": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Per-tunnel QoS Aggregator").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "per_tunnel_qos_aggregator_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_qos_mode": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set tunnel QoS mode").AddStringEnumDescription("spoke", "hub").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("spoke", "hub"),
- },
- },
- "tunnel_qos_mode_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_color": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set color for TLOC").AddStringEnumDescription("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6").AddDefaultValueDescription("default").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("default", "mpls", "metro-ethernet", "biz-internet", "public-internet", "lte", "3g", "red", "green", "blue", "gold", "silver", "bronze", "custom1", "custom2", "custom3", "private1", "private2", "private3", "private4", "private5", "private6"),
- },
- },
- "tunnel_interface_color_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_restrict": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Restrict this TLOC behavior").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_restrict_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_groups": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of groups").AddIntegerRangeDescription(1, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 4294967295),
- },
- },
- "tunnel_interface_groups_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_border": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as border TLOC").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_border_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_max_control_connections": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the maximum number of control connections for this TLOC").AddIntegerRangeDescription(0, 100).String,
- Optional: true,
- },
- "tunnel_interface_max_control_connections_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_vbond_as_stun_server": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Put this wan interface in STUN mode only").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_vbond_as_stun_server_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_exclude_controller_group_list": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Exclude the following controller groups defined in this list").String,
- ElementType: types.Int64Type,
- Optional: true,
- },
- "tunnel_interface_exclude_controller_group_list_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_vmanage_connection_preference": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set interface preference for control connection to vManage <0..8>").AddIntegerRangeDescription(0, 8).AddDefaultValueDescription("5").String,
- Optional: true,
- },
- "tunnel_interface_vmanage_connection_preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_port_hop": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Disallow port hopping on the tunnel interface").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_port_hop_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_low_bandwidth_link": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set the interface as a low-bandwidth circuit").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_low_bandwidth_link_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_tunnel_tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Tunnel TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tunnel_interface_tunnel_tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_clear_dont_fragment": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enable clear dont fragment (Currently Only SDWAN Tunnel Interface)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_clear_dont_fragment_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_clear_network_broadcast": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Accept and respond to network-prefix-directed broadcasts)").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_clear_network_broadcast_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_carrier": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set carrier for TLOC").AddStringEnumDescription("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8").AddDefaultValueDescription("default").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("default", "carrier1", "carrier2", "carrier3", "carrier4", "carrier5", "carrier6", "carrier7", "carrier8"),
- },
- },
- "tunnel_interface_carrier_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_bind_loopback_tunnel": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Bind loopback tunnel interface to a physical interface").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tunnel_interface_bind_loopback_tunnel_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_last_resort_circuit": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set TLOC as last resort").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_last_resort_circuit_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_nat_refresh_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set time period of nat refresh packets <1...60> seconds").AddIntegerRangeDescription(1, 60).AddDefaultValueDescription("5").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 60),
- },
- },
- "tunnel_interface_nat_refresh_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_hello_interval": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set time period of control hello packets <100..600000> milli seconds").AddIntegerRangeDescription(100, 600000).AddDefaultValueDescription("1000").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(100, 600000),
- },
- },
- "tunnel_interface_hello_interval_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_hello_tolerance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set tolerance of control hello packets <12..6000> seconds").AddIntegerRangeDescription(12, 6000).AddDefaultValueDescription("12").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(12, 6000),
- },
- },
- "tunnel_interface_hello_tolerance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_all": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow all traffic. Overrides all other allow-service options if allow-service all is set").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_all_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_bgp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/deny BGP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_bgp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_dhcp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DHCP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_dhcp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_dns": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny DNS").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_dns_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_icmp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny ICMP").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_icmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_netconf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NETCONF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_netconf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ntp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny NTP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_ntp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ospf": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny OSPF").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_ospf_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_ssh": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SSH").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_ssh_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_stun": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny STUN").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_stun_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_https": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny Https").AddDefaultValueDescription("true").String,
- Optional: true,
- },
- "tunnel_interface_allow_https_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_snmp": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny SNMP").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_snmp_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_allow_bfd": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Allow/Deny BFD").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "tunnel_interface_allow_bfd_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tunnel_interface_encapsulations": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Encapsulation for TLOC").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "encapsulation": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Encapsulation").AddStringEnumDescription("gre", "ipsec").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("gre", "ipsec"),
- },
- },
- "preference": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set preference for TLOC").AddIntegerRangeDescription(0, 4294967295).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.AtMost(4294967295),
- },
- },
- "preference_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "weight": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set weight for TLOC").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "weight_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "qos_shaping_rate": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("1ge interfaces: [0..1000000]kbps; 10ge interfaces: [0..10000000]kbps").AddIntegerRangeDescription(8, 100000000).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(8, 100000000),
- },
- },
- "qos_shaping_rate_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tcp_mss": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("TCP MSS on SYN packets, in bytes").AddIntegerRangeDescription(500, 1460).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(500, 1460),
- },
- },
- "tcp_mss_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Interface MTU <68...2000>, in bytes").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9216),
- },
- },
- "mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "ip_mtu": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Set ip mtu").AddIntegerRangeDescription(576, 9216).AddDefaultValueDescription("1500").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(576, 9216),
- },
- },
- "ip_mtu_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "tloc_extension": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Extends a local TLOC to a remote node only for vpn 0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "tloc_extension_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- }
-}
-
-func (r *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportWANVPNInterfaceT1E1Serial
-
- // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportWANVPNInterfaceT1E1Serial
-
- // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportWANVPNInterfaceT1E1Serial
-
- // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportWANVPNInterfaceT1E1Serial
-
- // 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 *TransportWANVPNInterfaceT1E1SerialProfileParcelResource) 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_transport_wan_vpn_interface_t1_e1_serial_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel_test.go
deleted file mode 100644
index 7e06df54d..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel_test.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 (
- "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 TestAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "shutdown", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "interface_name", "Serial0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ipv4_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ipv4_subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ipv6_address", "2001:0:0:1::/64"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "bandwidth", "123456"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "bandwidth_downstream", "123456"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "clock_rate", "1200"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "encapsulation", "ppp"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "per_tunnel_qos", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "per_tunnel_qos_aggregator", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_qos_mode", "hub"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_color", "mpls"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_restrict", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_groups", "42949672"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_border", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_max_control_connections", "62"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_vbond_as_stun_server", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_vmanage_connection_preference", "8"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_port_hop", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_low_bandwidth_link", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_tunnel_tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_clear_dont_fragment", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_clear_network_broadcast", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_carrier", "default"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_bind_loopback_tunnel", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_last_resort_circuit", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_nat_refresh_interval", "5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_hello_interval", "1000"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_hello_tolerance", "12"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_all", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_bgp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_dhcp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_dns", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_icmp", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_netconf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_ntp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_ospf", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_ssh", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_stun", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_https", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_snmp", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_allow_bfd", "false"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_encapsulations.0.encapsulation", "gre"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_encapsulations.0.preference", "4294967"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tunnel_interface_encapsulations.0.weight", "250"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tcp_mss", "1460"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "ip_mtu", "1500"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.test", "tloc_extension", "tloc"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportWANVPNInterfaceT1E1SerialPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-resource "sdwan_transport_wan_vpn_profile_parcel" "test" {
- name = "TF_TEST_WAN"
- description = "Terraform test"
- feature_profile_id = sdwan_transport_feature_profile.test.id
- vpn = 0
- enhance_ecmp_keying = true
- primary_dns_address_ipv4 = "1.2.3.4"
- secondary_dns_address_ipv4 = "2.3.4.5"
- primary_dns_address_ipv6 = "2001:0:0:1::0"
- secondary_dns_address_ipv6 = "2001:0:0:2::0"
- new_host_mappings = [
- {
- host_name = "example"
- list_of_ip_addresses = ["1.2.3.4"]
- }
- ]
- ipv4_static_routes = [
- {
- network_address = "1.2.3.4"
- subnet_mask = "0.0.0.0"
- gateway = "nextHop"
- next_hops = [
- {
- address = "1.2.3.4"
- administrative_distance = 1
- }
- ]
- administrative_distance = 1
- }
- ]
- ipv6_static_routes = [
- {
- prefix = "2002::/16"
- next_hops = [
- {
- address = "2001:0:0:1::0"
- administrative_distance = 1
- }
- ]
- }
- ]
- services = [
- {
- service_type = "TE"
- }
- ]
- nat_64_v4_pools = [
- {
- nat64_v4_pool_name = "example"
- nat64_v4_pool_range_start = "203.0.113.50"
- nat64_v4_pool_range_end = "203.0.113.100"
- nat64_v4_pool_overload = false
- }
- ]
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` interface_name = "Serial0"` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += ` tunnel_interface_color = "mpls"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportWANVPNInterfaceT1E1SerialProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` transport_wan_vpn_profile_parcel_id = sdwan_transport_wan_vpn_profile_parcel.test.id` + "\n"
- config += ` shutdown = true` + "\n"
- config += ` interface_name = "Serial0"` + "\n"
- config += ` ipv4_address = "1.2.3.4"` + "\n"
- config += ` ipv4_subnet_mask = "0.0.0.0"` + "\n"
- config += ` ipv6_address = "2001:0:0:1::/64"` + "\n"
- config += ` bandwidth = 123456` + "\n"
- config += ` bandwidth_downstream = 123456` + "\n"
- config += ` clock_rate = "1200"` + "\n"
- config += ` encapsulation = "ppp"` + "\n"
- config += ` tunnel_interface = true` + "\n"
- config += ` per_tunnel_qos = true` + "\n"
- config += ` per_tunnel_qos_aggregator = false` + "\n"
- config += ` tunnel_qos_mode = "hub"` + "\n"
- config += ` tunnel_interface_color = "mpls"` + "\n"
- config += ` tunnel_interface_restrict = true` + "\n"
- config += ` tunnel_interface_groups = 42949672` + "\n"
- config += ` tunnel_interface_border = false` + "\n"
- config += ` tunnel_interface_max_control_connections = 62` + "\n"
- config += ` tunnel_interface_vbond_as_stun_server = false` + "\n"
- config += ` tunnel_interface_exclude_controller_group_list = [2]` + "\n"
- config += ` tunnel_interface_vmanage_connection_preference = 8` + "\n"
- config += ` tunnel_interface_port_hop = true` + "\n"
- config += ` tunnel_interface_low_bandwidth_link = false` + "\n"
- config += ` tunnel_interface_tunnel_tcp_mss = 1460` + "\n"
- config += ` tunnel_interface_clear_dont_fragment = false` + "\n"
- config += ` tunnel_interface_clear_network_broadcast = false` + "\n"
- config += ` tunnel_interface_carrier = "default"` + "\n"
- config += ` tunnel_interface_bind_loopback_tunnel = "example"` + "\n"
- config += ` tunnel_interface_last_resort_circuit = false` + "\n"
- config += ` tunnel_interface_nat_refresh_interval = 5` + "\n"
- config += ` tunnel_interface_hello_interval = 1000` + "\n"
- config += ` tunnel_interface_hello_tolerance = 12` + "\n"
- config += ` tunnel_interface_allow_all = false` + "\n"
- config += ` tunnel_interface_allow_bgp = false` + "\n"
- config += ` tunnel_interface_allow_dhcp = true` + "\n"
- config += ` tunnel_interface_allow_dns = true` + "\n"
- config += ` tunnel_interface_allow_icmp = true` + "\n"
- config += ` tunnel_interface_allow_netconf = false` + "\n"
- config += ` tunnel_interface_allow_ntp = false` + "\n"
- config += ` tunnel_interface_allow_ospf = false` + "\n"
- config += ` tunnel_interface_allow_ssh = false` + "\n"
- config += ` tunnel_interface_allow_stun = false` + "\n"
- config += ` tunnel_interface_allow_https = true` + "\n"
- config += ` tunnel_interface_allow_snmp = false` + "\n"
- config += ` tunnel_interface_allow_bfd = false` + "\n"
- config += ` tunnel_interface_encapsulations = [{` + "\n"
- config += ` encapsulation = "gre"` + "\n"
- config += ` preference = 4294967` + "\n"
- config += ` weight = 250` + "\n"
- config += ` }]` + "\n"
- config += ` tcp_mss = 1460` + "\n"
- config += ` mtu = 1500` + "\n"
- config += ` ip_mtu = 1500` + "\n"
- config += ` tloc_extension = "tloc"` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel.go b/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel.go
deleted file mode 100644
index 49f57543a..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel.go
+++ /dev/null
@@ -1,507 +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"
- "regexp"
- "sync"
-
- "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
- "github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
- "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 = &TransportWANVPNProfileParcelResource{}
-var _ resource.ResourceWithImportState = &TransportWANVPNProfileParcelResource{}
-
-func NewTransportWANVPNProfileParcelResource() resource.Resource {
- return &TransportWANVPNProfileParcelResource{}
-}
-
-type TransportWANVPNProfileParcelResource struct {
- client *sdwan.Client
- updateMutex *sync.Mutex
-}
-
-func (r *TransportWANVPNProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
- resp.TypeName = req.ProviderTypeName + "_transport_wan_vpn_profile_parcel"
-}
-
-func (r *TransportWANVPNProfileParcelResource) 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 Transport WAN VPN 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,
- Optional: true,
- },
- "vpn": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("VPN").AddDefaultValueDescription("0").String,
- Optional: true,
- },
- "enhance_ecmp_keying": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Enhance ECMP Keying").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "enhance_ecmp_keying_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "primary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv4)").String,
- Optional: true,
- },
- "primary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_dns_address_ipv4": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv4)").String,
- Optional: true,
- },
- "secondary_dns_address_ipv4_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "primary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Primary DNS Address (IPv6)").String,
- Optional: true,
- },
- "primary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "secondary_dns_address_ipv6": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Secondary DNS Address (IPv6)").String,
- Optional: true,
- },
- "secondary_dns_address_ipv6_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "new_host_mappings": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "host_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Hostname").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "host_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "list_of_ip_addresses": schema.SetAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("List of IP").String,
- ElementType: types.StringType,
- Optional: true,
- },
- "list_of_ip_addresses_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv4_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Static Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "network_address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IP Address").String,
- Optional: true,
- },
- "network_address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "subnet_mask": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Subnet Mask").AddStringEnumDescription("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("255.255.255.255", "255.255.255.254", "255.255.255.252", "255.255.255.248", "255.255.255.240", "255.255.255.224", "255.255.255.192", "255.255.255.128", "255.255.255.0", "255.255.254.0", "255.255.252.0", "255.255.248.0", "255.255.240.0", "255.255.224.0", "255.255.192.0", "255.255.128.0", "255.255.0.0", "255.254.0.0", "255.252.0.0", "255.240.0.0", "255.224.0.0", "255.192.0.0", "255.128.0.0", "255.0.0.0", "254.0.0.0", "252.0.0.0", "248.0.0.0", "240.0.0.0", "224.0.0.0", "192.0.0.0", "128.0.0.0", "0.0.0.0"),
- },
- },
- "subnet_mask_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "gateway": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Gateway").AddStringEnumDescription("nextHop", "dhcp", "null0").AddDefaultValueDescription("nextHop").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("nextHop", "dhcp", "null0"),
- },
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop`").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance, Attribute conditional on `gateway` being equal to `null0`").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 255),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "ipv6_static_routes": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Static Route").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "prefix": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Prefix").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.RegexMatches(regexp.MustCompile(`((^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(/)(\b([0-9]{1,2}|1[01][0-9]|12[0-8])\b)$))`), ""),
- },
- },
- "prefix_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "next_hops": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "address": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Address").String,
- Optional: true,
- },
- "address_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "administrative_distance": schema.Int64Attribute{
- MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 254).String,
- Optional: true,
- Validators: []validator.Int64{
- int64validator.Between(1, 254),
- },
- },
- "administrative_distance_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "null0": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Route Gateway Next Hop").String,
- Optional: true,
- },
- "nat": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("IPv6 Nat").AddStringEnumDescription("NAT64", "NAT66").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("NAT64", "NAT66"),
- },
- },
- "nat_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- "services": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "service_type": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Service Type").AddStringEnumDescription("TE").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.OneOf("TE"),
- },
- },
- },
- },
- },
- "nat_64_v4_pools": schema.ListNestedAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 V4 Pool").String,
- Optional: true,
- NestedObject: schema.NestedAttributeObject{
- Attributes: map[string]schema.Attribute{
- "nat64_v4_pool_name": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 v4 Pool Name").String,
- Optional: true,
- Validators: []validator.String{
- stringvalidator.LengthBetween(1, 32),
- },
- },
- "nat64_v4_pool_name_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat64_v4_pool_range_start": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 Pool Range Start").String,
- Optional: true,
- },
- "nat64_v4_pool_range_start_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat64_v4_pool_range_end": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 Pool Range End").String,
- Optional: true,
- },
- "nat64_v4_pool_range_end_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- "nat64_v4_pool_overload": schema.BoolAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("NAT64 Overload").AddDefaultValueDescription("false").String,
- Optional: true,
- },
- "nat64_v4_pool_overload_variable": schema.StringAttribute{
- MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
- Optional: true,
- },
- },
- },
- },
- },
- }
-}
-
-func (r *TransportWANVPNProfileParcelResource) 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 *TransportWANVPNProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
- var plan TransportWANVPN
-
- // 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 *TransportWANVPNProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
- var state TransportWANVPN
-
- // 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 *TransportWANVPNProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
- var plan, state TransportWANVPN
-
- // 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 *TransportWANVPNProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
- var state TransportWANVPN
-
- // 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 *TransportWANVPNProfileParcelResource) 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_transport_wan_vpn_profile_parcel_test.go b/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel_test.go
deleted file mode 100644
index 78b10730d..000000000
--- a/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel_test.go
+++ /dev/null
@@ -1,143 +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 TestAccSdwanTransportWANVPNProfileParcel(t *testing.T) {
- if os.Getenv("SDWAN_2012") == "" {
- t.Skip("skipping test, set environment variable SDWAN_2012")
- }
- var checks []resource.TestCheckFunc
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "vpn", "0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "enhance_ecmp_keying", "true"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "primary_dns_address_ipv4", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "secondary_dns_address_ipv4", "2.3.4.5"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "primary_dns_address_ipv6", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "secondary_dns_address_ipv6", "2001:0:0:2::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "new_host_mappings.0.host_name", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.network_address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.subnet_mask", "0.0.0.0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.gateway", "nextHop"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.address", "1.2.3.4"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv4_static_routes.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv6_static_routes.0.prefix", "2002::/16"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.address", "2001:0:0:1::0"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "ipv6_static_routes.0.next_hops.0.administrative_distance", "1"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "services.0.service_type", "TE"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_name", "example"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_range_start", "203.0.113.50"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_range_end", "203.0.113.100"))
- checks = append(checks, resource.TestCheckResourceAttr("sdwan_transport_wan_vpn_profile_parcel.test", "nat_64_v4_pools.0.nat64_v4_pool_overload", "false"))
- resource.Test(t, resource.TestCase{
- PreCheck: func() { testAccPreCheck(t) },
- ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
- Steps: []resource.TestStep{
- {
- Config: testAccSdwanTransportWANVPNPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNProfileParcelConfig_minimum(),
- },
- {
- Config: testAccSdwanTransportWANVPNPrerequisitesProfileParcelConfig + testAccSdwanTransportWANVPNProfileParcelConfig_all(),
- Check: resource.ComposeTestCheckFunc(checks...),
- },
- },
- })
-}
-
-// End of section. //template:end testAcc
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
-const testAccSdwanTransportWANVPNPrerequisitesProfileParcelConfig = `
-resource "sdwan_transport_feature_profile" "test" {
- name = "TF_TEST"
- description = "Terraform test"
-}
-
-`
-
-// End of section. //template:end testPrerequisites
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum
-func testAccSdwanTransportWANVPNProfileParcelConfig_minimum() string {
- config := `resource "sdwan_transport_wan_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_MIN"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigMinimum
-
-// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
-func testAccSdwanTransportWANVPNProfileParcelConfig_all() string {
- config := `resource "sdwan_transport_wan_vpn_profile_parcel" "test" {` + "\n"
- config += ` name = "TF_TEST_ALL"` + "\n"
- config += ` description = "Terraform integration test"` + "\n"
- config += ` feature_profile_id = sdwan_transport_feature_profile.test.id` + "\n"
- config += ` vpn = 0` + "\n"
- config += ` enhance_ecmp_keying = true` + "\n"
- config += ` primary_dns_address_ipv4 = "1.2.3.4"` + "\n"
- config += ` secondary_dns_address_ipv4 = "2.3.4.5"` + "\n"
- config += ` primary_dns_address_ipv6 = "2001:0:0:1::0"` + "\n"
- config += ` secondary_dns_address_ipv6 = "2001:0:0:2::0"` + "\n"
- config += ` new_host_mappings = [{` + "\n"
- config += ` host_name = "example"` + "\n"
- config += ` list_of_ip_addresses = ["1.2.3.4"]` + "\n"
- config += ` }]` + "\n"
- config += ` ipv4_static_routes = [{` + "\n"
- config += ` network_address = "1.2.3.4"` + "\n"
- config += ` subnet_mask = "0.0.0.0"` + "\n"
- config += ` gateway = "nextHop"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "1.2.3.4"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` ipv6_static_routes = [{` + "\n"
- config += ` prefix = "2002::/16"` + "\n"
- config += ` next_hops = [{` + "\n"
- config += ` address = "2001:0:0:1::0"` + "\n"
- config += ` administrative_distance = 1` + "\n"
- config += ` }]` + "\n"
- config += ` }]` + "\n"
- config += ` services = [{` + "\n"
- config += ` service_type = "TE"` + "\n"
- config += ` }]` + "\n"
- config += ` nat_64_v4_pools = [{` + "\n"
- config += ` nat64_v4_pool_name = "example"` + "\n"
- config += ` nat64_v4_pool_range_start = "203.0.113.50"` + "\n"
- config += ` nat64_v4_pool_range_end = "203.0.113.100"` + "\n"
- config += ` nat64_v4_pool_overload = false` + "\n"
- config += ` }]` + "\n"
- config += `}` + "\n"
- return config
-}
-
-// End of section. //template:end testAccConfigAll
diff --git a/internal/provider/resource_sdwan_url_filtering_policy_definition.go b/internal/provider/resource_sdwan_url_filtering_policy_definition.go
index 516d92dab..21d07a8c4 100644
--- a/internal/provider/resource_sdwan_url_filtering_policy_definition.go
+++ b/internal/provider/resource_sdwan_url_filtering_policy_definition.go
@@ -208,7 +208,7 @@ func (r *URLFilteringPolicyDefinitionResource) Read(ctx context.Context, req res
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_vpn_list_policy_object.go b/internal/provider/resource_sdwan_vpn_list_policy_object.go
index b5cbc0152..509e4272b 100644
--- a/internal/provider/resource_sdwan_vpn_list_policy_object.go
+++ b/internal/provider/resource_sdwan_vpn_list_policy_object.go
@@ -156,7 +156,7 @@ func (r *VPNListPolicyObjectResource) Read(ctx context.Context, req resource.Rea
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_vpn_membership_policy_definition.go b/internal/provider/resource_sdwan_vpn_membership_policy_definition.go
index 824a57503..cc4858486 100644
--- a/internal/provider/resource_sdwan_vpn_membership_policy_definition.go
+++ b/internal/provider/resource_sdwan_vpn_membership_policy_definition.go
@@ -177,7 +177,7 @@ func (r *VPNMembershipPolicyDefinitionResource) Read(ctx context.Context, req re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go
index 008fa491b..861fc6f6f 100644
--- a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go
+++ b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go
@@ -257,7 +257,7 @@ func (r *ZoneBasedFirewallPolicyDefinitionResource) Read(ctx context.Context, re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition_test.go b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition_test.go
index df32942f4..811a64671 100644
--- a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition_test.go
+++ b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition_test.go
@@ -73,6 +73,7 @@ resource "sdwan_geo_location_list_policy_object" "test" {
}
]
}
+
`
// End of section. //template:end testPrerequisites
diff --git a/internal/provider/resource_sdwan_zone_list_policy_object.go b/internal/provider/resource_sdwan_zone_list_policy_object.go
index 5ed1d4b0c..b48aa8221 100644
--- a/internal/provider/resource_sdwan_zone_list_policy_object.go
+++ b/internal/provider/resource_sdwan_zone_list_policy_object.go
@@ -160,7 +160,7 @@ func (r *ZoneListPolicyObjectResource) Read(ctx context.Context, req resource.Re
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String()))
res, err := r.client.Get(state.getPath() + url.QueryEscape(state.Id.ValueString()))
- if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") {
+ if strings.Contains(res.Get("error.message").String(), "Failed to find specified resource") || strings.Contains(res.Get("error.message").String(), "Invalid template type") || strings.Contains(res.Get("error.message").String(), "Template definition not found") || strings.Contains(res.Get("error.message").String(), "Invalid Profile Id") || strings.Contains(res.Get("error.message").String(), "Invalid feature Id") || strings.Contains(res.Get("error.message").String(), "Invalid config group passed") {
resp.State.RemoveResource(ctx)
return
} else if err != nil {
diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl
index c87e96edf..a839c9577 100644
--- a/templates/guides/changelog.md.tmpl
+++ b/templates/guides/changelog.md.tmpl
@@ -7,9 +7,79 @@ description: |-
# Changelog
-## 0.3.14 (unreleased)
+## 0.4.2 (unreleased)
+
+- Add `sdwan_policy_object_application_list` resource and data source
+- Add `sdwan_policy_object_sla_class_list` resource and data source
+- Add `sdwan_policy_object_app_probe_class` resource and data source
+- Add `sdwan_policy_object_as_path_list` resource and data source
+- Add `sdwan_policy_object_vpn_group` resource and data source
+- Add `sdwan_policy_object_security_data_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_security_fqdn_list` resource and data source
+- Add `sdwan_policy_object_security_geolocation_list` resource and data source
+- Add `sdwan_policy_object_security_ips_signature` resource and data source
+- Add `sdwan_policy_object_security_local_domain_list` resource and data source
+- Add `sdwan_policy_object_security_port_list` resource and data source
+- Add `sdwan_policy_object_security_scalable_group_tag_list` resource and data source
+- Add `sdwan_policy_object_security_url_list` resource and data source
+- Add `sdwan_policy_object_preferred_color_group` resource and data source
+- Add `sdwan_policy_object_security_identity_list` resource and data source
+- Add `sdwan_policy_object_security_local_application_list` resource and data source
+- Add `sdwan_policy_object_standard_community_list` resource and data source
+- Add `sdwan_dns_security_feature_profile` resource and data source
+- Add `sdwan_sig_security_feature_profile` resource and data source
+- Add `sdwan_embedded_security_feature_profile` resource and data source
+
+## 0.4.1
+
+- Update documentation categories
+
+## 0.4.0
- Fix issue when reading deleted `sdwan_cli_config_profile_parcel` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/291)
+- Add `sdwan_transport_tracker_group_feature` resource and data source
+- Add `sdwan_transport_tracker_feature` resource and data source
+- Add `sdwan_service_tracker_group_feature` resource and data source
+- Add `sdwan_transport_ipv6_tracker_group_feature` resource and data source
+- Add `sdwan_service_object_tracker_feature` resource and data source
+- Add `sdwan_service_object_tracker_group_feature` resource and data source
+- BREAKING CHANGE: Rename `enable_crl_check` attribute of `sdwan_system_remote_access_profile_parcel` resource to `enable_certificate_list_check`
+- BREAKING CHANGE: Rename `psk_selection` attribute of `sdwan_system_remote_access_profile_parcel` resource to `psk_authentication_type`
+- BREAKING CHANGE: Rename `aaa_derive_name_identity` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_identity`
+- BREAKING CHANGE: Rename `aaa_derive_name_domain` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_domain`
+- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel`
+- Add `sdwan_policy_object_feature_profile` resource and data source
+- Add `sdwan_policy_object_class_map` resource and data source
+- Add `sdwan_policy_object_color_list` resource and data source
+- Add `sdwan_policy_object_data_ipv6_prefix_list` resource and data source
+- Add `sdwan_policy_object_data_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_tloc_list` resource and data source
+- Add `sdwan_policy_object_expanded_community_list` resource and data source
+- Add `sdwan_policy_object_extended_community_list` resource and data source
+- Add `sdwan_policy_object_mirror` resource and data source
+- Add `sdwan_policy_object_policer` resource and data source
+- Add `sdwan_policy_object_ipv4_prefix_list` resource and data source
+- Add `sdwan_policy_object_ipv6_prefix_list` resource and data source
+- Add `sdwan_other_feature_profile` resource and data source
+- Add `sdwan_other_ucse_feature` resource and data source
+- Add `sdwan_other_thousandeyes_feature` resource and data source
+- Add `sdwan_transport_gps_feature` resource and data source
+- Add `sdwan_transport_routing_ospf_feature` resource and data source
+- Add `sdwan_transport_routing_ospfv3_ipv4_feature` resource and data source
+- Add `sdwan_transport_routing_ospfv3_ipv6_feature` resource and data source
+- Add `sdwan_service_routing_ospf_feature` resource and data source
+- Add `sdwan_service_routing_ospfv3_ipv4_feature` resource and data source
+- Add `sdwan_service_routing_ospfv3_ipv6_feature` resource and data source
+- Add `sdwan_service_routing_bgp_feature` resource and data source
+- Add `sdwan_service_switchport_feature` resource and data source
+- Add `sdwan_transport_route_policy_feature` resource and data source
+- Add `sdwan_service_route_policy_feature` resource and data source
+- BREAKING CHANGE: Rename all profile parcel resources and data sources being used in configuration groups to "Features" with a `_feature` suffix
+- BREAKING CHANGE: Rename `sdwan_application_priority_qos_policy_profile_parcel` resource and data source to `sdwan_application_priority_qos_policy`
+- Fix issue when reading deleted `sdwan_configuration_group` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/297)
+- BREAKING CHANGE: Rename `service_lan_vpn_profile_parcel_id` attribute of `sdwan_service_lan_vpn_interface_ethernet_feature`, `sdwan_service_lan_vpn_interface_gre_feature`, `sdwan_service_lan_vpn_interface_ipsec_feature` and `sdwan_service_lan_vpn_interface_svi_feature` resource to `service_lan_vpn_feature_id`
+- BREAKING CHANGE: Rename `transport_management_vpn_profile_parcel_id` attribute of `sdwan_transport_management_vpn_interface_ethernet_feature` resource to `transport_management_vpn_feature_id`
+- BREAKING CHANGE: Rename `transport_wan_vpn_profile_parcel_id` attribute of `sdwan_transport_wan_vpn_interface_cellular_feature`, `sdwan_transport_wan_vpn_interface_ethernet_feature`, `sdwan_transport_wan_vpn_interface_gre_feature`, `sdwan_transport_wan_vpn_interface_ipsec_feature` and `sdwan_transport_wan_vpn_interface_t1_e1_serial_feature` resource to `transport_wan_vpn_feature_id`
## 0.3.13